diff --git a/sw/qa/extras/rtfexport/data/i23357.odt b/sw/qa/extras/rtfexport/data/i23357.odt new file mode 100644 index 000000000000..79705fc35c1b Binary files /dev/null and b/sw/qa/extras/rtfexport/data/i23357.odt differ diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index f04e315cc49b..6a483b7032f6 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -584,6 +584,11 @@ DECLARE_RTFEXPORT_TEST(testAbi10201, "abi10201.rtf") // crashtest } +DECLARE_RTFEXPORT_TEST(testI23357, "i23357.odt") +{ + // crashtest +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index a1bb87285f0c..5496639233e8 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -440,7 +440,16 @@ void RtfSdrExport::impl_writeGraphic() uno::Reference xShape = GetXShapeForSdrObject(const_cast(m_pSdrObject)); uno::Reference xPropertySet(xShape, uno::UNO_QUERY); OUString sGraphicURL; - xPropertySet->getPropertyValue("GraphicURL") >>= sGraphicURL; + try + { + xPropertySet->getPropertyValue("GraphicURL") >>= sGraphicURL; + } + catch (beans::UnknownPropertyException& rException) + { + // ATM groupshapes are not supported, just make sure we don't crash on them. + SAL_WARN("sw.rtf", "failed. Message: " << rException.Message); + return; + } OString aURLBS(OUStringToOString(sGraphicURL, RTL_TEXTENCODING_UTF8)); const char aURLBegin[] = "vnd.sun.star.GraphicObject:"; Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic();