summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-03-11 18:53:27 +0100
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-03-12 09:53:40 +0100
commit056ba01ee95db5dfd7df362e72bb418893c4c530 (patch)
tree497225f123ba188f19f363b73bacdeb03dcd4fdc /sc
parent6aff77cb30e7c73109684a72ccddf7a28605afcb (diff)
tdf#83901: move UItest to CppunitTest
Change-Id: I0d074da097912f8abba6bae6171596076d71e998 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90345 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/calc_tests/rows.py18
-rw-r--r--sc/qa/unit/uicalc/data/empty.odsbin0 -> 6981 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx23
3 files changed, 23 insertions, 18 deletions
diff --git a/sc/qa/uitest/calc_tests/rows.py b/sc/qa/uitest/calc_tests/rows.py
index 00b04e5f9d6e..96cffaf5fd1a 100644
--- a/sc/qa/uitest/calc_tests/rows.py
+++ b/sc/qa/uitest/calc_tests/rows.py
@@ -283,22 +283,4 @@ class CalcRows(UITestCase):
self.ui_test.close_doc()
- def test_tdf83901_row_insert_after(self):
- #Bug 83901 - ROW() value is not updated if row is inserted after
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- #- A2 = ROW(A3)
- enter_text_to_cell(gridwin, "A2", "=ROW(A3)")
- #- Insert a row between rows 2 and 3 by right-clicking on row 3 and choosing "insert rows above".
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.xUITest.executeCommand(".uno:SelectRow")
- self.xUITest.executeCommand(".uno:InsertRowsBefore")
-
- #- Result: cell A2 still shows "3" as its value, although it should show "4".
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 4)
-
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/unit/uicalc/data/empty.ods b/sc/qa/unit/uicalc/data/empty.ods
new file mode 100644
index 000000000000..0c797725af28
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/empty.ods
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index ece9c4dbbff7..222849673095 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -149,6 +149,29 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf124815)
CPPUNIT_ASSERT_EQUAL(OUString("Rakennukset"), pDoc->GetString(ScAddress(2, 0, 0)));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf83901)
+{
+ ScModelObj* pModelObj = createDoc("empty.ods");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ checkCurrentCell(0, 0);
+ pDoc->SetString(ScAddress(0, 1, 0), "=ROW(A3)");
+ CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(0, 1, 0)));
+
+ dispatchCommand(mxComponent, ".uno:GoDown", {});
+ dispatchCommand(mxComponent, ".uno:GoDown", {});
+ checkCurrentCell(0, 2);
+ dispatchCommand(mxComponent, ".uno:SelectRow", {});
+ dispatchCommand(mxComponent, ".uno:InsertRowsBefore", {});
+
+ //Without the fix, it would be 3.0
+ CPPUNIT_ASSERT_EQUAL(4.0, pDoc->GetValue(ScAddress(0, 1, 0)));
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(0, 1, 0)));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */