diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-08-26 17:20:39 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-08-26 17:20:39 +0100 |
commit | 74881f6a87c260fa32bd3ba5489c6ce6f5b9caf0 (patch) | |
tree | 5ac2002086fc69c33d1eed4dbc3ac109c1d35cd6 | |
parent | eb9531f9c01b5e3a823103c41bbb34905847b0bf (diff) |
export the source storage to import filter, to mirror TargetStorage for export
-rw-r--r-- | sd/source/filter/xml/sdxmlwrp.cxx | 7 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmlimp.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 11 |
3 files changed, 22 insertions, 1 deletions
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 0810204842c2..eb531436424c 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -490,7 +490,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) // ------------------------------------- - /** property map for export info set */ + /** property map for import info set */ PropertyMapEntry aImportInfoMap[] = { // necessary properties for XML progress bar at load time @@ -517,6 +517,8 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) { MAP_LEN( "OrganizerMode" ), 0, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "SourceStorage" ), 0, &embed::XStorage::static_type(), + ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { NULL, 0, 0, NULL, 0, 0 } }; @@ -594,6 +596,9 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) Reference<io::XInputStream> xInputStream; uno::Reference < embed::XStorage > xStorage = mrMedium.GetStorage(); + OUString sSourceStorage( RTL_CONSTASCII_USTRINGPARAM("SourceStorage") ); + xInfoSet->setPropertyValue( sSourceStorage, Any( xStorage ) ); + if( !xStorage.is() ) nRet = SD_XML_READERROR; 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 <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/xml/sax/SAXParseException.hpp> #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> #include <com/sun/star/xml/sax/SAXException.hpp> @@ -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() { |