[Libreoffice-commits] core.git: sc/source

Caolán McNamara caolanm at redhat.com
Mon Sep 9 12:05:47 PDT 2013


 sc/source/filter/qpro/qproform.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 21efe9ed56372dee93258fdbfd1bc88a0fd45760
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 9 20:05:00 2013 +0100

    CID#1079181 initialize buffer
    
    Change-Id: I516aedd445c8fcd4cefed1ed23d5bf8157b200a6
    Reviewed-on: https://gerrit.libreoffice.org/5889
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 65984ef..2b9bca6 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -185,8 +185,9 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray, sal_uInt16 /*nLen*/, con
 {
     sal_uInt8 nFmla[ nBufSize ], i, nArg, nArgArray[ nBufSize ];
     sal_Int8 nCol, nPage;
-    sal_uInt16 nInt, nIntCount = 0, nStringCount = 0, nFloatCount = 0, nDLLCount = 0, nIntArray[ nBufSize ], nArgCount = 0;
-    String sStringArray[ nBufSize ];
+    sal_uInt16 nInt, nIntCount = 0, nStringCount = 0, nFloatCount = 0, nDLLCount = 0, nArgCount = 0;
+    sal_uInt16 nIntArray[ nBufSize ] = {0};
+    OUString sStringArray[ nBufSize ];
     sal_uInt16 nDummy, nDLLId, nDLLArray[ nBufSize ];
     sal_uInt16 nNote, nRef, nRelBits;
     TokenId nPush;
@@ -211,7 +212,7 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray, sal_uInt16 /*nLen*/, con
             {
                 maIn >> nInt;
                 nIntArray[ nIntCount ] = nInt;
-        SAFEDEC_OR_RET(nRef, 2, ConvErrCount);
+                SAFEDEC_OR_RET(nRef, 2, ConvErrCount);
                 nIntCount++;
             }
 
@@ -219,7 +220,7 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray, sal_uInt16 /*nLen*/, con
             {
                 maIn >> nFloat;
                 nFloatArray[ nFloatCount ] = nFloat;
-        SAFEDEC_OR_RET(nRef, 8, ConvErrCount);
+                SAFEDEC_OR_RET(nRef, 8, ConvErrCount);
                 nFloatCount++;
             }
 
@@ -228,16 +229,16 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray, sal_uInt16 /*nLen*/, con
                 maIn >> nArg >> nDummy >> nDLLId;
                 nArgArray[ nArgCount ] = nArg;
                 nDLLArray[ nDLLCount ] = nDLLId;
-        SAFEDEC_OR_RET(nRef, 5, ConvErrCount);
+                SAFEDEC_OR_RET(nRef, 5, ConvErrCount);
                 nDLLCount++;
                 nArgCount++;
             }
             if( nFmla[ i ] == 0x06 )
             {
-                String aTmp(::read_zeroTerminated_uInt8s_ToOUString(maIn, maIn.GetStreamCharSet()));
+                OUString aTmp(::read_zeroTerminated_uInt8s_ToOUString(maIn, maIn.GetStreamCharSet()));
                 sStringArray[ nStringCount ] = aTmp;
                 nStringCount++;
-        SAFEDEC_OR_RET(nRef, aTmp.Len() + 1, ConvErrCount);
+                SAFEDEC_OR_RET(nRef, aTmp.getLength() + 1, ConvErrCount);
             }
         }
     }
@@ -350,8 +351,7 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray, sal_uInt16 /*nLen*/, con
                 break;
 
             case FT_ConstString:{
-                String aLabel;
-                aLabel = sStringArray[ nStringCount ];
+                OUString aLabel(sStringArray[ nStringCount ]);
                 aStack << aPool.Store( aLabel );
                 nStringCount++;
                 }


More information about the Libreoffice-commits mailing list