From 74881f6a87c260fa32bd3ba5489c6ce6f5b9caf0 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 26 Aug 2011 17:20:39 +0100 Subject: export the source storage to import filter, to mirror TargetStorage for export --- xmloff/inc/xmloff/xmlimp.hxx | 5 +++++ xmloff/source/core/xmlimp.cxx | 11 +++++++++++ 2 files changed, 16 insertions(+) (limited to 'xmloff') diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx index 69cbe1fe310d..498aed4e52ae 100644 --- a/xmloff/inc/xmloff/xmlimp.hxx +++ b/xmloff/inc/xmloff/xmlimp.hxx @@ -32,6 +32,7 @@ #include "sal/config.h" #include "xmloff/dllapi.h" #include "sal/types.h" +#include #include #include #include @@ -326,6 +327,10 @@ public: GetStreamForEmbeddedObjectURLFromBase64(); ::rtl::OUString ResolveEmbeddedObjectURLFromBase64(); + // get source storage we're importing from (if available) + ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > + GetSourceStorage(); + void AddStyleDisplayName( sal_uInt16 nFamily, const ::rtl::OUString& rName, const ::rtl::OUString& rDisplayName ); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index a70a43fcb71a..803290a7280b 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -193,6 +193,8 @@ public: const uno::Reference< uno::XComponentContext > mxComponentContext; + uno::Reference< embed::XStorage > mxSourceStorage; + std::auto_ptr< xmloff::RDFaImportHelper > mpRDFaHelper; SvXMLImport_Impl() : @@ -995,6 +997,10 @@ void SAL_CALL SvXMLImport::initialize( const uno::Sequence< uno::Any >& aArgumen uno::Any aAny = mxImportInfo->getPropertyValue(sPropName); aAny >>= (mpImpl->mbTextDocInOOoFileFormat); } + + sPropName = OUString( RTL_CONSTASCII_USTRINGPARAM("SourceStorage" ) ); + if( xPropertySetInfo->hasPropertyByName(sPropName) ) + mxImportInfo->getPropertyValue(sPropName) >>= mpImpl->mxSourceStorage; } } } @@ -1317,6 +1323,11 @@ Reference< XOutputStream > SvXMLImport::GetStreamForGraphicObjectURLFromBase64() return sRet; } +Reference< embed::XStorage > SvXMLImport::GetSourceStorage() +{ + return mpImpl->mxSourceStorage; +} + Reference < XOutputStream > SvXMLImport::GetStreamForEmbeddedObjectURLFromBase64() { -- cgit