cui/source/dialogs/hltpbase.cxx |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

New commits:
commit 637dd1d9f17cc663fa24f3df6e4b471871addbb9
Author:     Maya Stephens <maya.steph...@collabora.com>
AuthorDate: Mon Aug 11 12:01:32 2025 +0100
Commit:     Michael Stahl <michael.st...@collabora.com>
CommitDate: Tue Aug 19 14:09:23 2025 +0200

    Select hyperlinkdialog insert mode automatically in lokit
    
    Change-Id: I61bd5993e68ca27b512fbefa7807386339063581
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189883
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Michael Stahl <michael.st...@collabora.com>

diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 8595b1fd5889..df5586269025 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -230,6 +230,10 @@ void SvxHyperlinkTabPageBase::HideMarkWnd()
 // Fill Dialogfields
 void SvxHyperlinkTabPageBase::FillStandardDlgFields ( const SvxHyperlinkItem* 
pHyperlinkItem )
 {
+    // Form
+    OUString aStrFormText = CuiResId( RID_CUISTR_HYPERDLG_FROM_TEXT );
+    OUString aStrFormButton = CuiResId( RID_CUISTR_HYPERDLG_FORM_BUTTON );
+
     if (!comphelper::LibreOfficeKit::isActive())
     {
         // Frame
@@ -237,11 +241,6 @@ void SvxHyperlinkTabPageBase::FillStandardDlgFields ( 
const SvxHyperlinkItem* pH
         if (nPos != -1)
             mxCbbFrame->set_active(nPos);
 
-        // Form
-        OUString aStrFormText = CuiResId( RID_CUISTR_HYPERDLG_FROM_TEXT );
-
-        OUString aStrFormButton = CuiResId( RID_CUISTR_HYPERDLG_FORM_BUTTON );
-
         if( pHyperlinkItem->GetInsertMode() & HLINK_HTMLMODE )
         {
             mxLbForm->clear();
@@ -259,9 +258,16 @@ void SvxHyperlinkTabPageBase::FillStandardDlgFields ( 
const SvxHyperlinkItem* pH
     else
     {
         mxCbbFrame->hide();
-        mxLbForm->hide();
-        mxFormLabel->hide();
         mxFrameLabel->hide();
+
+        mxFormLabel->hide();
+        mxLbForm->hide();
+
+        // Although not visible, give fields so that default value can be used
+        mxLbForm->clear();
+        mxLbForm->append_text( aStrFormText );
+        mxLbForm->append_text( aStrFormButton );
+        mxLbForm->set_active( pHyperlinkItem->GetInsertMode() == HLINK_BUTTON 
? 1 : 0 );
     }
 
     // URL

Reply via email to