summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-02-10 13:51:50 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-02-10 15:50:59 +0100
commit9c2d5c877d61965d6e5fc9ef2d81299f0e04892c (patch)
treec5ba4fa24fcde61ea8d870edbd93a1e8542a096d
parenteb0a6b48cbd1346bcee92e2e418a454655c10c63 (diff)
tdf#37623: sc: Move UItest to CppUnittest
Change-Id: I0937baf4dc9db222da6ba74d2b9bcea9f18627ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129782 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sc/qa/uitest/calc_tests2/tdf37623.py31
-rw-r--r--sc/qa/uitest/data/tdf37623.odsbin7281 -> 0 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx30
3 files changed, 30 insertions, 31 deletions
diff --git a/sc/qa/uitest/calc_tests2/tdf37623.py b/sc/qa/uitest/calc_tests2/tdf37623.py
deleted file mode 100644
index d38b3afacb64..000000000000
--- a/sc/qa/uitest/calc_tests2/tdf37623.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-from uitest.framework import UITestCase
-from uitest.uihelper.common import get_url_for_data_file
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
-
-class tdf37623(UITestCase):
-
- def test_tdf37623_autofill_rows_hidden(self):
- with self.ui_test.load_file(get_url_for_data_file("tdf37623.ods")) as calc_doc:
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A6"}))
- with self.ui_test.execute_dialog_through_command(".uno:FillSeries") as xDialog:
- xautofill = xDialog.getChild("autofill")
- xautofill.executeAction("CLICK", tuple())
-
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 1)
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getValue(), 0)
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getValue(), 0)
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 5).getValue(), 3)
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf37623.ods b/sc/qa/uitest/data/tdf37623.ods
deleted file mode 100644
index 68100bbee8b5..000000000000
--- a/sc/qa/uitest/data/tdf37623.ods
+++ /dev/null
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 4ba8aaa040cb..41397c17c26a 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -265,6 +265,36 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf63805)
CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 1, 0)));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf37623)
+{
+ mxComponent = loadFromDesktop("private:factory/scalc");
+ ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get());
+ CPPUNIT_ASSERT(pModelObj);
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ goToCell("A3:A4");
+
+ dispatchCommand(mxComponent, ".uno:HideRow", {});
+
+ insertStringToCell(*pModelObj, "A2", "1");
+
+ goToCell("A2:A6");
+
+ uno::Sequence<beans::PropertyValue> aArgs(
+ comphelper::InitPropertySequence({ { "FillDir", uno::Any(OUString("B")) },
+ { "FillCmd", uno::Any(OUString("A")) },
+ { "FillStep", uno::Any(OUString("1")) },
+ { "FillDateCmd", uno::Any(OUString("M")) } }));
+ dispatchCommand(mxComponent, ".uno:FillSeries", aArgs);
+
+ CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(0, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(0, 2, 0)));
+ CPPUNIT_ASSERT_EQUAL(0.0, pDoc->GetValue(ScAddress(0, 3, 0)));
+ CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(0, 4, 0)));
+ CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(0, 5, 0)));
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144308)
{
mxComponent = loadFromDesktop("private:factory/scalc");