diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-13 10:45:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-13 10:45:36 +0100 |
commit | 9665fbad5d1ae9398eba089b685b322df447a32a (patch) | |
tree | ea908b1c7a49115a94b786697653b53a9f8246d7 /sw | |
parent | deea33b8c1389df925699c011c682f522e3dba71 (diff) |
coverity#1212526 Logically dead code
Change-Id: I9e2fd1249061fcf386a8812a42450e52d37bdc5c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 60327e58dd8f..8e48c430dc57 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1545,12 +1545,16 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, bool bNext ) const if ( rPoint.Y() < pCnt->Frm().Top() && !lcl_IsInRepeatedHeadline( pCnt ) ) return pCnt->UnionFrm().Pos(); - while ( pCnt ) + Point aRet(0, 0); + do { //Does the point lie in the current CntntFrm? SwRect aCntFrm( pCnt->UnionFrm() ); if ( aCntFrm.IsInside( rPoint ) && !lcl_IsInRepeatedHeadline( pCnt )) - return rPoint; + { + aRet = rPoint; + break; + } //Is the current one the last CntntFrm? //If the next CntntFrm lies behind the point, then the current on is the @@ -1561,7 +1565,10 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, bool bNext ) const //Does the point lie behind the last CntntFrm? if ( !pNxt ) - return Point( aCntFrm.Right(), aCntFrm.Bottom() ); + { + aRet = Point( aCntFrm.Right(), aCntFrm.Bottom() ); + break; + } //If the next CntntFrm lies behind the point then it is the one we //searched. @@ -1571,13 +1578,16 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, bool bNext ) const !lcl_IsInRepeatedHeadline( pCnt, &pTFrm ) && ( !pTFrm || pNxt->Frm().Left() > rPoint.X() )) { - if( bNext ) - return pNxt->Frm().Pos(); - return Point( aCntFrm.Right(), aCntFrm.Bottom() ); + if (bNext) + aRet = pNxt->Frm().Pos(); + else + aRet = Point( aCntFrm.Right(), aCntFrm.Bottom() ); + break; } pCnt = pNxt; } - return Point( 0, 0 ); + while (pCnt); + return aRet; } /** Returns the absolute document position of the desired page. |