writerfilter/source/dmapper/DomainMapperTableManager.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit b69a37e567a6a0b6c24a4438a0da906497c750f0 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Sep 9 12:22:55 2022 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Sep 9 15:49:20 2022 +0200 writerfilter: avoid divide by zero in DomainMapperTableManager::endOfRowAction() See https://crashreport.libreoffice.org/stats/signature/writerfilter::dmapper::DomainMapperTableManager::endOfRowAction() Probably since 116cadb5d2582532c69677a2f8499e8e9b7b9b80 "tdf#59274 DOCX import: fix tables with incomplete grid" Change-Id: I12f2842107885fbbc62be2186511102f642e3efc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139657 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 2d86919deca3..bc8b59642714 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -797,9 +797,6 @@ void DomainMapperTableManager::endOfRowAction() size_t nWidthsBound = pCellWidths->size() - 1; if (nWidthsBound) { - if (nFullWidthRelative == 0) - throw o3tl::divide_by_zero(); - // At incomplete table grids, last cell width can be smaller, than its final width. // Correct it based on the last but one column width and their span values. if ( bIsIncompleteGrid && rCurrentSpans.size()-1 == nWidthsBound ) @@ -810,6 +807,9 @@ void DomainMapperTableManager::endOfRowAction() nFullWidthRelative += nFixLastCellWidth - (*pCellWidths)[nWidthsBound]; } + if (nFullWidthRelative == 0) + throw o3tl::divide_by_zero(); + for (size_t i = 0; i < nWidthsBound; ++i) { nSum += (*pCellWidths)[i];