Bump version to 6.4-15
[LibreOffice.git] / sc / inc / undorangename.hxx
blob53df4ee63c0aece481466fe573300bb525f00c68
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/.
8 */
10 #ifndef INCLUDED_SC_INC_UNDORANGENAME_HXX
11 #define INCLUDED_SC_INC_UNDORANGENAME_HXX
13 #include <undobase.hxx>
15 #include <memory>
16 #include <map>
18 class ScDocShell;
20 /**
21 * Undo object for named ranges, both in global and sheet-local scopes.
23 class ScUndoAllRangeNames final : public ScSimpleUndo
25 public:
26 ScUndoAllRangeNames(ScDocShell* pDocSh,
27 const std::map<OUString, ScRangeName*>& rOldNames,
28 const std::map<OUString, std::unique_ptr<ScRangeName>>& rNewNames);
30 virtual ~ScUndoAllRangeNames() override;
32 virtual void Undo() override;
33 virtual void Redo() override;
34 virtual void Repeat(SfxRepeatTarget& rTarget) override;
35 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const override;
36 virtual OUString GetComment() const override;
38 private:
39 void DoChange(const std::map<OUString, std::unique_ptr<ScRangeName>>& rNames);
41 private:
42 std::map<OUString, std::unique_ptr<ScRangeName>> m_OldNames;
43 std::map<OUString, std::unique_ptr<ScRangeName>> m_NewNames;
46 class ScUndoAddRangeData final : public ScSimpleUndo
48 public:
49 // nTab = -1 for global range names
50 ScUndoAddRangeData(ScDocShell* pDocSh, const ScRangeData* pRangeData, SCTAB nTab);
52 virtual ~ScUndoAddRangeData() override;
54 virtual void Undo() override;
55 virtual void Redo() override;
56 virtual void Repeat(SfxRepeatTarget& rTarget) override;
57 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const override;
58 virtual OUString GetComment() const override;
60 private:
61 std::unique_ptr<ScRangeData> mpRangeData;
62 SCTAB const mnTab;
65 #endif
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */