diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 20eafe067baa..17b3711cf29c 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -307,6 +307,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/util,\ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/dom,\ DocumentBuilder \ + SAXDocumentBuilder \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/sax,\ FastShapeContextHandler \ @@ -1529,9 +1530,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/xml/cry SignatureCreator \ SignatureVerifier \ )) -$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/xml/dom,\ - SAXDocumentBuilder \ -)) $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/xml/input,\ SaxDocumentHandler \ )) @@ -4201,6 +4199,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/xml/dom,\ XNotation \ XProcessingInstruction \ XSAXDocumentBuilder \ + XSAXDocumentBuilder2 \ XText \ )) $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/xml/dom/events,\ diff --git a/offapi/com/sun/star/xml/dom/SAXDocumentBuilder.idl b/offapi/com/sun/star/xml/dom/SAXDocumentBuilder.idl index 7e25bce146b3..b8c4146e6175 100644 --- a/offapi/com/sun/star/xml/dom/SAXDocumentBuilder.idl +++ b/offapi/com/sun/star/xml/dom/SAXDocumentBuilder.idl @@ -1,17 +1,16 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + #ifndef __com_sun_star_xml_dom_documentbuilder_idl #define __com_sun_star_xml_dom_documentbuilder_idl -#include -#include + +#include module com { module sun { module star { module xml { module dom { - service SAXDocumentBuilder - { - interface XSAXDocumentBuilder; - interface com::sun::star::xml::sax::XDocumentHandler; - }; +service SAXDocumentBuilder : XSAXDocumentBuilder2; + };};};};}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/xml/dom/XSAXDocumentBuilder2.idl b/offapi/com/sun/star/xml/dom/XSAXDocumentBuilder2.idl new file mode 100644 index 000000000000..9463176f498f --- /dev/null +++ b/offapi/com/sun/star/xml/dom/XSAXDocumentBuilder2.idl @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_xml_dom_XSAXDocumentBuilder2_idl +#define __com_sun_star_xml_dom_XSAXDocumentBuilder2_idl + +#include +#include + +module com { module sun { module star { module xml { module dom { + +/** + Provides a unified interface for the SAXDocumentBuilder service to implement. +*/ +interface XSAXDocumentBuilder2 +{ + interface XSAXDocumentBuilder; + interface com::sun::star::xml::sax::XDocumentHandler; +}; + +};};};};}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 00e76c32c952..8b941251523e 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -43,10 +43,12 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -1084,9 +1086,8 @@ SvXMLImportContext* ORptFilter::CreateMetaContext(const ::rtl::OUString& rLocalN if ( (getImportFlags() & IMPORT_META) ) { uno::Reference xDocBuilder( - getServiceFactory()->createInstance(::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.SAXDocumentBuilder"))), - uno::UNO_QUERY_THROW); + xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(getServiceFactory()).getUNOContext()), + uno::UNO_QUERY_THROW); uno::Reference xDPS(GetModel(), uno::UNO_QUERY_THROW); pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties(), xDocBuilder); } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 0de87a254df3..3df0818c5de4 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -71,6 +71,7 @@ #include "rangeutl.hxx" #include "postit.hxx" #include "formulaparserpool.hxx" +#include #include #include @@ -90,6 +91,7 @@ #include #include #include +#include #include @@ -1831,8 +1833,7 @@ SvXMLImportContext *ScXMLImport::CreateContext( sal_uInt16 nPrefix, } else if ( (XML_NAMESPACE_OFFICE == nPrefix) && ( IsXMLToken(rLocalName, XML_DOCUMENT)) ) { 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); uno::Reference xDPS( GetModel(), uno::UNO_QUERY_THROW); @@ -2127,8 +2128,7 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext( if( !IsStylesOnlyMode() && (getImportFlags() & IMPORT_META)) { 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); uno::Reference xDPS( GetModel(), uno::UNO_QUERY_THROW); diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 0d38ec51db5e..d5343770d83e 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -37,7 +37,9 @@ one go*/ #include #include #include +#include +#include #include #include #include @@ -2657,8 +2659,7 @@ SvXMLImportContext *SmXMLImport::CreateContext(sal_uInt16 nPrefix, IsXMLToken(rLocalName, XML_DOCUMENT_META))) { uno::Reference xDocBuilder( - mxServiceFactory->createInstance( - "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/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 -#include +#include +#include #include #include -#include +#include +#include +#include +#include + #include #include #include @@ -40,8 +44,6 @@ #include #include #include -#include -#include #include #include #include @@ -71,6 +73,7 @@ #include #include +#include #include using ::rtl::OUString; @@ -414,8 +417,7 @@ SvXMLImportContext *SwXMLImport::CreateContext( IsXMLToken( rLocalName, XML_DOCUMENT ) ) { 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); uno::Reference 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 #include #include +#include +#include #include #include #include @@ -75,8 +77,7 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext( if (getImportFlags() & IMPORT_META) { uno::Reference 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 const xDocProps( GetDocumentProperties()); diff --git a/unoxml/source/dom/saxbuilder.hxx b/unoxml/source/dom/saxbuilder.hxx index f9a41f4b4e64..9945548cf998 100644 --- a/unoxml/source/dom/saxbuilder.hxx +++ b/unoxml/source/dom/saxbuilder.hxx @@ -25,17 +25,16 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -60,7 +59,7 @@ namespace DOM typedef std::stack< NSMap > NSStack; class CSAXDocumentBuilder - : public ::cppu::WeakImplHelper3< XDocumentHandler, XSAXDocumentBuilder, XServiceInfo > + : public ::cppu::WeakImplHelper2< XSAXDocumentBuilder2, XServiceInfo > { private: 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);