handle missing values gracefully

This commit is contained in:
Caolán McNamara 2011-06-13 13:16:38 +01:00
parent a832f5bf2f
commit b19194ec92

View file

@ -194,13 +194,12 @@ SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()
// Follow assignment use order of values in relation to our list of key names! // Follow assignment use order of values in relation to our list of key names!
DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()\nI miss some values of configuration keys!\n" ); DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()\nI miss some values of configuration keys!\n" );
// Copy values from list in right order to ouer internal member. // Copy values from list in right order to our internal member.
sal_Int32 nPropertyCount = seqValues.getLength(); sal_Int32 nPropertyCount = seqValues.getLength();
for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty ) for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
{ {
// Safe impossible cases. if (!seqValues[nProperty].hasValue())
// Check any for valid value. continue;
DBG_ASSERT( !(seqValues[nProperty].hasValue()==sal_False), "SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()\nInvalid property value detected!\n" );
switch( nProperty ) switch( nProperty )
{ {
case PROPERTYHANDLE_AUTOMNEMONIC : { case PROPERTYHANDLE_AUTOMNEMONIC : {