summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-04-07 17:58:06 +0200
committerLászló Németh <nemeth@numbertext.org>2022-04-08 12:00:10 +0200
commita21ef822f9769ded6ff834dbfa347cf0e5f913fd (patch)
tree1e681c9c5b09d89abf074177fc1404b785a98252 /sw/qa
parent844be7358f1eec00094a55fa1fb4fadadb8cd1bf (diff)
tdf#147179 sw: select tracked row change in Manage Changes
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 <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/uitest/writer_tests/trackedChanges.py29
1 files changed, 29 insertions, 0 deletions
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: