diff options
author | Niklas Nebel <nn@openoffice.org> | 2011-03-10 18:09:01 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-12-04 07:17:08 +0000 |
commit | ff132d6764e0013b01d729ed0b9d65f09aa80247 (patch) | |
tree | 3e8aafb1555cdde925d853c0fa9642a6a6af3c15 /sc | |
parent | 0585057592662d399179ef039edeed93e73f3642 (diff) |
calc66: #i117315# round-down single row height values in GetScaledRowHeight
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/table2.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 1137eff4401b..4f18036a9b51 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -2731,8 +2731,22 @@ sal_uLong ScTable::GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, double fS { if (nLastRow > nEndRow) nLastRow = nEndRow; - sal_uInt32 nThisHeight = mpRowHeights->getSumValue(nRow, nLastRow); - nHeight += static_cast<sal_uLong>(nThisHeight * fScale); + + // #i117315# can't use getSumValue, because individual values must be rounded + while (nRow <= nLastRow) + { + ScFlatUInt16RowSegments::RangeData aData; + if (!mpRowHeights->getRangeData(nRow, aData)) + return nHeight; // shouldn't happen + + SCROW nSegmentEnd = std::min( nLastRow, aData.mnRow2 ); + + // round-down a single height value, multiply resulting (pixel) values + sal_uLong nOneHeight = static_cast<sal_uLong>( aData.mnValue * fScale ); + nHeight += nOneHeight * ( nSegmentEnd + 1 - nRow ); + + nRow = nSegmentEnd + 1; + } } nRow = nLastRow + 1; } |