summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnurag Jain <anuragjainfzd@gmail.com>2011-06-06 23:13:37 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-06-06 23:13:37 -0400
commit7449f162745e9940a1d54726feb481a3f75a1446 (patch)
tree49481b904d1c21df2befb0b41b14fa3ab6d5ff3d
parent34c374a69dcce7fe669dedec7eaa36b6c2db4ca5 (diff)
Set the correct height based on the actual text height from edit engine.
-rw-r--r--sc/source/ui/app/inputwin.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index fdbd33d2a..b66936003 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -797,11 +797,11 @@ void ScTextWnd::Resize()
if (pEditView)
{
Size aSize = GetOutputSizePixel();
- int count = pEditEngine->GetLineCount(0);
- printf("%d %d\n", aSize.Height() , count);
- //Point aPos(0,(count-1)*aSize.Height());
- Point aPos(TEXT_STARTPOS,aSize.Height()/4);
- Point aPos2(aSize.Width()-5,3*aSize.Height()/4);
+ Size bSize = LogicToPixel(Size(0,pEditEngine->GetLineHeight(0,0)));
+ int nDiff=(aSize.Height()-bSize.Height())/2;
+ printf("here %d %d %d\n", nDiff , bSize.Height(), aSize.Height());
+ Point aPos(TEXT_STARTPOS,nDiff*aSize.Height()/aSize.Height());
+ Point aPos2(aSize.Width()-5,(aSize.Height()-nDiff)*aSize.Height()/aSize.Height());
// TODO : When in single line mode, set the height to the height of a
// single line, and set the position so that the text look centered.
pEditView->SetOutputArea(