24#include <com/sun/star/uno/Reference.hxx>
25#include <com/sun/star/document/XDocumentProperties.hpp>
26#include <com/sun/star/lang/IllegalArgumentException.hpp>
33class XMLMetaImportComponent :
public SvXMLImport
36 css::uno::Reference< css::document::XDocumentProperties> mxDocProps;
40 explicit XMLMetaImportComponent(
41 const css::uno::Reference< css::uno::XComponentContext >& xContext
47 const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& xAttrList )
override;
50 virtual void SAL_CALL setTargetDocument(
const css::uno::Reference< css::lang::XComponent >& xDoc )
override;
57extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
59 css::uno::XComponentContext *context,
60 css::uno::Sequence<css::uno::Any>
const &)
62 return cppu::acquire(
new XMLMetaImportComponent(context));
65XMLMetaImportComponent::XMLMetaImportComponent(
66 const uno::Reference< uno::XComponentContext >& xContext)
67 : SvXMLImport(xContext,
"XMLMetaImportComponent")
72 const uno::Reference< xml::sax::XFastAttributeList >& )
76 if (!mxDocProps.is()) {
77 throw uno::RuntimeException(
78 "XMLMetaImportComponent::CreateFastContext: setTargetDocument "
79 "has not been called", *
this);
87void SAL_CALL XMLMetaImportComponent::setTargetDocument(
88 const uno::Reference< lang::XComponent >& xDoc )
90 mxDocProps.set( xDoc, uno::UNO_QUERY );
91 if( !mxDocProps.is() )
92 throw lang::IllegalArgumentException(
93 "XMLMetaImportComponent::setTargetDocument: argument is no "
94 "XDocumentProperties", uno::Reference<uno::XInterface>(*
this), 0);
This class deliberately does not support XWeak, to improve performance when loading large documents.
handles the top-level office:document-meta element of meta.xml documents
Handling of tokens in XML:
#define XML_ELEMENT(prefix, name)