LibreOffice Module sw (master) 1
swmodalredlineacceptdlg.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#include <svx/ctredlin.hxx>
22
23#include <redlndlg.hxx>
25
27 : SfxDialogController(pParent, "svx/ui/acceptrejectchangesdialog.ui",
28 "AcceptRejectChangesDialog")
29 , m_xContentArea(m_xDialog->weld_content_area())
30{
31 m_xDialog->set_modal(true);
32
33 m_xImplDlg.reset(new SwRedlineAcceptDlg(m_xDialog, m_xBuilder.get(), m_xContentArea.get(), true));
34
35 SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id());
36 if (aDlgOpt.Exists())
37 {
38 css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem");
39 OUString sExtraData;
40 aUserItem >>= sExtraData;
41 m_xImplDlg->Initialize(sExtraData);
42 }
43 m_xImplDlg->Activate(); // for data's initialisation
44}
45
47{
48 AcceptAll(false); // refuse everything remaining
49
50 OUString sExtraData;
51 m_xImplDlg->FillInfo(sExtraData);
52 SvtViewOptions aDlgOpt(EViewType::Dialog, m_xDialog->get_help_id());
53 aDlgOpt.SetUserItem("UserItem", css::uno::Any(sExtraData));
54
55 m_xDialog->set_modal(false);
56}
57
59{
60}
61
63{
64 SvxTPFilter* pFilterTP = m_xImplDlg->GetChgCtrl().GetFilterPage();
65
66 if (pFilterTP->IsDate() || pFilterTP->IsAuthor() ||
67 pFilterTP->IsRange() || pFilterTP->IsAction())
68 {
69 pFilterTP->CheckDate(false); // turn off all filters
70 pFilterTP->CheckAuthor(false);
71 pFilterTP->CheckRange(false);
72 pFilterTP->CheckAction(false);
73 m_xImplDlg->FilterChangedHdl(nullptr);
74 }
75
76 m_xImplDlg->CallAcceptReject( false, bAccept );
77}
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XExecutableDialog > m_xDialog
css::uno::Any GetUserItem(const OUString &sName) const
void SetUserItem(const OUString &sName, const css::uno::Any &aValue)
bool Exists() const
bool IsRange() const
void CheckAction(bool bFlag)
bool IsAuthor() const
void CheckDate(bool bFlag)
void CheckAuthor(bool bFlag)
void CheckRange(bool bFlag)
bool IsAction() const
bool IsDate() const
virtual void Activate() override
SwModalRedlineAcceptDlg(weld::Window *pParent)
virtual ~SwModalRedlineAcceptDlg() override
std::unique_ptr< SwRedlineAcceptDlg > m_xImplDlg
std::unique_ptr< weld::Container > m_xContentArea