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>
26
28 : SfxTabDialogController(pParent, "modules/scalc/ui/sortdialog.ui", "SortDialog", pArgSet)
29{
30 AddTabPage("criteria", ScTabPageSortFields::Create, nullptr);
31 AddTabPage("options", ScTabPageSortOptions::Create, nullptr);
32
33 // restore dialog size
34 SvtViewOptions aDlgOpt(EViewType::Dialog, "SortDialog");
35 if (aDlgOpt.Exists())
36 m_xDialog->set_window_state(aDlgOpt.GetWindowState());
37}
38
40{
41 // tdf#153852 - Make of sort dialog resizable (and remember size)
42 SvtViewOptions aDlgOpt(EViewType::Dialog, "SortDialog");
43 OUString sWindowState = m_xDialog->get_window_state(vcl::WindowDataMask::PosSize);
44 aDlgOpt.SetWindowState(sWindowState);
45}
46
48 std::u16string_view rExtendText, std::u16string_view rCurrentText)
49 : GenericDialogController(pParent, "modules/scalc/ui/sortwarning.ui", "SortWarning")
50 , m_xFtText(m_xBuilder->weld_label("sorttext"))
51 , m_xBtnExtSort(m_xBuilder->weld_button("extend"))
52 , m_xBtnCurSort(m_xBuilder->weld_button("current"))
53{
54 OUString sTextName = m_xFtText->get_label();
55 sTextName = sTextName.replaceFirst("%1", rExtendText);
56 sTextName = sTextName.replaceFirst("%2", rCurrentText);
57 m_xFtText->set_label(sTextName);
58
59 m_xBtnExtSort->connect_clicked( LINK( this, ScSortWarningDlg, BtnHdl ) );
60 m_xBtnCurSort->connect_clicked( LINK( this, ScSortWarningDlg, BtnHdl ) );
61}
62
64{
65}
66
68{
69 if (&rBtn == m_xBtnExtSort.get())
70 {
71 m_xDialog->response(BTN_EXTEND_RANGE);
72 }
73 else if(&rBtn == m_xBtnCurSort.get())
74 {
76 }
77}
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XExecutableDialog > m_xDialog
virtual ~ScSortDlg() override
Definition: sortdlg.cxx:39
ScSortDlg(weld::Window *pParent, const SfxItemSet *pArgSet)
Definition: sortdlg.cxx:27
std::unique_ptr< weld::Button > m_xBtnCurSort
Definition: sortdlg.hxx:41
std::unique_ptr< weld::Label > m_xFtText
Definition: sortdlg.hxx:39
std::unique_ptr< weld::Button > m_xBtnExtSort
Definition: sortdlg.hxx:40
virtual ~ScSortWarningDlg() override
Definition: sortdlg.cxx:63
ScSortWarningDlg(weld::Window *pParent, std::u16string_view rExtendText, std::u16string_view rCurrentText)
Definition: sortdlg.cxx:47
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsort.cxx:158
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *pArgSet)
Definition: tpsort.cxx:575
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void SetWindowState(const OUString &sState)
OUString GetWindowState() const
bool Exists() const
#define BTN_EXTEND_RANGE
Definition: scui_def.hxx:65
#define BTN_CURRENT_SELECTION
Definition: scui_def.hxx:66
IMPL_LINK(ScSortWarningDlg, BtnHdl, weld::Button &, rBtn, void)
Definition: sortdlg.cxx:67