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

Miklos Vajna vmiklos at collabora.co.uk
Fri Feb 10 16:00:10 UTC 2017


 oox/source/drawingml/graphicshapecontext.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 2d732b498bab244cde6978e9389511a940101995
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Feb 10 14:33:51 2017 +0100

    Related: tdf#105707 PPTX import: warn on invalid SmartArt fallback relid
    
    We already warn when the SmartArt doesn't have a drawingML fallback, but
    having a reference to a fallback that is not a valid one (so resolves to
    an empty fragment path) is also unusable. So warn in that case as well.
    
    Change-Id: I03b2325003b4eb38b1347a88899799c6d5c33606
    Reviewed-on: https://gerrit.libreoffice.org/34129
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index 90d4818..ab0d474 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -275,6 +275,18 @@ ContextHandlerRef DiagramGraphicDataContext::onCreateContext( ::sal_Int32 aEleme
         // No DrawingML fallback, need to warn the user at the end.
         if (mpShapePtr->getExtDrawings().empty())
             getFilter().setMissingExtDrawing();
+        else
+        {
+            for (const auto& rRelId : mpShapePtr->getExtDrawings())
+            {
+                // An invalid fallback reference is as bad as a missing one.
+                if (getFragmentPathFromRelId(rRelId).isEmpty())
+                {
+                    getFilter().setMissingExtDrawing();
+                    break;
+                }
+            }
+        }
 
         break;
     }


More information about the Libreoffice-commits mailing list