From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- sc/source/ui/inc/undo/UndoDeleteSparkline.hxx | 43 +++++++++++++++++ sc/source/ui/inc/undo/UndoDeleteSparklineGroup.hxx | 45 +++++++++++++++++ sc/source/ui/inc/undo/UndoEditSparkline.hxx | 47 ++++++++++++++++++ sc/source/ui/inc/undo/UndoEditSparklineGroup.hxx | 44 +++++++++++++++++ sc/source/ui/inc/undo/UndoGroupSparklines.hxx | 56 ++++++++++++++++++++++ sc/source/ui/inc/undo/UndoInsertSparkline.hxx | 45 +++++++++++++++++ sc/source/ui/inc/undo/UndoUngroupSparklines.hxx | 54 +++++++++++++++++++++ 7 files changed, 334 insertions(+) create mode 100644 sc/source/ui/inc/undo/UndoDeleteSparkline.hxx create mode 100644 sc/source/ui/inc/undo/UndoDeleteSparklineGroup.hxx create mode 100644 sc/source/ui/inc/undo/UndoEditSparkline.hxx create mode 100644 sc/source/ui/inc/undo/UndoEditSparklineGroup.hxx create mode 100644 sc/source/ui/inc/undo/UndoGroupSparklines.hxx create mode 100644 sc/source/ui/inc/undo/UndoInsertSparkline.hxx create mode 100644 sc/source/ui/inc/undo/UndoUngroupSparklines.hxx (limited to 'sc/source/ui/inc/undo') diff --git a/sc/source/ui/inc/undo/UndoDeleteSparkline.hxx b/sc/source/ui/inc/undo/UndoDeleteSparkline.hxx new file mode 100644 index 000000000..97fcd77d9 --- /dev/null +++ b/sc/source/ui/inc/undo/UndoDeleteSparkline.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include +#include + +namespace sc +{ +class SparklineGroup; +struct SparklineData; + +/** Undo action for deleting a Sparkline */ +class UndoDeleteSparkline : public ScSimpleUndo +{ +private: + std::shared_ptr mpSparklineGroup; + ScAddress maSparklinePosition; + +public: + UndoDeleteSparkline(ScDocShell& rDocShell, ScAddress const& rSparklinePosition); + + virtual ~UndoDeleteSparkline() override; + + void Undo() override; + void Redo() override; + bool CanRepeat(SfxRepeatTarget& rTarget) const override; + void Repeat(SfxRepeatTarget& rTarget) override; + OUString GetComment() const override; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undo/UndoDeleteSparklineGroup.hxx b/sc/source/ui/inc/undo/UndoDeleteSparklineGroup.hxx new file mode 100644 index 000000000..081a741ab --- /dev/null +++ b/sc/source/ui/inc/undo/UndoDeleteSparklineGroup.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include +#include + +namespace sc +{ +class SparklineGroup; + +/** Undo action for deleting a sparkline group and all associated sparklines */ +class UndoDeleteSparklineGroup : public ScSimpleUndo +{ +private: + std::shared_ptr mpSparklineGroup; + std::vector> maSparklines; + SCTAB mnTab; + +public: + UndoDeleteSparklineGroup(ScDocShell& rDocShell, + std::shared_ptr const& pSparklineGroup, + SCTAB nSheetIndex); + + virtual ~UndoDeleteSparklineGroup() override; + + void Undo() override; + void Redo() override; + bool CanRepeat(SfxRepeatTarget& rTarget) const override; + void Repeat(SfxRepeatTarget& rTarget) override; + OUString GetComment() const override; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undo/UndoEditSparkline.hxx b/sc/source/ui/inc/undo/UndoEditSparkline.hxx new file mode 100644 index 000000000..4e33eaa1f --- /dev/null +++ b/sc/source/ui/inc/undo/UndoEditSparkline.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include +#include +#include + +namespace sc +{ +class Sparkline; +struct SparklineData; + +/** Undo action for editing a Sparkline */ +class UndoEditSparkline : public ScSimpleUndo +{ +private: + std::shared_ptr mpSparkline; + SCTAB mnTab; + ScRangeList maOldDataRange; + ScRangeList maNewDataRange; + +public: + UndoEditSparkline(ScDocShell& rDocShell, std::shared_ptr const& rpSparkline, + SCTAB nTab, ScRangeList const& rDataRange); + + virtual ~UndoEditSparkline() override; + + void Undo() override; + void Redo() override; + bool CanRepeat(SfxRepeatTarget& rTarget) const override; + void Repeat(SfxRepeatTarget& rTarget) override; + OUString GetComment() const override; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undo/UndoEditSparklineGroup.hxx b/sc/source/ui/inc/undo/UndoEditSparklineGroup.hxx new file mode 100644 index 000000000..4ab3e6a4e --- /dev/null +++ b/sc/source/ui/inc/undo/UndoEditSparklineGroup.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include + +#include +#include + +namespace sc +{ +/** Undo action for editing a Sparkline */ +class UndoEditSparklneGroup : public ScSimpleUndo +{ +private: + std::shared_ptr m_pSparklineGroup; + sc::SparklineAttributes m_aNewAttributes; + sc::SparklineAttributes m_aOriginalAttributes; + +public: + UndoEditSparklneGroup(ScDocShell& rDocShell, + std::shared_ptr const& rSparklineGroup, + sc::SparklineAttributes const& rAttributes); + virtual ~UndoEditSparklneGroup() override; + + void Undo() override; + void Redo() override; + bool CanRepeat(SfxRepeatTarget& rTarget) const override; + void Repeat(SfxRepeatTarget& rTarget) override; + OUString GetComment() const override; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undo/UndoGroupSparklines.hxx b/sc/source/ui/inc/undo/UndoGroupSparklines.hxx new file mode 100644 index 000000000..bcbc470bc --- /dev/null +++ b/sc/source/ui/inc/undo/UndoGroupSparklines.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include + +namespace sc +{ +/** Previous sparkline group data, which is restored at Undo grouping */ +struct UndoGroupSparklinesData +{ + UndoGroupSparklinesData(ScAddress const& rAddress, ScRangeList const& rDataRangeList, + std::shared_ptr const& rpGroup) + : m_aAddress(rAddress) + , m_aDataRangeList(rDataRangeList) + , m_pSparklineGroup(rpGroup) + { + } + + ScAddress m_aAddress; + ScRangeList m_aDataRangeList; + std::shared_ptr m_pSparklineGroup; +}; + +/** Undo action for grouping sparklines */ +class UndoGroupSparklines : public ScSimpleUndo +{ +private: + ScRange m_aRange; + std::shared_ptr m_pSparklineGroup; + std::vector m_aUndoData; + +public: + UndoGroupSparklines(ScDocShell& rDocShell, ScRange const& rRange, + std::shared_ptr const& rpSparklineGroup); + virtual ~UndoGroupSparklines() override; + + void Undo() override; + void Redo() override; + bool CanRepeat(SfxRepeatTarget& rTarget) const override; + void Repeat(SfxRepeatTarget& rTarget) override; + OUString GetComment() const override; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undo/UndoInsertSparkline.hxx b/sc/source/ui/inc/undo/UndoInsertSparkline.hxx new file mode 100644 index 000000000..d9e1885f1 --- /dev/null +++ b/sc/source/ui/inc/undo/UndoInsertSparkline.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include +#include + +namespace sc +{ +class SparklineGroup; +struct SparklineData; + +/** Undo action for inserting a Sparkline */ +class UndoInsertSparkline : public ScSimpleUndo +{ +private: + std::vector maSparklineDataVector; + std::shared_ptr mpSparklineGroup; + +public: + UndoInsertSparkline(ScDocShell& rDocShell, + std::vector const& rSparklineDataVector, + std::shared_ptr pSparklineGroup); + + virtual ~UndoInsertSparkline() override; + + void Undo() override; + void Redo() override; + bool CanRepeat(SfxRepeatTarget& rTarget) const override; + void Repeat(SfxRepeatTarget& rTarget) override; + OUString GetComment() const override; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undo/UndoUngroupSparklines.hxx b/sc/source/ui/inc/undo/UndoUngroupSparklines.hxx new file mode 100644 index 000000000..ce49d701e --- /dev/null +++ b/sc/source/ui/inc/undo/UndoUngroupSparklines.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include + +namespace sc +{ +/** Previous sparkline group data, which is restored at undo ungroupping */ +struct SparklineUndoData +{ + SparklineUndoData(ScAddress const& rAddress, ScRangeList const& rDataRangeList, + std::shared_ptr const& rpGroup) + : m_aAddress(rAddress) + , m_aDataRangeList(rDataRangeList) + , m_pSparklineGroup(rpGroup) + { + } + + ScAddress m_aAddress; + ScRangeList m_aDataRangeList; + std::shared_ptr m_pSparklineGroup; +}; + +/** Undo action for ungrouping sparklines */ +class UndoUngroupSparklines : public ScSimpleUndo +{ +private: + ScRange m_aRange; + std::vector m_aUndoData; + +public: + UndoUngroupSparklines(ScDocShell& rDocShell, ScRange const& rRange); + virtual ~UndoUngroupSparklines() override; + + void Undo() override; + void Redo() override; + bool CanRepeat(SfxRepeatTarget& rTarget) const override; + void Repeat(SfxRepeatTarget& rTarget) override; + OUString GetComment() const override; +}; + +} // namespace sc + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3