diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-08-07 10:16:05 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-08-12 10:30:02 +0200 |
commit | 9ece71a185c93845e38c25eae91bc1955d60bfed (patch) | |
tree | c7ff1243f1b0b354afe41d67654afbf3f7f9c1b6 | |
parent | 3dfd5d794b36a1af49c59f7ab4c5d563ba32ebb0 (diff) |
It seems lcl_ExtendLeftAndRight is just a workaround
Which screens the calculation error
Change-Id: I51a37b2eba54d8d0a50dedc666487a83fc8d7f8c
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index a2869bc580fd..751ff7d43300 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1432,25 +1432,6 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm, ::SwAlignRect( rRect, pGlobalShell ); } -static void lcl_ExtendLeftAndRight( SwRect& _rRect, - const SwFrm& _rFrm, - const SwBorderAttrs& _rAttrs, - const SwRectFn& _rRectFn ) -{ - // Extend left/right border/shadow rectangle to bottom of previous frame/to - // top of next frame, if border/shadow is joined with previous/next frame. - if ( _rAttrs.JoinedWithPrev( _rFrm ) ) - { - const SwFrm* pPrevFrm = _rFrm.GetPrev(); - (_rRect.*_rRectFn->fnSetTop)( (pPrevFrm->*_rRectFn->fnGetPrtBottom)() ); - } - if ( _rAttrs.JoinedWithNext( _rFrm ) ) - { - const SwFrm* pNextFrm = _rFrm.GetNext(); - (_rRect.*_rRectFn->fnSetBottom)( (pNextFrm->*_rRectFn->fnGetPrtTop)() ); - } -} - static void lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage, const SwRect &rRect, SwRegionRects &rRegion ) { @@ -4190,7 +4171,6 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, SvxShadowLocation eLoc = rShadow.GetLocation(); - SWRECTFN( this ) if( IsVertical() ) { switch( eLoc ) @@ -4234,13 +4214,14 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, aOut.Top ( rOutRect.Top() + nHeight ); if ( bBottom ) aOut.Bottom( aOut.Bottom() - nHeight ); - if ( bCnt && (!bTop || !bBottom) ) - ::lcl_ExtendLeftAndRight( aOut, *(this), rAttrs, fnRect ); + else + aOut.Bottom( aOut.Bottom() + nHeight ); aRegion.push_back( aOut ); } rOutRect.Right ( rOutRect.Right() - nWidth ); - rOutRect.Bottom( rOutRect.Bottom()- nHeight ); + if( bBottom ) + rOutRect.Bottom( rOutRect.Bottom()- nHeight ); } break; case SVX_SHADOW_TOPLEFT: @@ -4262,13 +4243,14 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, aOut.Bottom( rOutRect.Bottom() - nHeight ); if ( bTop ) aOut.Top( aOut.Top() + nHeight ); - if ( bCnt && (!bBottom || !bTop) ) - ::lcl_ExtendLeftAndRight( aOut, *(this), rAttrs, fnRect ); + else + aOut.Top( aOut.Top() - nHeight ); aRegion.push_back( aOut ); } rOutRect.Left( rOutRect.Left() + nWidth ); - rOutRect.Top( rOutRect.Top() + nHeight ); + if( bTop ) + rOutRect.Top( rOutRect.Top() + nHeight ); } break; case SVX_SHADOW_TOPRIGHT: @@ -4290,13 +4272,14 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, aOut.Bottom( rOutRect.Bottom() - nHeight ); if ( bTop ) aOut.Top( aOut.Top() + nHeight ); - if ( bCnt && (!bBottom || bTop) ) - ::lcl_ExtendLeftAndRight( aOut, *(this), rAttrs, fnRect ); + else + aOut.Top( aOut.Top() - nHeight ); aRegion.push_back( aOut ); } rOutRect.Right( rOutRect.Right() - nWidth ); - rOutRect.Top( rOutRect.Top() + nHeight ); + if( bTop ) + rOutRect.Top( rOutRect.Top() + nHeight ); } break; case SVX_SHADOW_BOTTOMLEFT: @@ -4318,13 +4301,14 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, aOut.Top( rOutRect.Top() + nHeight ); if ( bBottom ) aOut.Bottom( aOut.Bottom() - nHeight ); - if ( bCnt && (!bTop || !bBottom) ) - ::lcl_ExtendLeftAndRight( aOut, *(this), rAttrs, fnRect ); + else + aOut.Bottom( aOut.Bottom() + nHeight ); aRegion.push_back( aOut ); } rOutRect.Left( rOutRect.Left() + nWidth ); - rOutRect.Bottom( rOutRect.Bottom() - nHeight ); + if( bBottom ) + rOutRect.Bottom( rOutRect.Bottom() - nHeight ); } break; default: @@ -4691,8 +4675,6 @@ static void lcl_PaintLeftRightLine( const bool _bLeft, if ( _rFrm.IsCntntFrm() ) { - ::lcl_ExtendLeftAndRight( aRect, _rFrm, _rAttrs, _rRectFn ); - // No Top / bottom borders for joint borders if ( _rAttrs.JoinedWithPrev( _rFrm ) ) pTopBorder = NULL; if ( _rAttrs.JoinedWithNext( _rFrm ) ) pBottomBorder = NULL; |