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 : #undef SC_DLLIMPLEMENTATION
21 :
22 : #include <vcl/msgbox.hxx>
23 : #include "tpsort.hxx"
24 : #include "sortdlg.hxx"
25 : #include "scresid.hxx"
26 :
27 0 : ScSortDlg::ScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
28 : : SfxTabDialog(pParent, "SortDialog", "modules/scalc/ui/sortdialog.ui", pArgSet)
29 : , bIsHeaders(false)
30 0 : , bIsByRows(false)
31 : {
32 0 : AddTabPage("criteria", ScTabPageSortFields::Create, 0);
33 0 : AddTabPage("options", ScTabPageSortOptions::Create, 0);
34 0 : }
35 :
36 0 : ScSortWarningDlg::ScSortWarningDlg(vcl::Window* pParent,
37 : const OUString& rExtendText, const OUString& rCurrentText)
38 0 : : ModalDialog(pParent, "SortWarning", "modules/scalc/ui/sortwarning.ui")
39 : {
40 0 : get(aFtText, "sorttext" );
41 0 : get( aBtnExtSort, "extend" );
42 0 : get( aBtnCurSort, "current" );
43 :
44 0 : OUString sTextName = aFtText->GetText();
45 0 : sTextName = sTextName.replaceFirst("%1", rExtendText);
46 0 : sTextName = sTextName.replaceFirst("%2", rCurrentText);
47 0 : aFtText->SetText( sTextName );
48 :
49 0 : aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
50 0 : aBtnCurSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
51 0 : }
52 :
53 0 : IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
54 : {
55 0 : if ( pBtn == aBtnExtSort )
56 : {
57 0 : EndDialog( BTN_EXTEND_RANGE );
58 : }
59 0 : else if( pBtn == aBtnCurSort )
60 : {
61 0 : EndDialog( BTN_CURRENT_SELECTION );
62 : }
63 0 : return 0;
64 0 : }
65 :
66 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|