summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/tiledrendering/data/invalidate-on-save.odsbin0 -> 10807 bytes
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx27
2 files changed, 27 insertions, 0 deletions
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 000000000000..efe2c225a410
--- /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 81b22e461e18..b2b5ea6ac21d 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -3478,6 +3478,33 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testInvalidateForSplitPanes)
CPPUNIT_ASSERT_MESSAGE("The cell visible in the bottom left pane should be redrawn", bFoundBottomLeftPane);
}
+// Saving shouldn't trigger an invalidation
+CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testNoInvalidateOnSave)
+{
+ 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: */