summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-10-04 19:46:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-10-04 21:42:28 +0200
commit5a930d4b33e6b5e6642c936cb643c2c5605d6110 (patch)
tree2210b21a6cc60d8bb69dd77b78d4fa992711eb6a /vcl/source
parent79e6ad35d5402b6485d9776c60e20eaf236dba0f (diff)
Resolves: tdf#143391 scrolling by an entry height taller than visible area
leads to use of a rectangle with a negative height. Drop the attempted optimization, of reducing the area to copy to the min required, if the area is already shorter than the height of the area to scroll. Change-Id: Ic17d3d017f5280d1f6b655a2fc61627f512849cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123065 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/treelist/iconviewimpl.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/treelist/iconviewimpl.cxx b/vcl/source/treelist/iconviewimpl.cxx
index 3b2b370ab53d..319a0d7c899e 100644
--- a/vcl/source/treelist/iconviewimpl.cxx
+++ b/vcl/source/treelist/iconviewimpl.cxx
@@ -46,7 +46,8 @@ void IconViewImpl::CursorUp()
m_pView->PaintImmediately();
m_pStartEntry = pPrevFirstToDraw;
tools::Rectangle aArea( GetVisibleArea() );
- aArea.AdjustBottom( -nEntryHeight );
+ if (aArea.GetHeight() > nEntryHeight)
+ aArea.AdjustBottom(-nEntryHeight);
m_pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren );
m_pView->PaintImmediately();
ShowCursor( true );