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>
21 #include <unotools/viewoptions.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, OStringToOUString(m_xDialog->get_help_id(), RTL_TEXTENCODING_UTF8));
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, OStringToOUString(m_xDialog->get_help_id(), RTL_TEXTENCODING_UTF8));
53  aDlgOpt.SetUserItem("UserItem", css::uno::makeAny(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: */
void SetUserItem(const OUString &sName, const css::uno::Any &aValue)
bool IsDate() const
std::unique_ptr< weld::Container > m_xContentArea
virtual void Activate() override
virtual ~SwModalRedlineAcceptDlg() override
void CheckRange(bool bFlag)
void CheckAuthor(bool bFlag)
bool IsAuthor() const
void CheckAction(bool bFlag)
SwModalRedlineAcceptDlg(weld::Window *pParent)
bool IsRange() const
bool IsAction() const
std::unique_ptr< SwRedlineAcceptDlg > m_xImplDlg
bool Exists() const
Reference< XExecutableDialog > m_xDialog
css::uno::Any GetUserItem(const OUString &sName) const
void CheckDate(bool bFlag)