Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #undef SC_DLLIMPLEMENTATION
22 :
23 :
24 : #include <vcl/msgbox.hxx>
25 : #include "tpsort.hxx"
26 : #include "sortdlg.hxx"
27 : #include "scresid.hxx"
28 :
29 0 : ScSortDlg::ScSortDlg(Window* pParent, const SfxItemSet* pArgSet)
30 : : SfxTabDialog(pParent, "SortDialog", "modules/scalc/ui/sortdialog.ui", pArgSet)
31 : , bIsHeaders(false)
32 0 : , bIsByRows(false)
33 : {
34 0 : AddTabPage("criteria", ScTabPageSortFields::Create, 0);
35 0 : AddTabPage("options", ScTabPageSortOptions::Create, 0);
36 0 : }
37 :
38 :
39 0 : ScSortWarningDlg::ScSortWarningDlg(Window* pParent,
40 : const OUString& rExtendText, const OUString& rCurrentText)
41 0 : : ModalDialog(pParent, "SortWarning", "modules/scalc/ui/sortwarning.ui")
42 : {
43 0 : get(aFtText, "sorttext" );
44 0 : get( aBtnExtSort, "extend" );
45 0 : get( aBtnCurSort, "current" );
46 :
47 0 : OUString sTextName = aFtText->GetText();
48 0 : sTextName = sTextName.replaceFirst("%1", rExtendText);
49 0 : sTextName = sTextName.replaceFirst("%2", rCurrentText);
50 0 : aFtText->SetText( sTextName );
51 :
52 0 : aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
53 0 : aBtnCurSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
54 0 : }
55 :
56 0 : IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
57 : {
58 0 : if ( pBtn == aBtnExtSort )
59 : {
60 0 : EndDialog( BTN_EXTEND_RANGE );
61 : }
62 0 : else if( pBtn == aBtnCurSort )
63 : {
64 0 : EndDialog( BTN_CURRENT_SELECTION );
65 : }
66 0 : return 0;
67 0 : }
68 :
69 :
70 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|