Kaydet (Commit) b104b8fe authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Add detected attributes to the tree too.

Change-Id: I6d4b757f599ac8d33be3775ee55eaef61d89871a
üst 19b2f5df
...@@ -175,10 +175,8 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument& rDoc, const OUString& rPath) cons ...@@ -175,10 +175,8 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument& rDoc, const OUString& rPath) cons
void populateTree( void populateTree(
SvTreeListBox& rTreeCtrl, orcus::xml_structure_tree::walker& rWalker, SvTreeListBox& rTreeCtrl, orcus::xml_structure_tree::walker& rWalker,
const orcus::xml_structure_tree::element_name& rElemName, bool bRepeat, const Image& rImgRepeatElem, SvLBoxEntry* pParent) const orcus::xml_structure_tree::entity_name& rElemName, bool bRepeat, const Image& rImgRepeatElem, SvLBoxEntry* pParent)
{ {
// TODO: Make use of bRepeat flag.
OUString aName(rElemName.name.get(), rElemName.name.size(), RTL_TEXTENCODING_UTF8); OUString aName(rElemName.name.get(), rElemName.name.size(), RTL_TEXTENCODING_UTF8);
SvLBoxEntry* pEntry = rTreeCtrl.InsertEntry(aName, pParent); SvLBoxEntry* pEntry = rTreeCtrl.InsertEntry(aName, pParent);
if (bRepeat) if (bRepeat)
...@@ -190,12 +188,21 @@ void populateTree( ...@@ -190,12 +188,21 @@ void populateTree(
if (pParent) if (pParent)
rTreeCtrl.Expand(pParent); rTreeCtrl.Expand(pParent);
orcus::xml_structure_tree::element_names_type aChildElements; orcus::xml_structure_tree::entity_names_type aNames;
rWalker.get_children(aChildElements);
orcus::xml_structure_tree::element_names_type::const_iterator it = aChildElements.begin(); rWalker.get_attributes(aNames);
orcus::xml_structure_tree::element_names_type::const_iterator itEnd = aChildElements.end(); orcus::xml_structure_tree::entity_names_type::const_iterator it = aNames.begin();
orcus::xml_structure_tree::entity_names_type::const_iterator itEnd = aNames.end();
for (; it != itEnd; ++it) for (; it != itEnd; ++it)
{
orcus::xml_structure_tree::entity_name aAttrName = *it;
rTreeCtrl.InsertEntry(OUString(aAttrName.name.get(), aAttrName.name.size(), RTL_TEXTENCODING_UTF8), pEntry);
}
rTreeCtrl.Expand(pEntry);
rWalker.get_children(aNames);
for (it = aNames.begin(), itEnd = aNames.end(); it != itEnd; ++it)
{ {
orcus::xml_structure_tree::element aElem = rWalker.descend(*it); orcus::xml_structure_tree::element aElem = rWalker.descend(*it);
populateTree(rTreeCtrl, rWalker, *it, aElem.repeat, rImgRepeatElem, pEntry); populateTree(rTreeCtrl, rWalker, *it, aElem.repeat, rImgRepeatElem, pEntry);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment