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.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2025-07-20 19:50:57 +02:00
parent a37d19efa3
commit 05e516bd63
+19 -19
View File
@@ -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 ) )
if (!xPSI || !xPSI->hasPropertyByName(PROPERTY_CONTROLDEFAULT))
continue;
Any aDefault = xColProps->getPropertyValue( PROPERTY_CONTROLDEFAULT );
if (!aDefault.hasValue())
continue;
bool bReadOnly = false;
if ( xPSI->hasPropertyByName( PROPERTY_ISREADONLY ) )
xColProps->getPropertyValue( PROPERTY_ISREADONLY ) >>= bReadOnly;
if (bReadOnly)
continue;
try
{
Any aDefault = xColProps->getPropertyValue( PROPERTY_CONTROLDEFAULT );
bool bReadOnly = false;
if ( xPSI->hasPropertyByName( PROPERTY_ISREADONLY ) )
xColProps->getPropertyValue( PROPERTY_ISREADONLY ) >>= bReadOnly;
if ( !bReadOnly )
{
try
{
if ( aDefault.hasValue() )
xColUpdate->updateObject( aDefault );
}
catch(const Exception&)
{
DBG_UNHANDLED_EXCEPTION("forms.component");
}
}
xColUpdate->updateObject( aDefault );
}
catch(const Exception&)
{
DBG_UNHANDLED_EXCEPTION("forms.component");
}
}
}