[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 2 commits - sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Mar 18 09:17:09 UTC 2019
sw/source/core/crsr/DropDownFormFieldButton.cxx | 5 +++--
sw/source/ui/fldui/DropDownFormFieldDialog.cxx | 3 ++-
sw/source/uibase/docvw/edtwin.cxx | 15 +++++++++++++++
3 files changed, 20 insertions(+), 3 deletions(-)
New commits:
commit 43d4bb5b0906132695341c40d2bb4295ad3248ef
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sun Mar 10 09:45:56 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Mar 18 10:17:01 2019 +0100
MSForms: Fix handling of drop-down form field after DOC import
In the properties dialog, code expected that the ODF_FORMDROPDOWN_RESULT
is not set in case of an empty list. This caused a crash.
The field popup window code expected that the list is not specified
when it is empty, but DOC import code sets ODF_FORMDROPDOWN_LISTENTRY
even if the list is empty.
Change-Id: If4c86fc5a08cdc578150afaa42ad7e86bdba9150
Reviewed-on: https://gerrit.libreoffice.org/68963
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/69197
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index 5eb46e080bc0..17bdbc5ab07c 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -53,14 +53,15 @@ SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, l
OUString sListKey = ODF_FORMDROPDOWN_LISTENTRY;
sw::mark::IFieldmark::parameter_map_t::const_iterator pListEntries
= pParameters->find(sListKey);
+ css::uno::Sequence<OUString> vListEntries;
if (pListEntries != pParameters->end())
{
- css::uno::Sequence<OUString> vListEntries;
pListEntries->second >>= vListEntries;
for (OUString const& i : vListEntries)
aListBox->InsertEntry(i);
}
- else
+
+ if (vListEntries.getLength() == 0)
{
aListBox->InsertEntry(SwResId(STR_DROP_DOWN_EMPTY_LIST));
}
diff --git a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
index 5ad97b85978c..079aeaad4739 100644
--- a/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
+++ b/sw/source/ui/fldui/DropDownFormFieldDialog.cxx
@@ -113,7 +113,8 @@ void DropDownFormFieldDialog::InitControls()
{
sal_Int32 nSelection = -1;
pResult->second >>= nSelection;
- m_xListItemsTreeView->SelectEntry(vListEntries[nSelection]);
+ if (vListEntries.getLength() > nSelection)
+ m_xListItemsTreeView->SelectEntry(vListEntries[nSelection]);
}
}
}
commit 5ba23798017b57e2d4deb096a4e0f945185700b6
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Sat Mar 2 10:22:54 2019 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Mar 18 10:16:47 2019 +0100
MSForms: Open Control Properties dialog by double click for drop-down field
Change-Id: I66c0a7bad63d929ae346afe9d328d87dfa2c24ae
Reviewed-on: https://gerrit.libreoffice.org/68962
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/69196
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 3a93172afe41..e45c19fabf00 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3402,6 +3402,21 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
// table.
rSh.SelTableBox();
}
+
+ SwContentAtPos aContentAtPos(IsAttrAtPos::FormControl);
+ if( rSh.GetContentAtPos( aDocPos, aContentAtPos ) &&
+ aContentAtPos.aFnd.pFieldmark != nullptr)
+ {
+ IFieldmark *pFieldBM = const_cast< IFieldmark* > ( aContentAtPos.aFnd.pFieldmark );
+ if ( pFieldBM->GetFieldname( ) == ODF_FORMDROPDOWN )
+ {
+ RstMBDownFlags();
+ rSh.getIDocumentMarkAccess()->ClearFieldActivation();
+ GetView().GetViewFrame()->GetBindings().Execute(SID_FM_CTL_PROPERTIES);
+ return;
+ }
+ }
+
g_bHoldSelection = true;
return;
}
More information about the Libreoffice-commits
mailing list