[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - cui/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 27 16:08:51 UTC 2019
cui/source/dialogs/hltpbase.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit af4fc900cbd81e7c85b0938c5bedd3f7aa6e2f4a
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon May 27 15:27:06 2019 +0200
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon May 27 18:08:04 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.
[ master -> cp-6.0 backport note: on this branch, this fixes a
regression. ]
Conflicts:
cui/source/dialogs/hltpbase.cxx
Change-Id: I238d9f662a74f320d05ea6a6cc97319d2d5b3d5a
Reviewed-on: https://gerrit.libreoffice.org/73036
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index c60a6bf39160..247b4fbc3719 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -450,7 +450,13 @@ void SvxHyperlinkTabPageBase::GetDataFromCommonFields( OUString& aStrName,
aStrIntName = mpEdText->GetText();
aStrName = mpEdIndication->GetText();
aStrFrame = mpCbbFrame->GetText();
- eMode = (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 = (SvxLinkInsertMode) ( sal_uInt16(eMode) | HLINK_HTMLMODE );
More information about the Libreoffice-commits
mailing list