summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-09-09 18:52:49 +0200
committerCaolán McNamara <caolanm@redhat.com>2021-09-10 16:14:17 +0200
commit1ead58e823b86e254c80cade56d7e5e37b9fe160 (patch)
treea852e1841b4dd612907a64381bb84122aed32c9d
parentc3cdc29900574fefe4dc8b90e2941f2d3371d89c (diff)
xmloff: ODF export: avoid mysterious crash while sorting shapes
Apparently the draw page contains a null XShape. That sounds like a bug but OTOH this sorting feature from commit 9bc6160e0acbc78be998129ea55ed7e4529959faa isn't that important so let's sweep the problem under the rug. 0 swlo.dll sw::GetZOrderLayer::operator()(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const &) C:\cygwin64\home\buildslave\source\libo-core\sw\source\filter\xml\zorder.hxx:37 1 mergedlo.dll xmloff::FixZOrder(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const &,std::function<unsigned int > const &) C:\cygwin64\home\buildslave\source\libo-core\xmloff\source\draw\shapeexport.cxx:1003 2 swlo.dll SwXMLWriter::Write_(com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const &,rtl::OUString const &) C:\cygwin64\home\buildslave\source\libo-core\sw\source\filter\xml\wrtxml.cxx:190 https://crashreport.libreoffice.org/stats/crash_details/045adea4-c577-4164-9e69-bde5f892bd17 Change-Id: I1e67dc1c354cb14717cf9667314d6752e1b4c295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121860 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit a0d28d03ff40a77a2c88704a7b2bedb68e68563f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121878 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--xmloff/source/draw/shapeexport.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 5ed81e82a247..93a340fe3473 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1000,6 +1000,11 @@ void FixZOrder(uno::Reference<drawing::XShapes> const& xShapes,
for (sal_Int32 i = 0; i < nCount; ++i)
{
uno::Reference<beans::XPropertySet> const xShape(xShapes->getByIndex(i), uno::UNO_QUERY);
+ if (!xShape.is())
+ {
+ SAL_WARN("xmloff", "FixZOrder: null shape, cannot sort");
+ return;
+ }
unsigned int const nLayer(rGetLayer(xShape));
if (layers.size() <= nLayer)
{