summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-10-03 10:33:09 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-11-28 13:28:22 -0500
commit19b2f5dfb63f3c4d7b00d10a389b4d19f5d5fcea (patch)
tree830af36f3f05fbb1bb794ec102f557d9e506cc8a /sc/source/filter
parent5d979234d3205e290efae6a643c9156260d149ef (diff)
Use different icon for recurring elements.
Change-Id: I3869e4a1f2f4b68d57641395daaf79d911a1a891
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/inc/orcusfiltersimpl.hxx4
-rw-r--r--sc/source/filter/orcus/orcusfiltersimpl.cxx17
2 files changed, 16 insertions, 5 deletions
diff --git a/sc/source/filter/inc/orcusfiltersimpl.hxx b/sc/source/filter/inc/orcusfiltersimpl.hxx
index f51f00f9550d..311b6e08d502 100644
--- a/sc/source/filter/inc/orcusfiltersimpl.hxx
+++ b/sc/source/filter/inc/orcusfiltersimpl.hxx
@@ -17,7 +17,9 @@ class ScOrcusFiltersImpl : public ScOrcusFilters
public:
virtual bool importCSV(ScDocument& rDoc, const rtl::OUString& rPath) const;
- virtual bool loadXMLStructure(const rtl::OUString& rPath, SvTreeListBox& rTree) const;
+ virtual bool loadXMLStructure(
+ SvTreeListBox& rTreeCtrl, const rtl::OUString& rPath,
+ const Image& rImgDefaultElem, const Image& rImgRepeatElem) const;
};
#endif
diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx
index 721e5eea227d..845304380330 100644
--- a/sc/source/filter/orcus/orcusfiltersimpl.cxx
+++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx
@@ -175,12 +175,18 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument& rDoc, const OUString& rPath) cons
void populateTree(
SvTreeListBox& rTreeCtrl, orcus::xml_structure_tree::walker& rWalker,
- const orcus::xml_structure_tree::element_name& rElemName, bool bRepeat, SvLBoxEntry* pParent)
+ const orcus::xml_structure_tree::element_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);
SvLBoxEntry* pEntry = rTreeCtrl.InsertEntry(aName, pParent);
+ if (bRepeat)
+ {
+ rTreeCtrl.SetExpandedEntryBmp(pEntry, rImgRepeatElem);
+ rTreeCtrl.SetCollapsedEntryBmp(pEntry, rImgRepeatElem);
+ }
+
if (pParent)
rTreeCtrl.Expand(pParent);
@@ -192,12 +198,13 @@ void populateTree(
for (; it != itEnd; ++it)
{
orcus::xml_structure_tree::element aElem = rWalker.descend(*it);
- populateTree(rTreeCtrl, rWalker, *it, aElem.repeat, pEntry);
+ populateTree(rTreeCtrl, rWalker, *it, aElem.repeat, rImgRepeatElem, pEntry);
rWalker.ascend();
}
}
-bool ScOrcusFiltersImpl::loadXMLStructure(const OUString& rPath, SvTreeListBox& rTreeCtrl) const
+bool ScOrcusFiltersImpl::loadXMLStructure(
+ SvTreeListBox& rTreeCtrl, const rtl::OUString& rPath, const Image& rImgDefaultElem, const Image& rImgRepeatElem) const
{
INetURLObject aURL(rPath);
OString aSysPath = rtl::OUStringToOString(aURL.getFSysPath(SYSTEM_PATH), RTL_TEXTENCODING_UTF8);
@@ -217,12 +224,14 @@ bool ScOrcusFiltersImpl::loadXMLStructure(const OUString& rPath, SvTreeListBox&
aXmlTree.parse(&aStrm[0], aStrm.size());
rTreeCtrl.Clear();
+ rTreeCtrl.SetDefaultCollapsedEntryBmp(rImgDefaultElem);
+ rTreeCtrl.SetDefaultExpandedEntryBmp(rImgDefaultElem);
orcus::xml_structure_tree::walker aWalker = aXmlTree.get_walker();
// Root element.
orcus::xml_structure_tree::element aElem = aWalker.root();
- populateTree(rTreeCtrl, aWalker, aElem.name, aElem.repeat, NULL);
+ populateTree(rTreeCtrl, aWalker, aElem.name, aElem.repeat, rImgRepeatElem, NULL);
}
catch (const std::exception&)
{