summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/inc/undorangename.hxx14
-rw-r--r--sc/qa/unit/ucalc_sharedformula.cxx4
-rw-r--r--sc/source/core/data/documen3.cxx8
-rw-r--r--sc/source/ui/docshell/docfunc.cxx2
-rw-r--r--sc/source/ui/inc/docfunc.hxx2
-rw-r--r--sc/source/ui/inc/namedlg.hxx12
-rw-r--r--sc/source/ui/inc/namemgrtable.hxx9
-rw-r--r--sc/source/ui/inc/namepast.hxx5
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx5
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx22
-rw-r--r--sc/source/ui/namedlg/namemgrtable.cxx27
-rw-r--r--sc/source/ui/namedlg/namepast.cxx6
-rw-r--r--sc/source/ui/undo/undorangename.cxx20
-rw-r--r--sc/source/ui/view/tabvwshc.cxx9
15 files changed, 80 insertions, 67 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index ec019b098c64..83f12bc53912 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -528,7 +528,7 @@ public:
* non-empty range name set.
*/
SC_DLLPUBLIC void GetAllTabRangeNames(ScRangeName::TabNameCopyMap& rRangeNames) const;
- SC_DLLPUBLIC void SetAllRangeNames( const boost::ptr_map<OUString, ScRangeName>& rRangeMap);
+ SC_DLLPUBLIC void SetAllRangeNames(const std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap);
SC_DLLPUBLIC void GetTabRangeNameMap(std::map<OUString, ScRangeName*>& rRangeName);
SC_DLLPUBLIC void GetRangeNameMap(std::map<OUString, ScRangeName*>& rRangeName);
SC_DLLPUBLIC ScRangeName* GetRangeName(SCTAB nTab) const;
diff --git a/sc/inc/undorangename.hxx b/sc/inc/undorangename.hxx
index ba5a93538f29..009c2a13c63f 100644
--- a/sc/inc/undorangename.hxx
+++ b/sc/inc/undorangename.hxx
@@ -12,7 +12,9 @@
#include "undobase.hxx"
#include "rangenam.hxx"
-#include <boost/ptr_container/ptr_map.hpp>
+
+#include <memory>
+#include <map>
class ScDocShell;
@@ -23,8 +25,8 @@ class ScUndoAllRangeNames : public ScSimpleUndo
{
public:
ScUndoAllRangeNames(ScDocShell* pDocSh,
- const std::map<OUString, ScRangeName*>& rOldNames,
- const boost::ptr_map<OUString, ScRangeName>& rNewNames);
+ const std::map<OUString, ScRangeName*>& rOldNames,
+ const std::map<OUString, std::unique_ptr<ScRangeName>>& rNewNames);
virtual ~ScUndoAllRangeNames();
@@ -35,11 +37,11 @@ public:
virtual OUString GetComment() const override;
private:
- void DoChange(const boost::ptr_map<OUString, ScRangeName>& rNames);
+ void DoChange(const std::map<OUString, std::unique_ptr<ScRangeName>>& rNames);
private:
- boost::ptr_map<OUString, ScRangeName> maOldNames;
- boost::ptr_map<OUString, ScRangeName> maNewNames;
+ std::map<OUString, std::unique_ptr<ScRangeName>> m_OldNames;
+ std::map<OUString, std::unique_ptr<ScRangeName>> m_NewNames;
};
class ScUndoAddRangeData : public ScSimpleUndo
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx
index 63cc3b1673ed..8d70e4defd2d 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -1555,10 +1555,10 @@ void Test::testSharedFormulaUpdateOnNamedRangeChange()
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pNames->size());
ScDocFunc& rFunc = getDocShell().GetDocFunc();
- typedef boost::ptr_map<OUString, ScRangeName> NameMapType;
+ typedef std::map<OUString, std::unique_ptr<ScRangeName>> NameMapType;
NameMapType aNewNames;
OUString aScope(STR_GLOBAL_RANGE_NAME);
- aNewNames.insert(aScope, pNames);
+ aNewNames.insert(std::make_pair(aScope, std::unique_ptr<ScRangeName>(pNames)));
rFunc.ModifyAllRangeNames(aNewNames);
// Check to make sure all displayed formulas are still good.
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index e93926458ebb..21decad75207 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -119,16 +119,16 @@ void ScDocument::GetAllTabRangeNames(ScRangeName::TabNameCopyMap& rNames) const
rNames.swap(aNames);
}
-void ScDocument::SetAllRangeNames( const boost::ptr_map<OUString, ScRangeName>& rRangeMap)
+void ScDocument::SetAllRangeNames(const std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap)
{
OUString aGlobalStr(STR_GLOBAL_RANGE_NAME);
- boost::ptr_map<OUString,ScRangeName>::const_iterator itr = rRangeMap.begin(), itrEnd = rRangeMap.end();
+ auto itr = rRangeMap.begin(), itrEnd = rRangeMap.end();
for (; itr!=itrEnd; ++itr)
{
if (itr->first == aGlobalStr)
{
delete pRangeName;
- const ScRangeName* pName = itr->second;
+ const ScRangeName *const pName = itr->second.get();
if (pName->empty())
pRangeName = NULL;
else
@@ -136,7 +136,7 @@ void ScDocument::SetAllRangeNames( const boost::ptr_map<OUString, ScRangeName>&
}
else
{
- const ScRangeName* pName = itr->second;
+ const ScRangeName *const pName = itr->second.get();
SCTAB nTab;
bool bFound = GetTable(itr->first, nTab);
assert(bFound); (void)bFound; // fouled up?
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index c3e8551af5b5..6f1e5930c93a 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4872,7 +4872,7 @@ void ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTA
}
}
-void ScDocFunc::ModifyAllRangeNames( const boost::ptr_map<OUString, ScRangeName>& rRangeMap )
+void ScDocFunc::ModifyAllRangeNames(const std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap)
{
ScDocShellModificator aModificator(rDocShell);
ScDocument& rDoc = rDocShell.GetDocument();
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 6d9c032f2e2e..2d3864728ece 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -200,7 +200,7 @@ public:
* passed as arguments (it creates copies); the caller is responsible for
* destroying them.
*/
- void ModifyAllRangeNames( const boost::ptr_map<OUString, ScRangeName>& rRangeMap );
+ void ModifyAllRangeNames(const std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap);
bool CreateNames( const ScRange& rRange, sal_uInt16 nFlags, bool bApi, SCTAB nTab = -1 ); // -1 for global range names
bool InsertNameList( const ScAddress& rStartPos, bool bApi );
diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx
index 06fc81606c55..f0c008411307 100644
--- a/sc/source/ui/inc/namedlg.hxx
+++ b/sc/source/ui/inc/namedlg.hxx
@@ -30,8 +30,7 @@
#include "anyrefdg.hxx"
#include "namemgrtable.hxx"
-#include <boost/ptr_container/ptr_map.hpp>
-
+#include <memory>
#include <stack>
#include <map>
@@ -76,9 +75,9 @@ private:
//ugly hack to call DefineNames from ManageNames
bool mbCloseWithoutUndo;
- typedef boost::ptr_map<OUString, ScRangeName> RangeNameContainer;
+ typedef std::map<OUString, std::unique_ptr<ScRangeName>> RangeNameContainer;
- RangeNameContainer maRangeMap;
+ RangeNameContainer m_RangeMap;
private:
void Init();
@@ -116,7 +115,8 @@ protected:
public:
ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData,
- const ScAddress& aCursorPos, boost::ptr_map<OUString, ScRangeName>* pRangeMap = NULL );
+ const ScAddress& aCursorPos,
+ std::map<OUString, std::unique_ptr<ScRangeName>>* pRangeMap = nullptr);
virtual ~ScNameDlg();
virtual void dispose() override;
@@ -128,7 +128,7 @@ public:
virtual void tableInitialized() override;
- void GetRangeNames(boost::ptr_map<OUString, ScRangeName>& rRangeMap);
+ void GetRangeNames(std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap);
void SetEntry(const OUString& rName, const OUString& rScope);
};
diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx
index aec3cb2e4240..9d5f4e1958cd 100644
--- a/sc/source/ui/inc/namemgrtable.hxx
+++ b/sc/source/ui/inc/namemgrtable.hxx
@@ -16,8 +16,9 @@
#include "scresid.hxx"
#include "address.hxx"
+#include <memory>
#include <vector>
-#include <boost/ptr_container/ptr_map.hpp>
+#include <map>
class ScRangeName;
class ScRangeData;
@@ -47,7 +48,7 @@ private:
OUString maGlobalString;
// should be const because we should not modify it here
- const boost::ptr_map<OUString, ScRangeName>& mrRangeMap;
+ const std::map<OUString, std::unique_ptr<ScRangeName>>& m_RangeMap;
// for performance, save which entries already have the formula entry
// otherwise opening the dialog with a lot of range names is extremelly slow because
// we would calculate all formula strings during opening
@@ -64,7 +65,9 @@ private:
void setColWidths();
public:
- ScRangeManagerTable( SvSimpleTableContainer& rParent, boost::ptr_map<OUString, ScRangeName>& aTabRangeNames, const ScAddress& rPos );
+ ScRangeManagerTable(SvSimpleTableContainer& rParent,
+ std::map<OUString, std::unique_ptr<ScRangeName>>& rTabRangeNames,
+ const ScAddress& rPos);
virtual ~ScRangeManagerTable();
virtual void dispose() override;
diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx
index 113299c90e18..604e6c3c3ad1 100644
--- a/sc/source/ui/inc/namepast.hxx
+++ b/sc/source/ui/inc/namepast.hxx
@@ -26,7 +26,9 @@
#include <vcl/lstbox.hxx>
#include "namemgrtable.hxx"
+#include <memory>
#include <vector>
+#include <map>
#include "scui_def.hxx"
class ScRangeName;
@@ -44,7 +46,8 @@ private:
VclPtr<ScRangeManagerTable> mpTable;
std::vector<OUString> maSelectedNames;
- boost::ptr_map<OUString, ScRangeName> maRangeMap;
+ std::map<OUString, std::unique_ptr<ScRangeName>> m_RangeMap;
+
public:
ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool bInsList=true );
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 6f94a6088d15..a1621110d3e0 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -32,7 +32,8 @@
#include "shellids.hxx"
#include "tabprotection.hxx"
-#include <boost/ptr_container/ptr_map.hpp>
+#include <memory>
+#include <map>
class SbxObject;
class SdrOle2Obj;
@@ -168,7 +169,7 @@ private:
SfxBroadcaster* pAccessibilityBroadcaster;
// ugly hack for Add button in ScNameDlg
- boost::ptr_map<OUString, ScRangeName> maRangeMap;
+ std::map<OUString, std::unique_ptr<ScRangeName>> m_RangeMap;
bool mbInSwitch;
OUString maName;
OUString maScope;
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 3138ec047442..5426964f11f5 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -35,6 +35,8 @@
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
+#include <o3tl/make_unique.hxx>
+
#include <map>
// defines -------------------------------------------------------------------
@@ -49,7 +51,8 @@
ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData,
- const ScAddress& aCursorPos, boost::ptr_map<OUString, ScRangeName>* pRangeMap )
+ const ScAddress& aCursorPos,
+ std::map<OUString, std::unique_ptr<ScRangeName>> *const pRangeMap)
: ScAnyRefDlg(pB, pCW, pParent, "ManageNamesDialog", "modules/scalc/ui/managenamesdialog.ui")
, maGlobalNameStr(ScGlobal::GetRscString(STR_GLOBAL_SCOPE))
@@ -90,12 +93,13 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent
for (; itr != itrEnd; ++itr)
{
OUString aTemp(itr->first);
- maRangeMap.insert(aTemp, new ScRangeName(*itr->second));
+ m_RangeMap.insert(std::make_pair(aTemp,
+ o3tl::make_unique<ScRangeName>(*itr->second)));
}
}
else
{
- maRangeMap.swap(*pRangeMap);
+ m_RangeMap.swap(*pRangeMap);
}
Init();
}
@@ -136,7 +140,7 @@ void ScNameDlg::Init()
SvSimpleTableContainer *pCtrl = get<SvSimpleTableContainer>("names");
pCtrl->set_height_request(pCtrl->GetTextHeight()*12);
- m_pRangeManagerTable = VclPtr<ScRangeManagerTable>::Create(*pCtrl, maRangeMap, maCursorPos);
+ m_pRangeManagerTable = VclPtr<ScRangeManagerTable>::Create(*pCtrl, m_RangeMap, maCursorPos);
m_pRangeManagerTable->setInitListener(this);
m_pRangeManagerTable->SetSelectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) );
m_pRangeManagerTable->SetDeselectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) );
@@ -194,7 +198,7 @@ void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
bool ScNameDlg::Close()
{
if (mbDataChanged && !mbCloseWithoutUndo)
- mpViewData->GetDocFunc().ModifyAllRangeNames(maRangeMap);
+ mpViewData->GetDocFunc().ModifyAllRangeNames(m_RangeMap);
return DoClose( ScNameDlgWrapper::GetChildWindowId() );
}
@@ -319,9 +323,9 @@ bool ScNameDlg::IsFormulaValid()
ScRangeName* ScNameDlg::GetRangeName(const OUString& rScope)
{
if (rScope == maGlobalNameStr)
- return maRangeMap.find(OUString(STR_GLOBAL_RANGE_NAME))->second;
+ return m_RangeMap.find(OUString(STR_GLOBAL_RANGE_NAME))->second.get();
else
- return maRangeMap.find(rScope)->second;
+ return m_RangeMap.find(rScope)->second.get();
}
void ScNameDlg::ShowOptions(const ScRangeNameLine& rLine)
@@ -478,9 +482,9 @@ void ScNameDlg::ScopeChanged()
NameModified();
}
-void ScNameDlg::GetRangeNames(boost::ptr_map<OUString, ScRangeName>& rRangeMap)
+void ScNameDlg::GetRangeNames(std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap)
{
- maRangeMap.swap(rRangeMap);
+ m_RangeMap.swap(rRangeMap);
}
IMPL_LINK_NOARG_TYPED(ScNameDlg, OkBtnHdl, Button*, void)
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index 770fa33555ed..655fce68b964 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -34,12 +34,14 @@ static OUString createEntryString(const ScRangeNameLine& rLine)
ScRangeManagerTable::InitListener::~InitListener() {}
-ScRangeManagerTable::ScRangeManagerTable( SvSimpleTableContainer& rParent, boost::ptr_map<OUString, ScRangeName>& rRangeMap, const ScAddress& rPos ):
- SvSimpleTable( rParent, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ),
- maGlobalString( ScGlobal::GetRscString(STR_GLOBAL_SCOPE)),
- mrRangeMap( rRangeMap ),
- maPos( rPos ),
- mpInitListener(NULL)
+ScRangeManagerTable::ScRangeManagerTable(SvSimpleTableContainer& rParent,
+ std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap,
+ const ScAddress& rPos)
+ : SvSimpleTable( rParent, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP )
+ , maGlobalString( ScGlobal::GetRscString(STR_GLOBAL_SCOPE))
+ , m_RangeMap(rRangeMap)
+ , maPos( rPos )
+ , mpInitListener(nullptr)
{
static long aStaticTabs[] = {3, 0, 0, 0 };
SetTabs( &aStaticTabs[0], MAP_PIXEL );
@@ -141,15 +143,14 @@ void ScRangeManagerTable::Init()
{
SetUpdateMode(false);
Clear();
- for (boost::ptr_map<OUString, ScRangeName>::const_iterator itr = mrRangeMap.begin();
- itr != mrRangeMap.end(); ++itr)
+ for (auto const& itr : m_RangeMap)
{
- const ScRangeName* pLocalRangeName = itr->second;
+ const ScRangeName *const pLocalRangeName = itr.second.get();
ScRangeNameLine aLine;
- if ( itr->first == STR_GLOBAL_RANGE_NAME )
+ if (itr.first == STR_GLOBAL_RANGE_NAME)
aLine.aScope = maGlobalString;
else
- aLine.aScope = itr->first;
+ aLine.aScope = itr.first;
for (ScRangeName::const_iterator it = pLocalRangeName->begin();
it != pLocalRangeName->end(); ++it)
{
@@ -167,9 +168,9 @@ const ScRangeData* ScRangeManagerTable::findRangeData(const ScRangeNameLine& rLi
{
const ScRangeName* pRangeName;
if (rLine.aScope == maGlobalString)
- pRangeName = mrRangeMap.find(OUString(STR_GLOBAL_RANGE_NAME))->second;
+ pRangeName = m_RangeMap.find(OUString(STR_GLOBAL_RANGE_NAME))->second.get();
else
- pRangeName = mrRangeMap.find(rLine.aScope)->second;
+ pRangeName = m_RangeMap.find(rLine.aScope)->second.get();
return pRangeName->findByUpperName(ScGlobal::pCharClass->uppercase(rLine.aName));
}
diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx
index 7b64fed12108..a73d3723ec69 100644
--- a/sc/source/ui/namedlg/namepast.cxx
+++ b/sc/source/ui/namedlg/namepast.cxx
@@ -26,6 +26,8 @@
#include "rangenam.hxx"
#include "viewdata.hxx"
+#include <o3tl/make_unique.hxx>
+
ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool )
: ModalDialog( pParent, "InsertNameDialog", "modules/scalc/ui/insertname.ui" )
{
@@ -40,7 +42,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool
for (; itr != itrEnd; ++itr)
{
OUString aTemp(itr->first);
- maRangeMap.insert(aTemp, new ScRangeName(*itr->second));
+ m_RangeMap.insert(std::make_pair(aTemp, o3tl::make_unique<ScRangeName>(*itr->second)));
}
ScViewData* pViewData = ScDocShell::GetViewData();
@@ -50,7 +52,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(10 * GetTextHeight());
- mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, maRangeMap, aPos);
+ mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, m_RangeMap, aPos);
m_pBtnPaste->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) );
m_pBtnPasteAll->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
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();
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 6b8118e07f21..de6eddcdcad9 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -89,7 +89,7 @@ void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialog* pDialog)
if (nSlotId == FID_DEFINE_NAME)
{
mbInSwitch = true;
- static_cast<ScNameDlg*>(pDialog)->GetRangeNames(maRangeMap);
+ static_cast<ScNameDlg*>(pDialog)->GetRangeNames(m_RangeMap);
static_cast<ScNameDlg*>(pDialog)->Close();
sal_uInt16 nId = ScNameDefDlgWrapper::GetChildWindowId();
SfxViewFrame* pViewFrm = GetViewFrame();
@@ -156,7 +156,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
- GetViewData().GetTabNo() ), &maRangeMap);
+ GetViewData().GetTabNo() ), &m_RangeMap);
static_cast<ScNameDlg*>(pResult.get())->SetEntry( maName, maScope);
mbInSwitch = false;
}
@@ -177,10 +177,9 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
else
{
std::map<OUString, ScRangeName*> aRangeMap;
- for (boost::ptr_map<OUString, ScRangeName>::iterator itr = maRangeMap.begin();
- itr != maRangeMap.end(); ++itr)
+ for (auto const& itr : m_RangeMap)
{
- aRangeMap.insert(std::pair<OUString, ScRangeName*>(itr->first, itr->second));
+ aRangeMap.insert(std::pair<OUString, ScRangeName*>(itr.first, itr.second.get()));
}
pResult = VclPtr<ScNameDefDlg>::Create( pB, pCW, pParent, &GetViewData(), aRangeMap,
ScAddress( GetViewData().GetCurX(),