i#23357 RTF export: fix crash on groupshapes
Change-Id: I3329663060aeb06ac552bd5d1615d19efe160091
This commit is contained in:
BIN
sw/qa/extras/rtfexport/data/i23357.odt
Normal file
BIN
sw/qa/extras/rtfexport/data/i23357.odt
Normal file
Binary file not shown.
@@ -584,6 +584,11 @@ DECLARE_RTFEXPORT_TEST(testAbi10201, "abi10201.rtf")
|
|||||||
// crashtest
|
// crashtest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECLARE_RTFEXPORT_TEST(testI23357, "i23357.odt")
|
||||||
|
{
|
||||||
|
// crashtest
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
@@ -440,7 +440,16 @@ void RtfSdrExport::impl_writeGraphic()
|
|||||||
uno::Reference<drawing::XShape> xShape = GetXShapeForSdrObject(const_cast<SdrObject*>(m_pSdrObject));
|
uno::Reference<drawing::XShape> xShape = GetXShapeForSdrObject(const_cast<SdrObject*>(m_pSdrObject));
|
||||||
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
|
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
|
||||||
OUString sGraphicURL;
|
OUString sGraphicURL;
|
||||||
|
try
|
||||||
|
{
|
||||||
xPropertySet->getPropertyValue("GraphicURL") >>= sGraphicURL;
|
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));
|
OString aURLBS(OUStringToOString(sGraphicURL, RTL_TEXTENCODING_UTF8));
|
||||||
const char aURLBegin[] = "vnd.sun.star.GraphicObject:";
|
const char aURLBegin[] = "vnd.sun.star.GraphicObject:";
|
||||||
Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic();
|
Graphic aGraphic = GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin))).GetTransformedGraphic();
|
||||||
|
Reference in New Issue
Block a user