diff options
author | László Németh <nemeth@numbertext.org> | 2023-02-27 13:56:01 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2023-02-27 22:46:29 +0000 |
commit | e706698353a7187f46ddbf0faf1f6f7772753df6 (patch) | |
tree | d1405cc06b9fc27193caa6f819d9ad59f2f9a9c1 /sw/qa/uitest | |
parent | 3ffd375ffee648cdb67b1f3062f84a4b2f3af9df (diff) |
tdf#153859 sw: crash fix for setting chart with deleted data table
Opening Data Ranges dialog window of a chart with
deleted data table crashed Writer immediately.
Follow-up to commit 5b9855acc7fa6d1e4a5f53ff0bc47e1dd4729827
"tdf#132714 sw: fix crash at table row deletion associated
to a chart".
Change-Id: I96e901db75d40ae234f58827a957204bca13aa92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147893
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/uitest')
-rw-r--r-- | sw/qa/uitest/writer_tests7/tdf132714.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests7/tdf132714.py b/sw/qa/uitest/writer_tests7/tdf132714.py index 7ccedbeb6f4d..cad8ff24e80d 100644 --- a/sw/qa/uitest/writer_tests7/tdf132714.py +++ b/sw/qa/uitest/writer_tests7/tdf132714.py @@ -66,4 +66,32 @@ class tdf132714(UITestCase): # Without the fix in place, this test would have crashed here xToolkitRobot.mouseMove(xMouseEvent) + def test_data_ranges(self): + with self.ui_test.load_file(get_url_for_data_file("tdf132714.odt")) as document: + + # delete second row (first data row) in the associated text table of the chart + self.xUITest.executeCommand(".uno:GoDown") + self.xUITest.executeCommand(".uno:GoDown") + # Without the fix in place, at this point crash occurs. + self.xUITest.executeCommand(".uno:DeleteTable") + + # select embedded chart + self.assertEqual(1, document.EmbeddedObjects.Count) + document.CurrentController.select(document.getEmbeddedObjects().getByIndex(0)) + self.assertEqual("SwXTextEmbeddedObject", document.CurrentSelection.getImplementationName()) + + xChartMainTop = self.xUITest.getTopFocusWindow() + xWriterEdit = xChartMainTop.getChild("writer_edit") + # edit object by pressing Enter + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"})) + + # open DataRanges dialog window + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/Page=") + + # Without the fix in place, this test would have crashed here + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DataRanges"})) as xDialog: + pass + + # vim: set shiftwidth=4 softtabstop=4 expandtab: |