diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-28 17:43:23 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-28 17:49:57 +0100 |
commit | 29c3bb0968cb9770f7b822f5cf466314be9db825 (patch) | |
tree | da2220f78fb6470537b0e9ef5230240f134455ba /svgio | |
parent | e53eacb13369e713c20153ea84caae6d8505f239 (diff) |
Handle vnd.sun.star.Package: URLs provoking MalrformedUriException
...as e.g. happens when loading an .odt containing a Pcitures/XXX.svg stream
which in turn contains an <image xlink:href="logo.gif"/> with relative URL, e.g.
when loading the .odt generated by the instructions in fdo#75582.
Change-Id: I0d275662259bba8d582e2bd4671f0f6667060132
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/source/svgreader/svgimagenode.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index 9ee155b5be54..9cdb59afe9ba 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -237,7 +237,20 @@ namespace svgio if (!rPath.isEmpty()) { - const OUString aAbsUrl(rtl::Uri::convertRelToAbs(rPath, maUrl)); + OUString aAbsUrl; + try { + aAbsUrl = rtl::Uri::convertRelToAbs( + rPath, maUrl); + } catch (rtl::MalformedUriException & e) { + // Happens for the odd maUrl = + // "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 (!aAbsUrl.isEmpty()) { |