tdf#100257 - Data : XML Source does not work
Revert "sc: boost::ptr_vector->std::vector"
This reverts commit 280553e30f
.
Change-Id: Ia50c9cf7902e2e830c6e7f7a13c8f04341556e6c
Reviewed-on: https://gerrit.libreoffice.org/26106
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
5fd43512c3
commit
d6a6f587a8
@@ -15,6 +15,7 @@
|
|||||||
#include <vcl/image.hxx>
|
#include <vcl/image.hxx>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <boost/ptr_container/ptr_vector.hpp>
|
||||||
|
|
||||||
class SvTreeListEntry;
|
class SvTreeListEntry;
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ struct ScOrcusXMLTreeParam
|
|||||||
SC_DLLPUBLIC EntryData(EntryType eType);
|
SC_DLLPUBLIC EntryData(EntryType eType);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<EntryData> EntryDataVec;
|
typedef boost::ptr_vector<EntryData> UserDataStoreType;
|
||||||
|
|
||||||
Image maImgElementDefault;
|
Image maImgElementDefault;
|
||||||
Image maImgElementRepeat;
|
Image maImgElementRepeat;
|
||||||
@@ -47,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.
|
||||||
*/
|
*/
|
||||||
EntryDataVec maUserDataStore;
|
UserDataStoreType maUserDataStore;
|
||||||
|
|
||||||
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);
|
||||||
|
@@ -34,13 +34,20 @@ using namespace com::sun::star;
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
ScOrcusXMLTreeParam::EntryData& setUserDataToEntry(
|
ScOrcusXMLTreeParam::EntryData& setUserDataToEntry(
|
||||||
SvTreeListEntry& rEntry, ScOrcusXMLTreeParam::EntryDataVec& rStore, ScOrcusXMLTreeParam::EntryType eType)
|
SvTreeListEntry& rEntry, ScOrcusXMLTreeParam::UserDataStoreType& rStore, ScOrcusXMLTreeParam::EntryType eType)
|
||||||
{
|
{
|
||||||
rStore.push_back(ScOrcusXMLTreeParam::EntryData(eType));
|
rStore.push_back(new ScOrcusXMLTreeParam::EntryData(eType));
|
||||||
rEntry.SetUserData(&rStore.back());
|
rEntry.SetUserData(&rStore.back());
|
||||||
return rStore.back();
|
return rStore.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setEntityNameToUserData(
|
||||||
|
ScOrcusXMLTreeParam::EntryData& rEntryData,
|
||||||
|
const orcus::xml_structure_tree::entity_name& entity, const orcus::xml_structure_tree::walker& walker)
|
||||||
|
{
|
||||||
|
rEntryData.mnNamespaceID = walker.get_xmlns_index(entity.ns);
|
||||||
|
}
|
||||||
|
|
||||||
OUString toString(const orcus::xml_structure_tree::entity_name& entity, const orcus::xml_structure_tree::walker& walker)
|
OUString toString(const orcus::xml_structure_tree::entity_name& entity, const orcus::xml_structure_tree::walker& walker)
|
||||||
{
|
{
|
||||||
OUStringBuffer aBuf;
|
OUStringBuffer aBuf;
|
||||||
@@ -68,7 +75,8 @@ void populateTree(
|
|||||||
ScOrcusXMLTreeParam::EntryData& rEntryData = setUserDataToEntry(
|
ScOrcusXMLTreeParam::EntryData& rEntryData = setUserDataToEntry(
|
||||||
*pEntry, rParam.maUserDataStore,
|
*pEntry, rParam.maUserDataStore,
|
||||||
bRepeat ? ScOrcusXMLTreeParam::ElementRepeat : ScOrcusXMLTreeParam::ElementDefault);
|
bRepeat ? ScOrcusXMLTreeParam::ElementRepeat : ScOrcusXMLTreeParam::ElementDefault);
|
||||||
rEntryData.mnNamespaceID = rWalker.get_xmlns_index(rElemName.ns);
|
|
||||||
|
setEntityNameToUserData(rEntryData, rElemName, rWalker);
|
||||||
|
|
||||||
if (bRepeat)
|
if (bRepeat)
|
||||||
{
|
{
|
||||||
@@ -96,7 +104,7 @@ void populateTree(
|
|||||||
|
|
||||||
ScOrcusXMLTreeParam::EntryData& rAttrData =
|
ScOrcusXMLTreeParam::EntryData& rAttrData =
|
||||||
setUserDataToEntry(*pAttr, rParam.maUserDataStore, ScOrcusXMLTreeParam::Attribute);
|
setUserDataToEntry(*pAttr, rParam.maUserDataStore, ScOrcusXMLTreeParam::Attribute);
|
||||||
rAttrData.mnNamespaceID = rWalker.get_xmlns_index(rAttrName.ns);
|
setEntityNameToUserData(rAttrData, rAttrName, rWalker);
|
||||||
|
|
||||||
rTreeCtrl.SetExpandedEntryBmp(pAttr, rParam.maImgAttribute);
|
rTreeCtrl.SetExpandedEntryBmp(pAttr, rParam.maImgAttribute);
|
||||||
rTreeCtrl.SetCollapsedEntryBmp(pAttr, rParam.maImgAttribute);
|
rTreeCtrl.SetCollapsedEntryBmp(pAttr, rParam.maImgAttribute);
|
||||||
|
Reference in New Issue
Block a user