summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-07 12:30:37 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-07 17:26:35 +0100
commitb36a8a532b3ee6521d80277cb32a6936c0b09320 (patch)
tree76450d6a51b92b7eba65ac65f121cfa0292431bf
parent0b504bb12e4d563d1505e9c2039cbbd723cf1162 (diff)
busy loop seen on ods export attempt
ScXMLExport::ExportFormatRanges cannot advance because nMaxCols is 0 so busy loop and no progression In ScRowFormatRanges::GetMaxRows, aRowFormatRanges is empty which is why nMaxCols is 0 In ScFormatRangeStyles::GetFormatRanges aTables appears to be 30 empty items. But why it is empty can't be seen from the bt. Force this to be an assert to ensure crashtesting can flush out this case, rather than letting it get killed off as a timeout. Set this case as an error and break so failure results in an error message of failure to save instead of a hang. Change-Id: I827e1e638cddd976a48340f86741c21075afe856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160363 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index e1d1b7bc0f79..59274bd45a5b 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1566,7 +1566,13 @@ void ScXMLExport::ExportFormatRanges(const sal_Int32 nStartCol, const sal_Int32
pRowFormatRanges->Clear();
pCellStyles->GetFormatRanges(0, pSharedData->GetLastColumn(nSheet), nStartRow + nRows, nSheet, pRowFormatRanges.get());
sal_Int32 nMaxRows = pRowFormatRanges->GetMaxRows();
- OSL_ENSURE(nMaxRows, "something went wrong");
+ assert(nMaxRows && "ScXMLExport::ExportFormatRanges cannot make progress with zero rows, something went wrong");
+ if (!nMaxRows)
+ {
+ uno::Sequence<OUString> aEmptySeq;
+ SetError(XMLERROR_CANCEL|XMLERROR_FLAG_SEVERE, aEmptySeq);
+ break;
+ }
if (nMaxRows >= nTotalRows - nRows)
{
OpenRow(nSheet, nStartRow + nRows, nTotalRows - nRows, aRowAttr);