[Libreoffice-commits] core.git: 2 commits - basic/source

Caolán McNamara caolanm at redhat.com
Sun Feb 17 01:11:15 PST 2013


 basic/source/runtime/methods.cxx |    5 +++--
 basic/source/sbx/sbxscan.cxx     |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit bc56c5f8817526679c65e7f49682b6595583c588
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Feb 17 09:06:46 2013 +0000

    coverity#707502 Uninitialized scalar variable
    
    Change-Id: I38db032b2e9331170da9e8d84eaa85c894f9d8fb

diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 856a40d..d6e55d3 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -719,7 +719,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
         LanguageType eLangType = GetpApp()->GetSettings().GetLanguageTag().getLanguageType();
         SvNumberFormatter aFormatter( comphelper::getProcessComponentContext(), eLangType );
 
-        sal_uInt32 nIndex;
+        sal_uInt32 nIndex = 0;
         double nNumber;
         Color* pCol;
 
commit 9a55875ef4c466a4f176c3896c3cf7232b56c0bc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Feb 17 09:03:50 2013 +0000

    coverity#707496 Uninitialized scalar variable
    
    also...
     coverity#707497 Uninitialized scalar variable
    
    Change-Id: Ie3ac361685a52b23e088b78404ea4e013407fe2a

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index b9a2861..aeba267 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1952,7 +1952,7 @@ RTLFUNC(DateValue)
             SbiInstance::PrepareNumberFormatter( pFormatter, n, n, n );
         }
 
-        sal_uInt32 nIndex;
+        sal_uInt32 nIndex = 0;
         double fResult;
         OUString aStr( rPar.Get(1)->GetOUString() );
         sal_Bool bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
@@ -1967,6 +1967,7 @@ RTLFUNC(DateValue)
         {
             // Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value;
             SvNumberFormatter aFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US );
+            nIndex = 0;
             bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, fResult );
             nType = aFormatter.GetType( nIndex );
         }
@@ -2019,7 +2020,7 @@ RTLFUNC(TimeValue)
             SbiInstance::PrepareNumberFormatter( pFormatter, n, n, n );
         }
 
-        sal_uInt32 nIndex;
+        sal_uInt32 nIndex = 0;
         double fResult;
         sal_Bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetOUString(),
                                                    nIndex, fResult );


More information about the Libreoffice-commits mailing list