summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-05-27 15:27:06 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-05-27 16:24:02 +0200
commit834d796e03d257db486e6a6da8b1ccbee7ba24ee (patch)
tree2b6d4437524b622c36c5736b7ee66e5f6a4a35a8 /cui
parent5e075c3fbfd13d24042e420c340e9ae05f942dc5 (diff)
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
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/hltpbase.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 235f47fd3549..4d92ba429528 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -426,7 +426,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 );