diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-14 07:56:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-14 12:46:04 +0100 |
commit | 1856186951a70a0bcac4e0c3632ca4afe68c05e3 (patch) | |
tree | 793e0de2b341307b9144aa16bc55c5b073064ef2 | |
parent | gtk3: add approved theme color fetch / selection. (diff) | |
download | core-1856186951a70a0bcac4e0c3632ca4afe68c05e3.tar.gz core-1856186951a70a0bcac4e0c3632ca4afe68c05e3.zip |
optimize: traverse children with WINDOW_FIRSTCHILD/WINDOW_NEXT
-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 774000c00f20..04717dd02cef 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -370,25 +370,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 ); } } } |