nss: upgrade to release 3.73
[LibreOffice.git] / sc / inc / undorangename.hxx
blobac366b5d1219f305f963a0c51eeb3af4d65656c4
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, const std::map<OUString, ScRangeName*>& rOldNames,
27 const std::map<OUString, std::unique_ptr<ScRangeName>>& rNewNames);
29 virtual ~ScUndoAllRangeNames() override;
31 virtual void Undo() override;
32 virtual void Redo() override;
33 virtual void Repeat(SfxRepeatTarget& rTarget) override;
34 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const override;
35 virtual OUString GetComment() const override;
37 private:
38 void DoChange(const std::map<OUString, std::unique_ptr<ScRangeName>>& rNames);
40 private:
41 std::map<OUString, std::unique_ptr<ScRangeName>> m_OldNames;
42 std::map<OUString, std::unique_ptr<ScRangeName>> m_NewNames;
45 class ScUndoAddRangeData final : public ScSimpleUndo
47 public:
48 // nTab = -1 for global range names
49 ScUndoAddRangeData(ScDocShell* pDocSh, const ScRangeData* pRangeData, SCTAB nTab);
51 virtual ~ScUndoAddRangeData() override;
53 virtual void Undo() override;
54 virtual void Redo() override;
55 virtual void Repeat(SfxRepeatTarget& rTarget) override;
56 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const override;
57 virtual OUString GetComment() const override;
59 private:
60 std::unique_ptr<ScRangeData> mpRangeData;
61 SCTAB mnTab;
64 #endif
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */