sw/qa/uitest/writer_tests3/hyperlinkdialog.py |   36 ++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

New commits:
commit 42ee19baf9f1522fa1e0e51eb14d30f0e4eb12d3
Author:     siddhisalunkhe1998 <[email protected]>
AuthorDate: Thu Feb 5 11:16:35 2026 +0000
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Feb 10 14:50:58 2026 +0100

    tdf#168548 Add UITest for hyperlink dialog with horizontal tabs
    
    Add a test case to verify that the hyperlink dialog works correctly
    with both vertical (default) and horizontal tab position settings.
    
    1. Open hyperlink dialog with default vertical tabs
    2. Changes tab position to horizontal via
       Tools -> Options -> Appearance
    3. Reopens hyperlink dialog to verify it works with horizontal tabs
    
    This tests the fix from
    https://gerrit.libreoffice.org/c/core/+/195201
    
    Change-Id: I8d95e5a62d96b0668015dd2015d0399cc64124c2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198743
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py 
b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
index f72bb7e4ba90..979ab1455c24 100644
--- a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
+++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
@@ -182,4 +182,40 @@ class HyperlinkDialog(UITestCase):
                         args=("CLICK", tuple()), close_button="cancel"):
                     pass
 
+    def test_tdf168548_hyperlink_dialog_horizontal_tabs(self):
+        #CRASH: launching hyperlink dialog with horizontal tabs
+        with self.ui_test.create_doc_in_start_center("writer"):
+            # First, verify hyperlink dialog opens with default vertical tabs
+            with 
self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", 
close_button="cancel") as xDialog:
+                xTab = xDialog.getChild("tabcontrol")
+                self.assertEqual(get_state_as_dict(xTab)["PageCount"], "4")
+
+            try:
+                # Change the tab position setting to horizontal in Options -> 
Appearance
+                with 
self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as 
xDialog:
+                    xPages = xDialog.getChild("pages")
+                    xLOEntry = xPages.getChild('0')
+                    xLOEntry.executeAction("EXPAND", tuple())
+                    xAppearanceEntry = xLOEntry.getChild('7')
+                    xAppearanceEntry.executeAction("SELECT", tuple())
+                    xHorizontalRadio = xDialog.getChild("rbHorizontal")
+                    xHorizontalRadio.executeAction("CLICK", tuple())
+                    
self.assertEqual(get_state_as_dict(xHorizontalRadio)["Checked"], "true")
+
+                # Open hyperlink dialog again - without the fix this would 
crash
+                with 
self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", 
close_button="cancel") as xDialog:
+                    xTab = xDialog.getChild("tabcontrol")
+                    self.assertEqual(get_state_as_dict(xTab)["PageCount"], "4")
+            finally:
+                # Reset tab position back to default
+                with 
self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as 
xDialog:
+                    xPages = xDialog.getChild("pages")
+                    xLOEntry = xPages.getChild('0')
+                    xLOEntry.executeAction("EXPAND", tuple())
+                    xAppearanceEntry = xLOEntry.getChild('7')
+                    xAppearanceEntry.executeAction("SELECT", tuple())
+                    xVerticalRadio = xDialog.getChild("rbVertical")
+                    xVerticalRadio.executeAction("CLICK", tuple())
+                    
self.assertEqual(get_state_as_dict(xVerticalRadio)["Checked"], "true")
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to