diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-02-18 18:48:31 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-02-18 20:20:29 +0100 |
commit | bebf2433ba1b7797bddddb06bdeec7975250181c (patch) | |
tree | bfb4ab7402cd4441336f63387d3d7f64c0319ea2 /sc/qa/unit | |
parent | dc6eb44e625c541be1db5911d53b3b0cc30a2b1f (diff) |
tdf#124818: sc: move UItest to CppUnittest
The original UItest is just wrong. The report talks about
Select all - Cut - Undo and no cut and not undo is done there
Change-Id: I53b925f86aa01fd4f161ec3180b2d7471baff09f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130172
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/uicalc/data/tdf124818.xls | bin | 0 -> 17920 bytes | |||
-rw-r--r-- | sc/qa/unit/uicalc/uicalc.cxx | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf124818.xls b/sc/qa/unit/uicalc/data/tdf124818.xls Binary files differnew file mode 100644 index 000000000000..2e5656978a9d --- /dev/null +++ b/sc/qa/unit/uicalc/data/tdf124818.xls diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 15d34995c4b2..0861d04fc4a6 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1478,6 +1478,36 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126904) } } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124818) +{ + ScModelObj* pModelObj = createDoc("tdf124818.xls"); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + CPPUNIT_ASSERT_EQUAL(sal_Int16(2), ScDocShell::GetViewData()->GetTabNo()); + + dispatchCommand(mxComponent, ".uno:JumpToPrevTable", {}); + + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), ScDocShell::GetViewData()->GetTabNo()); + + ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); + SdrPage* pPage = pDrawLayer->GetPage(1); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage->GetObjCount()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + Scheduler::ProcessEventsToIdle(); + + dispatchCommand(mxComponent, ".uno:Cut", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pPage->GetObjCount()); + + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage->GetObjCount()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124816) { ScModelObj* pModelObj = createDoc("tdf124816.xlsx"); |