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

Caolán McNamara caolanm at redhat.com
Thu Dec 18 07:26:19 PST 2014


 vcl/source/control/combobox.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 1cd9420755dc5d5435bf564a992b727c455a3d73
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

diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 462c61f..5edee22 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -292,7 +292,7 @@ void ComboBox::ImplAutocompleteHandler( 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;
@@ -303,7 +303,10 @@ void ComboBox::ImplAutocompleteHandler( 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