cid#1607171 Data race condition
[LibreOffice.git] / sc / source / ui / inc / undo / UndoUngroupSparklines.hxx
blob7c836ac2d1cecd1be5745fefa185a63871368885
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 #pragma once
13 #include <undobase.hxx>
14 #include <memory>
15 #include <utility>
17 namespace sc
19 /** Previous sparkline group data, which is restored at undo ungroupping */
20 struct SparklineUndoData
22 SparklineUndoData(ScAddress const& rAddress, ScRangeList aDataRangeList,
23 std::shared_ptr<sc::SparklineGroup> pGroup)
24 : m_aAddress(rAddress)
25 , m_aDataRangeList(std::move(aDataRangeList))
26 , m_pSparklineGroup(std::move(pGroup))
30 ScAddress m_aAddress;
31 ScRangeList m_aDataRangeList;
32 std::shared_ptr<sc::SparklineGroup> m_pSparklineGroup;
35 /** Undo action for ungrouping sparklines */
36 class UndoUngroupSparklines : public ScSimpleUndo
38 private:
39 ScRange m_aRange;
40 std::vector<SparklineUndoData> m_aUndoData;
42 public:
43 UndoUngroupSparklines(ScDocShell& rDocShell, ScRange const& rRange);
44 virtual ~UndoUngroupSparklines() override;
46 void Undo() override;
47 void Redo() override;
48 bool CanRepeat(SfxRepeatTarget& rTarget) const override;
49 void Repeat(SfxRepeatTarget& rTarget) override;
50 OUString GetComment() const override;
53 } // namespace sc
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */