diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-10-05 17:48:48 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-11-28 13:28:23 -0500 |
commit | 06114f6a9659b722a1692ba25a6941b15cb08901 (patch) | |
tree | 30b5698a86fa6432426e8bbbcda0d5543c01bb1d | |
parent | b104b8feba6b18973d06a84a1238d0bdc501d16a (diff) |
Use different icon image for the attribute entries.
Change-Id: Icd053ba7906191f3bc937cdb3c76d037fd67dab5
-rw-r--r-- | sc/inc/orcusfilters.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/orcusfiltersimpl.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/orcus/orcusfiltersimpl.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/inc/xmlsourcedlg.hrc | 3 | ||||
-rw-r--r-- | sc/source/ui/inc/xmlsourcedlg.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/src/xmlsourcedlg.src | 6 | ||||
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 4 |
7 files changed, 24 insertions, 9 deletions
diff --git a/sc/inc/orcusfilters.hxx b/sc/inc/orcusfilters.hxx index 2ec5a490afc7..7db703411ebc 100644 --- a/sc/inc/orcusfilters.hxx +++ b/sc/inc/orcusfilters.hxx @@ -28,7 +28,7 @@ public: virtual bool loadXMLStructure( SvTreeListBox& rTreeCtrl, const rtl::OUString& rPath, - const Image& rImgDefaultElem, const Image& rImgRepeatElem) const = 0; + const Image& rImgDefaultElem, const Image& rImgRepeatElem, const Image& rImgElemAttr) const = 0; }; #endif diff --git a/sc/source/filter/inc/orcusfiltersimpl.hxx b/sc/source/filter/inc/orcusfiltersimpl.hxx index 311b6e08d502..2f42d0b85e22 100644 --- a/sc/source/filter/inc/orcusfiltersimpl.hxx +++ b/sc/source/filter/inc/orcusfiltersimpl.hxx @@ -19,7 +19,7 @@ public: virtual bool loadXMLStructure( SvTreeListBox& rTreeCtrl, const rtl::OUString& rPath, - const Image& rImgDefaultElem, const Image& rImgRepeatElem) const; + const Image& rImgDefaultElem, const Image& rImgRepeatElem, const Image& rImgElemAttr) const; }; #endif diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx index 46351755dc71..824eea9734bd 100644 --- a/sc/source/filter/orcus/orcusfiltersimpl.cxx +++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx @@ -175,7 +175,9 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument& rDoc, const OUString& rPath) cons void populateTree( SvTreeListBox& rTreeCtrl, orcus::xml_structure_tree::walker& rWalker, - const orcus::xml_structure_tree::entity_name& rElemName, bool bRepeat, const Image& rImgRepeatElem, SvLBoxEntry* pParent) + const orcus::xml_structure_tree::entity_name& rElemName, bool bRepeat, + const Image& rImgRepeatElem, const Image& rImgElemAttr, + SvLBoxEntry* pParent) { OUString aName(rElemName.name.get(), rElemName.name.size(), RTL_TEXTENCODING_UTF8); SvLBoxEntry* pEntry = rTreeCtrl.InsertEntry(aName, pParent); @@ -196,7 +198,9 @@ void populateTree( 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); + SvLBoxEntry* pAttr = rTreeCtrl.InsertEntry(OUString(aAttrName.name.get(), aAttrName.name.size(), RTL_TEXTENCODING_UTF8), pEntry); + rTreeCtrl.SetExpandedEntryBmp(pAttr, rImgElemAttr); + rTreeCtrl.SetCollapsedEntryBmp(pAttr, rImgElemAttr); } rTreeCtrl.Expand(pEntry); @@ -205,13 +209,14 @@ void populateTree( for (it = aNames.begin(), itEnd = aNames.end(); it != itEnd; ++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, rImgElemAttr, pEntry); rWalker.ascend(); } } bool ScOrcusFiltersImpl::loadXMLStructure( - SvTreeListBox& rTreeCtrl, const rtl::OUString& rPath, const Image& rImgDefaultElem, const Image& rImgRepeatElem) const + SvTreeListBox& rTreeCtrl, const rtl::OUString& rPath, + const Image& rImgDefaultElem, const Image& rImgRepeatElem, const Image& rImgElemAttr) const { INetURLObject aURL(rPath); OString aSysPath = rtl::OUStringToOString(aURL.getFSysPath(SYSTEM_PATH), RTL_TEXTENCODING_UTF8); @@ -238,7 +243,7 @@ bool ScOrcusFiltersImpl::loadXMLStructure( // Root element. orcus::xml_structure_tree::element aElem = aWalker.root(); - populateTree(rTreeCtrl, aWalker, aElem.name, aElem.repeat, rImgRepeatElem, NULL); + populateTree(rTreeCtrl, aWalker, aElem.name, aElem.repeat, rImgRepeatElem, rImgElemAttr, NULL); } catch (const std::exception&) { diff --git a/sc/source/ui/inc/xmlsourcedlg.hrc b/sc/source/ui/inc/xmlsourcedlg.hrc index 24c40b176cc3..ec10aff5a06a 100644 --- a/sc/source/ui/inc/xmlsourcedlg.hrc +++ b/sc/source/ui/inc/xmlsourcedlg.hrc @@ -21,6 +21,7 @@ #define IMG_ELEMENT_DEFAULT 50 #define IMG_ELEMENT_REPEAT 51 -#define IMG_FILE_OPEN 52 +#define IMG_ELEMENT_ATTRIBUTE 52 +#define IMG_FILE_OPEN 53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx index b6fb2ba7886b..39bfa6b14cdf 100644 --- a/sc/source/ui/inc/xmlsourcedlg.hxx +++ b/sc/source/ui/inc/xmlsourcedlg.hxx @@ -42,6 +42,7 @@ class ScXMLSourceDlg : public ModalDialog Image maImgFileOpen; Image maImgElemDefault; Image maImgElemRepeat; + Image maImgElemAttribute; ScDocument* mpDoc; diff --git a/sc/source/ui/src/xmlsourcedlg.src b/sc/source/ui/src/xmlsourcedlg.src index 564b9d163355..8a7b13a0b103 100644 --- a/sc/source/ui/src/xmlsourcedlg.src +++ b/sc/source/ui/src/xmlsourcedlg.src @@ -68,6 +68,12 @@ ModalDialog RID_SCDLG_XML_SOURCE MaskColor = STD_MASKCOLOR ; }; + Image IMG_ELEMENT_ATTRIBUTE + { + ImageBitmap = Bitmap { File = "time.png" ; }; + MaskColor = STD_MASKCOLOR ; + }; + Image IMG_FILE_OPEN { ImageBitmap = Bitmap { File = "file.png" ; }; diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 7f0a48bdc6d5..2a94a9bf0b36 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -36,6 +36,7 @@ ScXMLSourceDlg::ScXMLSourceDlg(Window* pParent, ScDocument* pDoc) : maImgFileOpen(ScResId(IMG_FILE_OPEN)), maImgElemDefault(ScResId(IMG_ELEMENT_DEFAULT)), maImgElemRepeat(ScResId(IMG_ELEMENT_REPEAT)), + maImgElemAttribute(ScResId(IMG_ELEMENT_ATTRIBUTE)), mpDoc(pDoc) { maBtnSelectSource.SetModeImage(maImgFileOpen); @@ -80,7 +81,8 @@ void ScXMLSourceDlg::LoadSourceFileStructure(const OUString& rPath) if (!pOrcus) return; - pOrcus->loadXMLStructure(maLbTree, rPath, maImgElemDefault, maImgElemRepeat); + pOrcus->loadXMLStructure( + maLbTree, rPath, maImgElemDefault, maImgElemRepeat, maImgElemAttribute); } IMPL_LINK(ScXMLSourceDlg, BtnPressedHdl, Button*, pBtn) |