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

New commits:
commit 88d1ff053aba640a42582ef61df8731e6cd82d67
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Aug 27 16:54:11 2021 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jun 11 12:06:42 2025 +0200

    tdf#143940: sc_uicalc: Add unittest
    
    Change-Id: I2d3940adb43d26d14e98c33cd749a47b32fda2de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121151
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/unit/uicalc/data/tdf143940.ods 
b/sc/qa/unit/uicalc/data/tdf143940.ods
new file mode 100644
index 000000000000..150f6ec476bc
Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf143940.ods differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index c2b50d330089..28093c60fd8e 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -2538,6 +2538,31 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testFillHandleDnD)
     CPPUNIT_ASSERT_EQUAL(u"6"_ustr, pDoc->GetString(ScAddress(0, 5, 0)));
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf143940)
+{
+    createScDoc("tdf143940.ods");
+    ScDocument* pDoc = getScDoc();
+    CPPUNIT_ASSERT(pDoc);
+
+    goToCell(u"A828"_ustr);
+
+    CPPUNIT_ASSERT_EQUAL(u"One Onza"_ustr, pDoc->GetString(ScAddress(0, 827, 
0)));
+
+    dispatchCommand(mxComponent, u".uno:InsertRowsBefore"_ustr, {});
+    Scheduler::ProcessEventsToIdle();
+
+    CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 827, 0)));
+
+    // Without the fix in place, this test would have crashed
+    // FIXME: Error: uncompleted content model. expecting: 
<covered-table-cell>,<table-cell>
+    skipValidation();
+    saveAndReload(u"calc8"_ustr);
+    pDoc = getScDoc();
+    CPPUNIT_ASSERT(pDoc);
+
+    CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(0, 827, 0)));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to