[Libreoffice-commits] core.git: sc/inc sc/source
Michael Stahl
mstahl at redhat.com
Thu Jun 9 19:59:36 UTC 2016
sc/inc/orcusxml.hxx | 6 +++---
sc/source/filter/orcus/xmlcontext.cxx | 13 +++++++------
2 files changed, 10 insertions(+), 9 deletions(-)
New commits:
commit 741077bf1cdb0c9240ee3e90f07a42bef5bb7a8f
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Jun 9 21:43:00 2016 +0200
sc: eeek, a boost::ptr_vector! take it off! take it off!
Change-Id: I3fffecd295577cc8eaa521e819b3c922f8c3f56e
diff --git a/sc/inc/orcusxml.hxx b/sc/inc/orcusxml.hxx
index cc41f3b..9d803ef 100644
--- a/sc/inc/orcusxml.hxx
+++ b/sc/inc/orcusxml.hxx
@@ -15,7 +15,7 @@
#include <vcl/image.hxx>
#include <vector>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <memory>
class SvTreeListEntry;
@@ -38,7 +38,7 @@ struct ScOrcusXMLTreeParam
SC_DLLPUBLIC EntryData(EntryType eType);
};
- typedef boost::ptr_vector<EntryData> UserDataStoreType;
+ typedef std::vector<std::unique_ptr<EntryData>> 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 873e2ef..6064565 100644
--- a/sc/source/filter/orcus/xmlcontext.cxx
+++ b/sc/source/filter/orcus/xmlcontext.cxx
@@ -15,6 +15,7 @@
#include <svtools/treelistbox.hxx>
#include <svtools/treelistentry.hxx>
#include <ucbhelper/content.hxx>
+#include <o3tl/make_unique.hxx>
#include <orcus/spreadsheet/import_interface.hpp>
#include <orcus/xml_structure_tree.hpp>
@@ -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<ScOrcusXMLTreeParam::EntryData>(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);
More information about the Libreoffice-commits
mailing list