LibreOffice Module sc (master) 1
UndoEditSparklineGroup.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
12
13#include <globstr.hrc>
14#include <scresid.hxx>
15
16#include <Sparkline.hxx>
17#include <SparklineGroup.hxx>
19#include <utility>
20
21namespace sc
22{
24 ScDocShell& rDocShell, std::shared_ptr<sc::SparklineGroup> const& pSparklineGroup,
25 sc::SparklineAttributes aAttributes)
26 : ScSimpleUndo(&rDocShell)
27 , m_pSparklineGroup(pSparklineGroup)
28 , m_aNewAttributes(std::move(aAttributes))
29 , m_aOriginalAttributes(pSparklineGroup->getAttributes())
30{
31}
32
34
36{
37 BeginUndo();
38
41
42 EndUndo();
43}
44
46{
47 BeginRedo();
48
49 m_pSparklineGroup->setAttributes(m_aNewAttributes);
51
52 EndRedo();
53}
54
56
57bool UndoEditSparklneGroup::CanRepeat(SfxRepeatTarget& /*rTarget*/) const { return false; }
58
60{
61 return ScResId(STR_UNDO_EDIT_SPARKLINE_GROUP);
62}
63
64} // end sc namespace
65
66/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void PostPaintGridAll()
Definition: docsh3.cxx:183
void BeginRedo()
Definition: undobase.cxx:145
void EndRedo()
Definition: undobase.cxx:154
void EndUndo()
Definition: undobase.cxx:125
ScDocShell * pDocShell
Definition: undobase.hxx:50
void BeginUndo()
Definition: undobase.cxx:90
Common properties for a group of sparklines.
bool CanRepeat(SfxRepeatTarget &rTarget) const override
std::shared_ptr< sc::SparklineGroup > m_pSparklineGroup
virtual ~UndoEditSparklneGroup() override
UndoEditSparklneGroup(ScDocShell &rDocShell, std::shared_ptr< sc::SparklineGroup > const &rSparklineGroup, sc::SparklineAttributes aAttributes)
OUString GetComment() const override
sc::SparklineAttributes m_aNewAttributes
void Repeat(SfxRepeatTarget &rTarget) override
sc::SparklineAttributes m_aOriginalAttributes
CAUTION! The following defines must be in the same namespace as the respective type.
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90