diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 12:39:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-14 13:33:20 +0200 |
commit | fcabb9a7263d4128ae934636b5a8eebc2a0217cc (patch) | |
tree | 28badfa7a81d578610f6abfc895d330f8a6437e4 /forms/source/component/Edit.cxx | |
parent | 600b35480da436b2683b720149b576e85c16aa84 (diff) |
loplugin:flatten in forms
Change-Id: I7e264cc1e60280b80a4e2e87b8944de4912c563d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92162
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source/component/Edit.cxx')
-rw-r--r-- | forms/source/component/Edit.cxx | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 688f846730fb..e1eefb02f396 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -556,31 +556,31 @@ sal_uInt16 OEditModel::getPersistenceFlags() const void OEditModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm ) { Reference< XPropertySet > xField = getField(); - if ( xField.is() ) + if ( !xField.is() ) + return; + + m_pValueFormatter.reset( new ::dbtools::FormattedColumnValue( getContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) ); + + if ( m_pValueFormatter->getKeyType() == NumberFormat::SCIENTIFIC ) + return; + + m_bMaxTextLenModified = getINT16(m_xAggregateSet->getPropertyValue(PROPERTY_MAXTEXTLEN)) != 0; + if ( !m_bMaxTextLenModified ) { - m_pValueFormatter.reset( new ::dbtools::FormattedColumnValue( getContext(), Reference< XRowSet >( _rxForm, UNO_QUERY ), xField ) ); + sal_Int32 nFieldLen = 0; + xField->getPropertyValue("Precision") >>= nFieldLen; - if ( m_pValueFormatter->getKeyType() != NumberFormat::SCIENTIFIC ) + if (nFieldLen > 0 && nFieldLen <= SAL_MAX_INT16) { - m_bMaxTextLenModified = getINT16(m_xAggregateSet->getPropertyValue(PROPERTY_MAXTEXTLEN)) != 0; - if ( !m_bMaxTextLenModified ) - { - sal_Int32 nFieldLen = 0; - xField->getPropertyValue("Precision") >>= nFieldLen; + Any aVal; + aVal <<= static_cast<sal_Int16>(nFieldLen); + m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, aVal); - if (nFieldLen > 0 && nFieldLen <= SAL_MAX_INT16) - { - Any aVal; - aVal <<= static_cast<sal_Int16>(nFieldLen); - m_xAggregateSet->setPropertyValue(PROPERTY_MAXTEXTLEN, aVal); - - m_bMaxTextLenModified = true; - } - } - else - m_bMaxTextLenModified = false; // to get sure that the text len won't be set in unloaded + m_bMaxTextLenModified = true; } } + else + m_bMaxTextLenModified = false; // to get sure that the text len won't be set in unloaded } |