sc: eeek, a boost::ptr_vector! take it off! take it off!
Change-Id: I3fffecd295577cc8eaa521e819b3c922f8c3f56e
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
#include <vcl/image.hxx>
|
#include <vcl/image.hxx>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/ptr_container/ptr_vector.hpp>
|
#include <memory>
|
||||||
|
|
||||||
class SvTreeListEntry;
|
class SvTreeListEntry;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ struct ScOrcusXMLTreeParam
|
|||||||
SC_DLLPUBLIC EntryData(EntryType eType);
|
SC_DLLPUBLIC EntryData(EntryType eType);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef boost::ptr_vector<EntryData> UserDataStoreType;
|
typedef std::vector<std::unique_ptr<EntryData>> UserDataStoreType;
|
||||||
|
|
||||||
Image maImgElementDefault;
|
Image maImgElementDefault;
|
||||||
Image maImgElementRepeat;
|
Image maImgElementRepeat;
|
||||||
@@ -48,7 +48,7 @@ struct ScOrcusXMLTreeParam
|
|||||||
* Store all custom data instances since the tree control doesn't manage
|
* Store all custom data instances since the tree control doesn't manage
|
||||||
* the life cycle of user datas.
|
* the life cycle of user datas.
|
||||||
*/
|
*/
|
||||||
UserDataStoreType maUserDataStore;
|
UserDataStoreType m_UserDataStore;
|
||||||
|
|
||||||
static SC_DLLPUBLIC EntryData* getUserData(SvTreeListEntry& rEntry);
|
static SC_DLLPUBLIC EntryData* getUserData(SvTreeListEntry& rEntry);
|
||||||
static SC_DLLPUBLIC const EntryData* getUserData(const SvTreeListEntry& rEntry);
|
static SC_DLLPUBLIC const EntryData* getUserData(const SvTreeListEntry& rEntry);
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include <svtools/treelistbox.hxx>
|
#include <svtools/treelistbox.hxx>
|
||||||
#include <svtools/treelistentry.hxx>
|
#include <svtools/treelistentry.hxx>
|
||||||
#include <ucbhelper/content.hxx>
|
#include <ucbhelper/content.hxx>
|
||||||
|
#include <o3tl/make_unique.hxx>
|
||||||
|
|
||||||
#include <orcus/spreadsheet/import_interface.hpp>
|
#include <orcus/spreadsheet/import_interface.hpp>
|
||||||
#include <orcus/xml_structure_tree.hpp>
|
#include <orcus/xml_structure_tree.hpp>
|
||||||
@@ -36,9 +37,9 @@ namespace {
|
|||||||
ScOrcusXMLTreeParam::EntryData& setUserDataToEntry(
|
ScOrcusXMLTreeParam::EntryData& setUserDataToEntry(
|
||||||
SvTreeListEntry& rEntry, ScOrcusXMLTreeParam::UserDataStoreType& rStore, ScOrcusXMLTreeParam::EntryType eType)
|
SvTreeListEntry& rEntry, ScOrcusXMLTreeParam::UserDataStoreType& rStore, ScOrcusXMLTreeParam::EntryType eType)
|
||||||
{
|
{
|
||||||
rStore.push_back(new ScOrcusXMLTreeParam::EntryData(eType));
|
rStore.push_back(o3tl::make_unique<ScOrcusXMLTreeParam::EntryData>(eType));
|
||||||
rEntry.SetUserData(&rStore.back());
|
rEntry.SetUserData(rStore.back().get());
|
||||||
return rStore.back();
|
return *rStore.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setEntityNameToUserData(
|
void setEntityNameToUserData(
|
||||||
@@ -73,7 +74,7 @@ void populateTree(
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ScOrcusXMLTreeParam::EntryData& rEntryData = setUserDataToEntry(
|
ScOrcusXMLTreeParam::EntryData& rEntryData = setUserDataToEntry(
|
||||||
*pEntry, rParam.maUserDataStore,
|
*pEntry, rParam.m_UserDataStore,
|
||||||
bRepeat ? ScOrcusXMLTreeParam::ElementRepeat : ScOrcusXMLTreeParam::ElementDefault);
|
bRepeat ? ScOrcusXMLTreeParam::ElementRepeat : ScOrcusXMLTreeParam::ElementDefault);
|
||||||
|
|
||||||
setEntityNameToUserData(rEntryData, rElemName, rWalker);
|
setEntityNameToUserData(rEntryData, rElemName, rWalker);
|
||||||
@@ -103,7 +104,7 @@ void populateTree(
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
ScOrcusXMLTreeParam::EntryData& rAttrData =
|
ScOrcusXMLTreeParam::EntryData& rAttrData =
|
||||||
setUserDataToEntry(*pAttr, rParam.maUserDataStore, ScOrcusXMLTreeParam::Attribute);
|
setUserDataToEntry(*pAttr, rParam.m_UserDataStore, ScOrcusXMLTreeParam::Attribute);
|
||||||
setEntityNameToUserData(rAttrData, rAttrName, rWalker);
|
setEntityNameToUserData(rAttrData, rAttrName, rWalker);
|
||||||
|
|
||||||
rTreeCtrl.SetExpandedEntryBmp(pAttr, rParam.maImgAttribute);
|
rTreeCtrl.SetExpandedEntryBmp(pAttr, rParam.maImgAttribute);
|
||||||
@@ -180,7 +181,7 @@ ScOrcusXMLContextImpl::~ScOrcusXMLContextImpl() {}
|
|||||||
|
|
||||||
void ScOrcusXMLContextImpl::loadXMLStructure(SvTreeListBox& rTreeCtrl, ScOrcusXMLTreeParam& rParam)
|
void ScOrcusXMLContextImpl::loadXMLStructure(SvTreeListBox& rTreeCtrl, ScOrcusXMLTreeParam& rParam)
|
||||||
{
|
{
|
||||||
rParam.maUserDataStore.clear();
|
rParam.m_UserDataStore.clear();
|
||||||
|
|
||||||
std::string aStrm;
|
std::string aStrm;
|
||||||
loadContentFromURL(maPath, aStrm);
|
loadContentFromURL(maPath, aStrm);
|
||||||
|
Reference in New Issue
Block a user