Bump version to 4.3-4
[LibreOffice.git] / sc / inc / undorangename.hxx
bloba855e9994e9b572660f9ad9a5fc92bd7eeb92bdd
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"
14 #include "rangenam.hxx"
15 #include <boost/ptr_container/ptr_map.hpp>
17 class ScDocShell;
19 /**
20 * Undo object for named ranges, both in global and sheet-local scopes.
22 class ScUndoAllRangeNames : public ScSimpleUndo
24 public:
25 ScUndoAllRangeNames(ScDocShell* pDocSh,
26 const std::map<OUString, ScRangeName*>& rOldNames,
27 const boost::ptr_map<OUString, ScRangeName>& rNewNames);
29 virtual ~ScUndoAllRangeNames();
31 virtual void Undo() SAL_OVERRIDE;
32 virtual void Redo() SAL_OVERRIDE;
33 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
34 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
35 virtual OUString GetComment() const SAL_OVERRIDE;
37 private:
38 void DoChange(const boost::ptr_map<OUString, ScRangeName>& rNames);
40 private:
41 boost::ptr_map<OUString, ScRangeName> maOldNames;
42 boost::ptr_map<OUString, ScRangeName> maNewNames;
45 class ScUndoAddRangeData : public ScSimpleUndo
47 public:
48 // nTab = -1 for global range names
49 ScUndoAddRangeData(ScDocShell* pDocSh, ScRangeData* pRangeData, SCTAB nTab);
51 virtual ~ScUndoAddRangeData();
53 virtual void Undo() SAL_OVERRIDE;
54 virtual void Redo() SAL_OVERRIDE;
55 virtual void Repeat(SfxRepeatTarget& rTarget) SAL_OVERRIDE;
56 virtual bool CanRepeat(SfxRepeatTarget& rTarget) const SAL_OVERRIDE;
57 virtual OUString GetComment() const SAL_OVERRIDE;
59 private:
60 ScRangeData* mpRangeData;
61 SCTAB mnTab;
64 #endif
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */