sc/qa/unit/data/ods/tdf131471.ods |binary sc/qa/unit/subsequent_filters_test3.cxx | 25 +++++++++++++++++++++++-- sc/source/ui/unoobj/docuno.cxx | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-)
New commits: commit 830f501147f830d5d1eeac601d97f9720d7b80f9 Author: Tibor Nagy <nagy.tib...@nisz.hu> AuthorDate: Mon Jul 10 17:53:49 2023 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Tue Jul 25 10:29:45 2023 +0200 tdf#131471 sc: fix background color of conditional formatting style The issue appears for merged cells when you trigger a change that causes the condition to be evaluated again. Manual test: open unit test document, put "1" in A1, and press Undo: the green background color of the condition was removed only partially. Change-Id: I8bb17c77ac49a1ee897c3e2b4902723d237765d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154277 Reviewed-by: László Németh <nem...@numbertext.org> Tested-by: László Németh <nem...@numbertext.org> (cherry picked from commit fdbea1f65e9f30f0d6cb4bade181ed2386a7c568) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154853 Tested-by: Jenkins diff --git a/sc/qa/unit/data/ods/tdf131471.ods b/sc/qa/unit/data/ods/tdf131471.ods new file mode 100644 index 000000000000..31f079274256 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf131471.ods differ diff --git a/sc/qa/unit/subsequent_filters_test3.cxx b/sc/qa/unit/subsequent_filters_test3.cxx index 44cd7024506c..54d5061d2cd9 100644 --- a/sc/qa/unit/subsequent_filters_test3.cxx +++ b/sc/qa/unit/subsequent_filters_test3.cxx @@ -391,8 +391,9 @@ struct PaintListener : public SfxListener const ScPaintHint* pPaintHint = dynamic_cast<const ScPaintHint*>(&rHint); if (pPaintHint) { - if (pPaintHint->GetStartCol() <= 0 && pPaintHint->GetEndCol() >= 0 - && pPaintHint->GetStartRow() <= 9 && pPaintHint->GetEndRow() >= 9) + if ((pPaintHint->GetStartCol() <= 0 && pPaintHint->GetEndCol() >= 0) + && ((pPaintHint->GetStartRow() <= 9 && pPaintHint->GetEndRow() >= 9) + || (pPaintHint->GetStartRow() == 2 && pPaintHint->GetEndRow() == 3))) { mbCalled = true; } @@ -420,6 +421,26 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testCondFormatFormulaListenerXLSX) CPPUNIT_ASSERT(aListener.mbCalled); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf131471) +{ + // Repaint range of conditional format in merged cell. + createScDoc("ods/tdf131471.ods"); + ScDocShell* pDocSh = getScDocShell(); + PaintListener aListener; + aListener.StartListening(*pDocSh); + ScDocument* pDoc = getScDoc(); + ScConditionalFormatList* pList = pDoc->GetCondFormList(0); + CPPUNIT_ASSERT(pList); + + CPPUNIT_ASSERT_EQUAL(size_t(1), pList->size()); + ScConditionalFormat* pFormat = pList->begin()->get(); + CPPUNIT_ASSERT(pFormat); + pDoc->SetDocVisible(true); + pDoc->SetValue(0, 0, 0, 1.0); + + CPPUNIT_ASSERT(aListener.mbCalled); +} + CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf137091) { // Set the system locale to Turkish diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 1358fb8ec56d..6ca01319a0b0 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -488,7 +488,7 @@ void ScModelObj::RepaintRange( const ScRange& rRange ) void ScModelObj::RepaintRange( const ScRangeList& rRange ) { if (pDocShell) - pDocShell->PostPaint( rRange, PaintPartFlags::Grid ); + pDocShell->PostPaint(rRange, PaintPartFlags::Grid, SC_PF_TESTMERGE); } static ScViewData* lcl_getViewMatchingDocZoomTab(const Fraction& rZoomX,