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>
14 #include "rangenam.hxx"
22 * Undo object for named ranges, both in global and sheet-local scopes.
24 class ScUndoAllRangeNames
: public ScSimpleUndo
27 ScUndoAllRangeNames(ScDocShell
* pDocSh
,
28 const std::map
<OUString
, ScRangeName
*>& rOldNames
,
29 const std::map
<OUString
, std::unique_ptr
<ScRangeName
>>& rNewNames
);
31 virtual ~ScUndoAllRangeNames() override
;
33 virtual void Undo() override
;
34 virtual void Redo() override
;
35 virtual void Repeat(SfxRepeatTarget
& rTarget
) override
;
36 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const override
;
37 virtual OUString
GetComment() const override
;
40 void DoChange(const std::map
<OUString
, std::unique_ptr
<ScRangeName
>>& rNames
);
43 std::map
<OUString
, std::unique_ptr
<ScRangeName
>> m_OldNames
;
44 std::map
<OUString
, std::unique_ptr
<ScRangeName
>> m_NewNames
;
47 class ScUndoAddRangeData
: public ScSimpleUndo
50 // nTab = -1 for global range names
51 ScUndoAddRangeData(ScDocShell
* pDocSh
, const ScRangeData
* pRangeData
, SCTAB nTab
);
53 virtual ~ScUndoAddRangeData() override
;
55 virtual void Undo() override
;
56 virtual void Redo() override
;
57 virtual void Repeat(SfxRepeatTarget
& rTarget
) override
;
58 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const override
;
59 virtual OUString
GetComment() const override
;
62 std::unique_ptr
<ScRangeData
> mpRangeData
;
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */