Improvement on previous commit
Change-Id: I51226f78ca60c32ebb908bcf4f74d38d0750eb00
This commit is contained in:
@@ -27,6 +27,8 @@ module com { module sun { module star { module xml { module dom {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Provides a unified interface for the SAXDocumentBuilder service to implement.
|
Provides a unified interface for the SAXDocumentBuilder service to implement.
|
||||||
|
|
||||||
|
@since LibreOffice 3.7
|
||||||
*/
|
*/
|
||||||
interface XSAXDocumentBuilder2
|
interface XSAXDocumentBuilder2
|
||||||
{
|
{
|
||||||
|
@@ -43,12 +43,10 @@
|
|||||||
#include <xmloff/nmspmap.hxx>
|
#include <xmloff/nmspmap.hxx>
|
||||||
#include <xmloff/XMLFontStylesContext.hxx>
|
#include <xmloff/XMLFontStylesContext.hxx>
|
||||||
#include <rtl/logfile.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/InputSource.hpp>
|
||||||
#include <com/sun/star/xml/sax/XParser.hpp>
|
#include <com/sun/star/xml/sax/XParser.hpp>
|
||||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||||
|
|
||||||
#include <comphelper/componentcontext.hxx>
|
|
||||||
#include <comphelper/genericpropertyset.hxx>
|
#include <comphelper/genericpropertyset.hxx>
|
||||||
#include <comphelper/mediadescriptor.hxx>
|
#include <comphelper/mediadescriptor.hxx>
|
||||||
#include <xmloff/ProgressBarHelper.hxx>
|
#include <xmloff/ProgressBarHelper.hxx>
|
||||||
@@ -1085,11 +1083,8 @@ SvXMLImportContext* ORptFilter::CreateMetaContext(const ::rtl::OUString& rLocalN
|
|||||||
|
|
||||||
if ( (getImportFlags() & IMPORT_META) )
|
if ( (getImportFlags() & IMPORT_META) )
|
||||||
{
|
{
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(getServiceFactory()).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), 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);
|
pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties());
|
||||||
}
|
}
|
||||||
return pContext;
|
return pContext;
|
||||||
}
|
}
|
||||||
|
@@ -71,7 +71,6 @@
|
|||||||
#include "rangeutl.hxx"
|
#include "rangeutl.hxx"
|
||||||
#include "postit.hxx"
|
#include "postit.hxx"
|
||||||
#include "formulaparserpool.hxx"
|
#include "formulaparserpool.hxx"
|
||||||
#include <comphelper/componentcontext.hxx>
|
|
||||||
#include <comphelper/extract.hxx>
|
#include <comphelper/extract.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
||||||
@@ -91,7 +90,6 @@
|
|||||||
#include <com/sun/star/sheet/XLabelRanges.hpp>
|
#include <com/sun/star/sheet/XLabelRanges.hpp>
|
||||||
#include <com/sun/star/io/XSeekable.hpp>
|
#include <com/sun/star/io/XSeekable.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -296,8 +294,7 @@ public:
|
|||||||
ScXMLFlatDocContext_Impl( ScXMLImport& i_rImport,
|
ScXMLFlatDocContext_Impl( ScXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
||||||
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
||||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
const uno::Reference<document::XDocumentProperties>& i_xDocProps);
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder);
|
|
||||||
|
|
||||||
virtual ~ScXMLFlatDocContext_Impl();
|
virtual ~ScXMLFlatDocContext_Impl();
|
||||||
|
|
||||||
@@ -309,12 +306,11 @@ public:
|
|||||||
ScXMLFlatDocContext_Impl::ScXMLFlatDocContext_Impl( ScXMLImport& i_rImport,
|
ScXMLFlatDocContext_Impl::ScXMLFlatDocContext_Impl( ScXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
||||||
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
||||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
const uno::Reference<document::XDocumentProperties>& i_xDocProps) :
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) :
|
|
||||||
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
||||||
ScXMLDocContext_Impl(i_rImport, i_nPrefix, i_rLName, i_xAttrList),
|
ScXMLDocContext_Impl(i_rImport, i_nPrefix, i_rLName, i_xAttrList),
|
||||||
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
||||||
i_xDocProps, i_xDocBuilder)
|
i_xDocProps)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1832,14 +1828,11 @@ SvXMLImportContext *ScXMLImport::CreateContext( sal_uInt16 nPrefix,
|
|||||||
pContext = CreateMetaContext(rLocalName);
|
pContext = CreateMetaContext(rLocalName);
|
||||||
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
|
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
|
||||||
( IsXMLToken(rLocalName, XML_DOCUMENT)) ) {
|
( IsXMLToken(rLocalName, XML_DOCUMENT)) ) {
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||||
GetModel(), uno::UNO_QUERY_THROW);
|
GetModel(), uno::UNO_QUERY_THROW);
|
||||||
// flat OpenDocument file format
|
// flat OpenDocument file format
|
||||||
pContext = new ScXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
|
pContext = new ScXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
|
||||||
xAttrList, xDPS->getDocumentProperties(), xDocBuilder);
|
xAttrList, xDPS->getDocumentProperties());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
|
pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
|
||||||
@@ -2127,14 +2120,11 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
|
|||||||
|
|
||||||
if( !IsStylesOnlyMode() && (getImportFlags() & IMPORT_META))
|
if( !IsStylesOnlyMode() && (getImportFlags() & IMPORT_META))
|
||||||
{
|
{
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||||
GetModel(), uno::UNO_QUERY_THROW);
|
GetModel(), uno::UNO_QUERY_THROW);
|
||||||
pContext = new SvXMLMetaDocumentContext(*this,
|
pContext = new SvXMLMetaDocumentContext(*this,
|
||||||
XML_NAMESPACE_OFFICE, rLocalName,
|
XML_NAMESPACE_OFFICE, rLocalName,
|
||||||
xDPS->getDocumentProperties(), xDocBuilder);
|
xDPS->getDocumentProperties());
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !pContext )
|
if( !pContext )
|
||||||
|
@@ -37,9 +37,7 @@ one go*/
|
|||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
#include <com/sun/star/container/XNameAccess.hpp>
|
||||||
#include <com/sun/star/embed/ElementModes.hpp>
|
#include <com/sun/star/embed/ElementModes.hpp>
|
||||||
#include <com/sun/star/uno/Any.h>
|
#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/genericpropertyset.hxx>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <comphelper/servicehelper.hxx>
|
#include <comphelper/servicehelper.hxx>
|
||||||
@@ -1856,8 +1854,7 @@ class SmXMLFlatDocContext_Impl
|
|||||||
public:
|
public:
|
||||||
SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
|
SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
||||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
const uno::Reference<document::XDocumentProperties>& i_xDocProps);
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder);
|
|
||||||
|
|
||||||
virtual ~SmXMLFlatDocContext_Impl();
|
virtual ~SmXMLFlatDocContext_Impl();
|
||||||
|
|
||||||
@@ -1866,12 +1863,11 @@ public:
|
|||||||
|
|
||||||
SmXMLFlatDocContext_Impl::SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
|
SmXMLFlatDocContext_Impl::SmXMLFlatDocContext_Impl( SmXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
||||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
const uno::Reference<document::XDocumentProperties>& i_xDocProps) :
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) :
|
|
||||||
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
||||||
SmXMLOfficeContext_Impl(i_rImport, i_nPrefix, i_rLName),
|
SmXMLOfficeContext_Impl(i_rImport, i_nPrefix, i_rLName),
|
||||||
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
||||||
i_xDocProps, i_xDocBuilder)
|
i_xDocProps)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2658,18 +2654,15 @@ SvXMLImportContext *SmXMLImport::CreateContext(sal_uInt16 nPrefix,
|
|||||||
if ( (IsXMLToken(rLocalName, XML_DOCUMENT) ||
|
if ( (IsXMLToken(rLocalName, XML_DOCUMENT) ||
|
||||||
IsXMLToken(rLocalName, XML_DOCUMENT_META)))
|
IsXMLToken(rLocalName, XML_DOCUMENT_META)))
|
||||||
{
|
{
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||||
GetModel(), uno::UNO_QUERY_THROW);
|
GetModel(), uno::UNO_QUERY_THROW);
|
||||||
return IsXMLToken(rLocalName, XML_DOCUMENT_META)
|
return IsXMLToken(rLocalName, XML_DOCUMENT_META)
|
||||||
? new SvXMLMetaDocumentContext(*this,
|
? new SvXMLMetaDocumentContext(*this,
|
||||||
XML_NAMESPACE_OFFICE, rLocalName,
|
XML_NAMESPACE_OFFICE, rLocalName,
|
||||||
xDPS->getDocumentProperties(), xDocBuilder)
|
xDPS->getDocumentProperties())
|
||||||
// flat OpenDocument file format -- this has not been tested...
|
// flat OpenDocument file format -- this has not been tested...
|
||||||
: new SmXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
|
: new SmXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
|
||||||
xDPS->getDocumentProperties(), xDocBuilder);
|
xDPS->getDocumentProperties());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
|
#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
|
||||||
#include <com/sun/star/text/XTextDocument.hpp>
|
#include <com/sun/star/text/XTextDocument.hpp>
|
||||||
#include <com/sun/star/text/XTextRange.hpp>
|
#include <com/sun/star/text/XTextRange.hpp>
|
||||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
|
||||||
|
|
||||||
#include <xmloff/xmlnmspe.hxx>
|
#include <xmloff/xmlnmspe.hxx>
|
||||||
#include <xmloff/xmltkmap.hxx>
|
#include <xmloff/xmltkmap.hxx>
|
||||||
@@ -73,7 +72,6 @@
|
|||||||
|
|
||||||
#include <xmloff/xmlmetai.hxx>
|
#include <xmloff/xmlmetai.hxx>
|
||||||
#include <xmloff/xformsimport.hxx>
|
#include <xmloff/xformsimport.hxx>
|
||||||
#include <comphelper/componentcontext.hxx>
|
|
||||||
#include <comphelper/servicehelper.hxx>
|
#include <comphelper/servicehelper.hxx>
|
||||||
|
|
||||||
using ::rtl::OUString;
|
using ::rtl::OUString;
|
||||||
@@ -281,8 +279,7 @@ public:
|
|||||||
sal_uInt16 nPrfx,
|
sal_uInt16 nPrfx,
|
||||||
const OUString& rLName,
|
const OUString& rLName,
|
||||||
const Reference< xml::sax::XAttributeList > & xAttrList,
|
const Reference< xml::sax::XAttributeList > & xAttrList,
|
||||||
const Reference< document::XDocumentProperties >& xDocProps,
|
const Reference< document::XDocumentProperties >& xDocProps);
|
||||||
const Reference< xml::sax::XDocumentHandler >& xDocBuilder);
|
|
||||||
virtual ~SwXMLOfficeDocContext_Impl();
|
virtual ~SwXMLOfficeDocContext_Impl();
|
||||||
|
|
||||||
TYPEINFO();
|
TYPEINFO();
|
||||||
@@ -298,11 +295,10 @@ SwXMLOfficeDocContext_Impl::SwXMLOfficeDocContext_Impl(
|
|||||||
sal_uInt16 nPrfx,
|
sal_uInt16 nPrfx,
|
||||||
const OUString& rLName,
|
const OUString& rLName,
|
||||||
const Reference< xml::sax::XAttributeList > & xAttrList,
|
const Reference< xml::sax::XAttributeList > & xAttrList,
|
||||||
const Reference< document::XDocumentProperties >& xDocProps,
|
const Reference< document::XDocumentProperties >& xDocProps) :
|
||||||
const Reference< xml::sax::XDocumentHandler >& xDocBuilder) :
|
|
||||||
SvXMLImportContext( rImport, nPrfx, rLName ),
|
SvXMLImportContext( rImport, nPrfx, rLName ),
|
||||||
SwXMLDocContext_Impl( rImport, nPrfx, rLName, xAttrList ),
|
SwXMLDocContext_Impl( rImport, nPrfx, rLName, xAttrList ),
|
||||||
SvXMLMetaDocumentContext( rImport, nPrfx, rLName, xDocProps, xDocBuilder)
|
SvXMLMetaDocumentContext( rImport, nPrfx, rLName, xDocProps)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -416,14 +412,11 @@ SvXMLImportContext *SwXMLImport::CreateContext(
|
|||||||
else if ( XML_NAMESPACE_OFFICE==nPrefix &&
|
else if ( XML_NAMESPACE_OFFICE==nPrefix &&
|
||||||
IsXMLToken( rLocalName, XML_DOCUMENT ) )
|
IsXMLToken( rLocalName, XML_DOCUMENT ) )
|
||||||
{
|
{
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentProperties> const xDocProps(
|
uno::Reference<document::XDocumentProperties> const xDocProps(
|
||||||
GetDocumentProperties());
|
GetDocumentProperties());
|
||||||
// flat OpenDocument file format
|
// flat OpenDocument file format
|
||||||
pContext = new SwXMLOfficeDocContext_Impl( *this, nPrefix, rLocalName,
|
pContext = new SwXMLOfficeDocContext_Impl( *this, nPrefix, rLocalName,
|
||||||
xAttrList, xDocProps, xDocBuilder);
|
xAttrList, xDocProps);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
|
pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
|
||||||
|
@@ -30,8 +30,6 @@
|
|||||||
#include <com/sun/star/frame/XModel.hpp>
|
#include <com/sun/star/frame/XModel.hpp>
|
||||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
||||||
#include <com/sun/star/text/XTextDocument.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/xmlnmspe.hxx>
|
||||||
#include <xmloff/xmlmetai.hxx>
|
#include <xmloff/xmlmetai.hxx>
|
||||||
#include <xmloff/xmlmetae.hxx>
|
#include <xmloff/xmlmetae.hxx>
|
||||||
@@ -76,13 +74,10 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext(
|
|||||||
|
|
||||||
if (getImportFlags() & IMPORT_META)
|
if (getImportFlags() & IMPORT_META)
|
||||||
{
|
{
|
||||||
uno::Reference<xml::sax::XDocumentHandler> const xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentProperties> const xDocProps(
|
uno::Reference<document::XDocumentProperties> const xDocProps(
|
||||||
GetDocumentProperties());
|
GetDocumentProperties());
|
||||||
pContext = new SvXMLMetaDocumentContext(*this,
|
pContext = new SvXMLMetaDocumentContext(*this,
|
||||||
XML_NAMESPACE_OFFICE, rLocalName, xDocProps, xDocBuilder);
|
XML_NAMESPACE_OFFICE, rLocalName, xDocProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !pContext )
|
if( !pContext )
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/document/XDocumentProperties.hpp>
|
#include <com/sun/star/document/XDocumentProperties.hpp>
|
||||||
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
#include <com/sun/star/xml/dom/XSAXDocumentBuilder2.hpp>
|
||||||
|
|
||||||
|
|
||||||
/// handles the top-level office:document-meta element of meta.xml documents
|
/// handles the top-level office:document-meta element of meta.xml documents
|
||||||
@@ -39,15 +39,13 @@ private:
|
|||||||
::com::sun::star::uno::Reference<
|
::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::document::XDocumentProperties> mxDocProps;
|
::com::sun::star::document::XDocumentProperties> mxDocProps;
|
||||||
::com::sun::star::uno::Reference<
|
::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::xml::sax::XDocumentHandler> mxDocBuilder;
|
::com::sun::star::xml::dom::XSAXDocumentBuilder2> mxDocBuilder;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SvXMLMetaDocumentContext(SvXMLImport& rImport, sal_uInt16 nPrfx,
|
SvXMLMetaDocumentContext(SvXMLImport& rImport, sal_uInt16 nPrfx,
|
||||||
const rtl::OUString& rLName,
|
const rtl::OUString& rLName,
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::document::XDocumentProperties>& xDocProps,
|
::com::sun::star::document::XDocumentProperties>& xDocProps);
|
||||||
const ::com::sun::star::uno::Reference<
|
|
||||||
::com::sun::star::xml::sax::XDocumentHandler>& xDocBuilder);
|
|
||||||
|
|
||||||
virtual ~SvXMLMetaDocumentContext();
|
virtual ~SvXMLMetaDocumentContext();
|
||||||
|
|
||||||
|
@@ -35,7 +35,6 @@
|
|||||||
|
|
||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
#include <comphelper/componentcontext.hxx>
|
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
#include "xmloff/xmlnmspe.hxx"
|
#include "xmloff/xmlnmspe.hxx"
|
||||||
#include <xmloff/xmltoken.hxx>
|
#include <xmloff/xmltoken.hxx>
|
||||||
@@ -57,7 +56,6 @@
|
|||||||
|
|
||||||
#include <com/sun/star/document/XDocumentProperties.hpp>
|
#include <com/sun/star/document/XDocumentProperties.hpp>
|
||||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
||||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
|
||||||
|
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
@@ -608,17 +606,14 @@ SvXMLImportContext *SchXMLImport::CreateContext( sal_uInt16 nPrefix, const OUStr
|
|||||||
GetModel(), uno::UNO_QUERY);
|
GetModel(), uno::UNO_QUERY);
|
||||||
// mst@: right now, this seems to be not supported, so it is untested
|
// mst@: right now, this seems to be not supported, so it is untested
|
||||||
if (xDPS.is()) {
|
if (xDPS.is()) {
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META))
|
pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META))
|
||||||
? new SvXMLMetaDocumentContext(*this,
|
? new SvXMLMetaDocumentContext(*this,
|
||||||
XML_NAMESPACE_OFFICE, rLocalName,
|
XML_NAMESPACE_OFFICE, rLocalName,
|
||||||
xDPS->getDocumentProperties(), xDocBuilder)
|
xDPS->getDocumentProperties())
|
||||||
// flat OpenDocument file format
|
// flat OpenDocument file format
|
||||||
: new SchXMLFlatDocContext_Impl(
|
: new SchXMLFlatDocContext_Impl(
|
||||||
maImportHelper, *this, nPrefix, rLocalName,
|
maImportHelper, *this, nPrefix, rLocalName,
|
||||||
xDPS->getDocumentProperties(), xDocBuilder);
|
xDPS->getDocumentProperties());
|
||||||
} else {
|
} else {
|
||||||
pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META))
|
pContext = (IsXMLToken(rLocalName, XML_DOCUMENT_META))
|
||||||
? SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList )
|
? SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList )
|
||||||
|
@@ -141,12 +141,11 @@ SchXMLFlatDocContext_Impl::SchXMLFlatDocContext_Impl(
|
|||||||
SchXMLImportHelper& i_rImpHelper,
|
SchXMLImportHelper& i_rImpHelper,
|
||||||
SchXMLImport& i_rImport,
|
SchXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const ::rtl::OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const ::rtl::OUString & i_rLName,
|
||||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
const uno::Reference<document::XDocumentProperties>& i_xDocProps) :
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) :
|
|
||||||
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
||||||
SchXMLDocContext(i_rImpHelper, i_rImport, i_nPrefix, i_rLName),
|
SchXMLDocContext(i_rImpHelper, i_rImport, i_nPrefix, i_rLName),
|
||||||
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
||||||
i_xDocProps, i_xDocBuilder)
|
i_xDocProps)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,8 +70,7 @@ public:
|
|||||||
SchXMLImportHelper& i_rImpHelper,
|
SchXMLImportHelper& i_rImpHelper,
|
||||||
SchXMLImport& i_rImport,
|
SchXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const ::rtl::OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const ::rtl::OUString & i_rLName,
|
||||||
const com::sun::star::uno::Reference<com::sun::star::document::XDocumentProperties>& i_xDocProps,
|
const com::sun::star::uno::Reference<com::sun::star::document::XDocumentProperties>& i_xDocProps);
|
||||||
const com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler>& i_xDocBuilder);
|
|
||||||
|
|
||||||
virtual ~SchXMLFlatDocContext_Impl();
|
virtual ~SchXMLFlatDocContext_Impl();
|
||||||
|
|
||||||
|
@@ -55,8 +55,6 @@
|
|||||||
|
|
||||||
#include <com/sun/star/document/XDocumentProperties.hpp>
|
#include <com/sun/star/document/XDocumentProperties.hpp>
|
||||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.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::OUString;
|
||||||
using ::rtl::OUStringBuffer;
|
using ::rtl::OUStringBuffer;
|
||||||
@@ -254,8 +252,7 @@ public:
|
|||||||
SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport,
|
SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
||||||
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
||||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
const uno::Reference<document::XDocumentProperties>& i_xDocProps);
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder);
|
|
||||||
|
|
||||||
virtual ~SdXMLFlatDocContext_Impl();
|
virtual ~SdXMLFlatDocContext_Impl();
|
||||||
|
|
||||||
@@ -267,12 +264,11 @@ public:
|
|||||||
SdXMLFlatDocContext_Impl::SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport,
|
SdXMLFlatDocContext_Impl::SdXMLFlatDocContext_Impl( SdXMLImport& i_rImport,
|
||||||
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
sal_uInt16 i_nPrefix, const OUString & i_rLName,
|
||||||
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
const uno::Reference<xml::sax::XAttributeList>& i_xAttrList,
|
||||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
const uno::Reference<document::XDocumentProperties>& i_xDocProps) :
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& i_xDocBuilder) :
|
|
||||||
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
SvXMLImportContext(i_rImport, i_nPrefix, i_rLName),
|
||||||
SdXMLDocContext_Impl(i_rImport, i_nPrefix, i_rLName, i_xAttrList),
|
SdXMLDocContext_Impl(i_rImport, i_nPrefix, i_rLName, i_xAttrList),
|
||||||
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
SvXMLMetaDocumentContext(i_rImport, i_nPrefix, i_rLName,
|
||||||
i_xDocProps, i_xDocBuilder)
|
i_xDocProps)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -733,14 +729,11 @@ SvXMLImportContext *SdXMLImport::CreateContext(sal_uInt16 nPrefix,
|
|||||||
pContext = CreateMetaContext(rLocalName, xAttrList);
|
pContext = CreateMetaContext(rLocalName, xAttrList);
|
||||||
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
|
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
|
||||||
( IsXMLToken(rLocalName, XML_DOCUMENT)) ) {
|
( IsXMLToken(rLocalName, XML_DOCUMENT)) ) {
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||||
GetModel(), uno::UNO_QUERY_THROW);
|
GetModel(), uno::UNO_QUERY_THROW);
|
||||||
// flat OpenDocument file format
|
// flat OpenDocument file format
|
||||||
pContext = new SdXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
|
pContext = new SdXMLFlatDocContext_Impl( *this, nPrefix, rLocalName,
|
||||||
xAttrList, xDPS->getDocumentProperties(), xDocBuilder);
|
xAttrList, xDPS->getDocumentProperties());
|
||||||
} else {
|
} else {
|
||||||
pContext = SvXMLImport::CreateContext(nPrefix, rLocalName, xAttrList);
|
pContext = SvXMLImport::CreateContext(nPrefix, rLocalName, xAttrList);
|
||||||
}
|
}
|
||||||
@@ -757,16 +750,13 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName,
|
|||||||
|
|
||||||
if (getImportFlags() & IMPORT_META)
|
if (getImportFlags() & IMPORT_META)
|
||||||
{
|
{
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
|
||||||
GetModel(), uno::UNO_QUERY_THROW);
|
GetModel(), uno::UNO_QUERY_THROW);
|
||||||
uno::Reference<document::XDocumentProperties> const xDocProps(
|
uno::Reference<document::XDocumentProperties> const xDocProps(
|
||||||
(IsStylesOnlyMode()) ? 0 : xDPS->getDocumentProperties());
|
(IsStylesOnlyMode()) ? 0 : xDPS->getDocumentProperties());
|
||||||
pContext = new SvXMLMetaDocumentContext(*this,
|
pContext = new SvXMLMetaDocumentContext(*this,
|
||||||
XML_NAMESPACE_OFFICE, rLocalName,
|
XML_NAMESPACE_OFFICE, rLocalName,
|
||||||
xDocProps, xDocBuilder);
|
xDocProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!pContext)
|
if(!pContext)
|
||||||
|
@@ -34,9 +34,6 @@
|
|||||||
#include <xmloff/xmlmetai.hxx>
|
#include <xmloff/xmlmetai.hxx>
|
||||||
#include <xmloff/nmspmap.hxx>
|
#include <xmloff/nmspmap.hxx>
|
||||||
|
|
||||||
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
|
||||||
#include <comphelper/componentcontext.hxx>
|
|
||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
using namespace ::xmloff::token;
|
using namespace ::xmloff::token;
|
||||||
|
|
||||||
@@ -68,11 +65,8 @@ SvXMLImportContext* XMLMetaImportComponent::CreateContext(
|
|||||||
"XMLMetaImportComponent::CreateContext: setTargetDocument "
|
"XMLMetaImportComponent::CreateContext: setTargetDocument "
|
||||||
"has not been called")), *this);
|
"has not been called")), *this);
|
||||||
}
|
}
|
||||||
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
|
|
||||||
xml::dom::SAXDocumentBuilder::create(comphelper::ComponentContext(mxServiceFactory).getUNOContext()),
|
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
return new SvXMLMetaDocumentContext(
|
return new SvXMLMetaDocumentContext(
|
||||||
*this, nPrefix, rLocalName, mxDocProps, xDocBuilder);
|
*this, nPrefix, rLocalName, mxDocProps);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -28,11 +28,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
|
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
|
||||||
#include <com/sun/star/xml/dom/XSAXDocumentBuilder.hpp>
|
#include <com/sun/star/xml/dom/SAXDocumentBuilder.hpp>
|
||||||
|
#include <com/sun/star/xml/dom/XSAXDocumentBuilder2.hpp>
|
||||||
#include <com/sun/star/xml/xpath/XXPathAPI.hpp>
|
#include <com/sun/star/xml/xpath/XXPathAPI.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySetInfo.hpp>
|
#include <com/sun/star/beans/XPropertySetInfo.hpp>
|
||||||
|
#include <comphelper/processfactory.hxx>
|
||||||
#include <xmloff/xmlmetai.hxx>
|
#include <xmloff/xmlmetai.hxx>
|
||||||
#include <xmloff/xmlimp.hxx>
|
#include <xmloff/xmlimp.hxx>
|
||||||
#include <xmloff/nmspmap.hxx>
|
#include <xmloff/nmspmap.hxx>
|
||||||
@@ -53,7 +54,7 @@ class XMLDocumentBuilderContext : public SvXMLImportContext
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
::com::sun::star::uno::Reference<
|
::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::xml::sax::XDocumentHandler> mxDocBuilder;
|
::com::sun::star::xml::dom::XSAXDocumentBuilder2> mxDocBuilder;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
XMLDocumentBuilderContext(SvXMLImport& rImport, sal_uInt16 nPrfx,
|
XMLDocumentBuilderContext(SvXMLImport& rImport, sal_uInt16 nPrfx,
|
||||||
@@ -61,7 +62,7 @@ public:
|
|||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::xml::sax::XAttributeList>& xAttrList,
|
::com::sun::star::xml::sax::XAttributeList>& xAttrList,
|
||||||
const ::com::sun::star::uno::Reference<
|
const ::com::sun::star::uno::Reference<
|
||||||
::com::sun::star::xml::sax::XDocumentHandler>& rDocBuilder);
|
::com::sun::star::xml::dom::XSAXDocumentBuilder2>& rDocBuilder);
|
||||||
|
|
||||||
virtual ~XMLDocumentBuilderContext();
|
virtual ~XMLDocumentBuilderContext();
|
||||||
|
|
||||||
@@ -81,7 +82,7 @@ public:
|
|||||||
XMLDocumentBuilderContext::XMLDocumentBuilderContext(SvXMLImport& rImport,
|
XMLDocumentBuilderContext::XMLDocumentBuilderContext(SvXMLImport& rImport,
|
||||||
sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
|
sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
|
||||||
const uno::Reference<xml::sax::XAttributeList>&,
|
const uno::Reference<xml::sax::XAttributeList>&,
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& rDocBuilder) :
|
const uno::Reference<xml::dom::XSAXDocumentBuilder2>& rDocBuilder) :
|
||||||
SvXMLImportContext( rImport, nPrfx, rLName ),
|
SvXMLImportContext( rImport, nPrfx, rLName ),
|
||||||
mxDocBuilder(rDocBuilder)
|
mxDocBuilder(rDocBuilder)
|
||||||
{
|
{
|
||||||
@@ -124,13 +125,11 @@ void XMLDocumentBuilderContext::EndElement()
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
lcl_initDocumentProperties(SvXMLImport & rImport,
|
lcl_initDocumentProperties(SvXMLImport & rImport,
|
||||||
uno::Reference<xml::sax::XDocumentHandler> const& xDocBuilder,
|
uno::Reference<xml::dom::XSAXDocumentBuilder2> const& xDocBuilder,
|
||||||
uno::Reference<document::XDocumentProperties> const& xDocProps)
|
uno::Reference<document::XDocumentProperties> const& xDocProps)
|
||||||
{
|
{
|
||||||
uno::Sequence< uno::Any > aSeq(1);
|
uno::Sequence< uno::Any > aSeq(1);
|
||||||
uno::Reference< xml::dom::XSAXDocumentBuilder > const xDB(xDocBuilder,
|
aSeq[0] <<= xDocBuilder->getDocument();
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
aSeq[0] <<= xDB->getDocument();
|
|
||||||
uno::Reference< lang::XInitialization > const xInit(xDocProps,
|
uno::Reference< lang::XInitialization > const xInit(xDocProps,
|
||||||
uno::UNO_QUERY_THROW);
|
uno::UNO_QUERY_THROW);
|
||||||
try {
|
try {
|
||||||
@@ -156,11 +155,9 @@ lcl_initDocumentProperties(SvXMLImport & rImport,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
lcl_initGenerator(SvXMLImport & rImport,
|
lcl_initGenerator(SvXMLImport & rImport,
|
||||||
uno::Reference<xml::sax::XDocumentHandler> const& xDocBuilder)
|
uno::Reference<xml::dom::XSAXDocumentBuilder2> const& xDocBuilder)
|
||||||
{
|
{
|
||||||
uno::Reference< xml::dom::XSAXDocumentBuilder > const xDB(xDocBuilder,
|
uno::Reference< xml::dom::XDocument > const xDoc(xDocBuilder->getDocument(),
|
||||||
uno::UNO_QUERY_THROW);
|
|
||||||
uno::Reference< xml::dom::XDocument > const xDoc(xDB->getDocument(),
|
|
||||||
uno::UNO_SET_THROW);
|
uno::UNO_SET_THROW);
|
||||||
try {
|
try {
|
||||||
uno::Reference< xml::xpath::XXPathAPI > const xPath(
|
uno::Reference< xml::xpath::XXPathAPI > const xPath(
|
||||||
@@ -188,16 +185,15 @@ lcl_initGenerator(SvXMLImport & rImport,
|
|||||||
|
|
||||||
SvXMLMetaDocumentContext::SvXMLMetaDocumentContext(SvXMLImport& rImport,
|
SvXMLMetaDocumentContext::SvXMLMetaDocumentContext(SvXMLImport& rImport,
|
||||||
sal_uInt16 nPrfx, const rtl::OUString& rLName,
|
sal_uInt16 nPrfx, const rtl::OUString& rLName,
|
||||||
const uno::Reference<document::XDocumentProperties>& xDocProps,
|
const uno::Reference<document::XDocumentProperties>& xDocProps) :
|
||||||
const uno::Reference<xml::sax::XDocumentHandler>& xDocBuilder) :
|
|
||||||
SvXMLImportContext( rImport, nPrfx, rLName ),
|
SvXMLImportContext( rImport, nPrfx, rLName ),
|
||||||
mxDocProps(xDocProps),
|
mxDocProps(xDocProps),
|
||||||
mxDocBuilder(xDocBuilder)
|
mxDocBuilder(
|
||||||
|
xml::dom::SAXDocumentBuilder::create(
|
||||||
|
comphelper::getProcessComponentContext()))
|
||||||
{
|
{
|
||||||
// #i103539#: must always read meta.xml for generator, xDocProps unwanted then
|
// #i103539#: must always read meta.xml for generator, xDocProps unwanted then
|
||||||
// OSL_ENSURE(xDocProps.is(), "SvXMLMetaDocumentContext: no document props");
|
// OSL_ENSURE(xDocProps.is(), "SvXMLMetaDocumentContext: no document props");
|
||||||
OSL_ENSURE(xDocBuilder.is(), "SvXMLMetaDocumentContext: no document hdlr");
|
|
||||||
// here are no attributes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SvXMLMetaDocumentContext::~SvXMLMetaDocumentContext()
|
SvXMLMetaDocumentContext::~SvXMLMetaDocumentContext()
|
||||||
|
Reference in New Issue
Block a user