diff options
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/source/svgreader/svgimagenode.cxx | 54 |
1 files changed, 21 insertions, 33 deletions
diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 39994a8fcaec..e575502394dd 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -234,45 +234,33 @@ namespace svgio else if(!maUrl.isEmpty()) { const OUString& rPath = getDocument().getAbsolutePath(); + OUString aAbsUrl; + try { + aAbsUrl = rtl::Uri::convertRelToAbs(rPath, maUrl); + } catch (rtl::MalformedUriException & e) { + // Happens for the odd rPath = + // "vnd.sun.star.Package:Pictures/..." scheme using + // path components not starting with a slash by mis- + // design: + SAL_INFO( + "svg", + "caught rtl::MalformedUriException \"" + << e.getMessage() << "\""); + } - if (!rPath.isEmpty()) + if (!aAbsUrl.isEmpty()) { - OUString aAbsUrl; - try { - aAbsUrl = rtl::Uri::convertRelToAbs( - rPath, maUrl); - } catch (rtl::MalformedUriException & e) { - // Happens for the odd rPath = - // "vnd.sun.star.Package:Pictures/..." scheme - // using path components not starting with a - // slash by mis-design: - SAL_INFO( - "svg", - "caught rtl::MalformedUriException \"" - << e.getMessage() << "\""); - } + SvFileStream aStream(aAbsUrl, STREAM_STD_READ); + Graphic aGraphic; - if (!aAbsUrl.isEmpty()) + if(GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic( + aGraphic, + aAbsUrl, + aStream)) { - SvFileStream aStream(aAbsUrl, STREAM_STD_READ); - Graphic aGraphic; - - if(GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic( - aGraphic, - aAbsUrl, - aStream)) - { - extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmapEx); - } + 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()) { |