cid#1607171 Data race condition
[LibreOffice.git] / sc / source / ui / undo / UndoEditSparklineGroup.cxx
blobe7e3320d5d34feea816429ca91e1c4141aa1946e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 */
11 #include <undo/UndoEditSparklineGroup.hxx>
13 #include <globstr.hrc>
14 #include <scresid.hxx>
16 #include <SparklineGroup.hxx>
17 #include <SparklineAttributes.hxx>
18 #include <utility>
20 namespace sc
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()
36 BeginUndo();
38 m_pSparklineGroup->setAttributes(m_aOriginalAttributes);
39 pDocShell->PostPaintGridAll();
41 EndUndo();
44 void UndoEditSparklneGroup::Redo()
46 BeginRedo();
48 m_pSparklineGroup->setAttributes(m_aNewAttributes);
49 pDocShell->PostPaintGridAll();
51 EndRedo();
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);
63 } // end sc namespace
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */