diff options
author | Sascha Ballach <sab@openoffice.org> | 2001-09-11 04:19:20 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2001-09-11 04:19:20 +0000 |
commit | 4a598200c48e08aca162537a9a23c06ff35d2900 (patch) | |
tree | d5faf5aba3e633341f65ea00b1911d9bf77eed24 /xmloff/source/meta | |
parent | 0c4fc182a624ea09714086684af3b6de9a7c6259 (diff) |
#90480#; make it possible to use the meta import component with a XDocumentInfo instead of a XModel
Diffstat (limited to 'xmloff/source/meta')
-rw-r--r-- | xmloff/source/meta/MetaImportComponent.cxx | 30 | ||||
-rw-r--r-- | xmloff/source/meta/xmlmetai.cxx | 16 |
2 files changed, 36 insertions, 10 deletions
diff --git a/xmloff/source/meta/MetaImportComponent.cxx b/xmloff/source/meta/MetaImportComponent.cxx index 9aa9000b4cee..b93b6c145b1b 100644 --- a/xmloff/source/meta/MetaImportComponent.cxx +++ b/xmloff/source/meta/MetaImportComponent.cxx @@ -2,9 +2,9 @@ * * $RCSfile: MetaImportComponent.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: dvo $ $Date: 2001-06-29 21:07:15 $ + * last change: $Author: sab $ $Date: 2001-09-11 05:19:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,11 +80,17 @@ using namespace ::xmloff::token; class SvXMLMetaDocumentContext : public SvXMLImportContext { +private: + ::com::sun::star::uno::Reference< + ::com::sun::star::document::XDocumentInfo> xDocInfo; + public: SvXMLMetaDocumentContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, 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< + ::com::sun::star::document::XDocumentInfo>& rDocInfo); virtual ~SvXMLMetaDocumentContext(); virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, @@ -96,8 +102,10 @@ public: SvXMLMetaDocumentContext::SvXMLMetaDocumentContext(SvXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLName, - const uno::Reference<xml::sax::XAttributeList>& xAttrList ) : - SvXMLImportContext( rImport, nPrfx, rLName ) + const uno::Reference<xml::sax::XAttributeList>& xAttrList, + const uno::Reference<document::XDocumentInfo>& rDocInfo) : + SvXMLImportContext( rImport, nPrfx, rLName ), + xDocInfo(rDocInfo) { // here are no attributes } @@ -114,7 +122,7 @@ SvXMLImportContext *SvXMLMetaDocumentContext::CreateChildContext( USHORT nPrefix if ( (XML_NAMESPACE_OFFICE == nPrefix) && IsXMLToken(rLocalName, XML_META) ) { - return new SfxXMLMetaContext(GetImport(), nPrefix, rLocalName, GetImport().GetModel()); + return new SfxXMLMetaContext(GetImport(), nPrefix, rLocalName, xDocInfo); } else { @@ -146,7 +154,7 @@ SvXMLImportContext* XMLMetaImportComponent::CreateContext( if ( (XML_NAMESPACE_OFFICE == nPrefix) && IsXMLToken(rLocalName, XML_DOCUMENT_META) ) { - return new SvXMLMetaDocumentContext(*this, nPrefix, rLocalName, xAttrList); + return new SvXMLMetaDocumentContext(*this, nPrefix, rLocalName, xAttrList, xDocInfo); } else { @@ -154,7 +162,13 @@ SvXMLImportContext* XMLMetaImportComponent::CreateContext( } } - +void SAL_CALL XMLMetaImportComponent::setTargetDocument( const uno::Reference< lang::XComponent >& xDoc ) + throw(lang::IllegalArgumentException, uno::RuntimeException) +{ + xDocInfo = uno::Reference< document::XDocumentInfo >::query( xDoc ); + if( !xDocInfo.is() ) + throw lang::IllegalArgumentException(); +} uno::Sequence< rtl::OUString > SAL_CALL XMLMetaImportComponent_getSupportedServiceNames() diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 2eb2a7324cad..8c0090f08353 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlmetai.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dvo $ $Date: 2001-06-29 21:07:15 $ + * last change: $Author: sab $ $Date: 2001-09-11 05:19:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -753,6 +753,18 @@ SfxXMLMetaContext::SfxXMLMetaContext( SvXMLImport& rImport, sal_uInt16 nPrfx, DBG_ASSERT( xInfoProp.is(), "no document info properties" ); } +SfxXMLMetaContext::SfxXMLMetaContext( SvXMLImport& rImport, sal_uInt16 nPrfx, + const rtl::OUString& rLName, + const uno::Reference<document::XDocumentInfo>& rDocInfo ) : + SvXMLImportContext( rImport, nPrfx, rLName ), + xDocInfo( rDocInfo ), + xInfoProp( rDocInfo, uno::UNO_QUERY ), + pTokenMap ( NULL ), + nUserKeys ( 0 ) +{ + DBG_ASSERT( xInfoProp.is(), "no document info properties" ); +} + SfxXMLMetaContext::~SfxXMLMetaContext() { delete pTokenMap; |