diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-05-27 15:27:06 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-06-21 12:23:29 +0200 |
commit | b0256ffc7342fc90a21cb1f22e0e04a6fdbf64e7 (patch) | |
tree | a6947ea8baa2c196bda84b467a218b8029fc9ab0 /cui | |
parent | lo: disable under-used hyperlink fields that are buggy online. (diff) | |
download | core-b0256ffc7342fc90a21cb1f22e0e04a6fdbf64e7.tar.gz core-b0256ffc7342fc90a21cb1f22e0e04a6fdbf64e7.zip |
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@collabora.com>
Tested-by: Jenkins
(cherry picked from commit 834d796e03d257db486e6a6da8b1ccbee7ba24ee)
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/hltpbase.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
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 ); |