Resolves: tdf#79250 add typed list to form control listbox

... so numeric and text data can be distinguished input.

Change-Id: I63280a93c272ccc6f5e7ca06a1a1fcbfb3db8455
This commit is contained in:
Eike Rathke
2017-02-10 18:27:14 +01:00
parent bed701f31a
commit e387b69967
21 changed files with 311 additions and 21 deletions

View File

@@ -193,6 +193,10 @@ void OComboBoxModel::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) cons
_rValue <<= comphelper::containerToSequence(getStringItemList());
break;
case PROPERTY_ID_TYPEDITEMLIST:
_rValue <<= getTypedItemList();
break;
default:
OBoundControlModel::getFastPropertyValue(_rValue, _nHandle);
}
@@ -247,6 +251,11 @@ void OComboBoxModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const
}
break;
// XXX NOTE: PROPERTY_ID_TYPEDITEMLIST not handled here because only
// set for external sources in which case not even
// setNewStringItemList() for PROPERTY_ID_STRINGITEMLIST above should
// had been called ...
default:
OBoundControlModel::setFastPropertyValue_NoBroadcast(_nHandle, _rValue);
}
@@ -304,6 +313,7 @@ void OComboBoxModel::describeAggregateProperties( Sequence< Property >& _rAggreg
// superseded properties:
RemoveProperty( _rAggregateProps, PROPERTY_STRINGITEMLIST );
RemoveProperty( _rAggregateProps, PROPERTY_TYPEDITEMLIST );
}
@@ -432,6 +442,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<css::io::XObjectInputStream>&
)
{
setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( css::uno::Sequence<OUString>() ) );
setFastPropertyValue( PROPERTY_ID_TYPEDITEMLIST, makeAny( css::uno::Sequence<css::uno::Any>() ) );
}
if (nVersion > 0x0004)
@@ -655,6 +666,8 @@ void OComboBoxModel::loadData( bool _bForce )
// Set String-Sequence at ListBox
setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( comphelper::containerToSequence(aStringList) ) );
// Reset TypedItemList, no matching data.
setFastPropertyValue( PROPERTY_ID_TYPEDITEMLIST, makeAny( css::uno::Sequence<css::uno::Any>() ) );
}
@@ -765,6 +778,7 @@ bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset )
aStringItemList.getArray()[ nOldLen ] = sNewValue;
setFastPropertyValue( PROPERTY_ID_STRINGITEMLIST, makeAny( aStringItemList ) );
setFastPropertyValue( PROPERTY_ID_TYPEDITEMLIST, makeAny( css::uno::Sequence<css::uno::Any>() ) );
}
}
}
@@ -810,7 +824,10 @@ Any OComboBoxModel::getDefaultForReset() const
void OComboBoxModel::stringItemListChanged( ControlModelLock& /*_rInstanceLock*/ )
{
if ( m_xAggregateSet.is() )
{
m_xAggregateSet->setPropertyValue( PROPERTY_STRINGITEMLIST, makeAny( comphelper::containerToSequence(getStringItemList()) ) );
m_xAggregateSet->setPropertyValue( PROPERTY_TYPEDITEMLIST, makeAny( getTypedItemList()) ) ;
}
}