[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Feb 18 23:22:58 UTC 2021
sc/qa/unit/uicalc/uicalc.cxx | 48 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
New commits:
commit 3a1e3bd2bb71d084233dfb791c1d0c3dd81b43e5
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Feb 18 22:43:07 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Feb 19 00:22:15 2021 +0100
tdf#117706: sc_uicalc: Add unittest
Change-Id: I7c201585d5c9a2651bea47b44069a5836b3df3b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111166
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index af82c872a183..0a719ee29bb2 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -429,6 +429,54 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf120660)
pMod->SetInputOptions(aInputOption);
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117706)
+{
+ mxComponent = loadFromDesktop("private:factory/scalc");
+ ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+ CPPUNIT_ASSERT(pModelObj);
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ insertStringToCell(*pModelObj, "A1", "A1");
+ insertStringToCell(*pModelObj, "A3", "A3");
+
+ // Use Adding Selection
+ dispatchCommand(mxComponent, ".uno:StatusSelectionModeExp", {});
+ Scheduler::ProcessEventsToIdle();
+
+ goToCell("A1");
+ dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ Scheduler::ProcessEventsToIdle();
+
+ dispatchCommand(mxComponent, ".uno:GoDown", {});
+ dispatchCommand(mxComponent, ".uno:GoDown", {});
+ lcl_AssertCurrentCursorPosition(0, 2);
+
+ dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ Scheduler::ProcessEventsToIdle();
+
+ // FIXME: The rows are not copied/pasted if using CopyToClip/PasteToClip
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+
+ mxComponent->dispose();
+
+ // Open a new document
+ mxComponent = loadFromDesktop("private:factory/scalc");
+ pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+ CPPUNIT_ASSERT(pModelObj);
+ pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: A1
+ // - Actual : A3
+ CPPUNIT_ASSERT_EQUAL(OUString("A1"), pDoc->GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("A3"), pDoc->GetString(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 2, 0)));
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131442)
{
mxComponent = loadFromDesktop("private:factory/scalc");
More information about the Libreoffice-commits
mailing list