summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-08-13 10:32:45 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-08-13 11:29:54 +0200
commitc56ae6454a7ac6ac6f2c10efd128d1e3ab1dc013 (patch)
tree2a1ae6f19dad1a931f6c20572de2c086d4f29844 /cui
parent87959e5deea6d33cd35dbb3b8423056f9566710e (diff)
Fix overly restrictive limit checks
Change-Id: I7a67208e500e79f62dad1eee1b89f96e0958ccc3 Reviewed-on: https://gerrit.libreoffice.org/77380 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optaboutconfig.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 41d590a6953f..aa5d960e7552 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -636,7 +636,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
sal_Int32 nNumb = sNewValue.toInt32();
//if the value is 0 and length is not 1, there is something wrong
- if( ( nNumb==0 && sNewValue.getLength()!=1 ) || nNumb >= SAL_MAX_INT16 || nNumb <= SAL_MIN_INT16)
+ if( ( nNumb==0 && sNewValue.getLength()!=1 ) || nNumb > SAL_MAX_INT16 || nNumb < SAL_MIN_INT16)
throw uno::Exception("out of range short", nullptr);
nShort = static_cast<sal_Int16>(nNumb);
pProperty->Value <<= nShort;
@@ -644,28 +644,28 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
else if( sPropertyType == "long" )
{
sal_Int32 nLong = sNewValue.toInt32();
- if( ( nLong==0 && sNewValue.getLength()!=1 ) || nLong >= SAL_MAX_INT32 || nLong <= SAL_MIN_INT32)
+ if( nLong==0 && sNewValue.getLength()!=1)
throw uno::Exception("out of range long", nullptr);
pProperty->Value <<= nLong;
}
else if( sPropertyType == "hyper")
{
sal_Int64 nHyper = sNewValue.toInt64();
- if( ( nHyper==0 && sNewValue.getLength()!=1 ) || nHyper >= SAL_MAX_INT32 || nHyper <= SAL_MIN_INT32)
+ if( nHyper==0 && sNewValue.getLength()!=1)
throw uno::Exception("out of range hyper", nullptr);
pProperty->Value <<= nHyper;
}
else if( sPropertyType == "double")
{
double nDoub = sNewValue.toDouble();
- if( ( nDoub ==0 && sNewValue.getLength()!=1 ) || nDoub >= SAL_MAX_INT32 || nDoub <= SAL_MIN_INT32)
+ if( nDoub ==0 && sNewValue.getLength()!=1)
throw uno::Exception("out of range double", nullptr);
pProperty->Value <<= nDoub;
}
else if( sPropertyType == "float")
{
float nFloat = sNewValue.toFloat();
- if( ( nFloat ==0 && sNewValue.getLength()!=1 ) || nFloat >= SAL_MAX_INT32 || nFloat <= SAL_MIN_INT32)
+ if( nFloat ==0 && sNewValue.getLength()!=1)
throw uno::Exception("out of range float", nullptr);
pProperty->Value <<= nFloat;
}