tdf#138466 Crash when creating different scenarios
apparently this is a regression from
commit 4176beb7ef831152ce92ac3fa31314438635ec2c
Author: Noel Grandin <noelgrandin@gmail.com>
Date: Sat Sep 12 18:21:44 2020 +0200
tdf#133327 fix calc loading background color with many cols
but I have no idea how or why, so just fix the crash.
Change-Id: Ia2f056fc53527338c431d3b34bb64e6eedc8e955
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106799
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index da8f7ce..dcaddbc 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -868,8 +868,9 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, const ScRange& aColumnHe
nColsRepeated = 1;
}
}
assert(nPrevIndex >= 0 && "coverity#1438402");
WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
// tdf#138466
if (nPrevIndex != -1)
WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
if (!bIsClosed)
CloseHeaderColumn();
if (pGroupColumns->IsGroupEnd(nColumn - 1))