summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-09-09 20:52:08 +0300
committerTor Lillqvist <tml@collabora.com>2013-09-09 20:56:16 +0300
commitf96b23669e5ccb18f55e9041a774206b50406d2a (patch)
treeb2c63840c88cd13f4d6b1f3115e50083541411a0
parent6509bbee4f752b2b47df2511d5004c1a23317da5 (diff)
WaE: variables 'nDoub' and 'nFloat' are uninitialized when used here
Initialise them in the presumably intended way to get rid of the warning. Note that the code around there is somewhat confused and downright wrong anyway, though. Also "+0", "-0" or "000" for instance are correct ways to write zero. Also SAL_MAX_INT32 and SAL_MIN_INT32 are legal values for a UNO "long". (And it will always be true that a sal_Int32 is <= SAL_MAX_INT32 and >= SAL_MIN_INT32.) And does the code accept any single-character string as zero? Then there is copy-paste galore for the "hyper", "double" and "float" cases. Change-Id: Ie1920cfb4d17dca7cd966d8b200d2510ea975290
-rw-r--r--cui/source/options/optaboutconfig.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index a1213d0c4203..3de545f60cbf 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -506,7 +506,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
}
else if( sPropertyType == OUString("double"))
{
- double nDoub;
+ double nDoub = sNewValue.toDouble();
if( !( nDoub ==0 && sNewValue.getLength()!=1 ) && nDoub < SAL_MAX_INT32 && nDoub > SAL_MIN_INT32)
pProperty->Value = uno::makeAny( nDoub );
else
@@ -514,7 +514,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
}
else if( sPropertyType == OUString("float"))
{
- float nFloat;
+ float nFloat = sNewValue.toFloat();
if( !( nFloat ==0 && sNewValue.getLength()!=1 ) && nFloat < SAL_MAX_INT32 && nFloat > SAL_MIN_INT32)
pProperty->Value = uno::makeAny( nFloat );
else