sw/qa/extras/rtfexport/data/i23357.odt |binary
 sw/qa/extras/rtfexport/rtfexport.cxx   |    5 +++++
 sw/source/filter/ww8/rtfsdrexport.cxx  |   11 ++++++++++-
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit adc68965d585b67ade2373d188e17de96c119770
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Tue Dec 10 10:38:20 2013 +0100

    i#23357 RTF export: fix crash on groupshapes
    
    Change-Id: I3329663060aeb06ac552bd5d1615d19efe160091

diff --git a/sw/qa/extras/rtfexport/data/i23357.odt 
b/sw/qa/extras/rtfexport/data/i23357.odt
new file mode 100644
index 0000000..79705fc
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 f04e315..6a483b7 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 a1bb872..5496639 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();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to