From 5081ea1a076c61c01ae3837aa2396501860ae4e9 Mon Sep 17 00:00:00 2001 From: Ivan Timofeev Date: Sat, 4 Aug 2012 17:26:59 +0400 Subject: calc input line: don't leave an empty area at the bottom if possible Change-Id: Iaaf82ee6b79d091c349a501f3a09e760c295546f --- sc/source/ui/app/inputwin.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index d819e0c733ab..f107349ee245 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1197,8 +1197,16 @@ void ScMultiTextWnd::Resize() if(pEditView) { Size aOutputSize = GetOutputSizePixel(); + Rectangle aOutputArea = PixelToLogic( Rectangle( Point(), aOutputSize )); + pEditView->SetOutputArea( aOutputArea ); + + // Don't leave an empty area at the bottom if we can move the text down. + long nMaxVisAreaTop = pEditEngine->GetTextHeight() - aOutputArea.GetHeight(); + if (pEditView->GetVisArea().Top() > nMaxVisAreaTop) + { + pEditView->Scroll(0, pEditView->GetVisArea().Top() - nMaxVisAreaTop); + } - pEditView->SetOutputArea( PixelToLogic( Rectangle( Point(), aOutputSize ) ) ); pEditEngine->SetPaperSize( PixelToLogic( Size( aOutputSize.Width(), 10000 ) ) ); } -- cgit