sc/qa/uitest/calc_tests8/tdf126248.py |   40 +++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 19 deletions(-)

New commits:
commit 9ee1b714c13db308c199172ffa0199405ca3d9c3
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Feb 7 13:24:25 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 14 13:18:20 2023 +0000

    sc: use try/finally to reset the changes in OptionsTreeDialog
    
    Otherwise it might affect other tests if it hits an assert
    
    Change-Id: If1d0226860f4befe7f531fda7260c8b4147f2079
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146606
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/uitest/calc_tests8/tdf126248.py 
b/sc/qa/uitest/calc_tests8/tdf126248.py
index dce58b03bbba..9e65f9c3d5b3 100644
--- a/sc/qa/uitest/calc_tests8/tdf126248.py
+++ b/sc/qa/uitest/calc_tests8/tdf126248.py
@@ -52,36 +52,38 @@ class tdf126248(UITestCase):
 
         with self.ui_test.create_doc_in_start_center("calc"):
 
-            self.changeLocalSetting("Chinese (traditional)")
+            try:
+                self.changeLocalSetting("Chinese (traditional)")
 
-            with 
self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog:
-                xTabs = xDialog.getChild("tabcontrol")
-                select_pos(xTabs, "1")
+                with 
self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog:
+                    xTabs = xDialog.getChild("tabcontrol")
+                    select_pos(xTabs, "1")
 
-                # Get current font names from the Format Cell dialog
-                westFontName = 
get_state_as_dict(xDialog.getChild("edWestFontName"))['Text']
-                eastFontName = 
get_state_as_dict(xDialog.getChild("edCJKFontName"))['Text']
+                    # Get current font names from the Format Cell dialog
+                    westFontName = 
get_state_as_dict(xDialog.getChild("edWestFontName"))['Text']
+                    eastFontName = 
get_state_as_dict(xDialog.getChild("edCJKFontName"))['Text']
 
-            xCalcDoc = self.xUITest.getTopFocusWindow()
-            gridwin = xCalcDoc.getChild("grid_window")
+                xCalcDoc = self.xUITest.getTopFocusWindow()
+                gridwin = xCalcDoc.getChild("grid_window")
 
-            enter_text_to_cell(gridwin, "A1", "Test")
+                enter_text_to_cell(gridwin, "A1", "Test")
 
-            # Without the fix in place, this test would have failed here
-            self.assertFontName(gridwin, westFontName)
+                # Without the fix in place, this test would have failed here
+                self.assertFontName(gridwin, westFontName)
 
-            enter_text_to_cell(gridwin, "B1", "測試")
+                enter_text_to_cell(gridwin, "B1", "測試")
 
-            self.assertFontName(gridwin, eastFontName)
+                self.assertFontName(gridwin, eastFontName)
 
-            self.changeLocalSetting("English (USA)")
+            finally:
+                self.changeLocalSetting("English (USA)")
 
-            enter_text_to_cell(gridwin, "C1", "Test")
+                enter_text_to_cell(gridwin, "C1", "Test")
 
-            self.assertFontName(gridwin, westFontName)
+                self.assertFontName(gridwin, westFontName)
 
-            enter_text_to_cell(gridwin, "D1", "測試")
+                enter_text_to_cell(gridwin, "D1", "測試")
 
-            self.assertFontName(gridwin, eastFontName)
+                self.assertFontName(gridwin, eastFontName)
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to