[Libreoffice-commits] core.git: sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 24 07:24:53 UTC 2021


 sc/qa/unit/uicalc/data/tdf143979.ods |binary
 sc/qa/unit/uicalc/uicalc.cxx         |   24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+)

New commits:
commit 39a11e3287febeb9dd56f43da6f6612afeb0f512
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Aug 23 18:51:11 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Aug 24 09:24:19 2021 +0200

    tdf#143979: sc_uicalc: Add unittest
    
    Change-Id: I0c51e69521a290bb13e39f592a45b9d94634ad3e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120911
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/unit/uicalc/data/tdf143979.ods b/sc/qa/unit/uicalc/data/tdf143979.ods
new file mode 100644
index 000000000000..0ebc22d62ff7
Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf143979.ods differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 034df5aa3e7d..b7f272883fe9 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1739,6 +1739,30 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126540_GridToggleModifiesTheDocument)
     CPPUNIT_ASSERT(pDocSh->IsModified());
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143979)
+{
+    ScModelObj* pModelObj = createDoc("tdf143979.ods");
+    ScDocument* pDoc = pModelObj->GetDocument();
+    CPPUNIT_ASSERT(pDoc);
+
+    goToCell("A5:B79");
+
+    dispatchCommand(mxComponent, ".uno:Copy", {});
+    Scheduler::ProcessEventsToIdle();
+
+    goToCell("D5");
+
+    //Without the fix in place, this test would have crashed
+    dispatchCommand(mxComponent, ".uno:PasteTransposed", {});
+    Scheduler::ProcessEventsToIdle();
+
+    for (size_t i = 3; i < 76; ++i)
+    {
+        OUString sExpected = "A" + OUString::number(i + 2);
+        CPPUNIT_ASSERT_EQUAL(sExpected, pDoc->GetString(ScAddress(i, 4, 0)));
+    }
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126926)
 {
     mxComponent = loadFromDesktop("private:factory/scalc");


More information about the Libreoffice-commits mailing list