From a21ef822f9769ded6ff834dbfa347cf0e5f913fd Mon Sep 17 00:00:00 2001 From: László Németh Date: Thu, 7 Apr 2022 17:58:06 +0200 Subject: tdf#147179 sw: select tracked row change in Manage Changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Manage Changes dialog window, selecting items of list of changes results selection of the associated text changes in the main text, as a visual feedback. From commit eebe4747d2d13545004937bb0267ccfc8ab9d63f, text changes of deleted/inserted rows or tables are listed under a single "tracked row" list item, as its children. Selecting a "tracked row" list item in Manage Changes resulted incomplete text selection in the main text: only the first text change in the first cell was selected instead of all associated text changes of tracked row(s) or table. Note: Manage Changes supports multiple selections, i.e. it's possible to select multiple list items by Ctrl + click, and select ranges by Shift + click. This commit does the same with redlines of tracked row changes. Follow-up to commit eebe4747d2d13545004937bb0267ccfc8ab9d63f "tdf#144270 sw: manage tracked table (row) deletion/insertion". Change-Id: If7b12e8d3c0e437495e1fcae0e8f04e34301c516 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132685 Tested-by: Jenkins Reviewed-by: László Németh --- sw/qa/uitest/writer_tests/trackedChanges.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sw/qa') diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py index c04034e7149b..0d13ddcdff8d 100644 --- a/sw/qa/uitest/writer_tests/trackedChanges.py +++ b/sw/qa/uitest/writer_tests/trackedChanges.py @@ -353,4 +353,33 @@ class trackedchanges(UITestCase): # This was False (missing comment) self.assertEqual(True, get_state_as_dict(xChild)["Text"].endswith('\tComment added')) + def test_tdf147179(self): + with self.ui_test.load_file(get_url_for_data_file("TC-table-del-add.docx")) as document: + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + + tables = document.getTextTables() + self.assertEqual(3, len(tables)) + + # Select text of the tracked row, not only text of its first cell + with self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges", close_button="close") as xTrackDlg: + changesList = xTrackDlg.getChild("writerchanges") + + # select second tracked table row in tree list + changesList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + while get_state_as_dict(xWriterEdit)["SelectedText"] != 'klj': + xToolkit.processEventsToIdle() + + # this was "j" (only text of the first cell was selected, not text of the row) + self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "klj" ) + + # select first tracked table row in tree list + changesList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + while get_state_as_dict(xWriterEdit)["SelectedText"] != 'bca': + xToolkit.processEventsToIdle() + + # this was "a" (only text of the first cell was selected, not text of the row) + self.assertEqual(get_state_as_dict(xWriterEdit)["SelectedText"], "bca" ) + # vim: set shiftwidth=4 softtabstop=4 expandtab: -- cgit