summaryrefslogtreecommitdiffstats
path: root/sc/qa/unit
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsxbin0 -> 7074 bytes
-rw-r--r--sc/qa/unit/subsequent_filters_test2.cxx11
-rw-r--r--sc/qa/unit/tiledrendering/data/invalidate-on-save.odsbin0 -> 10807 bytes
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx30
4 files changed, 41 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsx b/sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsx
new file mode 100644
index 0000000000..8df7720804
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf159581_optimalRowHeight.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx
index dd63f0b8a9..2b8ff43962 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/qa/unit/tiledrendering/data/invalidate-on-save.ods b/sc/qa/unit/tiledrendering/data/invalidate-on-save.ods
new file mode 100644
index 0000000000..efe2c225a4
--- /dev/null
+++ b/sc/qa/unit/tiledrendering/data/invalidate-on-save.ods
Binary files differ
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 00fda9336f..9e07c0c060 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -3113,6 +3113,36 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testGetViewRenderState)
CPPUNIT_ASSERT_EQUAL(";Default"_ostr, pModelObj->getViewRenderState());
}
+// Saving shouldn't trigger an invalidation
+CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNoInvalidateOnSave)
+{
+ comphelper::LibreOfficeKit::setCompatFlag(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+
+ loadFromFile(u"invalidate-on-save.ods");
+
+ // .uno:Save modifies the original file, make a copy first
+ saveAndReload("calc8");
+ ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
+ CPPUNIT_ASSERT(pModelObj);
+ pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
+
+ ScTabViewShell* pView = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
+ CPPUNIT_ASSERT(pView);
+
+ Scheduler::ProcessEventsToIdle();
+
+ // track invalidations
+ ViewCallback aView;
+
+ uno::Sequence<beans::PropertyValue> aArgs;
+ dispatchCommand(mxComponent, ".uno:Save", aArgs);
+
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT(!aView.m_bInvalidateTiles);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */