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 __SC_UNDORANGENAME_HXX__
11 #define __SC_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();
33 virtual void Repeat(SfxRepeatTarget
& rTarget
);
34 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const;
35 virtual OUString
GetComment() const;
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();
55 virtual void Repeat(SfxRepeatTarget
& rTarget
);
56 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const;
57 virtual OUString
GetComment() const;
60 ScRangeData
* mpRangeData
;
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */