summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2014-07-23 08:53:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-07-23 11:26:34 +0100
commitfd641c7b23ce4205c29fc0c564b73336cb2cfb07 (patch)
treeabf7d5ba6252da92cc38e7095dec5f7d228d83fa /xmloff/source
parent23e818d4f5cb6dff4c2238fa42a38496a9a85255 (diff)
Resolves: #i125289# do apply possible changed <GraphicStreamURL>...
only for embedded images which already have its stream inside the package fixes also issue 125290 (cherry picked from commit 9602a121b458e7456fc533dad86f434f846a72ba) Conflicts: xmloff/source/draw/shapeexport2.cxx Change-Id: I5af0093b20f2f291d3a94c690bfbdb59a59320c3
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/draw/shapeexport.cxx32
1 files changed, 19 insertions, 13 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 7f33e5828a88..ba8ce166f4a7 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2256,9 +2256,12 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
OUString aResolveURL( sImageURL );
const OUString sPackageURL( "vnd.sun.star.Package:" );
- // trying to preserve the filename
+ // trying to preserve the filename for embedded images which already have its stream inside the package
+ bool bIsEmbeddedImageWithExistingStreamInPackage = false;
if ( aStreamURL.match( sPackageURL, 0 ) )
{
+ bIsEmbeddedImageWithExistingStreamInPackage = true;
+
OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) );
sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 1;
if ( ( nLastIndex > 0 ) && ( nLastIndex < sRequestedName.getLength() ) )
@@ -2278,20 +2281,23 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
if( !aStr.isEmpty() )
{
- aStreamURL = sPackageURL;
- if( aStr[ 0 ] == '#' )
- {
- aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) );
- }
- else
+ // apply possible changed stream URL to embedded image object
+ if ( bIsEmbeddedImageWithExistingStreamInPackage )
{
- aStreamURL = aStreamURL.concat( aStr );
- }
+ aStreamURL = sPackageURL;
+ if ( aStr[0] == '#' )
+ {
+ aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) );
+ }
+ else
+ {
+ aStreamURL = aStreamURL.concat( aStr );
+ }
- // update stream URL for load on demand
- uno::Any aAny;
- aAny <<= aStreamURL;
- xPropSet->setPropertyValue("GraphicStreamURL", aAny );
+ uno::Any aAny;
+ aAny <<= aStreamURL;
+ xPropSet->setPropertyValue( OUString("GraphicStreamURL"), aAny );
+ }
mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );