summaryrefslogtreecommitdiff
path: root/filter/source/svg
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-09-07 17:00:44 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-09-08 10:18:39 +0200
commitac4030a0ca1aecd15d068b67780b81671c5a9aca (patch)
tree19f39043546877d98dc0e15d9ea46e4a025dbb20 /filter/source/svg
parent5504f14e95bfb57c3d2d4bd47010f0ec433631b7 (diff)
SVG export: fix failure on trying to read graphic of a 3D shape
Regression from commit 8fc1b60f62c213a0476f3acc9f89cd5eccbf335d (sw SVG export: try to reuse original bitmap data for JPG and PNG bitmaps, 2020-02-27), which generalized the code that tries to get the original bitmap of shapes for performance reasons. Originally this worked with SdrGrafObj, but now we try every XShape which has a Graphic property. Add the missing check, so shapes without a graphic property just miss the fast path, but doesn't fail the entire SVG export. (cherry picked from commit fbcdbfef8664430e15b9429187b58dede992accf) Conflicts: filter/qa/unit/svg.cxx filter/source/svg/svgexport.cxx Change-Id: I6b20083110f3269337b9df6a23bd193cc6f7d13b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102219 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'filter/source/svg')
-rw-r--r--filter/source/svg/svgexport.cxx3
-rw-r--r--filter/source/svg/svgwriter.cxx5
2 files changed, 6 insertions, 2 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index ab1ee9ce647b..50083f7b1f8d 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -58,6 +58,7 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/animationexport.hxx>
#include <svx/svdograf.hxx>
+#include <sal/log.hxx>
#include <memory>
@@ -604,7 +605,7 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< XOutputStream >& rxOSt
{
delete mpSVGDoc;
mpSVGDoc = nullptr;
- OSL_FAIL( "Exception caught" );
+ SAL_WARN("filter.svg", "Exception caught");
}
if( nullptr != pSdrModel )
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 6f4c25c6f0f0..7bc652e58a42 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -2691,7 +2691,10 @@ void GetGraphicFromXShape(const css::uno::Reference<css::drawing::XShape>* pShap
}
uno::Reference<graphic::XGraphic> xGraphic;
- xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
+ if (xPropertySet->getPropertySetInfo()->hasPropertyByName("Graphic"))
+ {
+ xPropertySet->getPropertyValue("Graphic") >>= xGraphic;
+ }
rGraphic= Graphic(xGraphic);
}
}