summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-08-04 17:26:59 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-08-04 17:26:59 +0400
commit5081ea1a076c61c01ae3837aa2396501860ae4e9 (patch)
treef38a6ec3e7330a85c958c7d8c64c70ae939fabc7 /sc
parent769e2b59e605c2c882d2039ad89e0958ea7bb2f2 (diff)
calc input line: don't leave an empty area at the bottom if possible
Change-Id: Iaaf82ee6b79d091c349a501f3a09e760c295546f
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputwin.cxx10
1 files changed, 9 insertions, 1 deletions
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 ) ) );
}