LibreOffice Module sw (master) 1
UndoThemeChange.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
10#include <UndoThemeChange.hxx>
11#include <svx/svdpage.hxx>
13#include <doc.hxx>
14#include <drawdoc.hxx>
16
17#include <memory>
18
19namespace sw
20{
22 std::shared_ptr<model::ColorSet> const& pOldColorSet,
23 std::shared_ptr<model::ColorSet> const& pNewColorSet)
24 : SwUndo(SwUndoId::CHANGE_THEME, &rDocument)
25 , mrDocument(rDocument)
26 , mpOldColorSet(pOldColorSet)
27 , mpNewColorSet(pNewColorSet)
28{
29}
30
32
33void UndoThemeChange::UndoImpl(UndoRedoContext& /*rUndoRedoContext*/)
34{
36 auto pTheme = pPage->getSdrPageProperties().GetTheme();
37 pTheme->setColorSet(mpOldColorSet);
38}
39
40void UndoThemeChange::RedoImpl(UndoRedoContext& /*rUndoRedoContext*/)
41{
43 auto pTheme = pPage->getSdrPageProperties().GetTheme();
44 pTheme->setColorSet(mpNewColorSet);
45}
46}
47
48/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
const SdrPage * GetPage(sal_uInt16 nPgNum) const
std::shared_ptr< model::Theme > const & GetTheme() const
SdrPageProperties & getSdrPageProperties()
Definition: doc.hxx:197
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:169
virtual void RedoImpl(UndoRedoContext &rUndoRedoContext) override
std::shared_ptr< model::ColorSet > mpOldColorSet
std::shared_ptr< model::ColorSet > mpNewColorSet
virtual ~UndoThemeChange() override
UndoThemeChange(SwDoc &rDocument, std::shared_ptr< model::ColorSet > const &pOld, std::shared_ptr< model::ColorSet > const &pNew)
virtual void UndoImpl(UndoRedoContext &rUndoRedoContext) override
Dialog to specify the properties of date form field.
SwUndoId
Definition: swundo.hxx:30