summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2011-03-10 18:09:01 +0100
committerNiklas Nebel <nn@openoffice.org>2011-03-10 18:09:01 +0100
commit4a1cf1e979464240953beb9550b4c46e591f92ba (patch)
tree3411546086265f753245a07a685c63d926bf77a0 /sc
parentde8ad25e0efc05f6ebc083349fc53f99563de6bd (diff)
calc66: #i117315# round-down single row height values in GetScaledRowHeight
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table2.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 10eb5512afea..83c5412d08c3 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2488,8 +2488,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;
}