summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-10 10:38:20 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-10 10:55:21 +0100
commitadc68965d585b67ade2373d188e17de96c119770 (patch)
tree91ebc38816e59d66c2832765fda2ab5e024cb52b /sw
parent445299be76934c6c593793aae2d7630f8a42562b (diff)
i#23357 RTF export: fix crash on groupshapes
Change-Id: I3329663060aeb06ac552bd5d1615d19efe160091
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/i23357.odtbin0 -> 25252 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx5
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx11
3 files changed, 15 insertions, 1 deletions
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
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/i23357.odt
Binary files 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<drawing::XShape> xShape = GetXShapeForSdrObject(const_cast<SdrObject*>(m_pSdrObject));
uno::Reference<beans::XPropertySet> 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();