[Libreoffice-commits] core.git: 2 commits - sal/rtl svgio/source
Stephan Bergmann
sbergman at redhat.com
Fri Feb 28 08:50:25 PST 2014
sal/rtl/uri.cxx | 21 ++++++++++++---------
svgio/source/svgreader/svgimagenode.cxx | 15 ++++++++++++++-
2 files changed, 26 insertions(+), 10 deletions(-)
New commits:
commit 51f73a9be8270487885d185eaa3dda13ec43d9b0
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Feb 28 17:49:40 2014 +0100
Simplify string construction
Change-Id: Ib46a64d8438dcaba37a234460d1a4113707e8c43
diff --git a/sal/rtl/uri.cxx b/sal/rtl/uri.cxx
index 513fb51..774c5f7 100644
--- a/sal/rtl/uri.cxx
+++ b/sal/rtl/uri.cxx
@@ -708,20 +708,23 @@ sal_Bool SAL_CALL rtl_uriConvertRelToAbs(rtl_uString * pBaseUriRef,
parseUriRef(pBaseUriRef, &aBaseComponents);
if (!aBaseComponents.aScheme.isPresent())
{
- rtl::OUString aMessage(pBaseUriRef);
- aMessage += rtl::OUString(
- " does not start with a scheme component");
- rtl_uString_assign(pException,
- const_cast< rtl::OUString & >(aMessage).pData);
+ rtl_uString_assign(
+ pException,
+ (rtl::OUString(
+ "<" + rtl::OUString(pBaseUriRef)
+ + "> does not start with a scheme component")
+ .pData));
return false;
}
if (aBaseComponents.aPath.pBegin != aBaseComponents.aPath.pEnd
&& *aBaseComponents.aPath.pBegin != '/')
{
- rtl::OUString aMessage(pBaseUriRef);
- aMessage += rtl::OUString(
- "path component does not start with slash");
- rtl_uString_assign(pException, aMessage.pData);
+ rtl_uString_assign(
+ pException,
+ (rtl::OUString(
+ "<" + rtl::OUString(pBaseUriRef)
+ + "> path component does not start with a slash")
+ .pData));
return false;
}
commit 29c3bb0968cb9770f7b822f5cf466314be9db825
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Feb 28 17:43:23 2014 +0100
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
diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx
index 9ee155b..9cdb59a 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())
{
More information about the Libreoffice-commits
mailing list