svgio/source/svgreader/svgimagenode.cxx | 54 ++++++++++++-------------------- 1 file changed, 21 insertions(+), 33 deletions(-)
New commits: commit 33ca98314133a93e71edb1a003fe8ddb7b36e8a9 Author: Stephan Bergmann <[email protected]> Date: Fri Feb 28 18:03:04 2014 +0100 Catching MalformedUriException subsumes the rPath.isEmpty() case now ...so that is no longer necessary, and checking for rPath.isEmpty() first also mis-handled the case where rPath was empty but maUrl was already absolute. Change-Id: Ieae800dd6c52f0cc308944ca0035ea4140d3a324 diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 39994a8..e575502 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()) { _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
