From 87432aeecdfa7194bb5050f912656e03294cf6c7 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Fri, 17 Jan 2014 01:37:00 +0000 Subject: Resolves: #i123042# corrected reload of linked content... to have access to its own path (cherry picked from commit bc89d402b3df00c2402ac86896eb2ce4c3f7b7d0) Conflicts: sfx2/source/appl/fileobj.cxx svgio/source/svgreader/svgimagenode.cxx svx/source/svdraw/svdograf.cxx Change-Id: I4f3e98588f17b4271465359a7f56f9845029e012 --- svgio/source/svgreader/svgimagenode.cxx | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'svgio/source') diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 533d1beea3f1..0219a0efb811 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -234,21 +234,32 @@ namespace svgio else if(!maUrl.isEmpty()) { const OUString& rPath = getDocument().getAbsolutePath(); - const OUString aAbsUrl(rtl::Uri::convertRelToAbs(rPath, maUrl)); - if(!aAbsUrl.isEmpty()) + if (!rPath.isEmpty()) { - SvFileStream aStream(aAbsUrl, STREAM_STD_READ); - Graphic aGraphic; + const OUString aAbsUrl(rtl::Uri::convertRelToAbs(rPath, maUrl)); - if(GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic( - aGraphic, - aAbsUrl, - aStream)) + if (!aAbsUrl.isEmpty()) { - extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmapEx); + SvFileStream aStream(aAbsUrl, STREAM_STD_READ); + Graphic aGraphic; + + if(GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic( + aGraphic, + aAbsUrl, + aStream)) + { + extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmapEx); + } } } + else + { + // #i123042# detect missing path and assert - content will be missing. The + // absolute path to itself needs to be set to correctly import linked + // content in a SVG file + OSL_ENSURE(false, "SVG graphic with internal links is interpreted, but local AbsolutePath is not set: linked content will be missing (!)"); + } } else if(!maXLink.isEmpty()) { -- cgit