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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 1 12:40:59 UTC 2018


 vcl/source/treelist/svimpbox.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 7d459621de27574f02588190e5fef7804cc3a0c1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Nov 30 11:41:41 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Dec 1 13:40:38 2018 +0100

    turn on hori scrollbar if WB_AUTOHSCROLL set and content doesn't fit
    
    Change-Id: I8812d6d5ccce6f84298a4c978c50f1e84653c559
    Reviewed-on: https://gerrit.libreoffice.org/64341
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index e61b0ebb05d4..a39b18744878 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -1174,7 +1174,7 @@ void SvImpLBox::AdjustScrollBars( Size& rSize )
     aOrigin.setX( aOrigin.X() * -1 );
     nMaxRight += aOrigin.X() - 1;
     long nVis = nMostRight - aOrigin.X();
-    if( (nWindowStyle & WB_HSCROLL) &&
+    if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
         (nVis < nMostRight || nMaxRight < nMostRight) )
     {
         bHorBar = true;
@@ -1193,7 +1193,7 @@ void SvImpLBox::AdjustScrollBars( Size& rSize )
         nMaxRight -= nVerSBarWidth;
         if( !bHorBar )
         {
-            if( (nWindowStyle & WB_HSCROLL) &&
+            if( (nWindowStyle & (WB_AUTOHSCROLL|WB_HSCROLL)) &&
                 (nVis < nMostRight || nMaxRight < nMostRight) )
                 bHorBar = true;
         }
@@ -2115,7 +2115,6 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
 
     SvTreeListEntry* pNewCursor;
 
-    const WinBits nWindowStyle = pView->GetStyle();
     switch( aCode )
     {
         case KEY_UP:
@@ -2200,7 +2199,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
                     CallEventListeners( VclEventId::ListboxSelect, pCursor );
                 }
             }
-            else if( nWindowStyle & WB_HSCROLL )
+            else if (aHorSBar->IsVisible())
             {
                 long    nThumb = aHorSBar->GetThumbPos();
                 nThumb += aHorSBar->GetLineSize();
@@ -2231,7 +2230,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
                     CallEventListeners( VclEventId::ListboxSelect, pCursor );
                 }
             }
-            else if ( nWindowStyle & WB_HSCROLL )
+            else if (aHorSBar->IsVisible())
             {
                 long    nThumb = aHorSBar->GetThumbPos();
                 nThumb -= aHorSBar->GetLineSize();


More information about the Libreoffice-commits mailing list