[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - cui/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 21 10:24:28 UTC 2019


 cui/source/dialogs/hltpbase.cxx |   56 +++++++++++++++++++++++++++-------------
 1 file changed, 39 insertions(+), 17 deletions(-)

New commits:
commit b0256ffc7342fc90a21cb1f22e0e04a6fdbf64e7
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon May 27 15:27:06 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jun 21 12:23:29 2019 +0200

    cui: fix Impress hyperlink insert when the form listbox is hidden
    
    In preparation of forward-porting the distro/collabora/cp-6.0-only
    commit 418adc09f503a5714f58f56619161fed6d668088 (lo: disable under-used
    hyperlink fields that are buggy online., 2019-05-22), which relaxes the
    invariant that mpLbForm never returns LISTBOX_ENTRY_NOTFOUND.
    
    A signed integer overflow is a problem in itself, but in practice the
    SID_HYPERLINK_SETLINK handler in sd::DrawViewShell::FuTemporary() didn't
    insert a field, since the insert mode was a large negative value instead
    of HLINK_FIELD.
    
    Change-Id: I238d9f662a74f320d05ea6a6cc97319d2d5b3d5a
    Reviewed-on: https://gerrit.libreoffice.org/73034
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 834d796e03d257db486e6a6da8b1ccbee7ba24ee)

diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 8aa8e3e0cff5..2992611d7ffe 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -444,7 +444,13 @@ void SvxHyperlinkTabPageBase::GetDataFromCommonFields( OUString& aStrName,
     aStrIntName = mpEdText->GetText();
     aStrName    = mpEdIndication->GetText();
     aStrFrame   = mpCbbFrame->GetText();
-    eMode       = static_cast<SvxLinkInsertMode>(mpLbForm->GetSelectedEntryPos()+1);
+
+    sal_Int32 nPos = mpLbForm->GetSelectedEntryPos();
+    if (nPos == LISTBOX_ENTRY_NOTFOUND)
+        // This happens when FillStandardDlgFields() hides mpLbForm.
+        nPos = 0;
+    eMode = static_cast<SvxLinkInsertMode>(nPos + 1);
+
     // Ask dialog whether the current doc is a HTML-doc
     if (static_cast<SvxHpLinkDlg*>(mpDialog.get())->IsHTMLDoc())
         eMode = static_cast<SvxLinkInsertMode>( sal_uInt16(eMode) | HLINK_HTMLMODE );
commit 7b3d9841fe7e801b4949a9389e8b6a89662d6db7
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Wed May 22 14:29:07 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jun 21 12:23:29 2019 +0200

    lo: disable under-used hyperlink fields that are buggy online.
    
    Reviewed-on: https://gerrit.libreoffice.org/72781
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    (cherry picked from commit 418adc09f503a5714f58f56619161fed6d668088)
    
    Change-Id: If2069288fac14c6113754288eb9136449626393d
    Reviewed-on: https://gerrit.libreoffice.org/72782
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    (cherry picked from commit a8e7c82a26996e4cbfb42dea5dbe0098046ba701)

diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 38402c8af924..8aa8e3e0cff5 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -36,6 +36,7 @@
 #include <dialmgr.hxx>
 #include <bitmaps.hlst>
 #include <vcl/builderfactory.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace ::ucbhelper;
 
@@ -242,27 +243,42 @@ void SvxHyperlinkTabPageBase::ShowMarkWnd ()
 // Fill Dialogfields
 void SvxHyperlinkTabPageBase::FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem )
 {
-    // Frame
-    sal_Int32 nPos = mpCbbFrame->GetEntryPos ( pHyperlinkItem->GetTargetFrame() );
-    if ( nPos != COMBOBOX_ENTRY_NOTFOUND)
-        mpCbbFrame->SetText ( pHyperlinkItem->GetTargetFrame() );
+    if (!comphelper::LibreOfficeKit::isActive())
+    {
+        // Frame
+        sal_Int32 nPos = mpCbbFrame->GetEntryPos ( pHyperlinkItem->GetTargetFrame() );
+        if ( nPos != COMBOBOX_ENTRY_NOTFOUND)
+            mpCbbFrame->SetText ( pHyperlinkItem->GetTargetFrame() );
 
-    // Form
-    OUString aStrFormText = CuiResId( RID_SVXSTR_HYPERDLG_FROM_TEXT );
-    OUString aStrFormButton = CuiResId( RID_SVXSTR_HYPERDLG_FORM_BUTTON );
+        // Form
+        OUString aStrFormText = CuiResId( RID_SVXSTR_HYPERDLG_FROM_TEXT );
 
-    if( pHyperlinkItem->GetInsertMode() & HLINK_HTMLMODE )
-    {
-        mpLbForm->Clear();
-        mpLbForm->InsertEntry( aStrFormText );
-        mpLbForm->SelectEntryPos ( 0 );
+        OUString aStrFormButton = CuiResId( RID_SVXSTR_HYPERDLG_FORM_BUTTON );
+
+        if( pHyperlinkItem->GetInsertMode() & HLINK_HTMLMODE )
+        {
+            mpLbForm->Clear();
+            mpLbForm->InsertEntry( aStrFormText );
+            mpLbForm->SelectEntryPos ( 0 );
+        }
+        else
+        {
+            mpLbForm->Clear();
+            mpLbForm->InsertEntry( aStrFormText );
+            mpLbForm->InsertEntry( aStrFormButton );
+            mpLbForm->SelectEntryPos ( pHyperlinkItem->GetInsertMode() == HLINK_BUTTON ? 1 : 0 );
+        }
     }
     else
     {
-        mpLbForm->Clear();
-        mpLbForm->InsertEntry( aStrFormText );
-        mpLbForm->InsertEntry( aStrFormButton );
-        mpLbForm->SelectEntryPos ( pHyperlinkItem->GetInsertMode() == HLINK_BUTTON ? 1 : 0 );
+        mpCbbFrame->Hide();
+        mpLbForm->Hide();
+
+        VclPtr<FixedText> pLabel;
+        get(pLabel, "form_label");
+        pLabel->Hide();
+        get(pLabel, "frame_label");
+        pLabel->Hide();
     }
 
     // URL


More information about the Libreoffice-commits mailing list