summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-02-10 14:33:51 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-02-10 15:59:44 +0000
commit2d732b498bab244cde6978e9389511a940101995 (patch)
tree2621d1df892fc91264693aca709a89bfb7edb7f1
parent0939e079abe3cea70c951fbe1859c39e11cfca29 (diff)
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@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index 90d481869502..ab0d4746d5bf 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;
}