1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #undef SC_DLLIMPLEMENTATION
22 #include <vcl/msgbox.hxx>
24 #include "sortdlg.hxx"
25 #include "scresid.hxx"
27 ScSortDlg::ScSortDlg(vcl::Window
* pParent
, const SfxItemSet
* pArgSet
)
28 : SfxTabDialog(pParent
, "SortDialog", "modules/scalc/ui/sortdialog.ui", pArgSet
)
32 AddTabPage("criteria", ScTabPageSortFields::Create
, 0);
33 AddTabPage("options", ScTabPageSortOptions::Create
, 0);
36 ScSortWarningDlg::ScSortWarningDlg(vcl::Window
* pParent
,
37 const OUString
& rExtendText
, const OUString
& rCurrentText
)
38 : ModalDialog(pParent
, "SortWarning", "modules/scalc/ui/sortwarning.ui")
40 get( aFtText
, "sorttext" );
41 get( aBtnExtSort
, "extend" );
42 get( aBtnCurSort
, "current" );
44 OUString sTextName
= aFtText
->GetText();
45 sTextName
= sTextName
.replaceFirst("%1", rExtendText
);
46 sTextName
= sTextName
.replaceFirst("%2", rCurrentText
);
47 aFtText
->SetText( sTextName
);
49 aBtnExtSort
->SetClickHdl( LINK( this, ScSortWarningDlg
, BtnHdl
) );
50 aBtnCurSort
->SetClickHdl( LINK( this, ScSortWarningDlg
, BtnHdl
) );
53 ScSortWarningDlg::~ScSortWarningDlg()
58 void ScSortWarningDlg::dispose()
63 ModalDialog::dispose();
66 IMPL_LINK( ScSortWarningDlg
, BtnHdl
, PushButton
*, pBtn
)
68 if ( pBtn
== aBtnExtSort
)
70 EndDialog( BTN_EXTEND_RANGE
);
72 else if( pBtn
== aBtnCurSort
)
74 EndDialog( BTN_CURRENT_SELECTION
);
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */