1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_SC_INC_UNDORANGENAME_HXX
11 #define INCLUDED_SC_INC_UNDORANGENAME_HXX
13 #include <undobase.hxx>
21 * Undo object for named ranges, both in global and sheet-local scopes.
23 class ScUndoAllRangeNames final
: public ScSimpleUndo
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
;
39 void DoChange(const std::map
<OUString
, std::unique_ptr
<ScRangeName
>>& rNames
);
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
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
;
61 std::unique_ptr
<ScRangeData
> mpRangeData
;
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */