diff options
Diffstat (limited to 'oox/source/core/filterbase.cxx')
-rw-r--r--[-rwxr-xr-x] | oox/source/core/filterbase.cxx | 53 |
1 files changed, 11 insertions, 42 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 902784cafe80..fb9e43c732de 100755..100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -130,10 +130,9 @@ enum FilterDirection struct FilterBaseImpl { - typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef; - typedef ::boost::shared_ptr< ModelObjectHelper > ModelObjHelperRef; - typedef ::boost::shared_ptr< OleObjectHelper > OleObjHelperRef; - typedef ::std::map< OUString, Reference< XGraphic > > EmbeddedGraphicMap; + typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef; + typedef ::boost::shared_ptr< ModelObjectHelper > ModelObjHelperRef; + typedef ::boost::shared_ptr< OleObjectHelper > OleObjHelperRef; FilterDirection meDirection; SequenceAsHashMap maArguments; @@ -144,7 +143,6 @@ struct FilterBaseImpl GraphicHelperRef mxGraphicHelper; /// Graphic and graphic object handling. ModelObjHelperRef mxModelObjHelper; /// Tables to create new named drawing objects. OleObjHelperRef mxOleObjHelper; /// OLE object handling. - EmbeddedGraphicMap maEmbeddedGraphics; /// Maps all imported embedded graphics by their path. Reference< XMultiServiceFactory > mxGlobalFactory; Reference< XModel > mxModel; @@ -200,11 +198,7 @@ void FilterBaseImpl::finalizeFilter() { try { - // clear the 'ComponentData' property in the descriptor - MediaDescriptor::iterator aIt = maMediaDesc.find( MediaDescriptor::PROP_COMPONENTDATA() ); - if( aIt != maMediaDesc.end() ) - aIt->second.clear(); - // write the descriptor back to the document model (adds the password) + // write the descriptor back to the document model (adds the passwords) mxModel->attachResource( maFileUrl, maMediaDesc.getAsConstPropertyValueList() ); // unlock the model controllers mxModel->unlockControllers(); @@ -248,11 +242,6 @@ const Reference< XMultiServiceFactory >& FilterBase::getGlobalFactory() const return mxImpl->mxGlobalFactory; } -MediaDescriptor& FilterBase::getMediaDescriptor() const -{ - return mxImpl->maMediaDesc; -} - const Reference< XModel >& FilterBase::getModel() const { return mxImpl->mxModel; @@ -278,6 +267,11 @@ const Reference< XInteractionHandler >& FilterBase::getInteractionHandler() cons return mxImpl->mxInteractionHandler; } +MediaDescriptor& FilterBase::getMediaDescriptor() const +{ + return mxImpl->maMediaDesc; +} + const OUString& FilterBase::getFileUrl() const { return mxImpl->maFileUrl; @@ -423,31 +417,6 @@ bool FilterBase::importBinaryData( StreamDataSequence& orDataSeq, const OUString return true; } -Reference< XGraphic > FilterBase::importEmbeddedGraphic( const OUString& rStreamName ) const -{ - Reference< XGraphic > xGraphic; - OSL_ENSURE( rStreamName.getLength() > 0, "FilterBase::importEmbeddedGraphic - empty stream name" ); - if( rStreamName.getLength() > 0 ) - { - FilterBaseImpl::EmbeddedGraphicMap::const_iterator aIt = mxImpl->maEmbeddedGraphics.find( rStreamName ); - if( aIt == mxImpl->maEmbeddedGraphics.end() ) - { - xGraphic = getGraphicHelper().importGraphic( openInputStream( rStreamName ) ); - if( xGraphic.is() ) - mxImpl->maEmbeddedGraphics[ rStreamName ] = xGraphic; - } - else - xGraphic = aIt->second; - } - return xGraphic; -} - -OUString FilterBase::importEmbeddedGraphicObject( const OUString& rStreamName ) const -{ - Reference< XGraphic > xGraphic = importEmbeddedGraphic( rStreamName ); - return xGraphic.is() ? getGraphicHelper().createGraphicObject( xGraphic ) : OUString(); -} - // com.sun.star.lang.XServiceInfo interface ----------------------------------- OUString SAL_CALL FilterBase::getImplementationName() throw( RuntimeException ) @@ -560,7 +529,7 @@ Reference< XStream > FilterBase::implGetOutputStream( MediaDescriptor& rMediaDes void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDescSeq ) { - mxImpl->maMediaDesc = rMediaDescSeq; + mxImpl->maMediaDesc << rMediaDescSeq; switch( mxImpl->meDirection ) { @@ -587,7 +556,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc GraphicHelper* FilterBase::implCreateGraphicHelper() const { // default: return base implementation without any special behaviour - return new GraphicHelper( mxImpl->mxGlobalFactory, mxImpl->mxTargetFrame ); + return new GraphicHelper( mxImpl->mxGlobalFactory, mxImpl->mxTargetFrame, mxImpl->mxStorage ); } // ============================================================================ |