tdf#155123: XML Form: Deleting parts of user defined data type impossible
2 parts:
1) in extensions/source/propctrlr/standardcontrol.cxx
if value retrieved from the field is 0, let's return an empty Any var.
2) forms/source/xforms/datatypes.cxx
Allow to select 0 in the spinbox for String and URI ("hyperlink") datatypes
to be homogeneous
Change-Id: Ife9a94c279e8651623112c0bf8a64555cb9c556c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151740
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 9468ecc..ad97825 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -499,7 +499,8 @@ namespace pcr
if ( !getTypedControlWindow()->get_text().isEmpty() )
{
double nValue = impl_fieldValueToApiValue_nothrow( getTypedControlWindow()->get_value( m_eValueUnit ) );
aPropValue <<= nValue;
if (nValue)
aPropValue <<= nValue;
}
return aPropValue;
}
diff --git a/forms/source/xforms/datatypes.cxx b/forms/source/xforms/datatypes.cxx
index e81f402..c2612f6 100644
--- a/forms/source/xforms/datatypes.cxx
+++ b/forms/source/xforms/datatypes.cxx
@@ -514,7 +514,7 @@ namespace xforms
{
sal_Int32 nValue( 0 );
OSL_VERIFY( _rNewValue >>= nValue );
if ( nValue <= 0 )
if ( nValue < 0 )
_rErrorMessage = "Length limits must denote positive integer values.";
// TODO/eforms: localize the error message
}
@@ -635,7 +635,7 @@ namespace xforms
{
sal_Int32 nValue( 0 );
OSL_VERIFY( _rNewValue >>= nValue );
if ( nValue <= 0 )
if ( nValue < 0 )
_rErrorMessage = "Length limits must denote positive integer values.";
// TODO/eforms: localize the error message
}