/[packages]/cauldron/libreoffice/current/SOURCES/0001-Resolves-i125289-do-apply-possible-changed-GraphicSt.patch
ViewVC logotype

Contents of /cauldron/libreoffice/current/SOURCES/0001-Resolves-i125289-do-apply-possible-changed-GraphicSt.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 658481 - (show annotations) (download)
Thu Jul 31 10:18:47 2014 UTC (6 years ago) by tv
File size: 3642 byte(s)
SILENT: new file ./SOURCES/0001-Resolves-i125289-do-apply-possible-changed-GraphicSt.patch
1 From e67d8d221326e1c753457d4283e2cff16b8b5f52 Mon Sep 17 00:00:00 2001
2 From: Oliver-Rainer Wittmann <orw@apache.org>
3 Date: Wed, 23 Jul 2014 08:53:15 +0000
4 Subject: [PATCH] Resolves: #i125289# do apply possible changed
5 <GraphicStreamURL>...
6
7 only for embedded images which already have its stream inside the package
8
9 fixes also issue 125290
10
11 (cherry picked from commit 9602a121b458e7456fc533dad86f434f846a72ba)
12
13 Conflicts:
14 xmloff/source/draw/shapeexport2.cxx
15
16 Change-Id: I5af0093b20f2f291d3a94c690bfbdb59a59320c3
17 (cherry picked from commit fd641c7b23ce4205c29fc0c564b73336cb2cfb07)
18 Reviewed-on: https://gerrit.libreoffice.org/10487
19 Reviewed-by: David Tardon <dtardon@redhat.com>
20 Tested-by: David Tardon <dtardon@redhat.com>
21 ---
22 xmloff/source/draw/shapeexport.cxx | 32 +++++++++++++++++++-------------
23 1 file changed, 19 insertions(+), 13 deletions(-)
24
25 diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
26 index c4bb166..ec8adfa 100644
27 --- a/xmloff/source/draw/shapeexport.cxx
28 +++ b/xmloff/source/draw/shapeexport.cxx
29 @@ -2256,9 +2256,12 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
30 OUString aResolveURL( sImageURL );
31 const OUString sPackageURL( "vnd.sun.star.Package:" );
32
33 - // trying to preserve the filename
34 + // trying to preserve the filename for embedded images which already have its stream inside the package
35 + bool bIsEmbeddedImageWithExistingStreamInPackage = false;
36 if ( aStreamURL.match( sPackageURL, 0 ) )
37 {
38 + bIsEmbeddedImageWithExistingStreamInPackage = true;
39 +
40 OUString sRequestedName( aStreamURL.copy( sPackageURL.getLength(), aStreamURL.getLength() - sPackageURL.getLength() ) );
41 sal_Int32 nLastIndex = sRequestedName.lastIndexOf( '/' ) + 1;
42 if ( ( nLastIndex > 0 ) && ( nLastIndex < sRequestedName.getLength() ) )
43 @@ -2278,20 +2281,23 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
44
45 if( !aStr.isEmpty() )
46 {
47 - aStreamURL = sPackageURL;
48 - if( aStr[ 0 ] == '#' )
49 - {
50 - aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) );
51 - }
52 - else
53 + // apply possible changed stream URL to embedded image object
54 + if ( bIsEmbeddedImageWithExistingStreamInPackage )
55 {
56 - aStreamURL = aStreamURL.concat( aStr );
57 - }
58 + aStreamURL = sPackageURL;
59 + if ( aStr[0] == '#' )
60 + {
61 + aStreamURL = aStreamURL.concat( aStr.copy( 1, aStr.getLength() - 1 ) );
62 + }
63 + else
64 + {
65 + aStreamURL = aStreamURL.concat( aStr );
66 + }
67
68 - // update stream URL for load on demand
69 - uno::Any aAny;
70 - aAny <<= aStreamURL;
71 - xPropSet->setPropertyValue("GraphicStreamURL", aAny );
72 + uno::Any aAny;
73 + aAny <<= aStreamURL;
74 + xPropSet->setPropertyValue( OUString("GraphicStreamURL"), aAny );
75 + }
76
77 mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
78 mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED );
79 --
80 1.9.3
81

  ViewVC Help
Powered by ViewVC 1.1.28