[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - 2 commits - sc/source vcl/source

Caolán McNamara caolanm at redhat.com
Fri Dec 19 02:09:04 PST 2014


 sc/source/filter/excel/xistring.cxx |    6 +++---
 vcl/source/control/combobox.cxx     |    7 +++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 809e667b7c6c58269d7a060f80798aab1bd332b4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 19 09:52:39 2014 +0000

    valgrind: initialize these
    
    Change-Id: I6440832fe508689ffa8e20fa17827528331e3585
    (cherry picked from commit 2645b1979365085edf4a94500f2c610bfc4e668b)

diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx
index c4165dd..e04f4d5 100644
--- a/sc/source/filter/excel/xistring.cxx
+++ b/sc/source/filter/excel/xistring.cxx
@@ -118,7 +118,7 @@ void XclImpString::ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats,
     {
         for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
         {
-            sal_uInt16 nChar, nFontIdx;
+            sal_uInt16 nChar(0), nFontIdx(0);
             rStrm >> nChar >> nFontIdx;
             AppendFormat( rFormats, nChar, nFontIdx );
         }
@@ -127,7 +127,7 @@ void XclImpString::ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats,
     {
         for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
         {
-            sal_uInt8 nChar, nFontIdx;
+            sal_uInt8 nChar(0), nFontIdx(0);
             rStrm >> nChar >> nFontIdx;
             AppendFormat( rFormats, nChar, nFontIdx );
         }
@@ -142,7 +142,7 @@ void XclImpString::ReadObjFormats( XclImpStream& rStrm, XclFormatRunVec& rFormat
     rFormats.reserve( nRunCount );
     for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx )
     {
-        sal_uInt16 nChar, nFontIdx;
+        sal_uInt16 nChar(0), nFontIdx(0);
         rStrm >> nChar >> nFontIdx;
         rStrm.Ignore( 4 );
         AppendFormat( rFormats, nChar, nFontIdx );
commit c8fa0a856e1c9063e16159982b410f3d33942d9a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 18 15:24:05 2014 +0000

    Resolves: rhbz#1175142 nStarts ends up as an invalid -1
    
    Change-Id: Ic67c5562d0e9936cd6a524ecd4f798aaf885a6e8
    (cherry picked from commit 1cd9420755dc5d5435bf564a992b727c455a3d73)
    (cherry picked from commit 4e8ae0f8187a9d3fa77d737f5de248cfd9b0ed55)

diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index a5810f2..8620102 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -297,7 +297,7 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
     {
         OUString    aFullText = pEdit->GetText();
         OUString    aStartText = aFullText.copy( 0, (sal_Int32)aSel.Max() );
-        sal_Int32      nStart = mpImplLB->GetCurrentPos();
+        sal_Int32   nStart = mpImplLB->GetCurrentPos();
 
         if ( nStart == LISTBOX_ENTRY_NOTFOUND )
             nStart = 0;
@@ -308,7 +308,10 @@ IMPL_LINK( ComboBox, ImplAutocompleteHdl, Edit*, pEdit )
         else if ( eAction == AUTOCOMPLETE_TABBACKWARD )
         {
             bForward = false;
-            nStart = nStart ? nStart - 1 : mpImplLB->GetEntryList()->GetEntryCount()-1;
+            if (nStart)
+                nStart = nStart - 1;
+            else if (mpImplLB->GetEntryList()->GetEntryCount())
+                nStart = mpImplLB->GetEntryList()->GetEntryCount()-1;
         }
 
         sal_Int32 nPos = LISTBOX_ENTRY_NOTFOUND;


More information about the Libreoffice-commits mailing list