From 372f9801687cad620924b7ac6e4fe488ff998334 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Sep 2012 14:00:14 +0200 Subject: 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 --- xmloff/source/chart/SchXMLImport.cxx | 6 +++--- xmloff/source/draw/sdxmlimp.cxx | 8 ++++---- xmloff/source/meta/MetaImportComponent.cxx | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index f7ef9a7fe5fb..b3cd44db2240 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -35,6 +35,7 @@ #include #include +#include #include #include "xmloff/xmlnmspe.hxx" #include @@ -56,6 +57,7 @@ #include #include +#include #include @@ -607,9 +609,7 @@ SvXMLImportContext *SchXMLImport::CreateContext( sal_uInt16 nPrefix, const OUStr // mst@: right now, this seems to be not supported, so it is untested if (xDPS.is()) { uno::Reference xDocBuilder( - mxServiceFactory->createInstance( - ::rtl::OUString( - "com.sun.star.xml.dom.SAXDocumentBuilder")), + xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()), uno::UNO_QUERY_THROW); pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META)) ? new SvXMLMetaDocumentContext(*this, diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index a0fbcd18bac7..d581d8a121f7 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -55,6 +55,8 @@ #include #include +#include +#include using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -732,8 +734,7 @@ SvXMLImportContext *SdXMLImport::CreateContext(sal_uInt16 nPrefix, } else if ( (XML_NAMESPACE_OFFICE == nPrefix) && ( IsXMLToken(rLocalName, XML_DOCUMENT)) ) { uno::Reference xDocBuilder( - mxServiceFactory->createInstance(::rtl::OUString( - "com.sun.star.xml.dom.SAXDocumentBuilder")), + xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()), uno::UNO_QUERY_THROW); uno::Reference xDPS( GetModel(), uno::UNO_QUERY_THROW); @@ -757,8 +758,7 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName, if (getImportFlags() & IMPORT_META) { uno::Reference xDocBuilder( - mxServiceFactory->createInstance(::rtl::OUString( - "com.sun.star.xml.dom.SAXDocumentBuilder")), + xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()), uno::UNO_QUERY_THROW); uno::Reference xDPS( GetModel(), uno::UNO_QUERY_THROW); diff --git a/xmloff/source/meta/MetaImportComponent.cxx b/xmloff/source/meta/MetaImportComponent.cxx index 5c5afb91ac81..1acb47ea63c2 100644 --- a/xmloff/source/meta/MetaImportComponent.cxx +++ b/xmloff/source/meta/MetaImportComponent.cxx @@ -34,6 +34,8 @@ #include #include +#include +#include using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -67,8 +69,7 @@ SvXMLImportContext* XMLMetaImportComponent::CreateContext( "has not been called")), *this); } uno::Reference 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); return new SvXMLMetaDocumentContext( *this, nPrefix, rLocalName, mxDocProps, xDocBuilder); -- cgit