vcl/source/treelist/svimpbox.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit b845fc51bb5c40eac121bbe52d8c77257bcbcdf3 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Oct 4 19:54:29 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Oct 4 22:02:17 2021 +0200 Related: tdf#143391 avoid creatinging a negative height for the scroll area this is similar to the case of IconViewImpl::CursorUp so presumably needs the same safety check Change-Id: Id1a79c27daabbf4e2077d46c3d14324695922ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123066 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index e0fd310139fc..765302b9961f 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -362,7 +362,8 @@ void SvImpLBox::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 );