Hello Kohei, This is a fix to some of the things you mentioned in last patch. Setting the paper size inside the Resize() of ScMultiTextWnd solves two issues
1: Prevents premature wrapping which was happening before. 2: The paperSize is recalculated as per the window size. Regards -- Anurag Jain Final yr B.Tech CSE SASTRA University Thanjavur(T.N.)-613402
From 14b16dbef8b57c87ec7e077c27ae5f74a26ed449 Mon Sep 17 00:00:00 2001 From: Anurag Jain <anuragjain...@gmail.com> Date: Tue, 23 Aug 2011 20:19:39 +0530 Subject: [PATCH] Fixed premature wrapping, black spot in A1 and scrollbar and button position. --- sc/source/ui/app/inputwin.cxx | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index bff10cb..9c1879f 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -835,8 +835,8 @@ void ScInputBarGroup::Resize() } SetSizePixel(aSize); - aButton.SetPosPixel(Point(aSize.Width()-4*LEFT_OFFSET,0)); - aScrollBar.SetPosPixel(Point(aSize.Width()-2*LEFT_OFFSET,0)); + aScrollBar.SetPosPixel(Point(aSize.Width()-4*LEFT_OFFSET,0)); + aButton.SetPosPixel(Point(aSize.Width()-2*LEFT_OFFSET,0)); Invalidate(); aMultiTextWnd.Resize(); @@ -902,7 +902,7 @@ IMPL_LINK( ScInputBarGroup, ClickHdl, PushButton*, pBtn ) pParent->SetMultiLineStatus(false); } pParent->Resize(); - pParent->CalcWindowSizePixel(); // TODO: changed from RecalcItems(). check if this does the same thing. + //pParent->CalcWindowSizePixel(); // TODO: changed from RecalcItems(). check if this does the same thing. return 0; } @@ -934,8 +934,8 @@ void ScMultiTextWnd::Paint( const Rectangle& rRec ) { // We always use edit engine to draw text at all times. if (!pEditEngine) - //InitEditEngine(SfxObjectShell::Current()); - StartEditEngine(); + InitEditEngine(SfxObjectShell::Current()); + //StartEditEngine(); if (pEditView) { @@ -979,6 +979,8 @@ void ScMultiTextWnd::Resize() pEditView->SetOutputArea( PixelToLogic(Rectangle(aPos1, aPos2))); + pEditEngine->SetPaperSize( PixelToLogic(Size(aOutputSize.Width() - 2*LEFT_OFFSET, 10000 ) )); + } } @@ -998,6 +1000,8 @@ void ScMultiTextWnd::Resize() pEditView->SetOutputArea( PixelToLogic(Rectangle(aPos1, aPos2))); + + pEditEngine->SetPaperSize( PixelToLogic(Size(aOutputSize.Width() - 2*LEFT_OFFSET, 10000 ) )); } } SetSizePixel(aTextBoxSize); @@ -1084,9 +1088,9 @@ void ScMultiTextWnd::InitEditEngine(SfxObjectShell* pObjSh) Size barSize=GetSizePixel(); barSize.Width() -= (2*nTextStartPos-4); - printf("bar size width %ld",barSize.Width()); + printf("bar size width %ld\n",barSize.Width()); pEditEngine->SetUpdateMode( false ); - pEditEngine->SetPaperSize( PixelToLogic(Size(994-4*LEFT_OFFSET,10000)) ); + pEditEngine->SetPaperSize( PixelToLogic(Size(barSize.Width(),10000)) ); pEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) ); -- 1.7.0.4
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice