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/.
12 #include <undobase.hxx>
20 * Undo object for named ranges, both in global and sheet-local scopes.
22 class ScUndoAllRangeNames final
: public ScSimpleUndo
25 ScUndoAllRangeNames(ScDocShell
* pDocSh
, const std::map
<OUString
, ScRangeName
*>& rOldNames
,
26 const std::map
<OUString
, ScRangeName
>& rNewNames
);
28 virtual ~ScUndoAllRangeNames() override
;
30 virtual void Undo() override
;
31 virtual void Redo() override
;
32 virtual void Repeat(SfxRepeatTarget
& rTarget
) override
;
33 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const override
;
34 virtual OUString
GetComment() const override
;
37 void DoChange(const std::map
<OUString
, ScRangeName
>& rNames
);
40 std::map
<OUString
, ScRangeName
> m_OldNames
;
41 std::map
<OUString
, ScRangeName
> m_NewNames
;
44 class ScUndoAddRangeData final
: public ScSimpleUndo
47 // nTab = -1 for global range names
48 ScUndoAddRangeData(ScDocShell
* pDocSh
, const ScRangeData
* pRangeData
, SCTAB nTab
);
50 virtual ~ScUndoAddRangeData() override
;
52 virtual void Undo() override
;
53 virtual void Redo() override
;
54 virtual void Repeat(SfxRepeatTarget
& rTarget
) override
;
55 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const override
;
56 virtual OUString
GetComment() const override
;
59 std::unique_ptr
<ScRangeData
> mpRangeData
;
63 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */