[Libreoffice-commits] core.git: writerfilter/source

Caolán McNamara caolanm at redhat.com
Mon Sep 22 09:32:47 PDT 2014


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit cfbcce701cd6dc3af6086428399136efef33ff59
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 22 13:56:05 2014 +0100

    Related: fdo#37691 \shptxt ... \jpegblip
    
    text shape with jpeg data, should we throw away
    the text shape here or keep it ?
    
    Change-Id: I9e4463b5863bf68cdcd18ea5d1f6c831a0de8ec9

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2fdbccd..78c2d71 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -808,9 +808,14 @@ int RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XSh
     if (xShape.is())
     {
         uno::Reference<lang::XServiceInfo> xSI(xShape, uno::UNO_QUERY_THROW);
-        assert(xSI->supportsService("com.sun.star.drawing.GraphicObjectShape"));
+        if (!xSI->supportsService("com.sun.star.drawing.GraphicObjectShape"))
+        {
+            //fdo37691-1.rtf
+            SAL_WARN("writerfilter.rtf", "cannot set graphic on existing shape, creating a new GraphicObjectShape");
+            xShape.set(NULL);
+        }
     }
-    else
+    if (!xShape.is())
     {
         if (m_xModelFactory.is())
             xShape.set(m_xModelFactory->createInstance("com.sun.star.drawing.GraphicObjectShape"), uno::UNO_QUERY);


More information about the Libreoffice-commits mailing list