diff options
-rw-r--r-- | filter/qa/unit/data/shape-nographic.odp | bin | 0 -> 14769 bytes | |||
-rw-r--r-- | filter/qa/unit/svg.cxx | 19 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 3 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 5 |
4 files changed, 25 insertions, 2 deletions
diff --git a/filter/qa/unit/data/shape-nographic.odp b/filter/qa/unit/data/shape-nographic.odp Binary files differnew file mode 100644 index 000000000000..43186d614986 --- /dev/null +++ b/filter/qa/unit/data/shape-nographic.odp diff --git a/filter/qa/unit/svg.cxx b/filter/qa/unit/svg.cxx index 5dcb1af0eb90..792964cb00d9 100644 --- a/filter/qa/unit/svg.cxx +++ b/filter/qa/unit/svg.cxx @@ -160,6 +160,25 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testSemiTransparentText) assertXPath(pXmlDoc, "//svg:text[2]/svg:tspan/svg:tspan/svg:tspan[@fill-opacity]", 0); } +CPPUNIT_TEST_FIXTURE(SvgFilterTest, testShapeNographic) +{ + // Load a document containing a 3D shape. + load("shape-nographic.odp"); + + // Export to SVG. + uno::Reference<frame::XStorable> xStorable(getComponent(), uno::UNO_QUERY_THROW); + SvMemoryStream aStream; + uno::Reference<io::XOutputStream> xOut = new utl::OOutputStreamWrapper(aStream); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("impress_svg_Export"); + aMediaDescriptor["OutputStream"] <<= xOut; + + // Without the accompanying fix in place, this test would have failed with: + // An uncaught exception of type com.sun.star.io.IOException + // - SfxBaseModel::impl_store <private:stream> failed: 0xc10(Error Area:Io Class:Write Code:16) + xStorable->storeToURL("private:stream", aMediaDescriptor.getAsConstPropertyValueList()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 615c60004c2b..dea16cf90d1f 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -59,6 +59,7 @@ #include <svx/svdograf.hxx> #include <svx/svdmodel.hxx> #include <svx/svdxcgv.hxx> +#include <sal/log.hxx> #include <memory> @@ -608,7 +609,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 ba6bdfd534cd..4a35b01e9dfd 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2758,7 +2758,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); } } |