Kaydet (Commit) 33ca9831 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst d12324d1
......@@ -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())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment