summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-11-09 15:50:01 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-11-10 17:12:22 +0100
commit295ae0ab150d8e9ea5da39c518906bdb5cb3aead (patch)
treea0804d185b4bbf4d89a670703d228f3b78347fb3
parent53b2132137f526106a3d57ffc6a9cb088a221e17 (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. (cherry picked from commit 56db6406b0b63a2d2d99024e7c311ebd874f3893) Conflicts: xmloff/qa/unit/text.cxx Change-Id: Id577ba9639151549a8f953aab31685a73a898504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142544 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--offapi/com/sun/star/text/ContentControl.idl8
-rw-r--r--schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng6
-rw-r--r--sw/inc/formatcontentcontrol.hxx9
-rw-r--r--sw/inc/unoprnms.hxx1
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport17.cxx1
-rw-r--r--sw/source/core/crsr/viscrs.cxx4
-rw-r--r--sw/source/core/txtnode/attrcontentcontrol.cxx17
-rw-r--r--sw/source/core/unocore/unocontentcontrol.cxx40
-rw-r--r--sw/source/core/unocore/unomap1.cxx1
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/ui/misc/contentcontroldlg.cxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
-rw-r--r--sw/source/uibase/wrtsh/wrtsh1.cxx13
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx6
-rw-r--r--xmloff/qa/unit/data/content-control-dropdown.fodt2
-rw-r--r--xmloff/qa/unit/text.cxx2
-rw-r--r--xmloff/source/text/txtparae.cxx9
-rw-r--r--xmloff/source/text/xmlcontentcontrolcontext.cxx13
-rw-r--r--xmloff/source/text/xmlcontentcontrolcontext.hxx1
19 files changed, 120 insertions, 19 deletions
diff --git a/offapi/com/sun/star/text/ContentControl.idl b/offapi/com/sun/star/text/ContentControl.idl
index ae8a0e1a9396..7bdb39fa5101 100644
--- a/offapi/com/sun/star/text/ContentControl.idl
+++ b/offapi/com/sun/star/text/ContentControl.idl
@@ -43,8 +43,6 @@ service ContentControl
[optional, property] string UncheckedState;
/** List items of a dropdown: DisplayText + Value pairs with string values for each item.
-
- If the list is non-empty, a dropdown control is provided on the UI.
*/
[optional, property] sequence< sequence< com::sun::star::beans::PropertyValue > > ListItems;
@@ -100,6 +98,12 @@ service ContentControl
*/
[optional, property] boolean ComboBox;
+ /** Drop-down that does not allow free-form text, i.e. not combo box.
+
+ @since LibreOffice 7.5
+ */
+ [optional, property] boolean DropDown;
+
/** The alias: kind of a human-readable title / description, show up on the UI.
@since LibreOffice 7.5
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index 0c9d2818e1cb..5359dec15298 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2929,6 +2929,12 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
</rng:attribute>
</rng:optional>
<rng:optional>
+ <!-- default value: false -->
+ <rng:attribute name="loext:dropdown">
+ <rng:ref name="boolean"/>
+ </rng:attribute>
+ </rng:optional>
+ <rng:optional>
<rng:attribute name="loext:alias">
<rng:ref name="string"/>
</rng:attribute>
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index 86bc8a0c62b7..a44c8b9b5a44 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -151,6 +151,9 @@ class SW_DLLPUBLIC SwContentControl : public sw::BroadcastingModify
/// Same as drop-down, but free-form input is also accepted.
bool m_bComboBox = false;
+ /// Same as combo box, but free-form input is not accepted.
+ bool m_bDropDown = false;
+
/// The placeholder's doc part: just remembered.
OUString m_aPlaceholderDocPart;
@@ -236,8 +239,6 @@ public:
std::vector<SwContentControlListItem> GetListItems() const { return m_aListItems; }
- bool HasListItems() const { return !m_aListItems.empty(); }
-
void SetListItems(const std::vector<SwContentControlListItem>& rListItems)
{
m_aListItems = rListItems;
@@ -280,6 +281,10 @@ public:
bool GetComboBox() const { return m_bComboBox; }
+ void SetDropDown(bool bDropDown) { m_bDropDown = bDropDown; }
+
+ bool GetDropDown() const { return m_bDropDown; }
+
void SetPlaceholderDocPart(const OUString& rPlaceholderDocPart)
{
m_aPlaceholderDocPart = rPlaceholderDocPart;
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 64fe359f7ac7..37069b07925f 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -882,6 +882,7 @@
#define UNO_NAME_CURRENT_DATE "CurrentDate"
#define UNO_NAME_PLAIN_TEXT "PlainText"
#define UNO_NAME_COMBO_BOX "ComboBox"
+#define UNO_NAME_DROP_DOWN "DropDown"
#define UNO_NAME_PLACEHOLDER_DOC_PART "PlaceholderDocPart"
#define UNO_NAME_DATA_BINDING_PREFIX_MAPPINGS "DataBindingPrefixMappings"
#define UNO_NAME_DATA_BINDING_XPATH "DataBindingXpath"
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index d7f85c501b47..8ccd9f1f6540 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -202,6 +202,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDropdownContentControlExport)
xMSF->createInstance("com.sun.star.text.ContentControl"), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, uno::UNO_QUERY);
{
+ xContentControlProps->setPropertyValue("DropDown", uno::Any(true));
uno::Sequence<beans::PropertyValues> aListItems = {
{
comphelper::makePropertyValue("DisplayText", uno::Any(OUString("red"))),
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index ec07f4353881..0e73555c0c94 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -697,7 +697,7 @@ void SwSelPaintRects::HighlightContentControl()
aJson.put("action", "show");
aJson.put("rectangles", aPayload);
- if (pContentControl && pContentControl->HasListItems())
+ if (pContentControl && (pContentControl->GetComboBox() || pContentControl->GetDropDown()))
{
tools::ScopedJsonWriterArray aItems = aJson.startArray("items");
for (const auto& rItem : pContentControl->GetListItems())
@@ -742,7 +742,7 @@ void SwSelPaintRects::HighlightContentControl()
}
}
- if (pContentControl && pContentControl->HasListItems())
+ if (pContentControl && (pContentControl->GetComboBox() || pContentControl->GetDropDown()))
{
if (pWrtShell)
{
diff --git a/sw/source/core/txtnode/attrcontentcontrol.cxx b/sw/source/core/txtnode/attrcontentcontrol.cxx
index 263b64a2da8f..7300ecfdf265 100644
--- a/sw/source/core/txtnode/attrcontentcontrol.cxx
+++ b/sw/source/core/txtnode/attrcontentcontrol.cxx
@@ -334,10 +334,17 @@ bool SwContentControl::IsInteractingCharacter(sal_Unicode cCh)
bool SwContentControl::ShouldOpenPopup(const vcl::KeyCode& rKeyCode)
{
- if (HasListItems() || GetDate())
+ switch (GetType())
{
- // Alt-down opens the popup.
- return rKeyCode.IsMod2() && rKeyCode.GetCode() == KEY_DOWN;
+ case SwContentControlType::DROP_DOWN_LIST:
+ case SwContentControlType::COMBO_BOX:
+ case SwContentControlType::DATE:
+ {
+ // Alt-down opens the popup.
+ return rKeyCode.IsMod2() && rKeyCode.GetCode() == KEY_DOWN;
+ }
+ default:
+ break;
}
return false;
@@ -355,7 +362,7 @@ SwContentControlType SwContentControl::GetType() const
return SwContentControlType::COMBO_BOX;
}
- if (!m_aListItems.empty())
+ if (m_bDropDown)
{
return SwContentControlType::DROP_DOWN_LIST;
}
@@ -407,6 +414,8 @@ void SwContentControl::dumpAsXml(xmlTextWriterPtr pWriter) const
BAD_CAST(OString::boolean(m_bPlainText).getStr()));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("combo-box"),
BAD_CAST(OString::boolean(m_bComboBox).getStr()));
+ (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("drop-down"),
+ BAD_CAST(OString::boolean(m_bDropDown).getStr()));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("placeholder-doc-part"),
BAD_CAST(m_aPlaceholderDocPart.toUtf8().getStr()));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("data-binding-prefix-mappings"),
diff --git a/sw/source/core/unocore/unocontentcontrol.cxx b/sw/source/core/unocore/unocontentcontrol.cxx
index bae19e9b6edd..c67dc8193de9 100644
--- a/sw/source/core/unocore/unocontentcontrol.cxx
+++ b/sw/source/core/unocore/unocontentcontrol.cxx
@@ -169,6 +169,7 @@ public:
OUString m_aCurrentDate;
bool m_bPlainText;
bool m_bComboBox;
+ bool m_bDropDown;
OUString m_aPlaceholderDocPart;
OUString m_aDataBindingPrefixMappings;
OUString m_aDataBindingXpath;
@@ -193,6 +194,7 @@ public:
, m_bDate(false)
, m_bPlainText(false)
, m_bComboBox(false)
+ , m_bDropDown(false)
{
if (m_pContentControl)
{
@@ -543,6 +545,7 @@ void SwXContentControl::AttachImpl(const uno::Reference<text::XTextRange>& xText
pContentControl->SetCurrentDate(m_pImpl->m_aCurrentDate);
pContentControl->SetPlainText(m_pImpl->m_bPlainText);
pContentControl->SetComboBox(m_pImpl->m_bComboBox);
+ pContentControl->SetDropDown(m_pImpl->m_bDropDown);
pContentControl->SetPlaceholderDocPart(m_pImpl->m_aPlaceholderDocPart);
pContentControl->SetDataBindingPrefixMappings(m_pImpl->m_aDataBindingPrefixMappings);
pContentControl->SetDataBindingXpath(m_pImpl->m_aDataBindingXpath);
@@ -783,10 +786,21 @@ void SAL_CALL SwXContentControl::setPropertyValue(const OUString& rPropertyName,
if (m_pImpl->m_bIsDescriptor)
{
m_pImpl->m_aListItems = aItems;
+
+ if (!m_pImpl->m_bComboBox && !m_pImpl->m_bDropDown)
+ {
+ m_pImpl->m_bDropDown = true;
+ }
}
else
{
m_pImpl->m_pContentControl->SetListItems(aItems);
+
+ if (!m_pImpl->m_pContentControl->GetComboBox()
+ && !m_pImpl->m_pContentControl->GetDropDown())
+ {
+ m_pImpl->m_pContentControl->SetDropDown(true);
+ }
}
}
else if (rPropertyName == UNO_NAME_PICTURE)
@@ -894,6 +908,21 @@ void SAL_CALL SwXContentControl::setPropertyValue(const OUString& rPropertyName,
}
}
}
+ else if (rPropertyName == UNO_NAME_DROP_DOWN)
+ {
+ bool bValue;
+ if (rValue >>= bValue)
+ {
+ if (m_pImpl->m_bIsDescriptor)
+ {
+ m_pImpl->m_bDropDown = bValue;
+ }
+ else
+ {
+ m_pImpl->m_pContentControl->SetDropDown(bValue);
+ }
+ }
+ }
else if (rPropertyName == UNO_NAME_PLACEHOLDER_DOC_PART)
{
OUString aValue;
@@ -1155,6 +1184,17 @@ uno::Any SAL_CALL SwXContentControl::getPropertyValue(const OUString& rPropertyN
aRet <<= m_pImpl->m_pContentControl->GetComboBox();
}
}
+ else if (rPropertyName == UNO_NAME_DROP_DOWN)
+ {
+ if (m_pImpl->m_bIsDescriptor)
+ {
+ aRet <<= m_pImpl->m_bDropDown;
+ }
+ else
+ {
+ aRet <<= m_pImpl->m_pContentControl->GetDropDown();
+ }
+ }
else if (rPropertyName == UNO_NAME_PLACEHOLDER_DOC_PART)
{
if (m_pImpl->m_bIsDescriptor)
diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx
index 05563ca34116..a584d1f59952 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -1039,6 +1039,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetContentControlProper
{ u"" UNO_NAME_CURRENT_DATE, 0, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 },
{ u"" UNO_NAME_PLAIN_TEXT, 0, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
{ u"" UNO_NAME_COMBO_BOX, 0, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
+ { u"" UNO_NAME_DROP_DOWN, 0, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
{ u"" UNO_NAME_PLACEHOLDER_DOC_PART, 0, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 },
{ u"" UNO_NAME_DATA_BINDING_PREFIX_MAPPINGS, 0, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 },
{ u"" UNO_NAME_DATA_BINDING_XPATH, 0, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 },
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0d54ef129784..1fc10fdbd332 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2405,7 +2405,7 @@ void DocxAttributeOutput::WriteContentControlStart()
m_pSerializer->endElementNS(XML_w14, XML_checkbox);
}
- if (m_pContentControl->HasListItems())
+ if (m_pContentControl->GetComboBox() || m_pContentControl->GetDropDown())
{
if (m_pContentControl->GetComboBox())
{
diff --git a/sw/source/ui/misc/contentcontroldlg.cxx b/sw/source/ui/misc/contentcontroldlg.cxx
index 5770bf1bd6bd..fadb4c1739fe 100644
--- a/sw/source/ui/misc/contentcontroldlg.cxx
+++ b/sw/source/ui/misc/contentcontroldlg.cxx
@@ -120,7 +120,7 @@ SwContentControlDlg::SwContentControlDlg(weld::Window* pParent, SwWrtShell& rWrt
m_xCheckboxFrame->set_visible(false);
}
- if (m_pContentControl->HasListItems())
+ if (m_pContentControl->GetComboBox() || m_pContentControl->GetDropDown())
{
for (const auto& rListItem : m_pContentControl->GetListItems())
{
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index f3f1911d3ee2..696529b61ab0 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3417,7 +3417,7 @@ void SwXTextDocument::executeContentControlEvent(const StringMap& rArguments)
auto pTextContentControl = static_txtattr_cast<SwTextContentControl*>(pAttr);
const SwFormatContentControl& rFormatContentControl = pTextContentControl->GetContentControl();
std::shared_ptr<SwContentControl> pContentControl = rFormatContentControl.GetContentControl();
- if (!pContentControl->HasListItems())
+ if (!pContentControl->GetComboBox() && !pContentControl->GetDropDown())
{
return;
}
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 52558d1963a6..4983bb3dc30f 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1058,12 +1058,17 @@ void SwWrtShell::InsertContentControl(SwContentControlType eType)
break;
}
case SwContentControlType::COMBO_BOX:
- {
- pContentControl->SetComboBox(true);
- [[fallthrough]];
- }
case SwContentControlType::DROP_DOWN_LIST:
{
+ if (eType == SwContentControlType::COMBO_BOX)
+ {
+ pContentControl->SetComboBox(true);
+ }
+ else if (eType == SwContentControlType::DROP_DOWN_LIST)
+ {
+ pContentControl->SetDropDown(true);
+ }
+
pContentControl->SetShowingPlaceHolder(true);
if (!HasSelection())
{
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ada74256cfc0..fe4b6c51b6ac 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -974,7 +974,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));
}
diff --git a/xmloff/qa/unit/data/content-control-dropdown.fodt b/xmloff/qa/unit/data/content-control-dropdown.fodt
index 97344d1e8bec..73007b2c7c26 100644
--- a/xmloff/qa/unit/data/content-control-dropdown.fodt
+++ b/xmloff/qa/unit/data/content-control-dropdown.fodt
@@ -2,7 +2,7 @@
<office:document xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
<office:body>
<office:text>
- <text:p><loext:content-control><loext:list-item loext:display-text="red" loext:value="R"/><loext:list-item loext:display-text="green" loext:value="G"/><loext:list-item loext:display-text="blue" loext:value="B"/>choose a color</loext:content-control></text:p>
+ <text:p><loext:content-control loext:dropdown="true"><loext:list-item loext:display-text="red" loext:value="R"/><loext:list-item loext:display-text="green" loext:value="G"/><loext:list-item loext:display-text="blue" loext:value="B"/>choose a color</loext:content-control></text:p>
</office:text>
</office:body>
</office:document>
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index 446e292a08cf..e2c18f4878da 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -487,6 +487,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDropdownContentControlExport)
xMSF->createInstance("com.sun.star.text.ContentControl"), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xContentControlProps(xContentControl, uno::UNO_QUERY);
{
+ xContentControlProps->setPropertyValue("DropDown", uno::Any(true));
uno::Sequence<beans::PropertyValues> aListItems = {
{
comphelper::makePropertyValue("DisplayText", uno::Any(OUString("red"))),
@@ -518,6 +519,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testDropdownContentControlExport)
// Then make sure the expected markup is used:
std::unique_ptr<SvStream> pStream = parseExportStream(aTempFile, "content.xml");
xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
+ assertXPath(pXmlDoc, "//loext:content-control", "dropdown", "true");
// Without the accompanying fix in place, this failed with:
// - Expected: 1
// - Actual : 0
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index eb510f025383..e1ae73aae8cd 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -3966,6 +3966,15 @@ void XMLTextParagraphExport::ExportContentControl(
GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_COMBOBOX, aBuffer.makeStringAndClear());
}
+ bool bDropDown = false;
+ xPropertySet->getPropertyValue("DropDown") >>= bDropDown;
+ if (bDropDown)
+ {
+ OUStringBuffer aBuffer;
+ sax::Converter::convertBool(aBuffer, bDropDown);
+ GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_DROPDOWN, aBuffer.makeStringAndClear());
+ }
+
OUString aAlias;
xPropertySet->getPropertyValue("Alias") >>= aAlias;
if (!aAlias.isEmpty())
diff --git a/xmloff/source/text/xmlcontentcontrolcontext.cxx b/xmloff/source/text/xmlcontentcontrolcontext.cxx
index bb4580b2cb78..0a7574625ab9 100644
--- a/xmloff/source/text/xmlcontentcontrolcontext.cxx
+++ b/xmloff/source/text/xmlcontentcontrolcontext.cxx
@@ -133,6 +133,14 @@ void XMLContentControlContext::startFastElement(
}
break;
}
+ case XML_ELEMENT(LO_EXT, XML_DROPDOWN):
+ {
+ if (sax::Converter::convertBool(bTmp, rIter.toView()))
+ {
+ m_bDropDown = bTmp;
+ }
+ break;
+ }
case XML_ELEMENT(LO_EXT, XML_ALIAS):
{
m_aAlias = rIter.toString();
@@ -239,6 +247,11 @@ void XMLContentControlContext::endFastElement(sal_Int32)
xPropertySet->setPropertyValue("ComboBox", uno::Any(m_bComboBox));
}
+ if (m_bDropDown)
+ {
+ xPropertySet->setPropertyValue("DropDown", uno::Any(m_bDropDown));
+ }
+
if (!m_aAlias.isEmpty())
{
xPropertySet->setPropertyValue("Alias", uno::Any(m_aAlias));
diff --git a/xmloff/source/text/xmlcontentcontrolcontext.hxx b/xmloff/source/text/xmlcontentcontrolcontext.hxx
index 0bfca015ec68..936fc03c781b 100644
--- a/xmloff/source/text/xmlcontentcontrolcontext.hxx
+++ b/xmloff/source/text/xmlcontentcontrolcontext.hxx
@@ -50,6 +50,7 @@ class XMLContentControlContext : public SvXMLImportContext
OUString m_aCurrentDate;
bool m_bPlainText = false;
bool m_bComboBox = false;
+ bool m_bDropDown = false;
OUString m_aAlias;
OUString m_aTag;