forms/source/component/DatabaseForm.cxx | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-)
New commits: commit 05e516bd637fb2de5f6284fa0bc3a8ba15456879 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Jul 20 20:02:35 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Jul 20 19:50:57 2025 +0200 Flatten ODatabaseForm::reset_impl a bit Change-Id: I47ad680ef80ed5ed40b329ff83d2c38506a64d54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188085 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 8591c5f28e45..18d0d854da57 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -1961,26 +1961,26 @@ void ODatabaseForm::reset_impl(bool _bApproveByListeners) xPSI = xColProps->getPropertySetInfo( ); static constexpr OUString PROPERTY_CONTROLDEFAULT = u"ControlDefault"_ustr; - if ( xPSI.is() && xPSI->hasPropertyByName( PROPERTY_CONTROLDEFAULT ) ) - { - Any aDefault = xColProps->getPropertyValue( PROPERTY_CONTROLDEFAULT ); + if (!xPSI || !xPSI->hasPropertyByName(PROPERTY_CONTROLDEFAULT)) + continue; - bool bReadOnly = false; - if ( xPSI->hasPropertyByName( PROPERTY_ISREADONLY ) ) - xColProps->getPropertyValue( PROPERTY_ISREADONLY ) >>= bReadOnly; + Any aDefault = xColProps->getPropertyValue( PROPERTY_CONTROLDEFAULT ); + if (!aDefault.hasValue()) + continue; - if ( !bReadOnly ) - { - try - { - if ( aDefault.hasValue() ) - xColUpdate->updateObject( aDefault ); - } - catch(const Exception&) - { - DBG_UNHANDLED_EXCEPTION("forms.component"); - } - } + bool bReadOnly = false; + if ( xPSI->hasPropertyByName( PROPERTY_ISREADONLY ) ) + xColProps->getPropertyValue( PROPERTY_ISREADONLY ) >>= bReadOnly; + if (bReadOnly) + continue; + + try + { + xColUpdate->updateObject( aDefault ); + } + catch(const Exception&) + { + DBG_UNHANDLED_EXCEPTION("forms.component"); } } }