[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source

Petr Mladek pmladek at kemper.freedesktop.org
Wed Apr 18 05:59:01 PDT 2012


 sw/source/core/view/viewsh.cxx |   32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

New commits:
commit 43b48f05e5aa3359a0227550b9a5c88851a582d2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Apr 14 07:56:45 2012 +0100

    optimize: traverse children with WINDOW_FIRSTCHILD/WINDOW_NEXT
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 0413382..f0dd635 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -368,25 +368,29 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
                     if ( GetWin() )
                     {
                         Window& rWindow = *(GetWin());
-                        if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount())
+                        if (rWindow.IsChildTransparentModeEnabled())
                         {
-                            const Rectangle aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect()));
-
-                            for ( sal_uInt16 a(0); a < rWindow.GetChildCount(); a++ )
+                            Window* pCandidate = rWindow.GetWindow( WINDOW_FIRSTCHILD );
+                            if (pCandidate)
                             {
-                                Window* pCandidate = rWindow.GetChild(a);
+                                const Rectangle aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect()));
 
-                                if ( pCandidate && pCandidate->IsPaintTransparent() )
+                                while (pCandidate)
                                 {
-                                    const Rectangle aCandidatePosSizePixel(
-                                                    pCandidate->GetPosPixel(),
-                                                    pCandidate->GetSizePixel());
-
-                                    if ( aCandidatePosSizePixel.IsOver(aRectanglePixel) )
+                                    if ( pCandidate->IsPaintTransparent() )
                                     {
-                                        pCandidate->Invalidate( INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
-                                        pCandidate->Update();
-                }
+                                        const Rectangle aCandidatePosSizePixel(
+                                                        pCandidate->GetPosPixel(),
+                                                        pCandidate->GetSizePixel());
+
+                                        if ( aCandidatePosSizePixel.IsOver(aRectanglePixel) )
+                                        {
+                                            pCandidate->Invalidate( INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
+                                            pCandidate->Update();
+                                        }
+                                    }
+
+                                    pCandidate = pCandidate->GetWindow( WINDOW_NEXT );
                                 }
                             }
                         }


More information about the Libreoffice-commits mailing list