summaryrefslogtreecommitdiff
path: root/sc/qa/unit/uicalc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-02-09 20:16:26 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-02-09 22:43:03 +0100
commit662055db385cd1f17ae1a375b2da3b3246e02517 (patch)
tree8c03737864b64d765a3d722de76b3c8d3077cbb0 /sc/qa/unit/uicalc
parent32e4d0907fa6d1fcd82b0762c3f02f4c1ee1dd94 (diff)
tdf#123052: sc: Move UItest to CppUnitTest
Change-Id: If7a30aef44a722b4c0d91ecd7626a2a39fe1290a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110652 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/unit/uicalc')
-rw-r--r--sc/qa/unit/uicalc/data/tdf123052.odsbin0 -> 7707 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx33
2 files changed, 33 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf123052.ods b/sc/qa/unit/uicalc/data/tdf123052.ods
new file mode 100644
index 000000000000..b87c73d880da
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf123052.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 8c92824fe541..7335fa01dc22 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -337,6 +337,39 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf122232)
lcl_AssertCurrentCursorPosition(2, 6);
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf123052)
+{
+ ScModelObj* pModelObj = createDoc("tdf123052.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ std::vector<ScAddress> aExpectedAddresses{ ScAddress(5, 2, 0), ScAddress(3, 4, 0),
+ ScAddress(4, 4, 0), ScAddress(5, 5, 0),
+ ScAddress(0, 7, 0), ScAddress(4, 8, 0) };
+
+ for (const auto& rAddress : aExpectedAddresses)
+ {
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+ Scheduler::ProcessEventsToIdle();
+
+ lcl_AssertCurrentCursorPosition(rAddress.Col(), rAddress.Row());
+ }
+
+ aExpectedAddresses.pop_back();
+
+ for (std::vector<ScAddress>::reverse_iterator it = aExpectedAddresses.rbegin();
+ it != aExpectedAddresses.rend(); ++it)
+ {
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_SHIFT | awt::Key::TAB);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_SHIFT | awt::Key::TAB);
+ Scheduler::ProcessEventsToIdle();
+
+ // Without the fix in place, this test would have failed here
+ lcl_AssertCurrentCursorPosition((*it).Col(), (*it).Row());
+ }
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf120660)
{
ScModelObj* pModelObj = createDoc("tdf120660.ods");