tdf#122319 - Don't allow nullable form components if input is required
Change-Id: I676aab37df7a98192680b87f0143a27d2a5fd3ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140713
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 9b5558e..7b6dd36 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1960,7 +1960,8 @@ void OBoundControlModel::connectToField(const Reference<XRowSet>& rForm)
m_xColumn.set( m_xField, UNO_QUERY );
sal_Int32 nNullableFlag = ColumnValue::NO_NULLS;
m_xField->getPropertyValue(PROPERTY_ISNULLABLE) >>= nNullableFlag;
m_bRequired = (ColumnValue::NO_NULLS == nNullableFlag);
// tdf#122319 - don't allow nullable form components if input is required
m_bRequired = (ColumnValue::NO_NULLS == nNullableFlag || m_bInputRequired);
// we're optimistic: in case of ColumnValue_NULLABLE_UNKNOWN we assume nullability...
}
else