Again? Oh, yes.
Now here it is.

On Tue, Jul 31, 2012 at 11:10 AM, Noel Power <nopo...@suse.com> wrote:

>  Hi János
> you forgot to attach the patch :-)
>
> On 30/07/12 19:04, János Uray wrote:
>
> This patch solves this bug:
> https://bugs.freedesktop.org/show_bug.cgi?id=47907
>
> The text was flickering because Window::Invalidate() clears the client
> area by default. To prevent this, I've added an INVALIDATE_NOERASE
> parameter to Invalidate() calls.
> On the other hand, the background still needed to be erased outside the
> text: the indentation space and the rest of the line.
>
> (Note: both svtools and basctl must be rebuilt.)
>
> Regards,
> Uray M. János
>
>
>
> _______________________________________________
> LibreOffice mailing 
> listLibreOffice@lists.freedesktop.orghttp://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
>
From 52553e121656d3eaf429148f930362489dcd762f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Uray=20M.=20J=C3=A1nos"?= <uray.ja...@gmail.com>
Date: Mon, 30 Jul 2012 19:41:03 +0200
Subject: [PATCH] fdo#47907: fix flickering scrolling in Basic IDE

Change-Id: I745a8284e4d361872c5c0c0c54500e0d36158fb0
---
 basctl/source/basicide/baside2b.cxx |    6 ++--
 svtools/source/edit/texteng.cxx     |   50 +++++++++++++++++++++--------------
 2 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 3e96c22..610d779 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -357,7 +357,7 @@ void EditorWindow::Resize()
         }
         InitScrollBars();
         if ( nVisY != pEditView->GetStartDocPos().Y() )
-            Invalidate();
+            Invalidate(INVALIDATE_NOERASE);
     }
 }
 
@@ -655,7 +655,7 @@ void EditorWindow::DataChanged(DataChangedEvent const & rDCEvt)
             != rDCEvt.GetOldSettings()->GetStyleSettings().GetFieldColor())
         {
             SetBackground(Wallpaper(aColor));
-            Invalidate();
+            Invalidate(INVALIDATE_NOERASE);
         }
         if (pEditEngine != 0)
         {
@@ -685,7 +685,7 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                 ( 0, pModulWindow->GetBreakPointWindow().GetCurYOffset() - pEditView->GetStartDocPos().Y() );
             pModulWindow->GetLineNumberWindow().DoScroll
                 ( 0, pModulWindow->GetLineNumberWindow().GetCurYOffset() - pEditView->GetStartDocPos().Y() );
-            pModulWindow->Invalidate();
+            pModulWindow->Invalidate(INVALIDATE_NOERASE);
         }
         else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
         {
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index efce793..a7e7d32 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -1983,6 +1983,8 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
     if ( !IsFormatted() )
         FormatDoc();
 
+    Size const aOutSize = pOutDev->GetOutputSizePixel();
+
     bool bTransparent = false;
     Window* pOutWin = dynamic_cast<Window*>(pOutDev);
     bTransparent = (pOutWin && pOutWin->IsPaintTransparent());
@@ -2140,30 +2142,24 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
                                 break;
                                 case PORTIONKIND_TAB:
                                 {
-                                    // Bei HideSelection() nur Range, pSelection = 0.
-                                    if ( pSelStart || pPaintRange )
+                                    Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) );
+                                    sal_Bool bDone = sal_False;
+                                    if ( pSelStart )
                                     {
-                                        Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) );
-                                        sal_Bool bDone = sal_False;
-                                        if ( pSelStart )
+                                        // liegt der Tab in der Selektion???
+                                        TextPaM aTextStart( nPara, nIndex );
+                                        TextPaM aTextEnd( nPara, nIndex+1 );
+                                        if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) )
                                         {
-                                            // liegt der Tab in der Selektion???
-                                            TextPaM aTextStart( nPara, nIndex );
-                                            TextPaM aTextEnd( nPara, nIndex+1 );
-                                            if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) )
-                                            {
-                                                Color aOldColor = pOutDev->GetFillColor();
-                                                pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() );
-                                                pOutDev->DrawRect( aTabArea );
-                                                pOutDev->SetFillColor( aOldColor );
-                                                bDone = sal_True;
-                                            }
-                                        }
-                                        if ( !bDone )
-                                        {
-                                            pOutDev->Erase( aTabArea );
+                                            Color aOldColor = pOutDev->GetFillColor();
+                                            pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() );
+                                            pOutDev->DrawRect( aTabArea );
+                                            pOutDev->SetFillColor( aOldColor );
+                                            bDone = sal_True;
                                         }
                                     }
+                                    if ( !bDone )
+                                        pOutDev->Erase( aTabArea );
                                 }
                                 break;
                                 default:    OSL_FAIL( "ImpPaint: Unknown Portion-Type !" );
@@ -2174,6 +2170,20 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
                     }
                 }
 
+                // background after the end of line
+                {
+                    nIndex = pLine->GetLen();
+                    long nX = ImpGetOutputOffset(nPara, pLine, nIndex, nIndex);
+                    if (nX < aOutSize.Width())
+                    {
+                        Rectangle const aEol(
+                            rStartPos.X() + nX, nY,
+                            rStartPos.X() + aOutSize.Width(), nY + mnCharHeight
+                        );
+                        pOutDev->Erase(aEol);
+                    }
+                }
+
                 nY += mnCharHeight;
 
                 if ( pPaintArea && ( nY >= pPaintArea->Bottom() ) )
-- 
1.7.7

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to