Kaydet (Commit) 834d796e authored tarafından Miklos Vajna's avatar Miklos Vajna

cui: fix Impress hyperlink insert when the form listbox is hidden

In preparation of forward-porting the distro/collabora/cp-6.0-only
commit 418adc09 (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

Change-Id: I238d9f662a74f320d05ea6a6cc97319d2d5b3d5a
Reviewed-on: https://gerrit.libreoffice.org/73034Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
üst 5e075c3f
...@@ -426,7 +426,13 @@ void SvxHyperlinkTabPageBase::GetDataFromCommonFields( OUString& aStrName, ...@@ -426,7 +426,13 @@ void SvxHyperlinkTabPageBase::GetDataFromCommonFields( OUString& aStrName,
aStrIntName = mpEdText->GetText(); aStrIntName = mpEdText->GetText();
aStrName = mpEdIndication->GetText(); aStrName = mpEdIndication->GetText();
aStrFrame = mpCbbFrame->GetText(); aStrFrame = mpCbbFrame->GetText();
eMode = static_cast<SvxLinkInsertMode>(mpLbForm->GetSelectedEntryPos()+1);
sal_Int32 nPos = mpLbForm->GetSelectedEntryPos();
// This happens when FillStandardDlgFields() hides mpLbForm.
nPos = 0;
eMode = static_cast<SvxLinkInsertMode>(nPos + 1);
// Ask dialog whether the current doc is a HTML-doc // Ask dialog whether the current doc is a HTML-doc
if (static_cast<SvxHpLinkDlg*>(mpDialog.get())->IsHTMLDoc()) if (static_cast<SvxHpLinkDlg*>(mpDialog.get())->IsHTMLDoc())
eMode = static_cast<SvxLinkInsertMode>( sal_uInt16(eMode) | HLINK_HTMLMODE ); eMode = static_cast<SvxLinkInsertMode>( sal_uInt16(eMode) | HLINK_HTMLMODE );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment