summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-30 11:41:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-01 13:40:38 +0100
commit7d459621de27574f02588190e5fef7804cc3a0c1 (patch)
treec877f72842473601229d9c8fd258da6b7328b58a
parentaf9423b73b3b50cb1e48f08edc812331132470bf (diff)
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@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/treelist/svimpbox.cxx9
1 files changed, 4 insertions, 5 deletions
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();