[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - 3 commits - oox/source
Andras Timar
andras.timar at collabora.com
Fri Feb 10 20:28:05 UTC 2017
oox/source/drawingml/graphicshapecontext.cxx | 12 ++++++++++++
oox/source/ppt/extdrawingfragmenthandler.cxx | 5 ++++-
oox/source/ppt/pptimport.cxx | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
New commits:
commit ec4cba01b5f6045187ae6bd55f8cf58ef1af7b9c
Author: Andras Timar <andras.timar at collabora.com>
Date: Fri Feb 10 21:27:26 2017 +0100
Related: tdf#105707 PPTX import: decode document name from URL
Change-Id: I7448c48b9376a4b73b8a35034a73353981174823
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index df84f79..a7c3aff 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -102,7 +102,7 @@ bool PowerPointImport::importDocument()
{
// Construct a warning message.
INetURLObject aURL(getFileUrl());
- SfxErrorContext aContext(ERRCTX_SFX_OPENDOC, aURL.getName(INetURLObject::LAST_SEGMENT), nullptr, RID_ERRCTX);
+ SfxErrorContext aContext(ERRCTX_SFX_OPENDOC, aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET), nullptr, RID_ERRCTX);
OUString aWarning;
aContext.GetString(ERRCODE_WARNING_MASK, aWarning);
aWarning += ":\n";
commit 62869582258a28c471277f3eaa93efec6becfaca
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Feb 10 16:41:55 2017 +0100
Related: tdf#105707 PPTX import: warn on empty SmartArt fallback
This second related situation is about when there is drawingML fallback
for the SmartArt, but it's ampty shape tree, which is never created with
MSO2010+ (those shape trees always have at least one element). This is
as bad as the missing drawingML fallback, so warn on it.
Change-Id: I539d05154a4d1fcd5871dfc29616f77eb9945454
diff --git a/oox/source/ppt/extdrawingfragmenthandler.cxx b/oox/source/ppt/extdrawingfragmenthandler.cxx
index d7a77ac..38a9361 100644
--- a/oox/source/ppt/extdrawingfragmenthandler.cxx
+++ b/oox/source/ppt/extdrawingfragmenthandler.cxx
@@ -9,6 +9,7 @@
#include "extdrawingfragmenthandler.hxx"
+#include <oox/core/xmlfilterbase.hxx>
using namespace ::oox::core;
using namespace ::com::sun::star::xml::sax;
using namespace ::com::sun::star::uno;
@@ -34,7 +35,9 @@ ExtDrawingFragmentHandler::ExtDrawingFragmentHandler( XmlFilterBase& rFilter,
ExtDrawingFragmentHandler::~ExtDrawingFragmentHandler( ) throw ()
{
-
+ // Empty DrawingML fallback, need to warn the user at the end.
+ if (mpShapePtr && mpShapePtr->getChildren().empty())
+ getFilter().setMissingExtDrawing();
}
ContextHandlerRef
commit 65844c64aa4057805a11aa28d4cbb4637e1b6c53
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
diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx
index a1b6419..99029c3 100644
--- a/oox/source/drawingml/graphicshapecontext.cxx
+++ b/oox/source/drawingml/graphicshapecontext.cxx
@@ -273,6 +273,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