diff options
author | Daniel Sikeler <d.sikeler94@gmail.com> | 2015-08-14 12:40:49 +0200 |
---|---|---|
committer | Daniel Sikeler <d.sikeler94@gmail.com> | 2015-08-14 14:23:16 +0200 |
commit | 461677b333368cf6d0d18bcefec45b344dee86ee (patch) | |
tree | 21a63dd64ec7d6d25be70a8177f0516818cad69a | |
parent | f72ad16b0a2fb30cf8c96473e044978719d83240 (diff) |
fastparser impl. for XMLTOCMarkImportContext_Impl
Change-Id: I2a3198cdacb4a104fbf7eb87487779ec2b1c7b9b
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 4436731727b5..00522e9b1b9b 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1835,6 +1835,11 @@ public: const OUString& rLocalName, enum XMLTextPElemTokens nTok, XMLHints_Impl& rHnts); + XMLTOCMarkImportContext_Impl( + SvXMLImport& rImport, + sal_Int32 Element, + enum XMLTextPElemTokens nTok, + XMLHints_Impl& rHnts ); protected: @@ -1843,6 +1848,10 @@ protected: const OUString& sLocalName, const OUString& sValue, Reference<beans::XPropertySet>& rPropSet) SAL_OVERRIDE; + virtual void ProcessAttribute( + sal_Int32 Elmenet, + const OUString& sValue, + Reference<beans::XPropertySet>& rPropSet ) SAL_OVERRIDE; }; TYPEINIT1( XMLTOCMarkImportContext_Impl, XMLIndexMarkImportContext_Impl ); @@ -1856,6 +1865,16 @@ XMLTOCMarkImportContext_Impl::XMLTOCMarkImportContext_Impl( { } +XMLTOCMarkImportContext_Impl::XMLTOCMarkImportContext_Impl( + SvXMLImport& rImport, + sal_Int32 Element, + enum XMLTextPElemTokens nTok, + XMLHints_Impl& rHnts ) +: XMLIndexMarkImportContext_Impl( rImport, Element, nTok, rHnts ), + sLevel("Level") +{ +} + void XMLTOCMarkImportContext_Impl::ProcessAttribute( sal_uInt16 nNamespace, const OUString& sLocalName, @@ -1886,6 +1905,33 @@ void XMLTOCMarkImportContext_Impl::ProcessAttribute( } } +void XMLTOCMarkImportContext_Impl::ProcessAttribute( + sal_Int32 Element, + const OUString& sValue, + Reference<beans::XPropertySet>& rPropSet ) +{ + SAL_WARN_IF(!rPropSet.is(), "xmloff.text", "need PropertySet"); + + if( Element == (NAMESPACE | XML_NAMESPACE_TEXT | XML_outline_level) ) + { + // outline level: set level property + sal_Int32 nTmp; + if( sax::Converter::convertNumber( nTmp, sValue ) + && nTmp >= 1 + && nTmp < GetImport().GetTextImport()-> + GetChapterNumbering()->getCount() ) + { + rPropSet->setPropertyValue( sLevel, uno::makeAny(static_cast<sal_Int16>(nTmp-1)) ); + } + // else: value out of range -> ignore + } + else + { + // else: delegate to superclass + XMLIndexMarkImportContext_Impl::ProcessAttribute( Element, sValue, rPropSet ); + } +} + class XMLUserIndexMarkImportContext_Impl : public XMLIndexMarkImportContext_Impl { const OUString sUserIndexName; |