tdf#137652 fix XDL import: no more missing empty items for combobox
Change-Id: I6837968ee7cc5e4b3bc9abd7e320f562c6ff0833 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104619 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
This commit is contained in:
committed by
Thorsten Behrens
parent
cb44cf2f36
commit
f4a5893ece
@@ -311,6 +311,7 @@ class MenuPopupElement
|
|||||||
{
|
{
|
||||||
std::vector< OUString > _itemValues;
|
std::vector< OUString > _itemValues;
|
||||||
std::vector< sal_Int16 > _itemSelected;
|
std::vector< sal_Int16 > _itemSelected;
|
||||||
|
bool _allowEmptyItems;
|
||||||
public:
|
public:
|
||||||
css::uno::Sequence< OUString > getItemValues();
|
css::uno::Sequence< OUString > getItemValues();
|
||||||
css::uno::Sequence< sal_Int16 > getSelectedItems();
|
css::uno::Sequence< sal_Int16 > getSelectedItems();
|
||||||
@@ -323,9 +324,11 @@ public:
|
|||||||
MenuPopupElement(
|
MenuPopupElement(
|
||||||
OUString const & rLocalName,
|
OUString const & rLocalName,
|
||||||
css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
|
css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
|
||||||
ElementBase * pParent, DialogImport * pImport )
|
ElementBase * pParent, DialogImport * pImport,
|
||||||
|
bool aAllowEmptyItems)
|
||||||
: ElementBase( pImport->XMLNS_DIALOGS_UID,
|
: ElementBase( pImport->XMLNS_DIALOGS_UID,
|
||||||
rLocalName, xAttributes, pParent, pImport )
|
rLocalName, xAttributes, pParent, pImport )
|
||||||
|
, _allowEmptyItems(aAllowEmptyItems)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1275,8 +1275,8 @@ Reference< xml::input::XElement > MenuPopupElement::startChildElement(
|
|||||||
else if ( rLocalName == "menuitem" )
|
else if ( rLocalName == "menuitem" )
|
||||||
{
|
{
|
||||||
OUString aValue( xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID,"value" ) );
|
OUString aValue( xAttributes->getValueByUidName( m_xImport->XMLNS_DIALOGS_UID,"value" ) );
|
||||||
SAL_WARN_IF( aValue.isEmpty(), "xmlscript.xmldlg", "### menuitem has no value?" );
|
SAL_WARN_IF( aValue.isEmpty() && !_allowEmptyItems, "xmlscript.xmldlg", "### menuitem has no value?" );
|
||||||
if (!aValue.isEmpty())
|
if ((!aValue.isEmpty()) || _allowEmptyItems)
|
||||||
{
|
{
|
||||||
_itemValues.push_back( aValue );
|
_itemValues.push_back( aValue );
|
||||||
|
|
||||||
@@ -1331,7 +1331,7 @@ Reference< xml::input::XElement > MenuListElement::startChildElement(
|
|||||||
// menupopup
|
// menupopup
|
||||||
else if ( rLocalName == "menupopup" )
|
else if ( rLocalName == "menupopup" )
|
||||||
{
|
{
|
||||||
_popup = new MenuPopupElement( rLocalName, xAttributes, this, m_xImport.get() );
|
_popup = new MenuPopupElement( rLocalName, xAttributes, this, m_xImport.get(), false );
|
||||||
return _popup;
|
return _popup;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1399,7 +1399,7 @@ Reference< xml::input::XElement > ComboBoxElement::startChildElement(
|
|||||||
// menupopup
|
// menupopup
|
||||||
else if ( rLocalName == "menupopup" )
|
else if ( rLocalName == "menupopup" )
|
||||||
{
|
{
|
||||||
_popup = new MenuPopupElement( rLocalName, xAttributes, this, m_xImport.get() );
|
_popup = new MenuPopupElement( rLocalName, xAttributes, this, m_xImport.get(), true );
|
||||||
return _popup;
|
return _popup;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user