diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-14 07:56:45 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-04-18 14:58:38 +0200 |
commit | 43b48f05e5aa3359a0227550b9a5c88851a582d2 (patch) | |
tree | 6642cb76130733c284a89b1cf249e75ed17445f4 | |
parent | 7ed7df6ba854a799e8e9fb92c68650cc5e6e5695 (diff) |
optimize: traverse children with WINDOW_FIRSTCHILD/WINDOW_NEXT
Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 0413382d5fe5..f0dd635c0559 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 ); } } } |