[Libreoffice-commits] core.git: Branch 'libreoffice-3-6-7' - sw/source

Michael Stahl mstahl at redhat.com
Thu Jun 27 12:10:15 PDT 2013


 sw/source/core/view/viewsh.cxx |   74 ++++++++++++++++++++++-------------------
 1 file changed, 41 insertions(+), 33 deletions(-)

New commits:
commit c007fe6949ca275dcda4cbf7ac5c3f86972137b4
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jun 24 18:09:35 2013 +0200

    fdo#43765, fdo#57884, fdo#58052, fdo#63949: disappearing form controls
    
    Transparent form controls in Writer may not be painted properly, if
    painted from ViewShell::ImplUnlockPaint(true), called from
    SwLayIdle::SwLayIdle.
    
    The problem is that SdrPaintWindow::OutputPreRenderDevice will paint
    the background of the transparent form controls (thus over-painting the
    controls), so it has to be followed by painting the controls themselves.
    
    (cherry picked from commit cfa994ccbd6ee681f5ab3648ce068c4881b495f5)
    
    Conflicts:
    	sw/source/core/view/viewsh.cxx
    
    Change-Id: Icda4ad835a398bbd50139be32ff5014a34f23bd5
    Reviewed-on: https://gerrit.libreoffice.org/4492
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index a7dccd7..f32597a 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -122,6 +122,44 @@ void ViewShell::ToggleHeaderFooterEdit()
 }
 
 //////////////////////////////////////////////////////////////////////////////
+
+static void
+lcl_PaintTransparentFormControls(ViewShell & rShell, SwRect const& rRect)
+{
+    // Direct paint has been performed: the background of transparent child
+    // windows has been painted, so need to paint the child windows now.
+    if (rShell.GetWin())
+    {
+        Window& rWindow = *(rShell.GetWin());
+        if (rWindow.IsChildTransparentModeEnabled())
+        {
+            Window * pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
+            if (pCandidate)
+            {
+                const Rectangle aRectanglePixel(
+                            rWindow.LogicToPixel(rRect.SVRect()));
+                while (pCandidate)
+                {
+                    if (pCandidate->IsPaintTransparent())
+                    {
+                        const Rectangle aCandidatePosSizePixel(
+                                        pCandidate->GetPosPixel(),
+                                        pCandidate->GetSizePixel());
+
+                        if (aCandidatePosSizePixel.IsOver(aRectanglePixel))
+                        {
+                            pCandidate->Invalidate(
+                                INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
+                            pCandidate->Update();
+                        }
+                    }
+                    pCandidate = pCandidate->GetWindow( WINDOW_NEXT );
+                }
+            }
+        }
+    }
+}
+
 // #i72754# 2nd set of Pre/PostPaints
 // This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation
 // and deactivation and mpPrePostOutDev to remember the OutDev from the BeginDrawLayers
@@ -390,39 +428,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
                         DLPostPaint2(true);
                     }
 
-                    // #i107365#
-                    // Direct paint has been performed. Thus, take care of
-                    // transparent child windows.
-                    if ( GetWin() )
-                    {
-                        Window& rWindow = *(GetWin());
-                        if (rWindow.IsChildTransparentModeEnabled())
-                        {
-                            Window* pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
-                            if (pCandidate)
-                            {
-                                const Rectangle aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect()));
-
-                                while (pCandidate)
-                                {
-                                    if ( pCandidate->IsPaintTransparent() )
-                                    {
-                                        const Rectangle aCandidatePosSizePixel(
-                                                        pCandidate->GetPosPixel(),
-                                                        pCandidate->GetSizePixel());
-
-                                        if ( aCandidatePosSizePixel.IsOver(aRectanglePixel) )
-                                        {
-                                            pCandidate->Invalidate( INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
-                                            pCandidate->Update();
-                                        }
-                                    }
-
-                                    pCandidate = pCandidate->GetWindow( WINDOW_NEXT );
-                                }
-                            }
-                        }
-                    }
+                    lcl_PaintTransparentFormControls(*this, aRect); // i#107365
                 }
 
                 delete pVout;
@@ -526,6 +532,8 @@ void ViewShell::ImplUnlockPaint( sal_Bool bVirDev )
 
                 // #i72754# end Pre/PostPaint encapsulation when pOut is back and content is painted
                 DLPostPaint2(true);
+
+                lcl_PaintTransparentFormControls(*this, VisArea()); // fdo#63949
             }
             else
             {


More information about the Libreoffice-commits mailing list