LibreOffice Module sc (master)  1
sortdlg.cxx
Go to the documentation of this file.
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 <scui_def.hxx>
23 #include <tpsort.hxx>
24 #include <sortdlg.hxx>
25 
26 ScSortDlg::ScSortDlg(weld::Window* pParent, const SfxItemSet* pArgSet)
27  : SfxTabDialogController(pParent, "modules/scalc/ui/sortdialog.ui", "SortDialog", pArgSet)
28  , bIsHeaders(false)
29  , bIsByRows(false)
30 {
31  AddTabPage("criteria", ScTabPageSortFields::Create, nullptr);
32  AddTabPage("options", ScTabPageSortOptions::Create, nullptr);
33 }
34 
36  std::u16string_view rExtendText, std::u16string_view rCurrentText)
37  : GenericDialogController(pParent, "modules/scalc/ui/sortwarning.ui", "SortWarning")
38  , m_xFtText(m_xBuilder->weld_label("sorttext"))
39  , m_xBtnExtSort(m_xBuilder->weld_button("extend"))
40  , m_xBtnCurSort(m_xBuilder->weld_button("current"))
41 {
42  OUString sTextName = m_xFtText->get_label();
43  sTextName = sTextName.replaceFirst("%1", rExtendText);
44  sTextName = sTextName.replaceFirst("%2", rCurrentText);
45  m_xFtText->set_label(sTextName);
46 
47  m_xBtnExtSort->connect_clicked( LINK( this, ScSortWarningDlg, BtnHdl ) );
48  m_xBtnCurSort->connect_clicked( LINK( this, ScSortWarningDlg, BtnHdl ) );
49 }
50 
52 {
53 }
54 
55 IMPL_LINK(ScSortWarningDlg, BtnHdl, weld::Button&, rBtn, void)
56 {
57  if (&rBtn == m_xBtnExtSort.get())
58  {
59  m_xDialog->response(BTN_EXTEND_RANGE);
60  }
61  else if(&rBtn == m_xBtnCurSort.get())
62  {
64  }
65 }
66 
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xBtnCurSort
Definition: sortdlg.hxx:49
#define BTN_EXTEND_RANGE
Definition: scui_def.hxx:65
IMPL_LINK(ScSortWarningDlg, BtnHdl, weld::Button &, rBtn, void)
Definition: sortdlg.cxx:55
#define BTN_CURRENT_SELECTION
Definition: scui_def.hxx:66
ScSortDlg(weld::Window *pParent, const SfxItemSet *pArgSet)
Definition: sortdlg.cxx:26
virtual ~ScSortWarningDlg() override
Definition: sortdlg.cxx:51
std::unique_ptr< weld::Button > m_xBtnExtSort
Definition: sortdlg.hxx:48
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsort.cxx:127
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::Label > m_xFtText
Definition: sortdlg.hxx:47
ScSortWarningDlg(weld::Window *pParent, std::u16string_view rExtendText, std::u16string_view rCurrentText)
Definition: sortdlg.cxx:35
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *pArgSet)
Definition: tpsort.cxx:582