tdf#123971 don't clobber entire RowHeight range on updates
Use start index from current loop variable, not full range; otherwise we're always clobbering values from (possibly higher) upper rows. Change-Id: I3add7c2358710f4ae3927e7b0a1c1ff544965a03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88785 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
This commit is contained in:
Binary file not shown.
@@ -4323,11 +4323,16 @@ void ScFiltersTest::testAutoheight2Rows()
|
||||
|
||||
SCTAB nTab = 0;
|
||||
int nHeight1 = rDoc.GetRowHeight(0, nTab, false);
|
||||
int nHeight3 = rDoc.GetRowHeight(2, nTab, false);
|
||||
int nHeight2 = rDoc.GetRowHeight(1, nTab, false);
|
||||
int nHeight4 = rDoc.GetRowHeight(3, nTab, false);
|
||||
int nHeight5 = rDoc.GetRowHeight(4, nTab, false);
|
||||
|
||||
// We will do relative comparison, because calculated autoheight
|
||||
// can be different on different platforms
|
||||
CPPUNIT_ASSERT_MESSAGE("Row #3 should be thinner than #1", nHeight3 < nHeight1);
|
||||
CPPUNIT_ASSERT_MESSAGE("Row #1 and row #4 must have same height after load & auto-adjust",
|
||||
abs( nHeight1 - nHeight4 ) < 10 );
|
||||
CPPUNIT_ASSERT_MESSAGE("Row #2 and row #5 must have same height after load & auto-adjust",
|
||||
abs( nHeight2 - nHeight5 ) < 10 );
|
||||
|
||||
xDocSh->DoClose();
|
||||
}
|
||||
|
||||
@@ -110,7 +110,9 @@ void ScFlatSegmentsImpl<ValueType_, ExtValueType_>::setValueIf(SCCOLROW nPos1, S
|
||||
getRangeData(nCurrentStartRow, aRangeData);
|
||||
if (rPredicate(aRangeData.mnValue))
|
||||
{
|
||||
setValue(nPos1, std::min<SCCOLROW>(nPos2, aRangeData.mnPos2), nValue);
|
||||
// set value from current iteration point on, til end of range.
|
||||
// Note that aRangeData may well contain much lower values for nPos1
|
||||
setValue(nCurrentStartRow, std::min<SCCOLROW>(nPos2, aRangeData.mnPos2), nValue);
|
||||
}
|
||||
|
||||
// even if nPos2 is bigger than nPos2 this should terminate the loop
|
||||
|
||||
Reference in New Issue
Block a user