diff options
-rw-r--r-- | sw/inc/ndgrf.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 1 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 11 |
4 files changed, 13 insertions, 7 deletions
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index d5e3ddd7a307..5292561bfbfb 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -174,8 +174,11 @@ public: bool SwapIn( bool bWaitForData = false ); /// Remove graphic in order to free memory. bool SwapOut(); - /// Access to storage stream-name. - void SetStreamName( const OUString& r ) { maGrfObj.SetUserData( r ); } + /// applying new stream name for embedded graphic - needed as saving the document might change this stream name + void ApplyNewEmbeddedStreamName(const OUString& r) + { + maGrfObj.SetUserData(r); + } /// Is this node selected by any shell? bool IsSelected() const; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index a89540756805..6a15f4e7a2d5 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2010,7 +2010,6 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) if(pIdx) { SwNodeIndex aIdx(*pIdx, 1); -// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode(); SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode(); if(!pGrfNode) throw uno::RuntimeException(); diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 6cbb329be4cf..c5d21ba8767b 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -197,6 +197,7 @@ void SwXMLTextParagraphExport::setTextEmbeddedGraphicURL( SwGrfNode *pGrfNd = GetNoTxtNode( rPropSet )->GetGrfNode(); if (pGrfNd && !pGrfNd->IsGrfLink()) { + pGrfNd->ApplyNewEmbeddedStreamName("vnd.sun.star.Package:" + rURL); // #i15411# save-as will swap all graphics in; we need to swap // them out again, to prevent excessive memory use pGrfNd->SwapOut(); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 9a1723bc183a..66577bac9594 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2247,7 +2247,6 @@ void XMLShapeExport::ImpExportGraphicObjectShape( if( !bIsEmptyPresObj ) { OUString aStreamURL; - OUString aStr; xPropSet->getPropertyValue("GraphicStreamURL") >>= aStreamURL; xPropSet->getPropertyValue("GraphicURL") >>= sImageURL; @@ -2255,7 +2254,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape( OUString aResolveURL( sImageURL ); const OUString sPackageURL( "vnd.sun.star.Package:" ); - // sj: trying to preserve the filename + // trying to preserve the filename if ( aStreamURL.match( sPackageURL, 0 ) ) { OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) ); @@ -2272,16 +2271,20 @@ void XMLShapeExport::ImpExportGraphicObjectShape( } } - aStr = mrExport.AddEmbeddedGraphicObject( aResolveURL ); + const OUString aStr = mrExport.AddEmbeddedGraphicObject( aResolveURL ); mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aStr ); if( !aStr.isEmpty() ) { + aStreamURL = sPackageURL; if( aStr[ 0 ] == '#' ) { - aStreamURL = sPackageURL; aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) ); } + else + { + aStreamURL = aStreamURL.concat( aStr ); + } // update stream URL for load on demand uno::Any aAny; |