From 848e020fcf3ba4d6c8ff0a03fb6049193cc78848 Mon Sep 17 00:00:00 2001
From: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date: Thu, 14 May 2015 15:26:15 +0900
Subject: move Resize code to Paint for ScTextWnd

Change-Id: Icd0e12e02b808c3cf1eacd15021cdf249bdcfab3
---
 sc/source/ui/app/inputwin.cxx | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 940b125328e9..d7ae24e611b2 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1518,6 +1518,10 @@ void ScTextWnd::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect
 {
     if (pEditView)
     {
+        Size aSize = rRenderContext.GetOutputSizePixel();
+        long nDiff = aSize.Height() - rRenderContext.LogicToPixel(Size(0, rRenderContext.GetTextHeight())).Height();
+        pEditView->SetOutputArea(rRenderContext.PixelToLogic(Rectangle(Point(0, (nDiff > 0) ? nDiff / 2 : 1), aSize)));
+
         pEditView->Paint(rRect, &rRenderContext);
     }
     else
@@ -1544,14 +1548,7 @@ void ScTextWnd::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect
 
 void ScTextWnd::Resize()
 {
-    if (pEditView)
-    {
-        Size aSize = GetOutputSizePixel();
-        long nDiff =  aSize.Height() - LogicToPixel( Size( 0, GetTextHeight() ) ).Height();
-
-        pEditView->SetOutputArea(PixelToLogic( Rectangle( Point( 0, (nDiff > 0) ? nDiff/2 : 1 ),
-                                     aSize ) ) );
-    }
+    Invalidate();
 }
 
 void ScTextWnd::MouseMove( const MouseEvent& rMEvt )
-- 
cgit