diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-09-09 20:52:08 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-09-09 20:56:16 +0300 |
commit | f96b23669e5ccb18f55e9041a774206b50406d2a (patch) | |
tree | b2c63840c88cd13f4d6b1f3115e50083541411a0 | |
parent | sal_Bool to bool (diff) | |
download | core-f96b23669e5ccb18f55e9041a774206b50406d2a.tar.gz core-f96b23669e5ccb18f55e9041a774206b50406d2a.zip |
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.cxx | 4 |
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 |