diff options
author | Justin Luth <justin.luth@collabora.com> | 2024-02-06 21:08:36 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2024-02-07 17:40:16 +0100 |
commit | 648c7c0f17125fd77d29be3c0611e1ab92f36b7f (patch) | |
tree | 494343730b1ee3957eac0ee42ad8b6b5bd45889c | |
parent | 41c9b2a81e9eb795aaecc8c52a8e7bce0a5a3c07 (diff) |
tdf#159581 sc: fix multi-sheet ScDocRowHeightUpdater
Apparently it was caching the first sheet's
row height, and applying it to every other sheet.
AFAICS, the only time this ever ran against multiple sheets
was during import time, so that is why it wasn't easily noticed
before 24.2 when XLSX started using it on import.
make CppunitTest_sc_subsequent_filters_test2 \
CPPUNIT_TEST_NAME=testTdf159581_optimalRowHeight
Change-Id: Ic4e4dd335fa48d02acbc85cfad35feb8eca7597b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163066
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r-- | sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsx | bin | 0 -> 7074 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters_test2.cxx | 11 | ||||
-rw-r--r-- | sc/source/core/data/dociter.cxx | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsx b/sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsx Binary files differnew file mode 100644 index 000000000000..8df77208045f --- /dev/null +++ b/sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsx diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index b0042d9878d6..7f6dae6df6ee 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -159,6 +159,17 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf123026_optimalRowHeight) CPPUNIT_ASSERT_GREATER(2000, nHeight); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testTdf159581_optimalRowHeight) +{ + createScDoc("xlsx/tdf159581_optimalRowHeight.xlsx"); + SCTAB nTab = 1; + SCROW nRow = 0; // row 1 + int nHeight = convertTwipToMm100(getScDoc()->GetRowHeight(nRow, nTab, false)); + + // Without the fix, this was 2027. It should be 450. + CPPUNIT_ASSERT_LESS(500, nHeight); +} + CPPUNIT_TEST_FIXTURE(ScFiltersTest2, testCustomNumFormatHybridCellODS) { createScDoc("ods/custom-numfmt-hybrid-cell.ods"); diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 4fcbcb792cd9..bb4e77d27f1d 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -1683,13 +1683,13 @@ void ScDocRowHeightUpdater::updateAll(const bool bOnlyUsedRows) ScProgress aProgress(mrDoc.GetDocumentShell(), ScResId(STR_PROGRESS_HEIGHTING), nCellCount, true); Fraction aZoom(1, 1); - sc::RowHeightContext aCxt(mrDoc.MaxRow(), mfPPTX, mfPPTY, aZoom, aZoom, mpOutDev); sal_uInt64 nProgressStart = 0; for (SCTAB nTab = 0; nTab < mrDoc.GetTableCount(); ++nTab) { if (!ValidTab(nTab) || !mrDoc.maTabs[nTab]) continue; + sc::RowHeightContext aCxt(mrDoc.MaxRow(), mfPPTX, mfPPTY, aZoom, aZoom, mpOutDev); SCCOL nEndCol = 0; SCROW nEndRow = mrDoc.MaxRow(); if (!bOnlyUsedRows || mrDoc.GetPrintArea(nTab, nEndCol, nEndRow)) |