From c3baf2a7f48b5ee46c6792b3106cb4fedb4a2ad2 Mon Sep 17 00:00:00 2001 From: tagezi Date: Fri, 27 May 2022 13:00:39 +0300 Subject: sc uitests: Cleaning up unused variables Removed unused variables in the 'with' statement as the syntax allows the statement to be used without a variable. Removed variables like 'xcomments' and 'xseedspin', which seem to have been copied and not cleaned up. Removed variables 'gridwin' and 'xCalcDoc' if 'gridwin' is not used. Change-Id: Ia97692a0fb2e2af1d2693e09ac8f7c614360ade8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135042 Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli --- sc/qa/uitest/calc_tests6/autocorrectOptions.py | 4 ---- sc/qa/uitest/calc_tests6/moveCopySheet.py | 4 +--- sc/qa/uitest/calc_tests6/shareSpreadsheet.py | 3 --- sc/qa/uitest/calc_tests6/tdf116996.py | 3 --- 4 files changed, 1 insertion(+), 13 deletions(-) (limited to 'sc/qa/uitest/calc_tests6') diff --git a/sc/qa/uitest/calc_tests6/autocorrectOptions.py b/sc/qa/uitest/calc_tests6/autocorrectOptions.py index 88805c5e847b..e626ad93f43b 100644 --- a/sc/qa/uitest/calc_tests6/autocorrectOptions.py +++ b/sc/qa/uitest/calc_tests6/autocorrectOptions.py @@ -16,9 +16,6 @@ class autocorrectOptions(UITestCase): def test_autocorrect_options_calc(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - with self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg", close_button="cancel") as xDialog: xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") #tab replace @@ -27,7 +24,6 @@ class autocorrectOptions(UITestCase): xnew = xDialog.getChild("new") xdelete = xDialog.getChild("delete") xtabview = xDialog.getChild("tabview") - xreset = xDialog.getChild("reset") nrRows = get_state_as_dict(xtabview)["VisibleCount"] self.assertTrue(int(nrRows) > 0) diff --git a/sc/qa/uitest/calc_tests6/moveCopySheet.py b/sc/qa/uitest/calc_tests6/moveCopySheet.py index 41019b371a83..a80b7c329173 100644 --- a/sc/qa/uitest/calc_tests6/moveCopySheet.py +++ b/sc/qa/uitest/calc_tests6/moveCopySheet.py @@ -14,8 +14,6 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class moveCopySheet(UITestCase): def test_copy_move_sheet(self): with self.ui_test.create_doc_in_start_center("calc") as document: - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") #default - 1 sheet; select the sheet (is selected), dialog move/copy sheet with self.ui_test.execute_dialog_through_command(".uno:Move") as xDialog: #new name = newName @@ -67,7 +65,7 @@ class moveCopySheet(UITestCase): #tdf#139464 Set OK button label to selected action: Move or Copy def test_tdf139464_move_sheet(self): - with self.ui_test.create_doc_in_start_center("calc") as document: + with self.ui_test.create_doc_in_start_center("calc"): with self.ui_test.execute_dialog_through_command(".uno:Move") as xDialog: xOkButton = xDialog.getChild("ok") xCopyButton = xDialog.getChild("copy") diff --git a/sc/qa/uitest/calc_tests6/shareSpreadsheet.py b/sc/qa/uitest/calc_tests6/shareSpreadsheet.py index 7fcf7a58110a..265d4a2d14e1 100644 --- a/sc/qa/uitest/calc_tests6/shareSpreadsheet.py +++ b/sc/qa/uitest/calc_tests6/shareSpreadsheet.py @@ -16,9 +16,6 @@ class shareSpreadsheet(UITestCase): def test_share_spreadsheet(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - xGridWindow = xCalcDoc.getChild("grid_window") - #dialog shareSpreadsheet with self.ui_test.execute_dialog_through_command(".uno:ShareDocument", close_button="cancel") as xDialog: diff --git a/sc/qa/uitest/calc_tests6/tdf116996.py b/sc/qa/uitest/calc_tests6/tdf116996.py index e1f55de66056..7e3f4e61c43b 100644 --- a/sc/qa/uitest/calc_tests6/tdf116996.py +++ b/sc/qa/uitest/calc_tests6/tdf116996.py @@ -14,9 +14,6 @@ from uitest.uihelper.common import get_state_as_dict class tdf116996(UITestCase): def test_tdf116996_enable_experimental_feature(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog", close_button="") as xDialogOpt: xPages = xDialogOpt.getChild("pages") xLOEntry = xPages.getChild('0') # Libreoffice -- cgit