diff options
author | Armin Le Grand <alg@apache.org> | 2014-01-17 01:37:00 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2014-01-17 01:37:00 +0000 |
commit | bc89d402b3df00c2402ac86896eb2ce4c3f7b7d0 (patch) | |
tree | 07d42d3f6d7f522a9a4e131e665f61b72b36283a /svgio | |
parent | 91eb528b63cdee73afc2dc4a48d5dca1b96dedd5 (diff) |
i123042 corrected reload of linked content to have access to it's own path
Notes
Notes:
merged as: 87432aeecdfa7194bb5050f912656e03294cf6c7
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/source/svgreader/svgimagenode.cxx | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 5851896c49db..a4646e7ccd42 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -241,21 +241,32 @@ namespace svgio else if(maUrl.getLength()) { const rtl::OUString& rPath = getDocument().getAbsolutePath(); - const rtl::OUString aAbsUrl(rtl::Uri::convertRelToAbs(rPath, maUrl)); - if(aAbsUrl.getLength()) + if(rPath.getLength()) { - SvFileStream aStream(aAbsUrl, STREAM_STD_READ); - Graphic aGraphic; + const rtl::OUString aAbsUrl(rtl::Uri::convertRelToAbs(rPath, maUrl)); - if(GRFILTER_OK == GraphicFilter::GetGraphicFilter()->ImportGraphic( - aGraphic, - aAbsUrl, - aStream)) + if(aAbsUrl.getLength()) { - 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 + { + // #123042# 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.getLength()) { |