diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-21 15:22:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-21 17:14:14 +0100 |
commit | 489bce598626390d9c0aa5e5b8514e26070add61 (patch) | |
tree | 170ec95dcb393dbe4f7178bc08e6d96b6b76954b /forms/source/component/FormattedField.cxx | |
parent | f19599c929ac6ae2708b19b9eff62ff70b44ee75 (diff) |
loplugin:flatten in filter..framework
Change-Id: I15a577b3c6da03001bbbf2c2b43b29b41c4007c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127234
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source/component/FormattedField.cxx')
-rw-r--r-- | forms/source/component/FormattedField.cxx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 340ee79a8a0f..432456802c4c 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -809,38 +809,38 @@ sal_uInt16 OFormattedModel::getPersistenceFlags() const bool OFormattedModel::commitControlValueToDbColumn( bool /*_bPostReset*/ ) { Any aControlValue( m_xAggregateFastSet->getFastPropertyValue( getValuePropertyAggHandle() ) ); - if ( aControlValue != m_aSaveValue ) - { - // empty string + EmptyIsNull = void - if ( !aControlValue.hasValue() - || ( ( aControlValue.getValueType().getTypeClass() == TypeClass_STRING ) - && getString( aControlValue ).isEmpty() - && m_bEmptyIsNull - ) + if ( aControlValue == m_aSaveValue ) + return true; + + // empty string + EmptyIsNull = void + if ( !aControlValue.hasValue() + || ( ( aControlValue.getValueType().getTypeClass() == TypeClass_STRING ) + && getString( aControlValue ).isEmpty() + && m_bEmptyIsNull ) - m_xColumnUpdate->updateNull(); - else + ) + m_xColumnUpdate->updateNull(); + else + { + try { - try + double f = 0.0; + if ( aControlValue.getValueType().getTypeClass() == TypeClass_DOUBLE || (aControlValue >>= f)) // #i110323 { - double f = 0.0; - if ( aControlValue.getValueType().getTypeClass() == TypeClass_DOUBLE || (aControlValue >>= f)) // #i110323 - { - DBTypeConversion::setValue( m_xColumnUpdate, m_aNullDate, getDouble( aControlValue ), m_nKeyType ); - } - else - { - DBG_ASSERT( aControlValue.getValueType().getTypeClass() == TypeClass_STRING, "OFormattedModel::commitControlValueToDbColumn: invalid value type!" ); - m_xColumnUpdate->updateString( getString( aControlValue ) ); - } + DBTypeConversion::setValue( m_xColumnUpdate, m_aNullDate, getDouble( aControlValue ), m_nKeyType ); } - catch(const Exception&) + else { - return false; + DBG_ASSERT( aControlValue.getValueType().getTypeClass() == TypeClass_STRING, "OFormattedModel::commitControlValueToDbColumn: invalid value type!" ); + m_xColumnUpdate->updateString( getString( aControlValue ) ); } } - m_aSaveValue = aControlValue; + catch(const Exception&) + { + return false; + } } + m_aSaveValue = aControlValue; return true; } |