From 16c9d63da67897e51960f3684d8d05b06f2c8f81 Mon Sep 17 00:00:00 2001 From: Luke Symes Date: Wed, 22 Jun 2011 15:40:26 +1200 Subject: [PATCH] Set the listbox height to an integer multiple of the listbox entry height. This ensures that we don't get a half visible entry at the bottom of the view. Signed-off-by: Tor Lillqvist --- svtools/source/contnr/svimpbox.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index da5aff817b60..ab6d4e1b8fb3 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1358,8 +1358,19 @@ void SvImpLBox::InitScrollBarBox() void SvImpLBox::Resize() { Size aSize( pView->Control::GetOutputSizePixel()); + long nEntryHeight = pView->GetEntryHeight(); + int nEntryCount = 0; + if( aSize.Width() <= 0 || aSize.Height() <= 0 ) return; + if( nEntryHeight ) + { + // Set the view height to an integer multiple of the entry height. + nEntryCount = (int) aSize.Height() / nEntryHeight; + aSize.Height() = pView->GetEntryHeight() * nEntryCount; + pView->Control::SetOutputSizePixel( aSize ); + } + nFlags |= F_IN_RESIZE; InitScrollBarBox();