From 741077bf1cdb0c9240ee3e90f07a42bef5bb7a8f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 9 Jun 2016 21:43:00 +0200 Subject: [PATCH] sc: eeek, a boost::ptr_vector! take it off! take it off! Change-Id: I3fffecd295577cc8eaa521e819b3c922f8c3f56e --- sc/inc/orcusxml.hxx | 6 +++--- sc/source/filter/orcus/xmlcontext.cxx | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sc/inc/orcusxml.hxx b/sc/inc/orcusxml.hxx index cc41f3b6c3e0..9d803ef20122 100644 --- a/sc/inc/orcusxml.hxx +++ b/sc/inc/orcusxml.hxx @@ -15,7 +15,7 @@ #include #include -#include +#include class SvTreeListEntry; @@ -38,7 +38,7 @@ struct ScOrcusXMLTreeParam SC_DLLPUBLIC EntryData(EntryType eType); }; - typedef boost::ptr_vector UserDataStoreType; + typedef std::vector> UserDataStoreType; Image maImgElementDefault; Image maImgElementRepeat; @@ -48,7 +48,7 @@ struct ScOrcusXMLTreeParam * Store all custom data instances since the tree control doesn't manage * the life cycle of user datas. */ - UserDataStoreType maUserDataStore; + UserDataStoreType m_UserDataStore; static SC_DLLPUBLIC EntryData* getUserData(SvTreeListEntry& rEntry); static SC_DLLPUBLIC const EntryData* getUserData(const SvTreeListEntry& rEntry); diff --git a/sc/source/filter/orcus/xmlcontext.cxx b/sc/source/filter/orcus/xmlcontext.cxx index 873e2ef8ce4d..606456563a4d 100644 --- a/sc/source/filter/orcus/xmlcontext.cxx +++ b/sc/source/filter/orcus/xmlcontext.cxx @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -36,9 +37,9 @@ namespace { ScOrcusXMLTreeParam::EntryData& setUserDataToEntry( SvTreeListEntry& rEntry, ScOrcusXMLTreeParam::UserDataStoreType& rStore, ScOrcusXMLTreeParam::EntryType eType) { - rStore.push_back(new ScOrcusXMLTreeParam::EntryData(eType)); - rEntry.SetUserData(&rStore.back()); - return rStore.back(); + rStore.push_back(o3tl::make_unique(eType)); + rEntry.SetUserData(rStore.back().get()); + return *rStore.back(); } void setEntityNameToUserData( @@ -73,7 +74,7 @@ void populateTree( return; ScOrcusXMLTreeParam::EntryData& rEntryData = setUserDataToEntry( - *pEntry, rParam.maUserDataStore, + *pEntry, rParam.m_UserDataStore, bRepeat ? ScOrcusXMLTreeParam::ElementRepeat : ScOrcusXMLTreeParam::ElementDefault); setEntityNameToUserData(rEntryData, rElemName, rWalker); @@ -103,7 +104,7 @@ void populateTree( continue; ScOrcusXMLTreeParam::EntryData& rAttrData = - setUserDataToEntry(*pAttr, rParam.maUserDataStore, ScOrcusXMLTreeParam::Attribute); + setUserDataToEntry(*pAttr, rParam.m_UserDataStore, ScOrcusXMLTreeParam::Attribute); setEntityNameToUserData(rAttrData, rAttrName, rWalker); rTreeCtrl.SetExpandedEntryBmp(pAttr, rParam.maImgAttribute); @@ -180,7 +181,7 @@ ScOrcusXMLContextImpl::~ScOrcusXMLContextImpl() {} void ScOrcusXMLContextImpl::loadXMLStructure(SvTreeListBox& rTreeCtrl, ScOrcusXMLTreeParam& rParam) { - rParam.maUserDataStore.clear(); + rParam.m_UserDataStore.clear(); std::string aStrm; loadContentFromURL(maPath, aStrm);