sc/source/filter/xml/xmlexprt.cxx | 3 --- 1 file changed, 3 deletions(-)
New commits: commit dbd2bfcc0ebc7815a5d8549366ace8f928ebe1d2 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Jun 11 10:03:25 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Jun 11 08:33:34 2025 +0200 Drop obsolete asserts These were added in commit d21298e3b108b0dfdb1515248068314757cf4dd7 (coverity#1438401 assert nPrevIndex >= 0, 2018-08-18), and commit 3e97b8a74b20d72d36ac65d3ef091cae79b8cdac (coverity#1438402 Improper use of negative value, 2018-08-20); the description of the problem in Coverity issue was "The negative value may be unexpected by later operations, causing incorrect computations". The index returned from GetStyleNameIndex indeed can be negative; it is passed to OpenAndCloseRow or directly to OpenNewRow, and eventually to WriteRowStartTag, which was fixed to treat negative index in commit 7246759822aff30e4e4e1bca7949eae3b0d960ef (tdf#143940: the style index might be -1, 2021-08-27). Change-Id: Ia0d737d61e5cd31d964b77facd09b4fb79e34e4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186347 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index fcfe6283c286..4b3309d0525f 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1477,7 +1477,6 @@ void ScXMLExport::OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, con ++nEqualRows; else { - assert(nPrevIndex >= 0 && "coverity#1438402"); ScRowFormatRanges* pTempRowFormatRanges = new ScRowFormatRanges(pRowFormatRanges.get()); OpenAndCloseRow(nPrevIndex, nRow - nEqualRows, nEqualRows, bPrevHidden, bPrevFiltered); pRowFormatRanges.reset(pTempRowFormatRanges); @@ -1488,7 +1487,6 @@ void ScXMLExport::OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, con } } } - assert(nPrevIndex >= 0 && "coverity#1438402"); OpenNewRow(nPrevIndex, nRow - nEqualRows, nEqualRows, bPrevHidden, bPrevFiltered); } else @@ -1500,7 +1498,6 @@ void ScXMLExport::OpenRow(const sal_Int32 nTable, const sal_Int32 nStartRow, con sal_Int32 nEndRowFiltered; bHidden = rRowAttr.rowHidden(nTable, nStartRow, nEndRowHidden); bFiltered = rRowAttr.rowFiltered(nTable, nStartRow, nEndRowFiltered); - assert(nIndex >= 0 && "coverity#1438402"); OpenNewRow(nIndex, nStartRow, 1, bHidden, bFiltered); } nOpenRow = nStartRow + nRepeatRow - 1;