LibreOffice Module sc (master) 1
undorangename.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 */
9
10#pragma once
11
12#include <undobase.hxx>
13
14#include <memory>
15#include <map>
16
17class ScDocShell;
18
23{
24public:
25 ScUndoAllRangeNames(ScDocShell* pDocSh, const std::map<OUString, ScRangeName*>& rOldNames,
26 const std::map<OUString, ScRangeName>& rNewNames);
27
28 virtual ~ScUndoAllRangeNames() override;
29
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;
35
36private:
37 void DoChange(const std::map<OUString, ScRangeName>& rNames);
38
39private:
40 std::map<OUString, ScRangeName> m_OldNames;
41 std::map<OUString, ScRangeName> m_NewNames;
42};
43
44class ScUndoAddRangeData final : public ScSimpleUndo
45{
46public:
47 // nTab = -1 for global range names
48 ScUndoAddRangeData(ScDocShell* pDocSh, const ScRangeData* pRangeData, SCTAB nTab);
49
50 virtual ~ScUndoAddRangeData() override;
51
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;
57
58private:
59 std::unique_ptr<ScRangeData> mpRangeData;
61};
62
63/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< ScRangeData > mpRangeData
virtual void Undo() override
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
ScUndoAddRangeData(ScDocShell *pDocSh, const ScRangeData *pRangeData, SCTAB nTab)
virtual ~ScUndoAddRangeData() override
virtual OUString GetComment() const override
virtual void Repeat(SfxRepeatTarget &rTarget) override
virtual void Redo() override
Undo object for named ranges, both in global and sheet-local scopes.
virtual OUString GetComment() const override
virtual void Redo() override
std::map< OUString, ScRangeName > m_NewNames
void DoChange(const std::map< OUString, ScRangeName > &rNames)
virtual ~ScUndoAllRangeNames() override
virtual void Undo() override
ScUndoAllRangeNames(ScDocShell *pDocSh, const std::map< OUString, ScRangeName * > &rOldNames, const std::map< OUString, ScRangeName > &rNewNames)
std::map< OUString, ScRangeName > m_OldNames
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
virtual void Repeat(SfxRepeatTarget &rTarget) override
FilterGroup & rTarget
sal_Int16 SCTAB
Definition: types.hxx:22