diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-03-15 10:20:06 +0530 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2017-03-21 09:24:32 +0000 |
commit | 9f9e861c6d168e8318b9cdc761a387b0d650e5c0 (patch) | |
tree | 02bdb8da78c2b899a5ed9d4132ec02632490c3c2 /include | |
parent | d7470bab57640a4499500e3c06ace4fb8ab9c4af (diff) |
Old-to-new mapping of attributes is moved into a Module:
This should make it easy to reuse the mapping code wherever
necessary and restores the loading of writerperfect documents.
Change-Id: I505bffa47fe37270b0430d9ae5afec5072762b4c
Reviewed-on: https://gerrit.libreoffice.org/35263
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/xmloff/xmlimp.hxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index c53b9c1bebac..72939eaced1f 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -53,6 +53,7 @@ #include <cppuhelper/implbase.hxx> #include <xmloff/formlayerimport.hxx> #include <comphelper/attributelist.hxx> +#include <sax/fastattribs.hxx> #include <com/sun/star/beans/NamedValue.hpp> @@ -133,6 +134,33 @@ public: virtual OUString SAL_CALL getNamespaceURI( const OUString& rNamespacePrefix ) override; }; +class XMLOFF_DLLPUBLIC SvXMLLegacyToFastDocHandler : public ::cppu::WeakImplHelper< + css::xml::sax::XDocumentHandler, + css::document::XImporter > +{ +private: + rtl::Reference< SvXMLImport > mrImport; + rtl::Reference< sax_fastparser::FastAttributeList > mxFastAttributes; + +public: + SvXMLLegacyToFastDocHandler( const rtl::Reference< SvXMLImport > & rImport ); + + // XImporter + virtual void SAL_CALL setTargetDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) override; + + // css::xml::sax::XDocumentHandler + virtual void SAL_CALL startDocument() override; + virtual void SAL_CALL endDocument() override; + virtual void SAL_CALL startElement(const OUString& aName, + const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs) override; + virtual void SAL_CALL endElement(const OUString& aName) override; + virtual void SAL_CALL characters(const OUString& aChars) override; + virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces) override; + virtual void SAL_CALL processingInstruction(const OUString& aTarget, + const OUString& aData) override; + virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override; +}; + class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< css::xml::sax::XExtendedDocumentHandler, @@ -145,6 +173,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper< css::xml::sax::XFastParser> { friend class SvXMLImportContext; + friend class SvXMLLegacyToFastDocHandler; css::uno::Reference< css::xml::sax::XLocator > mxLocator; css::uno::Reference< css::frame::XModel > mxModel; |