sc/source/core/data/table2.cxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
New commits: commit d5036b0e2bc50c991858e85760a8580cdf08629e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Nov 18 15:35:18 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Nov 19 06:42:15 2019 +0100 crashtesting fdo78617-2.ods as a consequence of commit feec8e3c34e08b621098a17f1011dccd0b4f7f4c Date: Tue Nov 12 16:00:55 2019 +0200 reduce iteration in ScViewData::GetScrPos Change-Id: Iec539c33bd80b9ad2d2a3698d443c5cec81f8f85 Reviewed-on: https://gerrit.libreoffice.org/83093 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit 00e1adec49c50f9128dd02ae721e62ae3e729ad6) Reviewed-on: https://gerrit.libreoffice.org/83120 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index e86f3d215778..c80d08602b15 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3178,17 +3178,20 @@ sal_uLong ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fS // round-down a single height value, multiply resulting (pixel) values const sal_uLong nOneHeight = static_cast<sal_uLong>( aData.mnValue * fScale ); - SCROW nRowsInSegment = nSegmentEnd + 1 - nRow; - if (pnMaxHeight) + // sometimes scaling results in zero height + if (nOneHeight) { - nRowsInSegment = std::min(nRowsInSegment, static_cast<SCROW>(*pnMaxHeight / nOneHeight + 1)); - nHeight += nOneHeight * nRowsInSegment; - if (nHeight > *pnMaxHeight) - return nHeight; + SCROW nRowsInSegment = nSegmentEnd + 1 - nRow; + if (pnMaxHeight) + { + nRowsInSegment = std::min(nRowsInSegment, static_cast<SCROW>(*pnMaxHeight / nOneHeight + 1)); + nHeight += nOneHeight * nRowsInSegment; + if (nHeight > *pnMaxHeight) + return nHeight; + } + else + nHeight += nOneHeight * nRowsInSegment; } - else - nHeight += nOneHeight * nRowsInSegment; - nRow = nSegmentEnd + 1; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits