From d1411afab98f7b41e9e700ef26b43dc77242d917 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Wed, 30 Aug 2023 16:22:02 +0200 Subject: tdf#150815 sc: fix repainting sparkline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, if the input range of the sparkline is not in the same row as the output range, the sparkline wasn't repainted after changing the data within its range. Force the update to avoid of showing obsolete data. Change-Id: Id56209b20387ee68144507a0102d3a0d093ff1ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156304 Reviewed-by: László Németh Tested-by: László Németh --- sc/qa/unit/data/ods/tdf150815.ods | Bin 0 -> 10947 bytes sc/qa/unit/subsequent_filters_test3.cxx | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 sc/qa/unit/data/ods/tdf150815.ods (limited to 'sc/qa') diff --git a/sc/qa/unit/data/ods/tdf150815.ods b/sc/qa/unit/data/ods/tdf150815.ods new file mode 100644 index 000000000000..2dd407b6cea5 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf150815.ods differ diff --git a/sc/qa/unit/subsequent_filters_test3.cxx b/sc/qa/unit/subsequent_filters_test3.cxx index d277e0858905..ff19d3d55c3c 100644 --- a/sc/qa/unit/subsequent_filters_test3.cxx +++ b/sc/qa/unit/subsequent_filters_test3.cxx @@ -393,7 +393,8 @@ struct PaintListener : public SfxListener { if ((pPaintHint->GetStartCol() <= 0 && pPaintHint->GetEndCol() >= 0) && ((pPaintHint->GetStartRow() <= 9 && pPaintHint->GetEndRow() >= 9) - || (pPaintHint->GetStartRow() == 2 && pPaintHint->GetEndRow() == 3))) + || (pPaintHint->GetStartRow() == 2 && pPaintHint->GetEndRow() == 3) + || (pPaintHint->GetStartRow() == 1 && pPaintHint->GetEndRow() == 1))) { mbCalled = true; } @@ -441,6 +442,25 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf131471) CPPUNIT_ASSERT(aListener.mbCalled); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf150815_RepaintSparkline) +{ + createScDoc("ods/tdf150815.ods"); + + ScDocument* pDoc = getScDoc(); + ScDocShell* pDocSh = getScDocShell(); + + PaintListener aListener; + aListener.StartListening(*pDocSh); + + auto pSparkline = pDoc->GetSparkline(ScAddress(0, 1, 0)); + CPPUNIT_ASSERT(pSparkline); + + ScTabViewShell* pViewShell = getViewShell(); + pViewShell->EnterData(0, 0, 0, "10"); + + CPPUNIT_ASSERT(aListener.mbCalled); +} + CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf137091) { // Set the system locale to Turkish -- cgit