diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-11-02 18:38:48 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-02 21:11:43 +0100 |
commit | f462cd39b990929bc71615f7f04d561d64c1039d (patch) | |
tree | f3a713fe4746846ccb4e2fe3ce3fc6c86d03e2f5 /sc/source/ui/undo | |
parent | 9939a89c1e39e5c350600b6bea795743ddb780fb (diff) |
sc: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I51d87693bdb3d57c36d8cafb851fdad10cd93589
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undorangename.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx index 6cb3d6c8b27a..f275cdc783f5 100644 --- a/sc/source/ui/undo/undorangename.cxx +++ b/sc/source/ui/undo/undorangename.cxx @@ -13,7 +13,6 @@ #include "docfunc.hxx" #include "sc.hrc" -#include <o3tl/ptr_container.hxx> #include <sfx2/app.hxx> #include <memory> @@ -24,21 +23,20 @@ using ::std::unique_ptr; ScUndoAllRangeNames::ScUndoAllRangeNames( ScDocShell* pDocSh, const std::map<OUString, ScRangeName*>& rOldNames, - const boost::ptr_map<OUString, ScRangeName>& rNewNames) : - ScSimpleUndo(pDocSh) + const std::map<OUString, std::unique_ptr<ScRangeName>>& rNewNames) + : ScSimpleUndo(pDocSh) { std::map<OUString, ScRangeName*>::const_iterator itr, itrEnd; for (itr = rOldNames.begin(), itrEnd = rOldNames.end(); itr != itrEnd; ++itr) { unique_ptr<ScRangeName> p(new ScRangeName(*itr->second)); - o3tl::ptr_container::insert(maOldNames, itr->first, std::move(p)); + m_OldNames.insert(std::make_pair(itr->first, std::move(p))); } - boost::ptr_map<OUString, ScRangeName>::const_iterator it, itEnd; - for (it = rNewNames.begin(), itEnd = rNewNames.end(); it != itEnd; ++it) + for (auto const& it : rNewNames) { - unique_ptr<ScRangeName> p(new ScRangeName(*it->second)); - o3tl::ptr_container::insert(maNewNames, it->first, std::move(p)); + unique_ptr<ScRangeName> p(new ScRangeName(*it.second)); + m_NewNames.insert(std::make_pair(it.first, std::move(p))); } } @@ -48,12 +46,12 @@ ScUndoAllRangeNames::~ScUndoAllRangeNames() void ScUndoAllRangeNames::Undo() { - DoChange(maOldNames); + DoChange(m_OldNames); } void ScUndoAllRangeNames::Redo() { - DoChange(maNewNames); + DoChange(m_NewNames); } void ScUndoAllRangeNames::Repeat(SfxRepeatTarget& /*rTarget*/) @@ -70,7 +68,7 @@ OUString ScUndoAllRangeNames::GetComment() const return ScGlobal::GetRscString(STR_UNDO_RANGENAMES); } -void ScUndoAllRangeNames::DoChange(const boost::ptr_map<OUString, ScRangeName>& rNames) +void ScUndoAllRangeNames::DoChange(const std::map<OUString, std::unique_ptr<ScRangeName>>& rNames) { ScDocument& rDoc = pDocShell->GetDocument(); |