LibreOffice Module sc (master) 1
UndoEditSparkline.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#include <globstr.hrc>
13#include <scresid.hxx>
14
15#include <Sparkline.hxx>
16#include <SparklineGroup.hxx>
17#include <utility>
18
19namespace sc
20{
22 std::shared_ptr<sc::Sparkline> pSparkline, SCTAB nTab,
23 ScRangeList aDataRange)
24 : ScSimpleUndo(&rDocShell)
25 , mpSparkline(std::move(pSparkline))
26 , mnTab(nTab)
27 , maOldDataRange(mpSparkline->getInputRange())
28 , maNewDataRange(std::move(aDataRange))
29{
30}
31
33
35{
36 BeginUndo();
37
38 mpSparkline->setInputRange(maOldDataRange);
39
41
42 EndUndo();
43}
44
46{
47 BeginRedo();
48
49 mpSparkline->setInputRange(maNewDataRange);
50
52
53 EndRedo();
54}
55
56void UndoEditSparkline::Repeat(SfxRepeatTarget& /*rTarget*/) {}
57
58bool UndoEditSparkline::CanRepeat(SfxRepeatTarget& /*rTarget*/) const { return false; }
59
60OUString UndoEditSparkline::GetComment() const { return ScResId(STR_UNDO_EDIT_SPARKLINE); }
61
62} // end sc namespace
63
64/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void PostPaintCell(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: docsh3.cxx:188
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
UndoEditSparkline(ScDocShell &rDocShell, std::shared_ptr< sc::Sparkline > pSparkline, SCTAB nTab, ScRangeList rDataRange)
void Repeat(SfxRepeatTarget &rTarget) override
std::shared_ptr< sc::Sparkline > mpSparkline
OUString GetComment() const override
virtual ~UndoEditSparkline() override
bool CanRepeat(SfxRepeatTarget &rTarget) const override
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
sal_Int16 SCTAB
Definition: types.hxx:22