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
This commit is contained in:
committed by
Stephan Bergmann
parent
a5036f396a
commit
372f980168
@@ -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,\
|
||||
|
@@ -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 <com/sun/star/xml/sax/XDocumentHandler.idl>
|
||||
#include <com/sun/star/xml/dom/XSAXDocumentBuilder.idl>
|
||||
|
||||
#include <com/sun/star/xml/dom/XSAXDocumentBuilder2.idl>
|
||||
|
||||
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: */
|
||||
|
41
offapi/com/sun/star/xml/dom/XSAXDocumentBuilder2.idl
Normal file
41
offapi/com/sun/star/xml/dom/XSAXDocumentBuilder2.idl
Normal file
@@ -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 <com/sun/star/xml/sax/XDocumentHandler.idl>
|
||||
#include <com/sun/star/xml/dom/XSAXDocumentBuilder.idl>
|
||||
|
||||
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: */
|
@@ -43,10 +43,12 @@
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
#include <xmloff/XMLFontStylesContext.hxx>
|
||||
#include <rtl/logfile.hxx>
|
||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
||||
#include <com/sun/star/xml/sax/InputSource.hpp>
|
||||
#include <com/sun/star/xml/sax/XParser.hpp>
|
||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
#include <comphelper/genericpropertyset.hxx>
|
||||
#include <comphelper/mediadescriptor.hxx>
|
||||
#include <xmloff/ProgressBarHelper.hxx>
|
||||
@@ -1084,9 +1086,8 @@ SvXMLImportContext* ORptFilter::CreateMetaContext(const ::rtl::OUString& rLocalN
|
||||
if ( (getImportFlags() & IMPORT_META) )
|
||||
{
|
||||
uno::Reference<xml::sax::XDocumentHandler> 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<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW);
|
||||
pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties(), xDocBuilder);
|
||||
}
|
||||
|
@@ -71,6 +71,7 @@
|
||||
#include "rangeutl.hxx"
|
||||
#include "postit.hxx"
|
||||
#include "formulaparserpool.hxx"
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
#include <comphelper/extract.hxx>
|
||||
|
||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
||||
@@ -90,6 +91,7 @@
|
||||
#include <com/sun/star/sheet/XLabelRanges.hpp>
|
||||
#include <com/sun/star/io/XSeekable.hpp>
|
||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -1831,8 +1833,7 @@ SvXMLImportContext *ScXMLImport::CreateContext( sal_uInt16 nPrefix,
|
||||
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
|
||||
( 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::XDocumentPropertiesSupplier> xDPS(
|
||||
GetModel(), uno::UNO_QUERY_THROW);
|
||||
@@ -2127,8 +2128,7 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
|
||||
if( !IsStylesOnlyMode() && (getImportFlags() & IMPORT_META))
|
||||
{
|
||||
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::XDocumentPropertiesSupplier> xDPS(
|
||||
GetModel(), uno::UNO_QUERY_THROW);
|
||||
|
@@ -37,7 +37,9 @@ one go*/
|
||||
#include <com/sun/star/container/XNameAccess.hpp>
|
||||
#include <com/sun/star/embed/ElementModes.hpp>
|
||||
#include <com/sun/star/uno/Any.h>
|
||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
||||
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
#include <comphelper/genericpropertyset.hxx>
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include <comphelper/servicehelper.hxx>
|
||||
@@ -2657,8 +2659,7 @@ SvXMLImportContext *SmXMLImport::CreateContext(sal_uInt16 nPrefix,
|
||||
IsXMLToken(rLocalName, XML_DOCUMENT_META)))
|
||||
{
|
||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
||||
mxServiceFactory->createInstance(
|
||||
"com.sun.star.xml.dom.SAXDocumentBuilder"),
|
||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
||||
uno::UNO_QUERY_THROW);
|
||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||
GetModel(), uno::UNO_QUERY_THROW);
|
||||
|
@@ -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());
|
||||
|
@@ -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());
|
||||
|
@@ -25,17 +25,16 @@
|
||||
|
||||
#include <sal/types.h>
|
||||
#include <osl/mutex.hxx>
|
||||
#include <cppuhelper/implbase3.hxx>
|
||||
#include <cppuhelper/implbase2.hxx>
|
||||
#include <com/sun/star/uno/Reference.h>
|
||||
#include <com/sun/star/uno/Sequence.h>
|
||||
|
||||
#include <com/sun/star/uno/XInterface.hpp>
|
||||
#include <com/sun/star/uno/Exception.hpp>
|
||||
#include <com/sun/star/xml/dom/XSAXDocumentBuilder.hpp>
|
||||
#include <com/sun/star/xml/dom/XSAXDocumentBuilder2.hpp>
|
||||
#include <com/sun/star/xml/dom/SAXDocumentBuilderState.hpp>
|
||||
#include <com/sun/star/xml/dom/XDocument.hpp>
|
||||
#include <com/sun/star/xml/dom/XDocumentFragment.hpp>
|
||||
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
||||
#include <com/sun/star/xml/sax/XLocator.hpp>
|
||||
#include <com/sun/star/xml/sax/XAttributeList.hpp>
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
@@ -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:
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <tools/debug.hxx>
|
||||
#include <rtl/ustrbuf.hxx>
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include "xmloff/xmlnmspe.hxx"
|
||||
#include <xmloff/xmltoken.hxx>
|
||||
@@ -56,6 +57,7 @@
|
||||
|
||||
#include <com/sun/star/document/XDocumentProperties.hpp>
|
||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
@@ -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<xml::sax::XDocumentHandler> 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,
|
||||
|
@@ -55,6 +55,8 @@
|
||||
|
||||
#include <com/sun/star/document/XDocumentProperties.hpp>
|
||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
|
||||
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<xml::sax::XDocumentHandler> 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<document::XDocumentPropertiesSupplier> xDPS(
|
||||
GetModel(), uno::UNO_QUERY_THROW);
|
||||
@@ -757,8 +758,7 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName,
|
||||
if (getImportFlags() & IMPORT_META)
|
||||
{
|
||||
uno::Reference<xml::sax::XDocumentHandler> 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<document::XDocumentPropertiesSupplier> xDPS(
|
||||
GetModel(), uno::UNO_QUERY_THROW);
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include <xmloff/xmlmetai.hxx>
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
|
||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
||||
#include <comphelper/componentcontext.hxx>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
using namespace ::xmloff::token;
|
||||
@@ -67,8 +69,7 @@ SvXMLImportContext* XMLMetaImportComponent::CreateContext(
|
||||
"has not been called")), *this);
|
||||
}
|
||||
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);
|
||||
return new SvXMLMetaDocumentContext(
|
||||
*this, nPrefix, rLocalName, mxDocProps, xDocBuilder);
|
||||
|
Reference in New Issue
Block a user