/src/libreoffice/sc/source/ui/undo/UndoEditSparklineGroup.cxx
Line | Count | Source |
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 | | |
11 | | #include <undo/UndoEditSparklineGroup.hxx> |
12 | | |
13 | | #include <globstr.hrc> |
14 | | #include <scresid.hxx> |
15 | | |
16 | | #include <SparklineGroup.hxx> |
17 | | #include <SparklineAttributes.hxx> |
18 | | #include <utility> |
19 | | |
20 | | namespace sc |
21 | | { |
22 | | UndoEditSparklneGroup::UndoEditSparklneGroup( |
23 | | ScDocShell& rShell, std::shared_ptr<sc::SparklineGroup> const& pSparklineGroup, |
24 | | sc::SparklineAttributes aAttributes) |
25 | 0 | : ScSimpleUndo(rShell) |
26 | 0 | , m_pSparklineGroup(pSparklineGroup) |
27 | 0 | , m_aNewAttributes(std::move(aAttributes)) |
28 | 0 | , m_aOriginalAttributes(pSparklineGroup->getAttributes()) |
29 | 0 | { |
30 | 0 | } |
31 | | |
32 | 0 | UndoEditSparklneGroup::~UndoEditSparklneGroup() = default; |
33 | | |
34 | | void UndoEditSparklneGroup::Undo() |
35 | 0 | { |
36 | 0 | BeginUndo(); |
37 | |
|
38 | 0 | m_pSparklineGroup->setAttributes(m_aOriginalAttributes); |
39 | 0 | rDocShell.PostPaintGridAll(); |
40 | |
|
41 | 0 | EndUndo(); |
42 | 0 | } |
43 | | |
44 | | void UndoEditSparklneGroup::Redo() |
45 | 0 | { |
46 | 0 | BeginRedo(); |
47 | |
|
48 | 0 | m_pSparklineGroup->setAttributes(m_aNewAttributes); |
49 | 0 | rDocShell.PostPaintGridAll(); |
50 | |
|
51 | 0 | EndRedo(); |
52 | 0 | } |
53 | | |
54 | 0 | void UndoEditSparklneGroup::Repeat(SfxRepeatTarget& /*rTarget*/) {} |
55 | | |
56 | 0 | bool UndoEditSparklneGroup::CanRepeat(SfxRepeatTarget& /*rTarget*/) const { return false; } |
57 | | |
58 | | OUString UndoEditSparklneGroup::GetComment() const |
59 | 0 | { |
60 | 0 | return ScResId(STR_UNDO_EDIT_SPARKLINE_GROUP); |
61 | 0 | } |
62 | | |
63 | | } // end sc namespace |
64 | | |
65 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |