diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-06-21 17:38:26 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-07-26 18:39:13 +0200 |
commit | 2e598ba08311adaaaad5b9ea2b4279102ff0f379 (patch) | |
tree | 0917934d1886ff5c61e0f23fd28633a016b175d0 /sc | |
parent | 7274fcf957314d4c3fffb02fb8bd156835df0510 (diff) |
CppunitTest_sc_uicalc: Test pasting with return key
Initially this test was created to test tdf#161461
but it needs some tweaks in order to reproduce it
See https://gerrit.libreoffice.org/c/core/+/169341/comment/7c8fc703_8d6797d5/
So at least add this test to test the paste with
return key feature on Calc
Change-Id: Ie3ae0975fa164fbf4c1d249649ab25cf0eeef0d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169341
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/uicalc/uicalc.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 023116d021af..68a4289417af 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -646,6 +646,31 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144308) xGlobalSheetSettings->setDoAutoComplete(bOldValue); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testPasteWithReturnKey) +{ + createScDoc(); + ScDocument* pDoc = getScDoc(); + ScModelObj* pModelObj = comphelper::getFromUnoTunnel<ScModelObj>(mxComponent); + + insertStringToCell(u"A1"_ustr, u"Test"); + + goToCell(u"A1"_ustr); + + for (SCROW i = 1; i <= 10; ++i) + { + dispatchCommand(mxComponent, u".uno:Copy"_ustr, {}); + + dispatchCommand(mxComponent, u".uno:GoDown"_ustr, {}); + + // Paste using Return + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN); + pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::RETURN); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(u"Test"_ustr, pDoc->GetString(ScAddress(0, i, 0))); + } +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf56036) { createScDoc(); |