diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-09-09 18:52:49 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-09-10 12:44:58 +0200 |
commit | a0d28d03ff40a77a2c88704a7b2bedb68e68563f (patch) | |
tree | 0345ed509de4a8424fe738a2069aceed8f2cd170 /xmloff/source/draw | |
parent | ef3329a520b11782c441ee6c2805bed622047407 (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>
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 455ca3b4e024..8c7ba1727a84 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1024,6 +1024,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) { |