diff options
Diffstat (limited to 'sc/source/filter/orcus/xmlcontext.cxx')
-rw-r--r-- | sc/source/filter/orcus/xmlcontext.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sc/source/filter/orcus/xmlcontext.cxx b/sc/source/filter/orcus/xmlcontext.cxx index 083972067468..873e2ef8ce4d 100644 --- a/sc/source/filter/orcus/xmlcontext.cxx +++ b/sc/source/filter/orcus/xmlcontext.cxx @@ -34,13 +34,20 @@ using namespace com::sun::star; namespace { 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()); 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) { OUStringBuffer aBuf; @@ -68,7 +75,8 @@ void populateTree( ScOrcusXMLTreeParam::EntryData& rEntryData = setUserDataToEntry( *pEntry, rParam.maUserDataStore, bRepeat ? ScOrcusXMLTreeParam::ElementRepeat : ScOrcusXMLTreeParam::ElementDefault); - rEntryData.mnNamespaceID = rWalker.get_xmlns_index(rElemName.ns); + + setEntityNameToUserData(rEntryData, rElemName, rWalker); if (bRepeat) { @@ -96,7 +104,7 @@ void populateTree( ScOrcusXMLTreeParam::EntryData& rAttrData = setUserDataToEntry(*pAttr, rParam.maUserDataStore, ScOrcusXMLTreeParam::Attribute); - rAttrData.mnNamespaceID = rWalker.get_xmlns_index(rAttrName.ns); + setEntityNameToUserData(rAttrData, rAttrName, rWalker); rTreeCtrl.SetExpandedEntryBmp(pAttr, rParam.maImgAttribute); rTreeCtrl.SetCollapsedEntryBmp(pAttr, rParam.maImgAttribute); |