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 #include <svx/ctredlin.hxx>
21 #include <unotools/viewoptions.hxx>
23 #include <redlndlg.hxx>
24 #include <swmodalredlineacceptdlg.hxx>
26 SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(weld::Window
*pParent
)
27 : SfxDialogController(pParent
, "svx/ui/acceptrejectchangesdialog.ui",
28 "AcceptRejectChangesDialog")
29 , m_xContentArea(m_xDialog
->weld_content_area())
31 m_xDialog
->set_modal(true);
33 m_xImplDlg
.reset(new SwRedlineAcceptDlg(m_xDialog
, m_xBuilder
.get(), m_xContentArea
.get(), true));
35 SvtViewOptions
aDlgOpt(EViewType::Dialog
, m_xDialog
->get_help_id());
38 css::uno::Any aUserItem
= aDlgOpt
.GetUserItem("UserItem");
40 aUserItem
>>= sExtraData
;
41 m_xImplDlg
->Initialize(sExtraData
);
43 m_xImplDlg
->Activate(); // for data's initialisation
46 SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg()
48 AcceptAll(false); // refuse everything remaining
51 m_xImplDlg
->FillInfo(sExtraData
);
52 SvtViewOptions
aDlgOpt(EViewType::Dialog
, m_xDialog
->get_help_id());
53 aDlgOpt
.SetUserItem("UserItem", css::uno::Any(sExtraData
));
55 m_xDialog
->set_modal(false);
58 void SwModalRedlineAcceptDlg::Activate()
62 void SwModalRedlineAcceptDlg::AcceptAll( bool bAccept
)
64 SvxTPFilter
* pFilterTP
= m_xImplDlg
->GetChgCtrl().GetFilterPage();
66 if (pFilterTP
->IsDate() || pFilterTP
->IsAuthor() ||
67 pFilterTP
->IsRange() || pFilterTP
->IsAction())
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);
76 m_xImplDlg
->CallAcceptReject( false, bAccept
);
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */