diff options
author | Rachit Gupta <rachitgupta1792@gmail.com> | 2014-05-13 22:16:05 +0530 |
---|---|---|
committer | Rachit Gupta <rachitgupta1792@gmail.com> | 2014-05-21 18:35:51 +0530 |
commit | adeb20a9ff1a1886be6cb4d5c9cb81895afb5d8b (patch) | |
tree | 6a2cfa3e04909f46d7f54adc8061fc2767871722 | |
parent | select_persona_dialog.ui changed to include search. (diff) | |
download | core-adeb20a9ff1a1886be6cb4d5c9cb81895afb5d8b.tar.gz core-adeb20a9ff1a1886be6cb4d5c9cb81895afb5d8b.zip |
Created std::vector to store learnmore URLs.
For now, we have to parse the HTML and display the images as the
result XML does not contain the header and footer URLs.
Change-Id: Ie95a75e218bc3da12802c971ea744fb38951e574
-rw-r--r-- | cui/source/options/personasdochandler.cxx | 18 | ||||
-rw-r--r-- | cui/source/options/personasdochandler.hxx | 13 |
2 files changed, 13 insertions, 18 deletions
diff --git a/cui/source/options/personasdochandler.cxx b/cui/source/options/personasdochandler.cxx index d8ab54c549e5..9b0e0346dda4 100644 --- a/cui/source/options/personasdochandler.cxx +++ b/cui/source/options/personasdochandler.cxx @@ -36,9 +36,11 @@ throw ( xml::sax::SAXException, RuntimeException, std::exception ) } void SAL_CALL -PersonasDocHandler::characters( const OUString & ) +PersonasDocHandler::characters( const OUString & aChars) throw ( xml::sax::SAXException, RuntimeException, std::exception ) { + if( m_bLearnmoreTag ) + m_vLearnmoreURLs.push_back( aChars ); } void SAL_CALL @@ -63,21 +65,19 @@ PersonasDocHandler::setDocumentLocator( void SAL_CALL PersonasDocHandler::startElement( const OUString& aName, - const Reference< xml::sax::XAttributeList > & xAttribs ) + const Reference< xml::sax::XAttributeList > & ) throw ( xml::sax::SAXException, RuntimeException, std::exception ) { - SAL_DEBUG("startElement: " << aName << "\n"); - for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) - { - SAL_DEBUG("\t\tAttribute Name: " << xAttribs->getNameByIndex(i) << "\tAttribute Value: " << xAttribs->getValueByIndex(i) << "\n"); - } + if ( aName == "learnmore" ) + m_bLearnmoreTag = true; + else + m_bLearnmoreTag = false; } -void SAL_CALL PersonasDocHandler::endElement( const OUString & aName ) +void SAL_CALL PersonasDocHandler::endElement( const OUString & ) throw ( xml::sax::SAXException, RuntimeException, std::exception ) { - SAL_DEBUG("endElement: " << aName << "\n"); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/personasdochandler.hxx b/cui/source/options/personasdochandler.hxx index 4ff9d83ac819..76afb9505b9e 100644 --- a/cui/source/options/personasdochandler.hxx +++ b/cui/source/options/personasdochandler.hxx @@ -20,20 +20,15 @@ #include <cppuhelper/implbase1.hxx> #include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XParser.hpp> +#include <vector> class PersonasDocHandler : public ::cppu::WeakImplHelper1< css::xml::sax::XDocumentHandler > { private: - OUString m_sHeaderURL; - OUString m_sFooterURL; - OUString m_sTextColor; - OUString m_sAccentColor; + std::vector<OUString> m_vLearnmoreURLs; + bool m_bLearnmoreTag; public: - PersonasDocHandler(){} - OUString getHeaderURL() { return m_sHeaderURL; } - OUString getFooterURL() { return m_sFooterURL; } - OUString getTextColor() { return m_sTextColor; } - OUString getAccentColor() { return m_sAccentColor; } + PersonasDocHandler(){ m_bLearnmoreTag = false; } // XDocumentHandler virtual void SAL_CALL startDocument() throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; |