summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/com/sun/star/wizards')
-rw-r--r--wizards/com/sun/star/wizards/common/PropertyNames.java3
-rw-r--r--wizards/com/sun/star/wizards/form/FormControlArranger.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/common/PropertyNames.java b/wizards/com/sun/star/wizards/common/PropertyNames.java
index 2d7cdd865336..5e5df5c879e1 100644
--- a/wizards/com/sun/star/wizards/common/PropertyNames.java
+++ b/wizards/com/sun/star/wizards/common/PropertyNames.java
@@ -20,6 +20,9 @@ package com.sun.star.wizards.common;
public class PropertyNames
{
+ public static String PROPERTY_DEFAULT_VALUE = "DefaultValue";
+ public static String PROPERTY_IS_NULLABLE = "IsNullable";
+ public static String PROPERTY_INPUT_REQUIRED = "InputRequired";
public static String PROPERTY_ENABLED = "Enabled";
public static String PROPERTY_HEIGHT = "Height";
public static String PROPERTY_HELPURL = "HelpURL";
diff --git a/wizards/com/sun/star/wizards/form/FormControlArranger.java b/wizards/com/sun/star/wizards/form/FormControlArranger.java
index 9a46928ac045..a1eacc71366d 100644
--- a/wizards/com/sun/star/wizards/form/FormControlArranger.java
+++ b/wizards/com/sun/star/wizards/form/FormControlArranger.java
@@ -21,6 +21,7 @@ import com.sun.star.awt.Point;
import com.sun.star.awt.Size;
import com.sun.star.container.XNameContainer;
import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdbc.ColumnValue;
import com.sun.star.sdbc.DataType;
import com.sun.star.task.XStatusIndicator;
import com.sun.star.uno.AnyConverter;
@@ -588,6 +589,8 @@ public class FormControlArranger
{
String sFieldName = FieldColumns[i].getFieldName();
int nFieldType = FieldColumns[i].getFieldType();
+ boolean bFieldNullable = AnyConverter.toInt(FieldColumns[i].getXColumnPropertySet().getPropertyValue(PropertyNames.PROPERTY_IS_NULLABLE)) != ColumnValue.NO_NULLS;
+ boolean bFieldHasDefaultValue = !AnyConverter.toString(FieldColumns[i].getXColumnPropertySet().getPropertyValue(PropertyNames.PROPERTY_DEFAULT_VALUE)).isEmpty();
Point aPoint = new Point(m_currentControlPosX, m_currentControlPosY);
if (bControlsareCreated)
@@ -629,6 +632,7 @@ public class FormControlArranger
}
checkOuterPoints(m_currentControlPosX, m_dbControlWidth, m_currentControlPosY, m_dbControlHeight, true);
aDBControl.setPropertyValue(PropertyNames.PROPERTY_BORDER, NBorderType);
+ aDBControl.setPropertyValue(PropertyNames.PROPERTY_INPUT_REQUIRED, !(bFieldNullable || bFieldHasDefaultValue));
}
catch (Exception e)
{