diff options
Diffstat (limited to 'sw/source/core/edit/edlingu.cxx')
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 460 |
1 files changed, 230 insertions, 230 deletions
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 49d32024b346..a92705eef782 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -71,7 +71,7 @@ class SwLinguIter SwPosition *pEnd; SwPosition *pCurr; SwPosition *pCurrX; - sal_uInt16 nCrsrCnt; + sal_uInt16 nCursorCnt; public: SwLinguIter(); @@ -89,7 +89,7 @@ public: inline const SwPosition *GetCurrX() const { return pCurrX; } inline void SetCurrX( SwPosition* pNew ){ delete pCurrX; pCurrX = pNew; } - inline sal_uInt16& GetCrsrCnt(){ return nCrsrCnt; } + inline sal_uInt16& GetCursorCnt(){ return nCursorCnt; } // for the UI: void _Start( SwEditShell *pSh, SwDocPositions eStart, @@ -155,16 +155,16 @@ public: class SwHyphIter : public SwLinguIter { - // With that we save a GetFrm() in Hyphenate //TODO: does it actually matter? + // With that we save a GetFrame() in Hyphenate //TODO: does it actually matter? const SwTextNode *m_pLastNode; - SwTextFrm *m_pLastFrm; - friend SwTextFrm * sw::SwHyphIterCacheLastTxtFrm(SwTextNode *, std::function<SwTextFrm * ()>); + SwTextFrame *m_pLastFrame; + friend SwTextFrame * sw::SwHyphIterCacheLastTextFrame(SwTextNode *, std::function<SwTextFrame * ()>); bool bOldIdle; static void DelSoftHyph( SwPaM &rPam ); public: - SwHyphIter() : m_pLastNode(nullptr), m_pLastFrm(nullptr), bOldIdle(false) {} + SwHyphIter() : m_pLastNode(nullptr), m_pLastFrame(nullptr), bOldIdle(false) {} void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd ); void End(); @@ -188,7 +188,7 @@ SwLinguIter::SwLinguIter() , pEnd(nullptr) , pCurr(nullptr) , pCurrX(nullptr) - , nCrsrCnt(0) + , nCursorCnt(0) { // TODO missing: ensurance of re-entrance, OSL_ENSURE( etc. } @@ -208,38 +208,38 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart, OSL_ENSURE( !pEnd, "SwLinguIter::_Start without End?"); - SwPaM *pCrsr = pSh->GetCrsr(); + SwPaM *pCursor = pSh->GetCursor(); - if( pShell->HasSelection() || pCrsr != pCrsr->GetNext() ) + if( pShell->HasSelection() || pCursor != pCursor->GetNext() ) { bSetCurr = nullptr != GetCurr(); - nCrsrCnt = pSh->GetCrsrCnt(); + nCursorCnt = pSh->GetCursorCnt(); if( pSh->IsTableMode() ) - pSh->TableCrsrToCursor(); + pSh->TableCursorToCursor(); pSh->Push(); sal_uInt16 n; - for( n = 0; n < nCrsrCnt; ++n ) + for( n = 0; n < nCursorCnt; ++n ) { pSh->Push(); - pSh->DestroyCrsr(); + pSh->DestroyCursor(); } pSh->Pop( false ); } else { bSetCurr = false; - nCrsrCnt = 1; + nCursorCnt = 1; pSh->Push(); pSh->SetLinguRange( eStart, eEnd ); } - pCrsr = pSh->GetCrsr(); - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); + pCursor = pSh->GetCursor(); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); - pStart = new SwPosition( *pCrsr->GetPoint() ); - pEnd = new SwPosition( *pCrsr->GetMark() ); + pStart = new SwPosition( *pCursor->GetPoint() ); + pEnd = new SwPosition( *pCursor->GetMark() ); if( bSetCurr ) { SwPosition* pNew = new SwPosition( *GetStart() ); @@ -248,7 +248,7 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart, SetCurrX( pNew ); } - pCrsr->SetMark(); + pCursor->SetMark(); } void SwLinguIter::_End(bool bRestoreSelection) @@ -259,7 +259,7 @@ void SwLinguIter::_End(bool bRestoreSelection) OSL_ENSURE( pEnd, "SwLinguIter::_End without end?"); if(bRestoreSelection) { - while( nCrsrCnt-- ) + while( nCursorCnt-- ) pSh->Pop( false ); pSh->KillPams(); @@ -303,40 +303,40 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) uno::Reference< uno::XInterface > xSpellRet; bool bGoOn = true; do { - SwPaM *pCrsr = pMySh->GetCrsr(); - if ( !pCrsr->HasMark() ) - pCrsr->SetMark(); + SwPaM *pCursor = pMySh->GetCursor(); + if ( !pCursor->HasMark() ) + pCursor->SetMark(); uno::Reference< beans::XPropertySet > xProp( GetLinguPropertySet() ); - *pMySh->GetCrsr()->GetPoint() = *GetCurr(); - *pMySh->GetCrsr()->GetMark() = *GetEnd(); - pMySh->GetDoc()->Spell(*pMySh->GetCrsr(), + *pMySh->GetCursor()->GetPoint() = *GetCurr(); + *pMySh->GetCursor()->GetMark() = *GetEnd(); + pMySh->GetDoc()->Spell(*pMySh->GetCursor(), xSpeller, pPageCnt, pPageSt, false ) >>= xSpellRet; - bGoOn = GetCrsrCnt() > 1; + bGoOn = GetCursorCnt() > 1; if( xSpellRet.is() ) { bGoOn = false; - SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() ); - SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() ); + SwPosition* pNewPoint = new SwPosition( *pCursor->GetPoint() ); + SwPosition* pNewMark = new SwPosition( *pCursor->GetMark() ); SetCurr( pNewPoint ); SetCurrX( pNewMark ); } if( bGoOn ) { pMySh->Pop( false ); - pCrsr = pMySh->GetCrsr(); - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); - SwPosition* pNew = new SwPosition( *pCrsr->GetPoint() ); + pCursor = pMySh->GetCursor(); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); + SwPosition* pNew = new SwPosition( *pCursor->GetPoint() ); SetStart( pNew ); - pNew = new SwPosition( *pCrsr->GetMark() ); + pNew = new SwPosition( *pCursor->GetMark() ); SetEnd( pNew ); pNew = new SwPosition( *GetStart() ); SetCurr( pNew ); pNew = new SwPosition( *pNew ); SetCurrX( pNew ); - pCrsr->SetMark(); - --GetCrsrCnt(); + pCursor->SetMark(); + --GetCursorCnt(); } }while ( bGoOn ); aSpellRet <<= xSpellRet; @@ -367,24 +367,24 @@ uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) OUString aConvText; bool bGoOn = true; do { - SwPaM *pCrsr = pMySh->GetCrsr(); - if ( !pCrsr->HasMark() ) - pCrsr->SetMark(); + SwPaM *pCursor = pMySh->GetCursor(); + if ( !pCursor->HasMark() ) + pCursor->SetMark(); - *pMySh->GetCrsr()->GetPoint() = *GetCurr(); - *pMySh->GetCrsr()->GetMark() = *GetEnd(); + *pMySh->GetCursor()->GetPoint() = *GetCurr(); + *pMySh->GetCursor()->GetMark() = *GetEnd(); // call function to find next text portion to be converted uno::Reference< linguistic2::XSpellChecker1 > xEmpty; - pMySh->GetDoc()->Spell( *pMySh->GetCrsr(), + pMySh->GetDoc()->Spell( *pMySh->GetCursor(), xEmpty, pPageCnt, pPageSt, false, &rArgs ) >>= aConvText; - bGoOn = GetCrsrCnt() > 1; + bGoOn = GetCursorCnt() > 1; if( !aConvText.isEmpty() ) { bGoOn = false; - SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() ); - SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() ); + SwPosition* pNewPoint = new SwPosition( *pCursor->GetPoint() ); + SwPosition* pNewMark = new SwPosition( *pCursor->GetMark() ); SetCurr( pNewPoint ); SetCurrX( pNewMark ); @@ -392,19 +392,19 @@ uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) if( bGoOn ) { pMySh->Pop( false ); - pCrsr = pMySh->GetCrsr(); - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); - SwPosition* pNew = new SwPosition( *pCrsr->GetPoint() ); + pCursor = pMySh->GetCursor(); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); + SwPosition* pNew = new SwPosition( *pCursor->GetPoint() ); SetStart( pNew ); - pNew = new SwPosition( *pCrsr->GetMark() ); + pNew = new SwPosition( *pCursor->GetMark() ); SetEnd( pNew ); pNew = new SwPosition( *GetStart() ); SetCurr( pNew ); pNew = new SwPosition( *pNew ); SetCurrX( pNew ); - pCrsr->SetMark(); - --GetCrsrCnt(); + pCursor->SetMark(); + --GetCursorCnt(); } }while ( bGoOn ); return makeAny( aConvText ); @@ -464,25 +464,25 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) uno::Reference< XHyphenatedWord > xHyphWord; bool bGoOn = false; do { - SwPaM *pCrsr; + SwPaM *pCursor; do { OSL_ENSURE( GetEnd(), "SwHyphIter::Continue without Start?" ); - pCrsr = pMySh->GetCrsr(); - if ( !pCrsr->HasMark() ) - pCrsr->SetMark(); - if ( *pCrsr->GetPoint() < *pCrsr->GetMark() ) + pCursor = pMySh->GetCursor(); + if ( !pCursor->HasMark() ) + pCursor->SetMark(); + if ( *pCursor->GetPoint() < *pCursor->GetMark() ) { - pCrsr->Exchange(); - pCrsr->SetMark(); + pCursor->Exchange(); + pCursor->SetMark(); } - if ( *pCrsr->End() <= *GetEnd() ) + if ( *pCursor->End() <= *GetEnd() ) { - *pCrsr->GetMark() = *GetEnd(); + *pCursor->GetMark() = *GetEnd(); // Do we need to break the word at the current cursor position? - const Point aCrsrPos( pMySh->GetCharRect().Pos() ); - xHyphWord = pMySh->GetDoc()->Hyphenate( pCrsr, aCrsrPos, + const Point aCursorPos( pMySh->GetCharRect().Pos() ); + xHyphWord = pMySh->GetDoc()->Hyphenate( pCursor, aCursorPos, pPageCnt, pPageSt ); } @@ -491,18 +491,18 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) SwEditShell::InsertSoftHyph( xHyphWord->getHyphenationPos() + 1); } } while( bAuto && xHyphWord.is() ); //end of do-while - bGoOn = !xHyphWord.is() && GetCrsrCnt() > 1; + bGoOn = !xHyphWord.is() && GetCursorCnt() > 1; if( bGoOn ) { pMySh->Pop( false ); - pCrsr = pMySh->GetCrsr(); - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); - SwPosition* pNew = new SwPosition(*pCrsr->End()); + pCursor = pMySh->GetCursor(); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); + SwPosition* pNew = new SwPosition(*pCursor->End()); SetEnd( pNew ); - pCrsr->SetMark(); - --GetCrsrCnt(); + pCursor->SetMark(); + --GetCursorCnt(); } } while ( bGoOn ); aHyphRet <<= xHyphWord; @@ -513,14 +513,14 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) void SwHyphIter::Ignore() { SwEditShell *pMySh = GetSh(); - SwPaM *pCrsr = pMySh->GetCrsr(); + SwPaM *pCursor = pMySh->GetCursor(); // delete old SoftHyphen - DelSoftHyph( *pCrsr ); + DelSoftHyph( *pCursor ); // and continue - pCrsr->Start()->nContent = pCrsr->End()->nContent; - pCrsr->SetMark(); + pCursor->Start()->nContent = pCursor->End()->nContent; + pCursor->SetMark(); } void SwHyphIter::DelSoftHyph( SwPaM &rPam ) @@ -539,9 +539,9 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos ) if( !pMySh ) return; - SwPaM *pCrsr = pMySh->GetCrsr(); - SwPosition* pSttPos = pCrsr->Start(); - SwPosition* pEndPos = pCrsr->End(); + SwPaM *pCursor = pMySh->GetCursor(); + SwPosition* pSttPos = pCursor->Start(); + SwPosition* pEndPos = pCursor->End(); const sal_Int32 nLastHyphLen = GetEnd()->nContent.GetIndex() - pSttPos->nContent.GetIndex(); @@ -558,30 +558,30 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos ) pMySh->StartAction(); { SwDoc *pDoc = pMySh->GetDoc(); - DelSoftHyph( *pCrsr ); + DelSoftHyph( *pCursor ); pSttPos->nContent += nHyphPos; SwPaM aRg( *pSttPos ); pDoc->getIDocumentContentOperations().InsertString( aRg, OUString(CHAR_SOFTHYPHEN) ); } // revoke selection - pCrsr->DeleteMark(); + pCursor->DeleteMark(); pMySh->EndAction(); - pCrsr->SetMark(); + pCursor->SetMark(); } namespace sw { -SwTextFrm * -SwHyphIterCacheLastTxtFrm(SwTextNode *const pNode, - std::function<SwTextFrm * ()> const create) +SwTextFrame * +SwHyphIterCacheLastTextFrame(SwTextNode *const pNode, + std::function<SwTextFrame * ()> const create) { assert(g_pHyphIter); - if (pNode != g_pHyphIter->m_pLastNode || !g_pHyphIter->m_pLastFrm) + if (pNode != g_pHyphIter->m_pLastNode || !g_pHyphIter->m_pLastFrame) { g_pHyphIter->m_pLastNode = pNode; - g_pHyphIter->m_pLastFrm = create(); + g_pHyphIter->m_pLastFrame = create(); } - return g_pHyphIter->m_pLastFrm; + return g_pHyphIter->m_pLastFrame; } } @@ -616,10 +616,10 @@ bool SwEditShell::HasHyphIter() void SwEditShell::SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd ) { - SwPaM *pCrsr = GetCrsr(); - MakeFindRange( static_cast<sal_uInt16>(eStart), static_cast<sal_uInt16>(eEnd), pCrsr ); - if( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); + SwPaM *pCursor = GetCursor(); + MakeFindRange( static_cast<sal_uInt16>(eStart), static_cast<sal_uInt16>(eEnd), pCursor ); + if( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); } void SwEditShell::SpellStart( @@ -645,10 +645,10 @@ void SwEditShell::SpellStart( if (pLinguIter) { - SwCursor* pSwCrsr = GetSwCrsr(); + SwCursor* pSwCursor = GetSwCursor(); - SwPosition *pTmp = new SwPosition( *pSwCrsr->GetPoint() ); - pSwCrsr->FillFindPos( eCurr, *pTmp ); + SwPosition *pTmp = new SwPosition( *pSwCursor->GetPoint() ); + pSwCursor->FillFindPos( eCurr, *pTmp ); pLinguIter->SetCurr( pTmp ); pTmp = new SwPosition( *pTmp ); @@ -736,8 +736,8 @@ uno::Any SwEditShell::SpellContinue( * - add nLastHyphLen onto SelectionStart * - iterate over all selected areas * - pDoc->Hyphenate() iterates over all Nodes of a selection - * - pTextNode->Hyphenate() calls SwTextFrm::Hyphenate of the EditShell - * - SwTextFrm:Hyphenate() iterates over all rows of the Pam + * - pTextNode->Hyphenate() calls SwTextFrame::Hyphenate of the EditShell + * - SwTextFrame:Hyphenate() iterates over all rows of the Pam * - LineIter::Hyphenate() sets the Hyphenator and the Pam based on * the to be separated word. * - Returns true if there is a hyphenation and false if the Pam is processed. @@ -842,13 +842,13 @@ uno::Reference< XSpellAlternatives > if( IsTableMode() ) return nullptr; - SwPaM* pCrsr = GetCrsr(); - SwPosition aPos( *pCrsr->GetPoint() ); + SwPaM* pCursor = GetCursor(); + SwPosition aPos( *pCursor->GetPoint() ); Point aPt( *pPt ); - SwCrsrMoveState eTmpState( MV_SETONLYTEXT ); + SwCursorMoveState eTmpState( MV_SETONLYTEXT ); SwTextNode *pNode; SwWrongList *pWrong; - if( GetLayout()->GetCrsrOfst( &aPos, aPt, &eTmpState ) && + if( GetLayout()->GetCursorOfst( &aPos, aPt, &eTmpState ) && nullptr != (pNode = aPos.nNode.GetNode().GetTextNode()) && nullptr != (pWrong = pNode->GetWrong()) && !pNode->IsInProtectSect() ) @@ -892,9 +892,9 @@ uno::Reference< XSpellAlternatives > // save the start and end positions of the line and the starting point Push(); LeftMargin(); - const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineStart = GetCursor()->GetPoint()->nContent.GetIndex(); RightMargin(); - const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineEnd = GetCursor()->GetPoint()->nContent.GetIndex(); Pop(false); // make sure the selection build later from the data below does @@ -911,9 +911,9 @@ uno::Reference< XSpellAlternatives > ++nRight; aPos.nContent = nBegin + nLeft; - pCrsr = GetCrsr(); - *pCrsr->GetPoint() = aPos; - pCrsr->SetMark(); + pCursor = GetCursor(); + *pCursor->GetPoint() = aPos; + pCursor->SetMark(); ExtendSelection( true, nLen - nLeft - nRight ); // don't determine the rectangle in the current line const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; @@ -921,19 +921,19 @@ uno::Reference< XSpellAlternatives > const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight); Push(); - pCrsr->DeleteMark(); - SwIndex& rContent = GetCrsr()->GetPoint()->nContent; + pCursor->DeleteMark(); + SwIndex& rContent = GetCursor()->GetPoint()->nContent; rContent = nWordStart; SwRect aStartRect; - SwCrsrMoveState aState; + SwCursorMoveState aState; aState.m_bRealWidth = true; - SwContentNode* pContentNode = pCrsr->GetContentNode(); - SwContentFrm *pContentFrame = pContentNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), false); + SwContentNode* pContentNode = pCursor->GetContentNode(); + SwContentFrame *pContentFrame = pContentNode->getLayoutFrame( GetLayout(), pPt, pCursor->GetPoint(), false); - pContentFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); + pContentFrame->GetCharRect( aStartRect, *pCursor->GetPoint(), &aState ); rContent = nWordEnd - 1; SwRect aEndRect; - pContentFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); + pContentFrame->GetCharRect( aEndRect, *pCursor->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); Pop(false); } @@ -954,13 +954,13 @@ bool SwEditShell::GetGrammarCorrection( if( IsTableMode() ) return bRes; - SwPaM* pCrsr = GetCrsr(); - SwPosition aPos( *pCrsr->GetPoint() ); + SwPaM* pCursor = GetCursor(); + SwPosition aPos( *pCursor->GetPoint() ); Point aPt( *pPt ); - SwCrsrMoveState eTmpState( MV_SETONLYTEXT ); + SwCursorMoveState eTmpState( MV_SETONLYTEXT ); SwTextNode *pNode; SwGrammarMarkUp *pWrong; - if( GetLayout()->GetCrsrOfst( &aPos, aPt, &eTmpState ) && + if( GetLayout()->GetCursorOfst( &aPos, aPt, &eTmpState ) && nullptr != (pNode = aPos.nNode.GetNode().GetTextNode()) && nullptr != (pWrong = pNode->GetGrammarCheck()) && !pNode->IsInProtectSect() ) @@ -1016,9 +1016,9 @@ bool SwEditShell::GetGrammarCorrection( // save the start and end positions of the line and the starting point Push(); LeftMargin(); - const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineStart = GetCursor()->GetPoint()->nContent.GetIndex(); RightMargin(); - const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineEnd = GetCursor()->GetPoint()->nContent.GetIndex(); Pop(false); // make sure the selection build later from the data below does @@ -1035,9 +1035,9 @@ bool SwEditShell::GetGrammarCorrection( ++nRight; aPos.nContent = nBegin + nLeft; - pCrsr = GetCrsr(); - *pCrsr->GetPoint() = aPos; - pCrsr->SetMark(); + pCursor = GetCursor(); + *pCursor->GetPoint() = aPos; + pCursor->SetMark(); ExtendSelection( true, nLen - nLeft - nRight ); // don't determine the rectangle in the current line const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; @@ -1045,19 +1045,19 @@ bool SwEditShell::GetGrammarCorrection( const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight); Push(); - pCrsr->DeleteMark(); - SwIndex& rContent = GetCrsr()->GetPoint()->nContent; + pCursor->DeleteMark(); + SwIndex& rContent = GetCursor()->GetPoint()->nContent; rContent = nWordStart; SwRect aStartRect; - SwCrsrMoveState aState; + SwCursorMoveState aState; aState.m_bRealWidth = true; - SwContentNode* pContentNode = pCrsr->GetContentNode(); - SwContentFrm *pContentFrame = pContentNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), false); + SwContentNode* pContentNode = pCursor->GetContentNode(); + SwContentFrame *pContentFrame = pContentNode->getLayoutFrame( GetLayout(), pPt, pCursor->GetPoint(), false); - pContentFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); + pContentFrame->GetCharRect( aStartRect, *pCursor->GetPoint(), &aState ); rContent = nWordEnd - 1; SwRect aEndRect; - pContentFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); + pContentFrame->GetCharRect( aEndRect, *pCursor->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); Pop(false); } @@ -1134,7 +1134,7 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b mpDoc->GetIDocumentUndoRedo().StartUndo( UNDO_UI_TEXT_CORRECTION, nullptr ); StartAction(); - SwPaM *pCrsr = GetCrsr(); + SwPaM *pCursor = GetCursor(); // save cursor position (which should be at the end of the current sentence) // for later restoration Push(); @@ -1171,10 +1171,10 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b break; } } - if ( !pCrsr->HasMark() ) - pCrsr->SetMark(); - pCrsr->GetPoint()->nContent = aCurrentOldPosition->nLeft; - pCrsr->GetMark()->nContent = aCurrentOldPosition->nRight; + if ( !pCursor->HasMark() ) + pCursor->SetMark(); + pCursor->GetPoint()->nContent = aCurrentOldPosition->nLeft; + pCursor->GetMark()->nContent = aCurrentOldPosition->nRight; sal_uInt16 nScriptType = SvtLanguageOptions::GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); sal_uInt16 nLangWhichId = RES_CHRATR_LANGUAGE; switch(nScriptType) @@ -1185,11 +1185,11 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b if(aCurrentNewPortion->sText != aCurrentOldPortion->sText) { // change text ... - mpDoc->getIDocumentContentOperations().DeleteAndJoin(*pCrsr); + mpDoc->getIDocumentContentOperations().DeleteAndJoin(*pCursor); // ... and apply language if necessary if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage) SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId) ); - mpDoc->getIDocumentContentOperations().InsertString(*pCrsr, aCurrentNewPortion->sText); + mpDoc->getIDocumentContentOperations().InsertString(*pCursor, aCurrentNewPortion->sText); } else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage) { @@ -1199,7 +1199,7 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b else if( aCurrentNewPortion->bIgnoreThisError ) { // add the 'ignore' markup to the TextNode's grammar ignore markup list - IgnoreGrammarErrorAt( *pCrsr ); + IgnoreGrammarErrorAt( *pCursor ); OSL_FAIL("TODO: add ignore mark to text node"); } if(aCurrentNewPortion == rNewPortions.begin()) @@ -1215,11 +1215,11 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end(); --aCurrentEndPosition; SpellContentPositions::const_iterator aCurrentStartPosition = rLastPositions.begin(); - pCrsr->GetPoint()->nContent = aCurrentStartPosition->nLeft; - pCrsr->GetMark()->nContent = aCurrentEndPosition->nRight; + pCursor->GetPoint()->nContent = aCurrentStartPosition->nLeft; + pCursor->GetMark()->nContent = aCurrentEndPosition->nRight; // delete the sentence completely - mpDoc->getIDocumentContentOperations().DeleteAndJoin(*pCrsr); + mpDoc->getIDocumentContentOperations().DeleteAndJoin(*pCursor); svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.begin(); while(aCurrentNewPortion != rNewPortions.end()) { @@ -1238,10 +1238,10 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b if(rLang.GetLanguage() != aCurrentNewPortion->eLanguage) SetAttrItem( SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId) ); // insert the new string - mpDoc->getIDocumentContentOperations().InsertString(*pCrsr, aCurrentNewPortion->sText); + mpDoc->getIDocumentContentOperations().InsertString(*pCursor, aCurrentNewPortion->sText); // set the cursor to the end of the inserted string - *pCrsr->Start() = *pCrsr->End(); + *pCursor->Start() = *pCursor->End(); ++aCurrentNewPortion; } } @@ -1252,14 +1252,14 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b Pop( false ); // collapse cursor to the end of the modified sentence - *pCrsr->Start() = *pCrsr->End(); + *pCursor->Start() = *pCursor->End(); if (bRecheck) { // in grammar check the current sentence has to be checked again GoStartSentence(); } // set continuation position for spell/grammar checking to the end of this sentence - g_pSpellIter->SetCurr( new SwPosition(*pCrsr->Start()) ); + g_pSpellIter->SetCurr( new SwPosition(*pCursor->Start()) ); mpDoc->GetIDocumentUndoRedo().EndUndo( UNDO_UI_TEXT_CORRECTION, nullptr ); EndAction(); @@ -1275,9 +1275,9 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh) const bool bShowChg = IDocumentRedlineAccess::IsShowChanges( pDoc->getIDocumentRedlineAccess().GetRedlineMode() ); if ( bShowChg ) { - SwPaM *pCrsr = pSh->GetCrsr(); - const SwPosition* pStartPos = pCrsr->Start(); - const SwTextNode* pTextNode = pCrsr->GetNode().GetTextNode(); + SwPaM *pCursor = pSh->GetCursor(); + const SwPosition* pStartPos = pCursor->Start(); + const SwTextNode* pTextNode = pCursor->GetNode().GetTextNode(); sal_uInt16 nAct = pDoc->getIDocumentRedlineAccess().GetRedlinePos( *pTextNode, USHRT_MAX ); const sal_Int32 nStartIndex = pStartPos->nContent.GetIndex(); @@ -1312,8 +1312,8 @@ static void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShel { if(!aDeletedRedlines.empty()) { - SwPaM *pCrsr = pSh->GetCrsr(); - const SwPosition* pEndPos = pCrsr->End(); + SwPaM *pCursor = pSh->GetCursor(); + const SwPosition* pEndPos = pCursor->End(); const sal_Int32 nEnd = pEndPos->nContent.GetIndex(); while(!aDeletedRedlines.empty() && aDeletedRedlines.back().nLeft > nEnd) @@ -1360,12 +1360,12 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh bool bGoOn = true; bool bGrammarErrorFound = false; do { - SwPaM *pCrsr = pMySh->GetCrsr(); - if ( !pCrsr->HasMark() ) - pCrsr->SetMark(); + SwPaM *pCursor = pMySh->GetCursor(); + if ( !pCursor->HasMark() ) + pCursor->SetMark(); - *pCrsr->GetPoint() = *GetCurr(); - *pCrsr->GetMark() = *GetEnd(); + *pCursor->GetPoint() = *GetCurr(); + *pCursor->GetMark() = *GetEnd(); if( bBackToStartOfSentence ) { @@ -1373,17 +1373,17 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh bBackToStartOfSentence = false; } uno::Any aSpellRet = - pMySh->GetDoc()->Spell(*pCrsr, + pMySh->GetDoc()->Spell(*pCursor, xSpeller, nullptr, nullptr, bIsGrammarCheck ); aSpellRet >>= xSpellRet; aSpellRet >>= aGrammarResult; - bGoOn = GetCrsrCnt() > 1; + bGoOn = GetCursorCnt() > 1; bGrammarErrorFound = aGrammarResult.aErrors.getLength() > 0; if( xSpellRet.is() || bGrammarErrorFound ) { bGoOn = false; - SwPosition* pNewPoint = new SwPosition( *pCrsr->GetPoint() ); - SwPosition* pNewMark = new SwPosition( *pCrsr->GetMark() ); + SwPosition* pNewPoint = new SwPosition( *pCursor->GetPoint() ); + SwPosition* pNewMark = new SwPosition( *pCursor->GetMark() ); SetCurr( pNewPoint ); SetCurrX( pNewMark ); @@ -1391,19 +1391,19 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh if( bGoOn ) { pMySh->Pop( false ); - pCrsr = pMySh->GetCrsr(); - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); - SwPosition* pNew = new SwPosition( *pCrsr->GetPoint() ); + pCursor = pMySh->GetCursor(); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); + SwPosition* pNew = new SwPosition( *pCursor->GetPoint() ); SetStart( pNew ); - pNew = new SwPosition( *pCrsr->GetMark() ); + pNew = new SwPosition( *pCursor->GetMark() ); SetEnd( pNew ); pNew = new SwPosition( *GetStart() ); SetCurr( pNew ); pNew = new SwPosition( *pNew ); SetCurrX( pNew ); - pCrsr->SetMark(); - --GetCrsrCnt(); + pCursor->SetMark(); + --GetCursorCnt(); } } while ( bGoOn ); @@ -1411,13 +1411,13 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh { // an error has been found // To fill the spell portions the beginning of the sentence has to be found - SwPaM *pCrsr = pMySh->GetCrsr(); + SwPaM *pCursor = pMySh->GetCursor(); // set the mark to the right if necessary - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); // the cursor has to be collapsed on the left to go to the start of the sentence - if sentence ends inside of the error - pCrsr->DeleteMark(); - pCrsr->SetMark(); + pCursor->DeleteMark(); + pCursor->SetMark(); bool bStartSent = pMySh->GoStartSentence(); SpellContentPositions aDeletedRedlines = lcl_CollectDeletedRedlines(pMySh); if(bStartSent) @@ -1426,33 +1426,33 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh AddPortion(nullptr, nullptr, aDeletedRedlines); } // Set the cursor to the error already found - *pCrsr->GetPoint() = *GetCurrX(); - *pCrsr->GetMark() = *GetCurr(); + *pCursor->GetPoint() = *GetCurrX(); + *pCursor->GetMark() = *GetCurr(); AddPortion(xSpellRet, &aGrammarResult, aDeletedRedlines); // save the end position of the error to continue from here - SwPosition aSaveStartPos = *pCrsr->End(); + SwPosition aSaveStartPos = *pCursor->End(); // determine the end of the current sentence - if ( *pCrsr->GetPoint() < *pCrsr->GetMark() ) - pCrsr->Exchange(); + if ( *pCursor->GetPoint() < *pCursor->GetMark() ) + pCursor->Exchange(); // again collapse to start marking after the end of the error - pCrsr->DeleteMark(); - pCrsr->SetMark(); + pCursor->DeleteMark(); + pCursor->SetMark(); pMySh->GoEndSentence(); if( bGrammarErrorFound ) { - const ModelToViewHelper aConversionMap(static_cast<SwTextNode&>(pCrsr->GetNode())); + const ModelToViewHelper aConversionMap(static_cast<SwTextNode&>(pCursor->GetNode())); OUString aExpandText = aConversionMap.getViewText(); sal_Int32 nSentenceEnd = aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition ); // remove trailing space if( aExpandText[nSentenceEnd - 1] == ' ' ) --nSentenceEnd; - if( pCrsr->End()->nContent.GetIndex() < nSentenceEnd ) + if( pCursor->End()->nContent.GetIndex() < nSentenceEnd ) { - pCrsr->End()->nContent.Assign( - pCrsr->End()->nNode.GetNode().GetContentNode(), nSentenceEnd); + pCursor->End()->nContent.Assign( + pCursor->End()->nNode.GetNode().GetContentNode(), nSentenceEnd); } } @@ -1460,10 +1460,10 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh // save the 'global' end of the spellchecking const SwPosition aSaveEndPos = *GetEnd(); // set the sentence end as 'local' end - SetEnd( new SwPosition( *pCrsr->End() )); + SetEnd( new SwPosition( *pCursor->End() )); - *pCrsr->GetPoint() = aSaveStartPos; - *pCrsr->GetMark() = *GetEnd(); + *pCursor->GetPoint() = aSaveStartPos; + *pCursor->GetMark() = *GetEnd(); // now the rest of the sentence has to be searched for errors // for each error the non-error text between the current and the last error has // to be added to the portions - if necessary broken into same-language-portions @@ -1473,33 +1473,33 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh { xSpellRet = nullptr; // don't search for grammar errors here anymore! - pMySh->GetDoc()->Spell(*pCrsr, + pMySh->GetDoc()->Spell(*pCursor, xSpeller, nullptr, nullptr, false ) >>= xSpellRet; - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); - SetCurr( new SwPosition( *pCrsr->GetPoint() )); - SetCurrX( new SwPosition( *pCrsr->GetMark() )); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); + SetCurr( new SwPosition( *pCursor->GetPoint() )); + SetCurrX( new SwPosition( *pCursor->GetMark() )); // if an error has been found go back to the text preceding the error if(xSpellRet.is()) { - *pCrsr->GetPoint() = aSaveStartPos; - *pCrsr->GetMark() = *GetCurr(); + *pCursor->GetPoint() = aSaveStartPos; + *pCursor->GetMark() = *GetCurr(); } // add the portion AddPortion(nullptr, nullptr, aDeletedRedlines); if(xSpellRet.is()) { - *pCrsr->GetPoint() = *GetCurr(); - *pCrsr->GetMark() = *GetCurrX(); + *pCursor->GetPoint() = *GetCurr(); + *pCursor->GetMark() = *GetCurrX(); AddPortion(xSpellRet, nullptr, aDeletedRedlines); // move the cursor to the end of the error string - *pCrsr->GetPoint() = *GetCurrX(); + *pCursor->GetPoint() = *GetCurrX(); // and save the end of the error as new start position aSaveStartPos = *GetCurrX(); // and the end of the sentence - *pCrsr->GetMark() = *GetEnd(); + *pCursor->GetMark() = *GetEnd(); } // if the end of the sentence has already been reached then break here if(*GetCurrX() >= *GetEnd()) @@ -1512,18 +1512,18 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh // go to the end of sentence as the grammar check returned it // at this time the Point is behind the grammar error // and the mark points to the sentence end as - if ( *pCrsr->GetPoint() < *pCrsr->GetMark() ) - pCrsr->Exchange(); + if ( *pCursor->GetPoint() < *pCursor->GetMark() ) + pCursor->Exchange(); } // the part between the last error and the end of the sentence has to be added - *pMySh->GetCrsr()->GetPoint() = *GetEnd(); + *pMySh->GetCursor()->GetPoint() = *GetEnd(); if(*GetCurrX() < *GetEnd()) { AddPortion(nullptr, nullptr, aDeletedRedlines); } // set the shell cursor to the end of the sentence to prevent a visible selection - *pCrsr->GetMark() = *GetEnd(); + *pCursor->GetMark() = *GetEnd(); if( !bIsGrammarCheck ) { // set the current position to the end of the sentence @@ -1537,8 +1537,8 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh else { // if no error could be found the selection has to be corrected - at least if it's not in the body - *pMySh->GetCrsr()->GetPoint() = *GetEnd(); - pMySh->GetCrsr()->DeleteMark(); + *pMySh->GetCursor()->GetPoint() = *GetEnd(); + pMySh->GetCursor()->DeleteMark(); } return bRet; @@ -1605,9 +1605,9 @@ void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt, aPortion.bIsHidden = bIsHidden; aPortion.xAlternatives = xAlt; SpellContentPosition aPosition; - SwPaM *pCrsr = GetSh()->GetCrsr(); - aPosition.nLeft = pCrsr->Start()->nContent.GetIndex(); - aPosition.nRight = pCrsr->End()->nContent.GetIndex(); + SwPaM *pCursor = GetSh()->GetCursor(); + aPosition.nLeft = pCursor->Start()->nContent.GetIndex(); + aPosition.nRight = pCursor->End()->nContent.GetIndex(); aLastPortions.push_back(aPortion); aLastPositions.push_back(aPosition); } @@ -1628,16 +1628,16 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, } else { - SwPaM *pCrsr = GetSh()->GetCrsr(); - if ( *pCrsr->GetPoint() > *pCrsr->GetMark() ) - pCrsr->Exchange(); + SwPaM *pCursor = GetSh()->GetCursor(); + if ( *pCursor->GetPoint() > *pCursor->GetMark() ) + pCursor->Exchange(); // save the start and end positions - SwPosition aStart(*pCrsr->GetPoint()); - SwPosition aEnd(*pCrsr->GetMark()); + SwPosition aStart(*pCursor->GetPoint()); + SwPosition aEnd(*pCursor->GetMark()); // iterate over the text to find changes in language // set the mark equal to the point - *pCrsr->GetMark() = aStart; - SwTextNode* pTextNode = pCrsr->GetNode().GetTextNode(); + *pCursor->GetMark() = aStart; + SwTextNode* pTextNode = pCursor->GetNode().GetTextNode(); LanguageType eStartLanguage = lcl_GetLanguage(*GetSh()); SpellContentPosition aNextRedline = lcl_FindNextDeletedRedline( rDeletedRedlines, aStart.nContent.GetIndex() ); @@ -1646,14 +1646,14 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, // select until the end of the current redline const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? aEnd.nContent.GetIndex() : aNextRedline.nRight; - pCrsr->GetPoint()->nContent.Assign( pTextNode, nEnd ); + pCursor->GetPoint()->nContent.Assign( pTextNode, nEnd ); CreatePortion(xAlt, pGrammarResult, false, true); - aStart = *pCrsr->End(); + aStart = *pCursor->End(); // search for next redline aNextRedline = lcl_FindNextDeletedRedline( rDeletedRedlines, aStart.nContent.GetIndex() ); } - while(*pCrsr->GetPoint() < aEnd) + while(*pCursor->GetPoint() < aEnd) { // #125786 in table cell with fixed row height the cursor might not move forward if(!GetSh()->Right(1, CRSR_SKIP_CELLS)) @@ -1662,11 +1662,11 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, bool bField = false; // read the character at the current position to check if it's a field sal_Unicode const cChar = - pTextNode->GetText()[pCrsr->GetMark()->nContent.GetIndex()]; + pTextNode->GetText()[pCursor->GetMark()->nContent.GetIndex()]; if( CH_TXTATR_BREAKWORD == cChar || CH_TXTATR_INWORD == cChar) { const SwTextAttr* pTextAttr = pTextNode->GetTextAttrForCharAt( - pCrsr->GetMark()->nContent.GetIndex() ); + pCursor->GetMark()->nContent.GetIndex() ); const sal_uInt16 nWhich = pTextAttr ? pTextAttr->Which() : static_cast<sal_uInt16>(RES_TXTATR_END); @@ -1682,12 +1682,12 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, } else if (cChar == CH_TXT_ATR_FORMELEMENT) { - SwPosition aPos(*pCrsr->GetMark()); + SwPosition aPos(*pCursor->GetMark()); bField = pMySh->GetDoc()->getIDocumentMarkAccess()->getDropDownFor(aPos); } LanguageType eCurLanguage = lcl_GetLanguage(*GetSh()); - bool bRedline = aNextRedline.nLeft == pCrsr->GetPoint()->nContent.GetIndex(); + bool bRedline = aNextRedline.nLeft == pCursor->GetPoint()->nContent.GetIndex(); // create a portion if the next character // - is a field, // - is at the beginning of a deleted redline @@ -1699,41 +1699,41 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, // with a different language // in the case of redlining it's different if(eCurLanguage != eStartLanguage || bField) - *pCrsr->GetPoint() = *pCrsr->GetMark(); + *pCursor->GetPoint() = *pCursor->GetMark(); // set to the last start - *pCrsr->GetMark() = aStart; + *pCursor->GetMark() = aStart; // create portion should only be called if a selection exists // there's no selection if there's a field at the beginning - if(*pCrsr->Start() != *pCrsr->End()) + if(*pCursor->Start() != *pCursor->End()) CreatePortion(xAlt, pGrammarResult, false, false); - aStart = *pCrsr->End(); + aStart = *pCursor->End(); // now export the field - if there is any if(bField) { - *pCrsr->GetMark() = *pCrsr->GetPoint(); + *pCursor->GetMark() = *pCursor->GetPoint(); GetSh()->Right(1, CRSR_SKIP_CELLS); CreatePortion(xAlt, pGrammarResult, true, false); - aStart = *pCrsr->End(); + aStart = *pCursor->End(); } } // if a redline start then create a portion for it if(bRedline) { - *pCrsr->GetMark() = *pCrsr->GetPoint(); + *pCursor->GetMark() = *pCursor->GetPoint(); // select until the end of the current redline const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? aEnd.nContent.GetIndex() : aNextRedline.nRight; - pCrsr->GetPoint()->nContent.Assign( pTextNode, nEnd ); + pCursor->GetPoint()->nContent.Assign( pTextNode, nEnd ); CreatePortion(xAlt, pGrammarResult, false, true); - aStart = *pCrsr->End(); + aStart = *pCursor->End(); // search for next redline aNextRedline = lcl_FindNextDeletedRedline( rDeletedRedlines, aStart.nContent.GetIndex() ); } - *pCrsr->GetMark() = *pCrsr->GetPoint(); + *pCursor->GetMark() = *pCursor->GetPoint(); } - pCrsr->SetMark(); - *pCrsr->GetMark() = aStart; + pCursor->SetMark(); + *pCursor->GetMark() = aStart; CreatePortion(xAlt, pGrammarResult, false, false); } } @@ -1759,7 +1759,7 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition ) pWrong = pNode->GetWrong(); if( pWrong ) pWrong->RemoveEntry( nStart, nEnd ); - SwTextFrm::repaintTextFrames( *pNode ); + SwTextFrame::repaintTextFrames( *pNode ); } ++aIdx; nStart = 0; |