sw/source/core/text/itrcrsr.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
New commits: commit 2c8e9ed3cbe3aed5520ce8f5888dd083f8ee50c3 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sat Dec 30 15:08:32 2023 +0600 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat Dec 30 11:49:10 2023 +0100 Simplify a bit Change-Id: Ic2fa4c0a1c7424ff2114c494d0c4e06a3f8b1cce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161439 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 30b605cac011..7a74df60c990 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -82,7 +82,7 @@ static void lcl_GetCharRectInsideField( SwTextSizeInfo& rInf, SwRect& rOrig, if ( ! pPor->GetNextPortion() || nFieldIdx + nFieldLen > nCharOfst ) break; - nFieldIdx = nFieldIdx + nFieldLen; + nFieldIdx += nFieldLen; rOrig.Pos().AdjustX(pPor->Width() ); pPor = pPor->GetNextPortion(); @@ -471,7 +471,7 @@ void SwTextCursor::GetEndCharRect(SwRect* pOrig, const TextFrameIndex nOfst, // Search for the last Text/EndPortion of the line while( pPor ) { - nX = nX + pPor->Width(); + nX += pPor->Width(); if( pPor->InTextGrp() || ( pPor->GetLen() && !pPor->IsFlyPortion() && !pPor->IsHolePortion() ) || pPor->IsBreakPortion() ) { @@ -1009,7 +1009,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, while( pNext && !pNext->InFieldGrp() ) { OSL_ENSURE( !pNext->GetLen(), "Where's my field follow?" ); - nAddX = nAddX + pNext->Width(); + nAddX += pNext->Width(); pNext = pNext->GetNextPortion(); } if( !pNext ) @@ -1382,7 +1382,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con if ( pPor->InSpaceGrp() && nSpaceAdd ) { const_cast<SwTextSizeInfo&>(GetInfo()).SetIdx( nCurrStart ); - nWidth = nWidth + pPor->CalcSpacing( nSpaceAdd, GetInfo() ); + nWidth += pPor->CalcSpacing( nSpaceAdd, GetInfo() ); } if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) || ( pPor->IsMultiPortion() && static_cast<SwMultiPortion*>(pPor)->HasTabulator() ) @@ -1416,8 +1416,8 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con while (ConsiderNextPortionForCursorOffset(pPor, nWidth30, nX)) { - nX = nX - nWidth; - nCurrStart = nCurrStart + pPor->GetLen(); + nX -= nWidth; + nCurrStart += pPor->GetLen(); pPor = pPor->GetNextPortion(); nWidth = pPor->Width(); if ( m_pCurr->IsSpaceAdd() || pKanaComp ) @@ -1425,7 +1425,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con if ( pPor->InSpaceGrp() && nSpaceAdd ) { const_cast<SwTextSizeInfo&>(GetInfo()).SetIdx( nCurrStart ); - nWidth = nWidth + pPor->CalcSpacing( nSpaceAdd, GetInfo() ); + nWidth += pPor->CalcSpacing( nSpaceAdd, GetInfo() ); } if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) || @@ -1467,7 +1467,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con SwLinePortion *pNextPor = pPor->GetNextPortion(); while( pNextPor && pNextPor->InFieldGrp() && !pNextPor->Width() ) { - nCurrStart = nCurrStart + pPor->GetLen(); + nCurrStart += pPor->GetLen(); pPor = pNextPor; if( !pPor->IsFlyPortion() && !pPor->IsMarginPortion() ) bLastHyph = pPor->InHyphGrp(); @@ -1671,7 +1671,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con { const sal_uInt16 nPreWidth = static_cast<SwDoubleLinePortion*>(pPor)->PreWidth(); if ( nX > nPreWidth ) - nX = nX - nPreWidth; + nX -= nPreWidth; else nX = 0; }