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 : #include "sortdlg.hrc"
29 :
30 0 : ScSortDlg::ScSortDlg( Window* pParent,
31 : const SfxItemSet* pArgSet ) :
32 : SfxTabDialog( pParent,
33 : ScResId( RID_SCDLG_SORT ),
34 : pArgSet ),
35 : bIsHeaders ( false ),
36 0 : bIsByRows ( false )
37 : {
38 0 : AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 );
39 0 : AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 );
40 0 : FreeResource();
41 0 : }
42 :
43 0 : ScSortDlg::~ScSortDlg()
44 : {
45 0 : }
46 :
47 : //==================================================================
48 0 : ScSortWarningDlg::ScSortWarningDlg( Window* pParent,
49 : const String& rExtendText,
50 : const String& rCurrentText ):
51 0 : ModalDialog ( pParent, "SortWarning", "modules/scalc/ui/sortwarning.ui" )
52 : {
53 0 : get(aFtText, "sorttext" );
54 0 : get( aBtnExtSort, "extend" );
55 0 : get( aBtnCurSort, "current" );
56 :
57 0 : String sTextName = aFtText->GetText();
58 0 : sTextName.SearchAndReplaceAscii("%1", rExtendText);
59 0 : sTextName.SearchAndReplaceAscii("%2", rCurrentText);
60 0 : aFtText->SetText( sTextName );
61 :
62 0 : aBtnExtSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
63 0 : aBtnCurSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
64 0 : }
65 :
66 0 : ScSortWarningDlg::~ScSortWarningDlg()
67 : {
68 0 : }
69 :
70 0 : IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
71 : {
72 0 : if ( pBtn == aBtnExtSort )
73 : {
74 0 : EndDialog( BTN_EXTEND_RANGE );
75 : }
76 0 : else if( pBtn == aBtnCurSort )
77 : {
78 0 : EndDialog( BTN_CURRENT_SELECTION );
79 : }
80 0 : return 0;
81 0 : }
82 : //========================================================================//
83 :
84 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|