diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-06 14:00:14 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-12 10:24:55 +0200 |
commit | 372f9801687cad620924b7ac6e4fe488ff998334 (patch) | |
tree | 2f439042ac40dd775c52427da5acdd7f0fcde595 /sw | |
parent | a5036f396aadb44e44844ad2c784ee521eeda55a (diff) |
fdo#46808, Adapt xml::dom::SAXDocumentBuilderr UNO service to new style
Create a merged XSAXDocumentBuilder2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Change-Id: Iaa96031a0b7c27e957d2edb0394e5eeaaa84cdca
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlmeta.cxx | 5 |
2 files changed, 12 insertions, 9 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index bf1c1c32eefb..15e0f9846e6a 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -27,11 +27,15 @@ ************************************************************************/ -#include <com/sun/star/text/XTextDocument.hpp> -#include <com/sun/star/text/XTextRange.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/document/PrinterIndependentLayout.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/i18n/XForbiddenCharacters.hpp> +#include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/text/XTextRange.hpp> +#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp> + #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltkmap.hxx> #include <xmloff/xmlictxt.hxx> @@ -40,8 +44,6 @@ #include <xmloff/XMLTextShapeImportHelper.hxx> #include <xmloff/XMLFontStylesContext.hxx> #include <xmloff/ProgressBarHelper.hxx> -#include <com/sun/star/i18n/XForbiddenCharacters.hpp> -#include <com/sun/star/document/PrinterIndependentLayout.hpp> #include <doc.hxx> #include <TextCursorHelper.hxx> #include <unotext.hxx> @@ -71,6 +73,7 @@ #include <xmloff/xmlmetai.hxx> #include <xmloff/xformsimport.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/servicehelper.hxx> using ::rtl::OUString; @@ -414,8 +417,7 @@ SvXMLImportContext *SwXMLImport::CreateContext( IsXMLToken( rLocalName, XML_DOCUMENT ) ) { uno::Reference<xml::sax::XDocumentHandler> xDocBuilder( - mxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.dom.SAXDocumentBuilder"))), + xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()), uno::UNO_QUERY_THROW); uno::Reference<document::XDocumentProperties> const xDocProps( GetDocumentProperties()); diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx index 0b80ece87fed..58b472fbc61d 100644 --- a/sw/source/filter/xml/xmlmeta.cxx +++ b/sw/source/filter/xml/xmlmeta.cxx @@ -30,6 +30,8 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp> +#include <comphelper/componentcontext.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmlmetai.hxx> #include <xmloff/xmlmetae.hxx> @@ -75,8 +77,7 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext( if (getImportFlags() & IMPORT_META) { uno::Reference<xml::sax::XDocumentHandler> const xDocBuilder( - mxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.xml.dom.SAXDocumentBuilder"))), + xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()), uno::UNO_QUERY_THROW); uno::Reference<document::XDocumentProperties> const xDocProps( GetDocumentProperties()); |