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"
15 #include <boost/ptr_container/ptr_map.hpp>
20 * Undo object for named ranges, both in global and sheet-local scopes.
22 class ScUndoAllRangeNames
: public ScSimpleUndo
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
;
38 void DoChange(const boost::ptr_map
<OUString
, ScRangeName
>& rNames
);
41 boost::ptr_map
<OUString
, ScRangeName
> maOldNames
;
42 boost::ptr_map
<OUString
, ScRangeName
> maNewNames
;
45 class ScUndoAddRangeData
: public ScSimpleUndo
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
;
60 ScRangeData
* mpRangeData
;
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */