summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-08-01 16:17:32 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-08-01 19:33:34 +0200
commitcfb1e6354e095d0addf9f7a1114902b2bce5f627 (patch)
treee7bb3be8be97c67f258a707ca5c5c5e7d12e9d3a /sc/qa
parent21f13b90295edf84f87125791e05810666058a1c (diff)
tdf#156462: sc_uicalc: Add unittest
Change-Id: Ib02bcb33c243450cdc94328e07d02510d50eb7c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155164 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/uicalc/data/tdf156462.odsbin0 -> 8014 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf156462.ods b/sc/qa/unit/uicalc/data/tdf156462.ods
new file mode 100644
index 000000000000..3f77ac3be0b3
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf156462.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index d96b78b87136..9a795f4a5bde 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1227,6 +1227,21 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf68290)
lcl_AssertCurrentCursorPosition(*pDocSh, u"M3");
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf156462)
+{
+ createScDoc("tdf156462.ods");
+ ScDocShell* pDocSh = getScDocShell();
+
+ lcl_AssertCurrentCursorPosition(*pDocSh, u"G2");
+
+ ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_MOD1 | KEY_LEFT);
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, the cursor would have jumped to cell C2
+ lcl_AssertCurrentCursorPosition(*pDocSh, u"D2");
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf132057)
{
createScDoc("tdf132057.ods");