diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-11-09 15:50:01 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-11-09 17:00:00 +0100 |
commit | 56db6406b0b63a2d2d99024e7c311ebd874f3893 (patch) | |
tree | b7096b526b5bfd5f5a474f467761f7065f8e81c2 /writerfilter | |
parent | cb8a05bfccf77d5217f4f2e20b5898d6a24f990d (diff) |
sw content controls: allow no list items in a dropdown
- Replace SwContentControl::HasListItems(), which assumed that the type
is dropdown if we have list items. This is not valid, it's OK to have
a dropdown with no list items. Add a GetDropDown() instead to check
for the type, explicitly.
- UNO API sets the dropdown bit when list items are set and the type is
not expilcitly combo box or drop down, to keep backwards
compatibility with existing documents.
- No change to the edit shell, SwDropDownContentControlButton already
checked if items are empty and used STR_DROP_DOWN_EMPTY_LIST in that
case, but that was dead code previously.
- ODT & DOCX filters are now updated, ODF has a new
<loext:content-control loext:dropdown="..."> attribute to specify that
the type is a dropdown, explicitly.
Change-Id: Id577ba9639151549a8f953aab31685a73a898504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142491
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 0e436fe165b9..e3e2ca0aa9dd 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -980,7 +980,11 @@ void DomainMapper_Impl::PopSdt() pItems[i] = aItem; } xContentControlProps->setPropertyValue("ListItems", uno::Any(aItems)); - if (m_pSdtHelper->getControlType() == SdtControlType::comboBox) + if (m_pSdtHelper->getControlType() == SdtControlType::dropDown) + { + xContentControlProps->setPropertyValue("DropDown", uno::Any(true)); + } + else { xContentControlProps->setPropertyValue("ComboBox", uno::Any(true)); } |