summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-20 16:14:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-21 15:41:50 +0200
commit2a612907aef4c9987f906c6b98aa9b400f58f617 (patch)
tree6170f363054cabb1cd33af9208145827b22c83a1 /cui
parent3a481dde031ba416ec4ef0351130e26e49417418 (diff)
loplugin:flatten in connectivity..desktop
Change-Id: Iff59d3049ba40b4338ef8eec67d08a96b0834d2b Reviewed-on: https://gerrit.libreoffice.org/42578 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optaboutconfig.cxx25
1 files changed, 10 insertions, 15 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 717ae6d9ccf9..a006e71639ee 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -649,43 +649,38 @@ 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)
- nShort = (sal_Int16) nNumb;
- else
+ if( ( nNumb==0 && sNewValue.getLength()!=1 ) || nNumb >= SAL_MAX_INT16 || nNumb <= SAL_MIN_INT16)
throw uno::Exception();
+ nShort = (sal_Int16) nNumb;
pProperty->Value <<= nShort;
}
else if( sPropertyType == "long" )
{
sal_Int32 nLong = sNewValue.toInt32();
- if( !( nLong==0 && sNewValue.getLength()!=1 ) && nLong < SAL_MAX_INT32 && nLong > SAL_MIN_INT32)
- pProperty->Value <<= nLong;
- else
+ if( ( nLong==0 && sNewValue.getLength()!=1 ) || nLong >= SAL_MAX_INT32 || nLong <= SAL_MIN_INT32)
throw uno::Exception();
+ 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)
- pProperty->Value <<= nHyper;
- else
+ if( ( nHyper==0 && sNewValue.getLength()!=1 ) || nHyper >= SAL_MAX_INT32 || nHyper <= SAL_MIN_INT32)
throw uno::Exception();
+ 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)
- pProperty->Value <<= nDoub;
- else
+ if( ( nDoub ==0 && sNewValue.getLength()!=1 ) || nDoub >= SAL_MAX_INT32 || nDoub <= SAL_MIN_INT32)
throw uno::Exception();
+ 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)
- pProperty->Value <<= nFloat;
- else
+ if( ( nFloat ==0 && sNewValue.getLength()!=1 ) || nFloat >= SAL_MAX_INT32 || nFloat <= SAL_MIN_INT32)
throw uno::Exception();
+ pProperty->Value <<= nFloat;
}
else if( sPropertyType == "string" )
{