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/.
11 #include <undo/UndoEditSparklineGroup.hxx>
13 #include <globstr.hrc>
14 #include <scresid.hxx>
16 #include <SparklineGroup.hxx>
17 #include <SparklineAttributes.hxx>
22 UndoEditSparklneGroup::UndoEditSparklneGroup(
23 ScDocShell
& rDocShell
, std::shared_ptr
<sc::SparklineGroup
> const& pSparklineGroup
,
24 sc::SparklineAttributes aAttributes
)
25 : ScSimpleUndo(&rDocShell
)
26 , m_pSparklineGroup(pSparklineGroup
)
27 , m_aNewAttributes(std::move(aAttributes
))
28 , m_aOriginalAttributes(pSparklineGroup
->getAttributes())
32 UndoEditSparklneGroup::~UndoEditSparklneGroup() = default;
34 void UndoEditSparklneGroup::Undo()
38 m_pSparklineGroup
->setAttributes(m_aOriginalAttributes
);
39 pDocShell
->PostPaintGridAll();
44 void UndoEditSparklneGroup::Redo()
48 m_pSparklineGroup
->setAttributes(m_aNewAttributes
);
49 pDocShell
->PostPaintGridAll();
54 void UndoEditSparklneGroup::Repeat(SfxRepeatTarget
& /*rTarget*/) {}
56 bool UndoEditSparklneGroup::CanRepeat(SfxRepeatTarget
& /*rTarget*/) const { return false; }
58 OUString
UndoEditSparklneGroup::GetComment() const
60 return ScResId(STR_UNDO_EDIT_SPARKLINE_GROUP
);
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */