diff options
Diffstat (limited to 'sw/source/core/edit')
-rw-r--r-- | sw/source/core/edit/acorrect.cxx | 64 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 130 | ||||
-rw-r--r-- | sw/source/core/edit/edatmisc.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/edit/edattr.cxx | 62 | ||||
-rw-r--r-- | sw/source/core/edit/eddel.cxx | 48 | ||||
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/edit/edfld.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/edit/edfmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edglbldc.cxx | 52 | ||||
-rw-r--r-- | sw/source/core/edit/edglss.cxx | 22 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 216 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 460 | ||||
-rw-r--r-- | sw/source/core/edit/ednumber.cxx | 186 | ||||
-rw-r--r-- | sw/source/core/edit/edredln.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/edit/edsect.cxx | 42 | ||||
-rw-r--r-- | sw/source/core/edit/edtab.cxx | 98 | ||||
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/edit/edundo.cxx | 28 | ||||
-rw-r--r-- | sw/source/core/edit/edws.cxx | 30 |
19 files changed, 755 insertions, 755 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index 1c1de66998cd..e84ddf3d3174 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -37,40 +37,40 @@ using namespace ::com::sun::star; -class _PaMIntoCrsrShellRing +class _PaMIntoCursorShellRing { - SwCrsrShell& rSh; - SwPaM &rDelPam, &rCrsr; + SwCursorShell& rSh; + SwPaM &rDelPam, &rCursor; SwPaM* pPrevDelPam; - SwPaM* pPrevCrsr; + SwPaM* pPrevCursor; static void RemoveFromRing( SwPaM& rPam, SwPaM* pPrev ); public: - _PaMIntoCrsrShellRing( SwCrsrShell& rSh, SwPaM& rCrsr, SwPaM& rPam ); - ~_PaMIntoCrsrShellRing(); + _PaMIntoCursorShellRing( SwCursorShell& rSh, SwPaM& rCursor, SwPaM& rPam ); + ~_PaMIntoCursorShellRing(); }; -_PaMIntoCrsrShellRing::_PaMIntoCrsrShellRing( SwCrsrShell& rCSh, - SwPaM& rShCrsr, SwPaM& rPam ) - : rSh( rCSh ), rDelPam( rPam ), rCrsr( rShCrsr ) +_PaMIntoCursorShellRing::_PaMIntoCursorShellRing( SwCursorShell& rCSh, + SwPaM& rShCursor, SwPaM& rPam ) + : rSh( rCSh ), rDelPam( rPam ), rCursor( rShCursor ) { - SwPaM* pShCrsr = rSh._GetCrsr(); + SwPaM* pShCursor = rSh._GetCursor(); pPrevDelPam = rDelPam.GetPrev(); - pPrevCrsr = rCrsr.GetPrev(); + pPrevCursor = rCursor.GetPrev(); - rDelPam.GetRingContainer().merge( pShCrsr->GetRingContainer() ); - rCrsr.GetRingContainer().merge( pShCrsr->GetRingContainer() ); + rDelPam.GetRingContainer().merge( pShCursor->GetRingContainer() ); + rCursor.GetRingContainer().merge( pShCursor->GetRingContainer() ); } -_PaMIntoCrsrShellRing::~_PaMIntoCrsrShellRing() +_PaMIntoCursorShellRing::~_PaMIntoCursorShellRing() { // and take out the Pam again: RemoveFromRing( rDelPam, pPrevDelPam ); - RemoveFromRing( rCrsr, pPrevCrsr ); + RemoveFromRing( rCursor, pPrevCursor ); } -void _PaMIntoCrsrShellRing::RemoveFromRing( SwPaM& rPam, SwPaM* pPrev ) +void _PaMIntoCursorShellRing::RemoveFromRing( SwPaM& rPam, SwPaM* pPrev ) { SwPaM* p; SwPaM* pNext = &rPam; @@ -83,7 +83,7 @@ void _PaMIntoCrsrShellRing::RemoveFromRing( SwPaM& rPam, SwPaM* pPrev ) SwAutoCorrDoc::SwAutoCorrDoc( SwEditShell& rEditShell, SwPaM& rPam, sal_Unicode cIns ) - : rEditSh( rEditShell ), rCrsr( rPam ), pIdx( nullptr ) + : rEditSh( rEditShell ), rCursor( rPam ), pIdx( nullptr ) , m_nEndUndoCounter(0) , bUndoIdInitialized( cIns == 0 ) { @@ -105,7 +105,7 @@ void SwAutoCorrDoc::DeleteSel( SwPaM& rDelPam ) { // so that also the DelPam be moved, include it in the // Shell-Cursr-Ring !! - _PaMIntoCrsrShellRing aTmp( rEditSh, rCrsr, rDelPam ); + _PaMIntoCursorShellRing aTmp( rEditSh, rCursor, rDelPam ); pDoc->getIDocumentContentOperations().DeleteAndJoin( rDelPam ); } else @@ -116,7 +116,7 @@ void SwAutoCorrDoc::DeleteSel( SwPaM& rDelPam ) bool SwAutoCorrDoc::Delete( sal_Int32 nStt, sal_Int32 nEnd ) { - const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode; + const SwNodeIndex& rNd = rCursor.GetPoint()->nNode; SwPaM aSel( rNd, nStt, rNd, nEnd ); DeleteSel( aSel ); @@ -127,7 +127,7 @@ bool SwAutoCorrDoc::Delete( sal_Int32 nStt, sal_Int32 nEnd ) bool SwAutoCorrDoc::Insert( sal_Int32 nPos, const OUString& rText ) { - SwPaM aPam( rCrsr.GetPoint()->nNode.GetNode(), nPos ); + SwPaM aPam( rCursor.GetPoint()->nNode.GetNode(), nPos ); rEditSh.GetDoc()->getIDocumentContentOperations().InsertString( aPam, rText ); if( !bUndoIdInitialized ) { @@ -148,10 +148,10 @@ bool SwAutoCorrDoc::Replace( sal_Int32 nPos, const OUString& rText ) bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const OUString& rText ) { - SwPaM* pPam = &rCrsr; + SwPaM* pPam = &rCursor; if( pPam->GetPoint()->nContent.GetIndex() != nPos ) { - pPam = new SwPaM( *rCrsr.GetPoint() ); + pPam = new SwPaM( *rCursor.GetPoint() ); pPam->GetPoint()->nContent = nPos; } @@ -187,7 +187,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const } else { - _PaMIntoCrsrShellRing aTmp( rEditSh, rCrsr, *pPam ); + _PaMIntoCursorShellRing aTmp( rEditSh, rCursor, *pPam ); pPam->SetMark(); pPam->GetPoint()->nContent = std::min<sal_Int32>( @@ -223,7 +223,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const } } - if( pPam != &rCrsr ) + if( pPam != &rCursor ) delete pPam; return true; @@ -232,7 +232,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const bool SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& rItem ) { - const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode; + const SwNodeIndex& rNd = rCursor.GetPoint()->nNode; SwPaM aPam( rNd, nStt, rNd, nEnd ); SfxItemPool& rPool = rEditSh.GetDoc()->GetAttrPool(); @@ -254,7 +254,7 @@ bool SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, bool SwAutoCorrDoc::SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ) { - const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode; + const SwNodeIndex& rNd = rCursor.GetPoint()->nNode; SwPaM aPam( rNd, nStt, rNd, nEnd ); SfxItemSet aSet( rEditSh.GetDoc()->GetAttrPool(), @@ -277,7 +277,7 @@ OUString const* SwAutoCorrDoc::GetPrevPara(bool const bAtNormalPos) OUString const* pStr(nullptr); if( bAtNormalPos || !pIdx ) - pIdx = new SwNodeIndex( rCrsr.GetPoint()->nNode, -1 ); + pIdx = new SwNodeIndex( rCursor.GetPoint()->nNode, -1 ); else --(*pIdx); @@ -305,7 +305,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, // Found a beginning of a paragraph or a Blank, // search for the word Kuerzel (Shortcut) in the Auto - SwTextNode* pTextNd = rCrsr.GetNode().GetTextNode(); + SwTextNode* pTextNd = rCursor.GetNode().GetTextNode(); OSL_ENSURE( pTextNd, "where is the TextNode?" ); bool bRet = false; @@ -329,7 +329,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, // replace also last colon of keywords surrounded by colons (for example, ":name:") bool replaceLastChar = pFnd->GetShort()[0] == ':' && pFnd->GetShort().endsWith(":"); - const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode; + const SwNodeIndex& rNd = rCursor.GetPoint()->nNode; SwPaM aPam( rNd, rSttPos, rNd, nEndPos + (replaceLastChar ? 1 : 0) ); if( pFnd->IsTextOnly() ) @@ -355,7 +355,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, if( pPara ) { OSL_ENSURE( !pIdx, "who has not deleted his Index?" ); - pIdx = new SwNodeIndex( rCrsr.GetPoint()->nNode, -1 ); + pIdx = new SwNodeIndex( rCursor.GetPoint()->nNode, -1 ); } SwDoc* pAutoDoc = aTBlks.GetDoc(); @@ -410,7 +410,7 @@ void SwAutoCorrDoc::SaveCpltSttWord( sal_uLong nFlag, sal_Int32 nPos, const OUString& rExceptWord, sal_Unicode cChar ) { - sal_uLong nNode = pIdx ? pIdx->GetIndex() : rCrsr.GetPoint()->nNode.GetIndex(); + sal_uLong nNode = pIdx ? pIdx->GetIndex() : rCursor.GetPoint()->nNode.GetIndex(); LanguageType eLang = GetLanguage(nPos, false); rEditSh.GetDoc()->SetAutoCorrExceptWord( new SwAutoCorrExceptWord( nFlag, nNode, nPos, rExceptWord, cChar, eLang )); @@ -422,7 +422,7 @@ LanguageType SwAutoCorrDoc::GetLanguage( sal_Int32 nPos, bool bPrevPara ) const SwTextNode* pNd = (( bPrevPara && pIdx ) ? *pIdx - : rCrsr.GetPoint()->nNode ).GetNode().GetTextNode(); + : rCursor.GetPoint()->nNode ).GetNode().GetTextNode(); if( pNd ) eRet = pNd->GetLang( nPos ); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 9577162a976a..3db4de004081 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -98,7 +98,7 @@ class SwAutoFormat SwEditShell* m_pEditShell; SwDoc* m_pDoc; SwTextNode* m_pCurTextNd; // the current TextNode - SwTextFrm* m_pCurTextFrm; // frame of the current TextNode + SwTextFrame* m_pCurTextFrame; // frame of the current TextNode sal_uLong m_nEndNdIdx; // for the percentage-display mutable std::unique_ptr<CharClass> m_pCharClass; // Character classification mutable LanguageType m_eCharClassLang; @@ -179,7 +179,7 @@ class SwAutoFormat OUString* pPrefix = nullptr, OUString* pPostfix = nullptr, OUString* pNumTypes = nullptr ) const; /// get the FORMATTED TextFrame - SwTextFrm* GetFrm( const SwTextNode& rTextNd ) const; + SwTextFrame* GetFrame( const SwTextNode& rTextNd ) const; void BuildIndent(); void BuildText(); @@ -238,21 +238,21 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c ) return *pSrc ? pSrc : nullptr; } -SwTextFrm* SwAutoFormat::GetFrm( const SwTextNode& rTextNd ) const +SwTextFrame* SwAutoFormat::GetFrame( const SwTextNode& rTextNd ) const { // get the Frame - const SwContentFrm *pFrm = rTextNd.getLayoutFrm( m_pEditShell->GetLayout() ); - OSL_ENSURE( pFrm, "For Autoformat a Layout is needed" ); - if( m_aFlags.bAFormatByInput && !pFrm->IsValid() ) + const SwContentFrame *pFrame = rTextNd.getLayoutFrame( m_pEditShell->GetLayout() ); + OSL_ENSURE( pFrame, "For Autoformat a Layout is needed" ); + if( m_aFlags.bAFormatByInput && !pFrame->IsValid() ) { - SwRect aTmpFrm( pFrm->Frm() ); - SwRect aTmpPrt( pFrm->Prt() ); - pFrm->Calc(pFrm->getRootFrm()->GetCurrShell()->GetOut()); - if( pFrm->Frm() != aTmpFrm || pFrm->Prt() != aTmpPrt || - ( pFrm->IsTextFrm() && !const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pFrm))->Paint().IsEmpty() ) ) - pFrm->SetCompletePaint(); + SwRect aTmpFrame( pFrame->Frame() ); + SwRect aTmpPrt( pFrame->Prt() ); + pFrame->Calc(pFrame->getRootFrame()->GetCurrShell()->GetOut()); + if( pFrame->Frame() != aTmpFrame || pFrame->Prt() != aTmpPrt || + ( pFrame->IsTextFrame() && !const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pFrame))->Paint().IsEmpty() ) ) + pFrame->SetCompletePaint(); } - return const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pFrm))->GetFormatted(); + return const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pFrame))->GetFormatted(); } void SwAutoFormat::_SetRedlineText( sal_uInt16 nActionId ) @@ -334,7 +334,7 @@ OUString SwAutoFormat::GoNextPara() m_pDoc->GetDocShell() ); m_pCurTextNd = static_cast<SwTextNode*>(pNewNd); - m_pCurTextFrm = GetFrm( *m_pCurTextNd ); + m_pCurTextFrame = GetFrame( *m_pCurTextNd ); return m_pCurTextNd->GetText(); } @@ -367,7 +367,7 @@ const SwTextNode* SwAutoFormat::GetNextNode() const bool SwAutoFormat::IsOneLine( const SwTextNode& rNd ) const { - SwTextFrmInfo aFInfo( GetFrm( rNd ) ); + SwTextFrameInfo aFInfo( GetFrame( rNd ) ); return aFInfo.IsOneLine(); } @@ -376,7 +376,7 @@ bool SwAutoFormat::IsFastFullLine( const SwTextNode& rNd ) const bool bRet = m_aFlags.bRightMargin; if( bRet ) { - SwTextFrmInfo aFInfo( GetFrm( rNd ) ); + SwTextFrameInfo aFInfo( GetFrame( rNd ) ); bRet = aFInfo.IsFilled( m_aFlags.nRightMargin ); } return bRet; @@ -396,7 +396,7 @@ bool SwAutoFormat::IsEnumericChar( const SwTextNode& rNd ) const if (StrChr(pBulletChar, rText[nBlnks])) return true; // Should there be a symbol font at the position? - SwTextFrmInfo aFInfo( GetFrm( rNd ) ); + SwTextFrameInfo aFInfo( GetFrame( rNd ) ); if( aFInfo.IsBullet( nBlnks )) return true; } @@ -467,8 +467,8 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTextNode& rNd, sal_uInt16 *pDigitLvl sal_Int32 SwAutoFormat::GetBigIndent( sal_Int32& rAktSpacePos ) const { - SwTextFrmInfo aFInfo( GetFrm( *m_pCurTextNd ) ); - const SwTextFrm* pNxtFrm = nullptr; + SwTextFrameInfo aFInfo( GetFrame( *m_pCurTextNd ) ); + const SwTextFrame* pNxtFrame = nullptr; if( !m_bMoreLines ) { @@ -476,10 +476,10 @@ sal_Int32 SwAutoFormat::GetBigIndent( sal_Int32& rAktSpacePos ) const if( !CanJoin( pNxtNd ) || !IsOneLine( *pNxtNd ) ) return 0; - pNxtFrm = GetFrm( *pNxtNd ); + pNxtFrame = GetFrame( *pNxtNd ); } - return aFInfo.GetBigIndent( rAktSpacePos, pNxtFrm ); + return aFInfo.GetBigIndent( rAktSpacePos, pNxtFrame ); } bool SwAutoFormat::IsNoAlphaLine( const SwTextNode& rNd ) const @@ -599,7 +599,7 @@ bool SwAutoFormat::DoTable() ( '+' != ( cChar = rTmp[nEndPlus - 1]) && '|' != cChar )) return false; - SwTextFrmInfo aInfo( m_pCurTextFrm ); + SwTextFrameInfo aInfo( m_pCurTextFrame ); sal_Int32 n = nSttPlus; std::vector<sal_uInt16> aPosArr; @@ -643,7 +643,7 @@ bool SwAutoFormat::DoTable() { eHori = text::HoriOrientation::NONE; // then - as last - we need to add the current frame width into the array - aPosArr.push_back( static_cast<sal_uInt16>(m_pCurTextFrm->Frm().Width()) ); + aPosArr.push_back( static_cast<sal_uInt16>(m_pCurTextFrame->Frame().Width()) ); } else eHori = text::HoriOrientation::LEFT; @@ -1084,11 +1084,11 @@ void SwAutoFormat::DeleteSel( SwPaM& rDelPam ) if( m_aFlags.bWithRedlining ) { // Add to Shell-Cursor-Ring so that DelPam will be moved as well! - SwPaM* pShCrsr = m_pEditShell->_GetCrsr(); - SwPaM aTmp( *m_pCurTextNd, 0, pShCrsr ); + SwPaM* pShCursor = m_pEditShell->_GetCursor(); + SwPaM aTmp( *m_pCurTextNd, 0, pShCursor ); SwPaM* pPrev = rDelPam.GetPrev(); - rDelPam.GetRingContainer().merge( pShCrsr->GetRingContainer() ); + rDelPam.GetRingContainer().merge( pShCursor->GetRingContainer() ); m_pEditShell->DeleteSel( rDelPam ); @@ -1190,7 +1190,7 @@ void SwAutoFormat::DelMoreLinesBlanks( bool bWithLineBreaks ) m_aDelPam.GetPoint()->nNode = m_aNdIdx; m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, 0 ); - SwTextFrmInfo aFInfo( m_pCurTextFrm ); + SwTextFrameInfo aFInfo( m_pCurTextFrame ); aFInfo.GetSpaces( m_aDelPam, !m_aFlags.bAFormatByInput || bWithLineBreaks ); do { @@ -1353,7 +1353,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) bool bBreak = true; // first, determine current indentation and frame width - SwTwips nFrmWidth = m_pCurTextFrm->Prt().Width();; + SwTwips nFrameWidth = m_pCurTextFrame->Prt().Width();; SwTwips nLeftTextPos; { sal_Int32 nPos(0); @@ -1363,7 +1363,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) ++nPos; } - SwTextFrmInfo aInfo( m_pCurTextFrm ); + SwTextFrameInfo aInfo( m_pCurTextFrame ); nLeftTextPos = aInfo.GetCharPos(nPos); nLeftTextPos -= m_pCurTextNd->GetSwAttrSet().GetLRSpace().GetLeft(); } @@ -1452,8 +1452,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) aRule.Set( n, aFormat ); if( n == nLvl && - nFrmWidth < ( nSpaceSteps * MAXLEVEL ) ) - nSpaceSteps = static_cast<sal_uInt16>(( nFrmWidth - nLeftTextPos ) / + nFrameWidth < ( nSpaceSteps * MAXLEVEL ) ) + nSpaceSteps = static_cast<sal_uInt16>(( nFrameWidth - nLeftTextPos ) / ( MAXLEVEL - nLvl )); } } @@ -1540,7 +1540,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) } // Does it fit completely into the frame? - bool bDefStep = nFrmWidth < (nSpaceSteps * MAXLEVEL); + bool bDefStep = nFrameWidth < (nSpaceSteps * MAXLEVEL); for( ; n < MAXLEVEL; ++n ) { SwNumFormat aFormat( aRule.Get( n ) ); @@ -1721,11 +1721,11 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) if( !bBreak ) { SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES ); - SwTextFrmInfo aFInfo( m_pCurTextFrm ); + SwTextFrameInfo aFInfo( m_pCurTextFrame ); const SwTextNode* pNxtNd = GetNextNode(); while( CanJoin( pNxtNd ) && - 20 < std::abs( (long)(nSpaces - aFInfo.SetFrm( - GetFrm( *pNxtNd ) ).GetLineStart() )) + 20 < std::abs( (long)(nSpaces - aFInfo.SetFrame( + GetFrame( *pNxtNd ) ).GetLineStart() )) ) { bBreak = !IsFastFullLine( *pNxtNd ) || @@ -1807,7 +1807,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) SwAutoCorrDoc aACorrDoc( *m_pEditShell, m_aDelPam ); - SwTextFrmInfo aFInfo( nullptr ); + SwTextFrameInfo aFInfo( nullptr ); sal_Int32 nSttPos, nLastBlank = nPos; bool bFirst = m_aFlags.bCapitalStartSentence, bFirstSent = bFirst; @@ -1827,8 +1827,8 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) { // beachte: Sonderfall Symbolfonts !!! - if( !aFInfo.GetFrm() ) - aFInfo.SetFrm( GetFrm( *m_pCurTextNd ) ); + if( !aFInfo.GetFrame() ) + aFInfo.SetFrame( GetFrame( *m_pCurTextNd ) ); if( !aFInfo.IsBullet( nPos )) { SetRedlineText( STR_AUTOFMTREDL_TYPO ); @@ -1853,7 +1853,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) m_pCurTextNd = m_aNdIdx.GetNode().GetTextNode(); pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); - aFInfo.SetFrm( nullptr ); + aFInfo.SetFrame( nullptr ); } nPos += sReplace.getLength() - 1; @@ -1878,8 +1878,8 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( ( cChar == '\"' && bReplaceQuote ) || ( cChar == '\'' && bReplaceSglQuote ) ) { // consider Symbolfonts! - if( !aFInfo.GetFrm() ) - aFInfo.SetFrm( GetFrm( *m_pCurTextNd ) ); + if( !aFInfo.GetFrame() ) + aFInfo.SetFrame( GetFrame( *m_pCurTextNd ) ); if( !aFInfo.IsBullet( nPos )) { SetRedlineText( STR_AUTOFMTREDL_TYPO ); @@ -1905,7 +1905,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); m_aDelPam.DeleteMark(); - aFInfo.SetFrm( nullptr ); + aFInfo.SetFrame( nullptr ); } nPos += sReplace.getLength() - 1; @@ -1925,8 +1925,8 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( m_aFlags.bChgWeightUnderl ) { // consider Symbolfonts! - if( !aFInfo.GetFrm() ) - aFInfo.SetFrm( GetFrm( *m_pCurTextNd ) ); + if( !aFInfo.GetFrame() ) + aFInfo.SetFrame( GetFrame( *m_pCurTextNd ) ); if( !aFInfo.IsBullet( nPos )) { SetRedlineText( '*' == cChar @@ -1946,7 +1946,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); m_aDelPam.DeleteMark(); - aFInfo.SetFrm( nullptr ); + aFInfo.SetFrame( nullptr ); } //#125102# in case of the mode REDLINE_SHOW_DELETE the ** are still contained in pText if(0 == (m_pDoc->getIDocumentRedlineAccess().GetRedlineMode() & nsRedlineMode_t::REDLINE_SHOW_DELETE)) @@ -2078,7 +2078,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags& rFlags, m_aEndNdIdx( pEdShell->GetDoc()->GetNodes().GetEndOfContent() ), m_pEditShell( pEdShell ), m_pDoc( pEdShell->GetDoc() ), - m_pCurTextNd( nullptr ), m_pCurTextFrm( nullptr ), + m_pCurTextNd( nullptr ), m_pCurTextFrame( nullptr ), m_nRedlAutoFormatSeqId( 0 ) { OSL_ENSURE( (pSttNd && pEndNd) || (!pSttNd && !pEndNd), @@ -2143,7 +2143,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags& rFlags, sal_uInt16 nDigitLvl = 0; // set defaults - SwTextFrmInfo aFInfo( nullptr ); + SwTextFrameInfo aFInfo( nullptr ); // This is the automat for autoformatting m_eStat = READ_NEXT_PARA; @@ -2182,9 +2182,9 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags& rFlags, // recognize a table definition +---+---+ if( m_aFlags.bAFormatByInput && m_aFlags.bCreateTable && DoTable() ) { - //JP 30.09.96: DoTable() builds on PopCrsr and MoveCrsr after AutoFormat! + //JP 30.09.96: DoTable() builds on PopCursor and MoveCursor after AutoFormat! pEdShell->Pop( false ); - *pEdShell->GetCrsr() = m_aDelPam; + *pEdShell->GetCursor() = m_aDelPam; pEdShell->Push(); m_eStat = IS_END; @@ -2217,7 +2217,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags& rFlags, break; } - aFInfo.SetFrm( m_pCurTextFrm ); + aFInfo.SetFrame( m_pCurTextFrame ); // so far: if there were templates assigned, keep these and go to next node sal_uInt16 nPoolId = m_pCurTextNd->GetTextColl()->GetPoolFormatId(); @@ -2529,11 +2529,11 @@ void SwEditShell::AutoFormat( const SvxSwAutoFormatFlags* pAFlags ) pWait.reset(new SwWait( *GetDoc()->GetDocShell(), true )); } - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); // There are more than one or a selection is open - if( pCrsr->GetNext() != pCrsr || pCrsr->HasMark() ) + if( pCursor->GetNext() != pCursor || pCursor->HasMark() ) { - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( rPaM.HasMark() ) { @@ -2554,15 +2554,15 @@ void SwEditShell::AutoFormat( const SvxSwAutoFormatFlags* pAFlags ) void SwEditShell::AutoFormatBySplitNode() { SET_CURR_SHELL( this ); - SwPaM* pCrsr = GetCrsr(); - if( !pCrsr->IsMultiSelection() && pCrsr->Move( fnMoveBackward, fnGoNode ) ) + SwPaM* pCursor = GetCursor(); + if( !pCursor->IsMultiSelection() && pCursor->Move( fnMoveBackward, fnGoNode ) ) { StartAllAction(); StartUndo( UNDO_AUTOFORMAT ); bool bRange = false; - pCrsr->SetMark(); - SwIndex* pContent = &pCrsr->GetMark()->nContent; + pCursor->SetMark(); + SwIndex* pContent = &pCursor->GetMark()->nContent; if( pContent->GetIndex() ) { *pContent = 0; @@ -2571,12 +2571,12 @@ void SwEditShell::AutoFormatBySplitNode() else { // then go one node backwards - SwNodeIndex m_aNdIdx( pCrsr->GetMark()->nNode, -1 ); + SwNodeIndex m_aNdIdx( pCursor->GetMark()->nNode, -1 ); SwTextNode* pTextNd = m_aNdIdx.GetNode().GetTextNode(); if (pTextNd && !pTextNd->GetText().isEmpty()) { pContent->Assign( pTextNd, 0 ); - pCrsr->GetMark()->nNode = m_aNdIdx; + pCursor->GetMark()->nNode = m_aNdIdx; bRange = true; } } @@ -2587,15 +2587,15 @@ void SwEditShell::AutoFormatBySplitNode() SvxSwAutoFormatFlags aAFFlags = *GetAutoFormatFlags(); // use default values so far - SwAutoFormat aFormat( this, aAFFlags, &pCrsr->GetMark()->nNode, - &pCrsr->GetPoint()->nNode ); + SwAutoFormat aFormat( this, aAFFlags, &pCursor->GetMark()->nNode, + &pCursor->GetPoint()->nNode ); - //JP 30.09.96: DoTable() builds on PopCrsr and MoveCrsr! + //JP 30.09.96: DoTable() builds on PopCursor and MoveCursor! Pop( false ); - pCrsr = GetCrsr(); + pCursor = GetCursor(); } - pCrsr->DeleteMark(); - pCrsr->Move( fnMoveForward, fnGoNode ); + pCursor->DeleteMark(); + pCursor->Move( fnMoveForward, fnGoNode ); EndUndo( UNDO_AUTOFORMAT ); EndAllAction(); diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx index 59a22b133605..83f796369c01 100644 --- a/sw/source/core/edit/edatmisc.cxx +++ b/sw/source/core/edit/edatmisc.cxx @@ -32,17 +32,17 @@ void SwEditShell::ResetAttr( const std::set<sal_uInt16> &attrs, SwPaM* pPaM ) { SET_CURR_SHELL( this ); - SwPaM* pCrsr = pPaM ? pPaM : GetCrsr( ); + SwPaM* pCursor = pPaM ? pPaM : GetCursor( ); StartAllAction(); - bool bUndoGroup = pCrsr->GetNext() != pCrsr; + bool bUndoGroup = pCursor->GetNext() != pCursor; if( bUndoGroup ) { GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_RESETATTR, nullptr); } - for(SwPaM& rCurCrsr : pCrsr->GetRingContainer()) - GetDoc()->ResetAttrs(rCurCrsr, true, attrs); + for(SwPaM& rCurrentCursor : pCursor->GetRingContainer()) + GetDoc()->ResetAttrs(rCurrentCursor, true, attrs); if( bUndoGroup ) { @@ -54,7 +54,7 @@ void SwEditShell::ResetAttr( const std::set<sal_uInt16> &attrs, SwPaM* pPaM ) void SwEditShell::GCAttr() { - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if ( !rPaM.HasMark() ) { @@ -99,13 +99,13 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags ) { SET_CURR_SHELL( this ); StartAllAction(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr ) // Ring of Cursors + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor ) // Ring of Cursors { bool bIsTableMode = IsTableMode(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, nullptr); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( rPaM.HasMark() && ( bIsTableMode || *rPaM.GetPoint() != *rPaM.GetMark() )) @@ -120,7 +120,7 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags ) { if( !HasSelection() ) UpdateAttr(); - GetDoc()->getIDocumentContentOperations().InsertPoolItem( *pCrsr, rHint, nFlags ); + GetDoc()->getIDocumentContentOperations().InsertPoolItem( *pCursor, rHint, nFlags ); } EndAllAction(); } @@ -129,19 +129,19 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM* { SET_CURR_SHELL( this ); - SwPaM* pCrsr = pPaM ? pPaM : GetCrsr(); + SwPaM* pCursor = pPaM ? pPaM : GetCursor(); StartAllAction(); - if( pCrsr->GetNext() != pCrsr ) // Ring of Cursors + if( pCursor->GetNext() != pCursor ) // Ring of Cursors { bool bIsTableMode = IsTableMode(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, nullptr); - for(SwPaM& rTmpCrsr : pCrsr->GetRingContainer()) + for(SwPaM& rTmpCursor : pCursor->GetRingContainer()) { - if( rTmpCrsr.HasMark() && ( bIsTableMode || - *rTmpCrsr.GetPoint() != *rTmpCrsr.GetMark() )) + if( rTmpCursor.HasMark() && ( bIsTableMode || + *rTmpCursor.GetPoint() != *rTmpCursor.GetMark() )) { - GetDoc()->getIDocumentContentOperations().InsertItemSet(rTmpCrsr, rSet, nFlags ); + GetDoc()->getIDocumentContentOperations().InsertItemSet(rTmpCursor, rSet, nFlags ); } } @@ -151,7 +151,7 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM* { if( !HasSelection() ) UpdateAttr(); - GetDoc()->getIDocumentContentOperations().InsertItemSet( *pCrsr, rSet, nFlags ); + GetDoc()->getIDocumentContentOperations().InsertItemSet( *pCursor, rSet, nFlags ); } EndAllAction(); } diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 88de80c275a4..c4843969d31d 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -63,7 +63,7 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, const bool bMergeIndentValuesOfNumRule ) const { // ??? pPaM can be different from the Cursor ??? - if( GetCrsrCnt() > getMaxLookup() ) + if( GetCursorCnt() > getMaxLookup() ) { rSet.InvalidateAllItems(); return false; @@ -172,12 +172,12 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, bool SwEditShell::GetCurAttr( SfxItemSet& rSet, const bool bMergeIndentValuesOfNumRule ) const { - return GetPaMAttr( GetCrsr(), rSet, bMergeIndentValuesOfNumRule ); + return GetPaMAttr( GetCursor(), rSet, bMergeIndentValuesOfNumRule ); } bool SwEditShell::GetCurParAttr( SfxItemSet& rSet) const { - return GetPaMParAttr( GetCrsr(), rSet ); + return GetPaMParAttr( GetCursor(), rSet ); } bool SwEditShell::GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const @@ -234,7 +234,7 @@ bool SwEditShell::GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const SwTextFormatColl* SwEditShell::GetCurTextFormatColl( ) const { - return GetPaMTextFormatColl( GetCrsr() ); + return GetPaMTextFormatColl( GetCursor() ); } SwTextFormatColl* SwEditShell::GetPaMTextFormatColl( SwPaM* pPaM ) const @@ -284,7 +284,7 @@ SwTextFormatColl* SwEditShell::GetPaMTextFormatColl( SwPaM* pPaM ) const std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell::GetItemWithPaM( sal_uInt16 nWhich ) { std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> vItem; - for(SwPaM& rCurrentPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rCurrentPaM : GetCursor()->GetRingContainer()) { // for all the point and mark (selections) // get the start and the end node of the current selection @@ -384,13 +384,13 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell bool SwEditShell::GetCurFootnote( SwFormatFootnote* pFillFootnote ) { // The cursor must be positioned on the current footnotes anchor: - SwPaM* pCrsr = GetCrsr(); - SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + SwPaM* pCursor = GetCursor(); + SwTextNode* pTextNd = pCursor->GetNode().GetTextNode(); if( !pTextNd ) return false; SwTextAttr *const pFootnote = pTextNd->GetTextAttrForCharAt( - pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); + pCursor->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); if( pFootnote && pFillFootnote ) { // Transfer data from the attribute @@ -406,10 +406,10 @@ bool SwEditShell::SetCurFootnote( const SwFormatFootnote& rFillFootnote ) bool bChgd = false; StartAllAction(); - for(SwPaM& rCrsr : GetCrsr()->GetRingContainer()) + for(SwPaM& rCursor : GetCursor()->GetRingContainer()) { bChgd |= - mpDoc->SetCurFootnote( rCrsr, rFillFootnote.GetNumStr(), rFillFootnote.GetNumber(), rFillFootnote.IsEndNote() ); + mpDoc->SetCurFootnote( rCursor, rFillFootnote.GetNumStr(), rFillFootnote.GetNumber(), rFillFootnote.IsEndNote() ); } @@ -480,7 +480,7 @@ bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const if( !nDefDist ) return false; - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { sal_uLong nSttNd = rPaM.GetMark()->nNode.GetIndex(), nEndNd = rPaM.GetPoint()->nNode.GetIndex(); @@ -499,13 +499,13 @@ bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const long nNext = rLS.GetTextLeft() + nDefDist; if( bModulus ) nNext = ( nNext / nDefDist ) * nDefDist; - SwFrm* pFrm = pCNd->getLayoutFrm( GetLayout() ); - if ( pFrm ) + SwFrame* pFrame = pCNd->getLayoutFrame( GetLayout() ); + if ( pFrame ) { - const sal_uInt16 nFrmWidth = static_cast<sal_uInt16>( pFrm->IsVertical() ? - pFrm->Frm().Height() : - pFrm->Frm().Width() ); - bRet = nFrmWidth > ( nNext + MM50 ); + const sal_uInt16 nFrameWidth = static_cast<sal_uInt16>( pFrame->IsVertical() ? + pFrame->Frame().Height() : + pFrame->Frame().Width() ); + bRet = nFrameWidth > ( nNext + MM50 ); } else bRet = false; @@ -524,17 +524,17 @@ void SwEditShell::MoveLeftMargin( bool bRight, bool bModulus ) StartAllAction(); StartUndo( UNDO_START ); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr ) // Multiple selection ? + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor ) // Multiple selection ? { - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->MoveLeftMargin( aRangeArr.SetPam( n, aPam ), bRight, bModulus ); } else - GetDoc()->MoveLeftMargin( *pCrsr, bRight, bModulus ); + GetDoc()->MoveLeftMargin( *pCursor, bRight, bModulus ); EndUndo( UNDO_END ); EndAllAction(); @@ -639,7 +639,7 @@ SvtScriptType SwEditShell::GetScriptType() const SvtScriptType nRet = SvtScriptType::NONE; { - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { const SwPosition *pStt = rPaM.Start(), *pEnd = pStt == rPaM.GetMark() @@ -749,8 +749,8 @@ SvtScriptType SwEditShell::GetScriptType() const sal_uInt16 SwEditShell::GetCurLang() const { - const SwPaM* pCrsr = GetCrsr(); - const SwPosition& rPos = *pCrsr->GetPoint(); + const SwPaM* pCursor = GetCursor(); + const SwPosition& rPos = *pCursor->GetPoint(); const SwTextNode* pTNd = rPos.nNode.GetNode().GetTextNode(); sal_uInt16 nLang; if( pTNd ) @@ -758,7 +758,7 @@ sal_uInt16 SwEditShell::GetCurLang() const //JP 24.9.2001: if exist no selection, then get the language before // the current character! sal_Int32 nPos = rPos.nContent.GetIndex(); - if( nPos && !pCrsr->HasMark() ) + if( nPos && !pCursor->HasMark() ) --nPos; nLang = pTNd->GetLang( nPos ); } @@ -769,17 +769,17 @@ sal_uInt16 SwEditShell::GetCurLang() const sal_uInt16 SwEditShell::GetScalingOfSelectedText() const { - const SwPaM* pCrsr = GetCrsr(); - const SwPosition* pStt = pCrsr->Start(); + const SwPaM* pCursor = GetCursor(); + const SwPosition* pStt = pCursor->Start(); const SwTextNode* pTNd = pStt->nNode.GetNode().GetTextNode(); OSL_ENSURE( pTNd, "no textnode available" ); sal_uInt16 nScaleWidth; if( pTNd ) { - const SwPosition* pEnd = pStt == pCrsr->GetPoint() - ? pCrsr->GetMark() - : pCrsr->GetPoint(); + const SwPosition* pEnd = pStt == pCursor->GetPoint() + ? pCursor->GetMark() + : pCursor->GetPoint(); const sal_Int32 nStt = pStt->nContent.GetIndex(); const sal_Int32 nEnd = pStt->nNode == pEnd->nNode ? pEnd->nContent.GetIndex() diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index b41d1b410989..08e06d841665 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -94,7 +94,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo ) SwPaM * pPam = &rPam; if (bSelectAll) { - assert(dynamic_cast<SwShellCrsr*>(&rPam)); // must be corrected pam + assert(dynamic_cast<SwShellCursor*>(&rPam)); // must be corrected pam pNewPam.reset(new SwPaM(*rPam.GetMark(), *rPam.GetPoint())); // Selection starts at the first para of the first cell, but we // want to delete the table node before the first cell as well. @@ -115,11 +115,11 @@ long SwEditShell::Delete() { SET_CURR_SHELL( this ); long nRet = 0; - if ( !HasReadonlySel() || CrsrInsideInputField() ) + if ( !HasReadonlySel() || CursorInsideInputField() ) { StartAllAction(); - bool bUndo = GetCrsr()->GetNext() != GetCrsr(); + bool bUndo = GetCursor()->GetNext() != GetCursor(); if( bUndo ) // more than one selection? { SwRewriter aRewriter; @@ -128,7 +128,7 @@ long SwEditShell::Delete() GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_DELETE, &aRewriter); } - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { DeleteSel( rPaM, &bUndo ); } @@ -159,7 +159,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) SwPosition * pPos = nullptr; std::shared_ptr<SwPosition> pInsertPos; sal_uInt16 nMove = 0; - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( !pPos ) { @@ -171,17 +171,17 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) continue; } else - pPos = pDestShell->GetCrsr()->GetPoint(); + pPos = pDestShell->GetCursor()->GetPoint(); } if( IsBlockMode() ) { // In block mode different insert positions will be calculated // by simulated cursor movements from the given first insert position if( nMove ) { - SwCursor aCrsr( *pPos, nullptr, false); - if( aCrsr.UpDown( false, nMove, nullptr, 0 ) ) + SwCursor aCursor( *pPos, nullptr, false); + if( aCursor.UpDown( false, nMove, nullptr, 0 ) ) { - pInsertPos.reset( new SwPosition( *aCrsr.GetPoint() ) ); + pInsertPos.reset( new SwPosition( *aCursor.GetPoint() ) ); aInsertList.push_back( pInsertPos ); } } @@ -207,7 +207,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) std::list< std::shared_ptr<SwPosition> >::iterator pNextInsert = aInsertList.begin(); pDestShell->GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( !pPos ) { @@ -219,7 +219,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) continue; } else - pPos = pDestShell->GetCrsr()->GetPoint(); + pPos = pDestShell->GetCursor()->GetPoint(); } if( !bFirstMove ) { @@ -257,22 +257,22 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) // Maybe nothing has been moved? if( !bFirstMove ) { - SwPaM* pCrsr = pDestShell->GetCrsr(); - pCrsr->SetMark(); - pCrsr->GetPoint()->nNode = aSttNdIdx.GetIndex()+1; - pCrsr->GetPoint()->nContent.Assign( pCrsr->GetContentNode(),nSttCntIdx); - pCrsr->Exchange(); + SwPaM* pCursor = pDestShell->GetCursor(); + pCursor->SetMark(); + pCursor->GetPoint()->nNode = aSttNdIdx.GetIndex()+1; + pCursor->GetPoint()->nContent.Assign( pCursor->GetContentNode(),nSttCntIdx); + pCursor->Exchange(); } else { // If the cursor moved during move process, move also its GetMark - pDestShell->GetCrsr()->SetMark(); - pDestShell->GetCrsr()->DeleteMark(); + pDestShell->GetCursor()->SetMark(); + pDestShell->GetCursor()->DeleteMark(); } #if OSL_DEBUG_LEVEL > 0 // check if the indices are registered in the correct nodes { - for(SwPaM& rCmp : pDestShell->GetCrsr()->GetRingContainer()) + for(SwPaM& rCmp : pDestShell->GetCursor()->GetRingContainer()) { OSL_ENSURE( rCmp.GetPoint()->nContent.GetIdxReg() == rCmp.GetContentNode(), "Point in wrong Node" ); @@ -288,7 +288,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) pDestShell->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); pDestShell->EndAllAction(); - pDestShell->SaveTableBoxContent( pDestShell->GetCrsr()->GetPoint() ); + pDestShell->SaveTableBoxContent( pDestShell->GetCursor()->GetPoint() ); return bRet; } @@ -310,7 +310,7 @@ bool SwEditShell::Replace( const OUString& rNewStr, bool bRegExpRplc ) StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, nullptr); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( rPaM.HasMark() && *rPaM.GetMark() != *rPaM.GetPoint() ) { @@ -333,13 +333,13 @@ bool SwEditShell::DelFullPara() bool bRet = false; if( !IsTableMode() ) { - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); // no multi selection - if( !pCrsr->IsMultiSelection() && !HasReadonlySel() ) + if( !pCursor->IsMultiSelection() && !HasReadonlySel() ) { SET_CURR_SHELL( this ); StartAllAction(); - bRet = GetDoc()->getIDocumentContentOperations().DelFullPara( *pCrsr ); + bRet = GetDoc()->getIDocumentContentOperations().DelFullPara( *pCursor ); EndAllAction(); } } diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index db47d26fc823..85b29f6ea83f 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -58,7 +58,7 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat, aRewriter.AddRule(UndoArg1, pLocal->GetName()); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_SETFMTCOLL, &aRewriter); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if ( !rPaM.HasReadonlySel( GetViewOptions()->IsFormView() ) ) @@ -102,8 +102,8 @@ void SwEditShell::FillByEx(SwTextFormatColl* pColl, bool bReset) pColl->ResetAllFormatAttr(); } - SwPaM * pCrsr = GetCrsr(); - SwContentNode * pCnt = pCrsr->GetContentNode(); + SwPaM * pCursor = GetCursor(); + SwContentNode * pCnt = pCursor->GetContentNode(); const SfxItemSet* pSet = pCnt->GetpSwAttrSet(); if( pSet ) { diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index a4a67ccf7bf2..7bb4aa7acdfd 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -171,7 +171,7 @@ void SwEditShell::FieldToText( SwFieldType* pType ) StartAllAction(); StartUndo( UNDO_DELETE ); Push(); - SwPaM* pPaM = GetCrsr(); + SwPaM* pPaM = GetCursor(); // TODO: this is really hackish SwFieldHint aHint( pPaM ); SwIterator<SwClient,SwFieldType> aIter(*pType); @@ -197,7 +197,7 @@ void SwEditShell::Insert2(SwField& rField, const bool bForceExpandHints) ? SetAttrMode::FORCEHINTEXPAND : SetAttrMode::DEFAULT; - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) // for each PaM + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) // for each PaM { const bool bSuccess(GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, aField, nInsertFlags)); OSL_ENSURE( bSuccess, "Doc->Insert(Field) failed"); @@ -258,13 +258,13 @@ void SwEditShell::UpdateFields( SwField &rField ) if( RES_GETREFFLD == nFieldWhich ) pMsgHint = &aRefMkHt; - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); SwTextField *pTextField; SwFormatField *pFormatField; - if ( !pCrsr->IsMultiSelection() && !pCrsr->HasMark()) + if ( !pCursor->IsMultiSelection() && !pCursor->HasMark()) { - pTextField = GetTextFieldAtPos( pCrsr->Start(), true ); + pTextField = GetTextFieldAtPos( pCursor->Start(), true ); if (!pTextField) // #i30221# pTextField = lcl_FindInputField( GetDoc(), rField); @@ -282,7 +282,7 @@ void SwEditShell::UpdateFields( SwField &rField ) SwMsgPoolItem aFieldHint( RES_TXTATR_FIELD ); // Search-Hint SwMsgPoolItem aAnnotationFieldHint( RES_TXTATR_ANNOTATION ); SwMsgPoolItem aInputFieldHint( RES_TXTATR_INPUTFIELD ); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) // for each PaM + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) // for each PaM { if( rPaM.HasMark() && bOkay ) // ... with selection { diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index 81e9ba762ee3..d65fe3b3eb32 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -59,7 +59,7 @@ void SwEditShell::FillByEx(SwCharFormat* pCharFormat, bool bReset) pCharFormat->ResetAllFormatAttr(); } - SwPaM* pPam = GetCrsr(); + SwPaM* pPam = GetCursor(); const SwContentNode* pCNd = pPam->GetContentNode(); if( pCNd->IsTextNode() ) { diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx index 9017f73e0213..694e71506811 100644 --- a/sw/source/core/edit/edglbldc.cxx +++ b/sw/source/core/edit/edglbldc.cxx @@ -142,11 +142,11 @@ bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos, SET_CURR_SHELL( this ); StartAllAction(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr || IsTableMode() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor || IsTableMode() ) ClearMark(); - SwPosition& rPos = *pCrsr->GetPoint(); + SwPosition& rPos = *pCursor->GetPoint(); rPos.nNode = rInsPos.GetDocPos(); bool bEndUndo = false; @@ -160,7 +160,7 @@ bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos, pMyDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); --rPos.nNode; pMyDoc->getIDocumentContentOperations().AppendTextNode( rPos ); - pCrsr->SetMark(); + pCursor->SetMark(); } InsertSection( rNew ); @@ -183,11 +183,11 @@ bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos, SET_CURR_SHELL( this ); StartAllAction(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr || IsTableMode() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor || IsTableMode() ) ClearMark(); - SwPosition& rPos = *pCrsr->GetPoint(); + SwPosition& rPos = *pCursor->GetPoint(); rPos.nNode = rInsPos.GetDocPos(); bool bEndUndo = false; @@ -223,11 +223,11 @@ bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos ) SET_CURR_SHELL( this ); StartAllAction(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr || IsTableMode() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor || IsTableMode() ) ClearMark(); - SwPosition& rPos = *pCrsr->GetPoint(); + SwPosition& rPos = *pCursor->GetPoint(); rPos.nNode = rInsPos.GetDocPos() - 1; rPos.nContent.Assign( nullptr, 0 ); @@ -247,11 +247,11 @@ bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr , StartAllAction(); StartUndo( UNDO_START ); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr || IsTableMode() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor || IsTableMode() ) ClearMark(); - SwPosition& rPos = *pCrsr->GetPoint(); + SwPosition& rPos = *pCursor->GetPoint(); SwDoc* pMyDoc = GetDoc(); const SwGlblDocContent& rDelPos = *rArr[ nDelPos ]; @@ -271,13 +271,13 @@ bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr , case GLBLDOC_UNKNOWN: { rPos.nNode = nDelIdx; - pCrsr->SetMark(); + pCursor->SetMark(); if( ++nDelPos < rArr.size() ) rPos.nNode = rArr[ nDelPos ]->GetDocPos(); else rPos.nNode = pMyDoc->GetNodes().GetEndOfContent(); --rPos.nNode; - if( !pMyDoc->getIDocumentContentOperations().DelFullPara( *pCrsr ) ) + if( !pMyDoc->getIDocumentContentOperations().DelFullPara( *pCursor ) ) Delete(); } break; @@ -315,8 +315,8 @@ bool SwEditShell::MoveGlobalDocContent( const SwGlblDocContents& rArr , SET_CURR_SHELL( this ); StartAllAction(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr || IsTableMode() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor || IsTableMode() ) ClearMark(); SwDoc* pMyDoc = GetDoc(); @@ -345,23 +345,23 @@ bool SwEditShell::GotoGlobalDocContent( const SwGlblDocContent& rPos ) return false; SET_CURR_SHELL( this ); - SttCrsrMove(); + SttCursorMove(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr || IsTableMode() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor || IsTableMode() ) ClearMark(); - SwPosition& rCrsrPos = *pCrsr->GetPoint(); - rCrsrPos.nNode = rPos.GetDocPos(); + SwPosition& rCursorPos = *pCursor->GetPoint(); + rCursorPos.nNode = rPos.GetDocPos(); SwDoc* pMyDoc = GetDoc(); - SwContentNode * pCNd = rCrsrPos.nNode.GetNode().GetContentNode(); + SwContentNode * pCNd = rCursorPos.nNode.GetNode().GetContentNode(); if( !pCNd ) - pCNd = pMyDoc->GetNodes().GoNext( &rCrsrPos.nNode ); + pCNd = pMyDoc->GetNodes().GoNext( &rCursorPos.nNode ); - rCrsrPos.nContent.Assign( pCNd, 0 ); + rCursorPos.nContent.Assign( pCNd, 0 ); - EndCrsrMove(); + EndCursorMove(); return true; } diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index c5a2b4284903..1e3ccacc2bf9 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -39,7 +39,7 @@ void SwEditShell::InsertGlossary( SwTextBlocks& rGlossary, const OUString& rStr ) { StartAllAction(); - GetDoc()->InsertGlossary( rGlossary, rStr, *GetCrsr(), this ); + GetDoc()->InsertGlossary( rGlossary, rStr, *GetCursor(), this ); EndAllAction(); } @@ -96,7 +96,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, { KillPams(); - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); SwNodeIndex aStt( pMyDoc->GetNodes().GetEndOfExtras(), 1 ); SwContentNode* pContentNd = pMyDoc->GetNodes().GoNext( &aStt ); @@ -104,16 +104,16 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, if( !pNd ) pNd = pContentNd; - pCrsr->GetPoint()->nNode = *pNd; + pCursor->GetPoint()->nNode = *pNd; if( pNd == pContentNd ) - pCrsr->GetPoint()->nContent.Assign( pContentNd, 0 ); - pCrsr->SetMark(); + pCursor->GetPoint()->nContent.Assign( pContentNd, 0 ); + pCursor->SetMark(); // then until the end of the Node array - pCrsr->GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1; - pContentNd = pCrsr->GetContentNode(); + pCursor->GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1; + pContentNd = pCursor->GetContentNode(); if( pContentNd ) - pCrsr->GetPoint()->nContent.Assign( pContentNd, pContentNd->Len() ); + pCursor->GetPoint()->nContent.Assign( pContentNd, pContentNd->Len() ); OUString sBuf; if( GetSelectedText( sBuf, GETSELTXT_PARABRK_TO_ONLYCR ) && !sBuf.isEmpty() ) @@ -205,12 +205,12 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) } else { - bool bColSel = _GetCrsr()->IsColumnSelection(); + bool bColSel = _GetCursor()->IsColumnSelection(); if( bColSel && pInsDoc->IsClipBoard() ) pInsDoc->SetColumnSelection( true ); bool bSelectAll = StartsWithTable() && ExtendedSelectedAll(/*bFootnotes =*/ false); { - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( !rPaM.HasMark() ) { @@ -263,7 +263,7 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) */ bool SwEditShell::GetSelectedText( OUString &rBuf, int nHndlParaBrk ) { - GetCrsr(); // creates all cursors if needed + GetCursor(); // creates all cursors if needed if( IsSelOnePara() ) { rBuf = GetSelText(); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index ce7921cfc5ea..3336422bb73b 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -65,17 +65,17 @@ using namespace com::sun::star; -void SwEditShell::Insert( sal_Unicode c, bool bOnlyCurrCrsr ) +void SwEditShell::Insert( sal_Unicode c, bool bOnlyCurrCursor ) { StartAllAction(); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { const bool bSuccess = GetDoc()->getIDocumentContentOperations().InsertString(rPaM, OUString(c)); OSL_ENSURE( bSuccess, "Doc->Insert() failed." ); (void) bSuccess; SaveTableBoxContent( rPaM.GetPoint() ); - if( bOnlyCurrCrsr ) + if( bOnlyCurrCursor ) break; } @@ -92,40 +92,40 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) ? (SwInsertFlags::FORCEHINTEXPAND | SwInsertFlags::EMPTYEXPAND) : SwInsertFlags::EMPTYEXPAND; - for(SwPaM& rCurrentCrsr : getShellCrsr( true )->GetRingContainer()) + for(SwPaM& rCurrentCursor : getShellCursor( true )->GetRingContainer()) { //OPT: GetSystemCharSet const bool bSuccess = - GetDoc()->getIDocumentContentOperations().InsertString(rCurrentCrsr, rStr, nInsertFlags); + GetDoc()->getIDocumentContentOperations().InsertString(rCurrentCursor, rStr, nInsertFlags); OSL_ENSURE( bSuccess, "Doc->Insert() failed." ); if (bSuccess) { - GetDoc()->UpdateRsid( rCurrentCrsr, rStr.getLength() ); + GetDoc()->UpdateRsid( rCurrentCursor, rStr.getLength() ); // Set paragraph rsid if beginning of paragraph SwTextNode *const pTextNode = - rCurrentCrsr.GetPoint()->nNode.GetNode().GetTextNode(); + rCurrentCursor.GetPoint()->nNode.GetNode().GetTextNode(); if( pTextNode && pTextNode->Len() == 1) GetDoc()->UpdateParRsid( pTextNode ); } - SaveTableBoxContent( rCurrentCrsr.GetPoint() ); + SaveTableBoxContent( rCurrentCursor.GetPoint() ); } } // calculate cursor bidi level - SwCursor* pTmpCrsr = _GetCrsr(); - const bool bDoNotSetBidiLevel = ! pTmpCrsr || - ( dynamic_cast<SwUnoCrsr*>(pTmpCrsr) != nullptr ); + SwCursor* pTmpCursor = _GetCursor(); + const bool bDoNotSetBidiLevel = ! pTmpCursor || + ( dynamic_cast<SwUnoCursor*>(pTmpCursor) != nullptr ); if ( ! bDoNotSetBidiLevel ) { - SwNode& rNode = pTmpCrsr->GetPoint()->nNode.GetNode(); + SwNode& rNode = pTmpCursor->GetPoint()->nNode.GetNode(); if ( rNode.IsTextNode() ) { - SwIndex& rIdx = pTmpCrsr->GetPoint()->nContent; + SwIndex& rIdx = pTmpCursor->GetPoint()->nContent; sal_Int32 nPrevPos = rIdx.GetIndex(); if ( nPrevPos ) --nPrevPos; @@ -137,12 +137,12 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) { // seems to be an empty paragraph. Point aPt; - SwContentFrm* pFrm = - static_cast<SwTextNode&>(rNode).getLayoutFrm( GetLayout(), &aPt, pTmpCrsr->GetPoint(), + SwContentFrame* pFrame = + static_cast<SwTextNode&>(rNode).getLayoutFrame( GetLayout(), &aPt, pTmpCursor->GetPoint(), false ); SwScriptInfo aScriptInfo; - aScriptInfo.InitScriptInfo( static_cast<SwTextNode&>(rNode), pFrm->IsRightToLeft() ); + aScriptInfo.InitScriptInfo( static_cast<SwTextNode&>(rNode), pFrame->IsRightToLeft() ); nLevel = aScriptInfo.DirType( nPrevPos ); } else @@ -152,7 +152,7 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) nLevel = pSI->DirType( nPrevPos ); } - pTmpCrsr->SetCrsrBidiLevel( nLevel ); + pTmpCursor->SetCursorBidiLevel( nLevel ); } } @@ -164,7 +164,7 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) void SwEditShell::Overwrite(const OUString &rStr) { StartAllAction(); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( !GetDoc()->getIDocumentContentOperations().Overwrite(rPaM, rStr ) ) { @@ -180,7 +180,7 @@ long SwEditShell::SplitNode( bool bAutoFormat, bool bCheckTableStart ) StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, nullptr); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { // Here, a table cell becomes a normal text cell. GetDoc()->ClearBoxNumAttrs( rPaM.GetPoint()->nNode ); @@ -204,7 +204,7 @@ bool SwEditShell::AppendTextNode() StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, nullptr); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { GetDoc()->ClearBoxNumAttrs( rPaM.GetPoint()->nNode ); bRet = GetDoc()->getIDocumentContentOperations().AppendTextNode( *rPaM.GetPoint()) || bRet; @@ -222,15 +222,15 @@ bool SwEditShell::AppendTextNode() SwGrfNode * SwEditShell::_GetGrfNode() const { SwGrfNode *pGrfNode = nullptr; - SwPaM* pCrsr = GetCrsr(); - if( !pCrsr->HasMark() || - pCrsr->GetPoint()->nNode == pCrsr->GetMark()->nNode ) - pGrfNode = pCrsr->GetPoint()->nNode.GetNode().GetGrfNode(); + SwPaM* pCursor = GetCursor(); + if( !pCursor->HasMark() || + pCursor->GetPoint()->nNode == pCursor->GetMark()->nNode ) + pGrfNode = pCursor->GetPoint()->nNode.GetNode().GetGrfNode(); return pGrfNode; } -// returns a Graphic pointer if CurCrsr->GetPoint() points to a SwGrfNode and +// returns a Graphic pointer if CurrentCursor->GetPoint() points to a SwGrfNode and // GetMark is not set or points to the same Graphic const Graphic* SwEditShell::GetGraphic( bool bWait ) const { @@ -265,15 +265,15 @@ sal_uInt16 SwEditShell::GetGraphicType() const return static_cast<sal_uInt16>(pGrfNode ? pGrfNode->GetGrfObj().GetType() : GRAPHIC_NONE); } -// returns the size of a graphic in <rSz> if CurCrsr->GetPoint() points to a SwGrfNode and +// returns the size of a graphic in <rSz> if CurrentCursor->GetPoint() points to a SwGrfNode and // GetMark is not set or points to the same graphic bool SwEditShell::GetGrfSize(Size& rSz) const { SwNoTextNode* pNoTextNd; - SwPaM* pCurrentCrsr = GetCrsr(); - if( ( !pCurrentCrsr->HasMark() - || pCurrentCrsr->GetPoint()->nNode == pCurrentCrsr->GetMark()->nNode ) - && nullptr != ( pNoTextNd = pCurrentCrsr->GetNode().GetNoTextNode() ) ) + SwPaM* pCurrentCursor = GetCursor(); + if( ( !pCurrentCursor->HasMark() + || pCurrentCursor->GetPoint()->nNode == pCurrentCursor->GetMark()->nNode ) + && nullptr != ( pNoTextNd = pCurrentCursor->GetNode().GetNoTextNode() ) ) { rSz = pNoTextNd->GetTwipSize(); return true; @@ -287,7 +287,7 @@ void SwEditShell::ReRead( const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj ) { StartAllAction(); - mpDoc->getIDocumentContentOperations().ReRead( *GetCrsr(), rGrfName, rFltName, pGraphic, pGrfObj ); + mpDoc->getIDocumentContentOperations().ReRead( *GetCursor(), rGrfName, rFltName, pGraphic, pGrfObj ); EndAllAction(); } @@ -309,16 +309,16 @@ void SwEditShell::GetGrfNms( OUString* pGrfName, OUString* pFltName, const tools::PolyPolygon *SwEditShell::GetGraphicPolygon() const { - SwNoTextNode *pNd = GetCrsr()->GetNode().GetNoTextNode(); + SwNoTextNode *pNd = GetCursor()->GetNode().GetNoTextNode(); return pNd->HasContour(); } void SwEditShell::SetGraphicPolygon( const tools::PolyPolygon *pPoly ) { - SwNoTextNode *pNd = GetCrsr()->GetNode().GetNoTextNode(); + SwNoTextNode *pNd = GetCursor()->GetNode().GetNoTextNode(); StartAllAction(); pNd->SetContour( pPoly ); - SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper()); + SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pNd->getLayoutFrame(GetLayout())->GetUpper()); const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround(); pFly->GetFormat()->NotifyClients( &rSur, &rSur ); GetDoc()->getIDocumentState().SetModified(); @@ -327,13 +327,13 @@ void SwEditShell::SetGraphicPolygon( const tools::PolyPolygon *pPoly ) void SwEditShell::ClearAutomaticContour() { - SwNoTextNode *pNd = GetCrsr()->GetNode().GetNoTextNode(); + SwNoTextNode *pNd = GetCursor()->GetNode().GetNoTextNode(); OSL_ENSURE( pNd, "is no NoTextNode!" ); if( pNd->HasAutomaticContour() ) { StartAllAction(); pNd->SetContour( nullptr ); - SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper()); + SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pNd->getLayoutFrame(GetLayout())->GetUpper()); const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround(); pFly->GetFormat()->NotifyClients( &rSur, &rSur ); GetDoc()->getIDocumentState().SetModified(); @@ -343,19 +343,19 @@ void SwEditShell::ClearAutomaticContour() /** Get OLE object at pointer. * - * Returns a pointer to a SvInPlaceObjectRef if CurCrsr->GetPoint() points to a SwOLENode and + * Returns a pointer to a SvInPlaceObjectRef if CurrentCursor->GetPoint() points to a SwOLENode and * GetMark is not set or points to the same object reference. Gets this pointer from the Doc * if the object should be searched by name. */ svt::EmbeddedObjectRef& SwEditShell::GetOLEObject() const { OSL_ENSURE( CNT_OLE == GetCntType(), "GetOLEObj: no OLENode." ); - OSL_ENSURE( !GetCrsr()->HasMark() || - (GetCrsr()->HasMark() && - GetCrsr()->GetPoint()->nNode == GetCrsr()->GetMark()->nNode), + OSL_ENSURE( !GetCursor()->HasMark() || + (GetCursor()->HasMark() && + GetCursor()->GetPoint()->nNode == GetCursor()->GetMark()->nNode), "GetOLEObj: no OLENode." ); - SwOLENode *pOLENode = GetCrsr()->GetNode().GetOLENode(); + SwOLENode *pOLENode = GetCursor()->GetNode().GetOLENode(); OSL_ENSURE( pOLENode, "GetOLEObj: no OLENode." ); SwOLEObj& rOObj = pOLENode->GetOLEObj(); return rOObj.GetObject(); @@ -371,7 +371,7 @@ bool SwEditShell::HasOLEObj( const OUString &rName ) const SwNode& rNd = aIdx.GetNode(); if( rNd.IsOLENode() && rName == static_cast<SwOLENode&>(rNd).GetChartTableName() && - static_cast<SwOLENode&>(rNd).getLayoutFrm( GetLayout() ) ) + static_cast<SwOLENode&>(rNd).getLayoutFrame( GetLayout() ) ) return true; aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); @@ -381,7 +381,7 @@ bool SwEditShell::HasOLEObj( const OUString &rName ) const void SwEditShell::SetChartName( const OUString &rName ) { - SwOLENode *pONd = GetCrsr()->GetNode().GetOLENode(); + SwOLENode *pONd = GetCursor()->GetNode().GetOLENode(); OSL_ENSURE( pONd, "ChartNode not found" ); pONd->SetChartTableName( rName ); } @@ -400,7 +400,7 @@ void SwEditShell::SetTableName( SwFrameFormat& rTableFormat, const OUString &rNe /// request current word OUString SwEditShell::GetCurWord() { - const SwPaM& rPaM = *GetCrsr(); + const SwPaM& rPaM = *GetCursor(); const SwTextNode* pNd = rPaM.GetNode().GetTextNode(); OUString aString = pNd ? pNd->GetCurWord(rPaM.GetPoint()->nContent.GetIndex()) : @@ -444,15 +444,15 @@ OUString SwEditShell::GetDropText( const sal_Int32 nChars ) const */ OUString aText; - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); if ( IsMultiSelection() ) { // if a multi selection exists, search for the first line // -> it is the cursor with the lowest index - sal_uLong nIndex = pCrsr->GetMark()->nNode.GetIndex(); + sal_uLong nIndex = pCursor->GetMark()->nNode.GetIndex(); bool bPrev = true; - SwPaM* pLast = pCrsr; - SwPaM* pTemp = pCrsr; + SwPaM* pLast = pCursor; + SwPaM* pTemp = pCursor; while ( bPrev ) { SwPaM* pPrev2 = dynamic_cast< SwPaM* >( pTemp->GetPrev() ); @@ -464,13 +464,13 @@ OUString SwEditShell::GetDropText( const sal_Int32 nChars ) const if ( nTemp < nIndex ) { nIndex = nTemp; - pCrsr = pPrev2; + pCursor = pPrev2; } } } } - SwTextNode* pTextNd = pCrsr->GetNode( !pCrsr->HasMark() ).GetTextNode(); + SwTextNode* pTextNd = pCursor->GetNode( !pCursor->HasMark() ).GetTextNode(); if( pTextNd ) { sal_Int32 nDropLen = pTextNd->GetDropLen( nChars ); @@ -483,13 +483,13 @@ OUString SwEditShell::GetDropText( const sal_Int32 nChars ) const void SwEditShell::ReplaceDropText( const OUString &rStr, SwPaM* pPaM ) { - SwPaM* pCrsr = pPaM ? pPaM : GetCrsr(); - if( pCrsr->GetPoint()->nNode == pCrsr->GetMark()->nNode && - pCrsr->GetNode().GetTextNode()->IsTextNode() ) + SwPaM* pCursor = pPaM ? pPaM : GetCursor(); + if( pCursor->GetPoint()->nNode == pCursor->GetMark()->nNode && + pCursor->GetNode().GetTextNode()->IsTextNode() ) { StartAllAction(); - const SwNodeIndex& rNd = pCrsr->GetPoint()->nNode; + const SwNodeIndex& rNd = pCursor->GetPoint()->nNode; SwPaM aPam( rNd, rStr.getLength(), rNd, 0 ); if( !GetDoc()->getIDocumentContentOperations().Overwrite( aPam, rStr ) ) { @@ -506,7 +506,7 @@ OUString SwEditShell::Calculate() SwCalc aCalc( *GetDoc() ); const CharClass& rCC = GetAppCharClass(); - for(SwPaM& rCurrentPaM : GetCrsr()->GetNext()->GetRingContainer()) + for(SwPaM& rCurrentPaM : GetCursor()->GetNext()->GetRingContainer()) { SwTextNode* pTextNd = rCurrentPaM.GetNode().GetTextNode(); if(pTextNd) @@ -571,7 +571,7 @@ sfx2::LinkManager& SwEditShell::GetLinkManager() void *SwEditShell::GetIMapInventor() const { // The node on which the cursor points should be sufficient as a unique identifier - return static_cast<void*>(&(GetCrsr()->GetNode())); + return static_cast<void*>(&(GetCursor()->GetNode())); } // #i73788# @@ -580,10 +580,10 @@ Graphic SwEditShell::GetIMapGraphic() const // returns always a graphic if the cursor is in a Fly SET_CURR_SHELL( const_cast<SwViewShell*>(static_cast<SwViewShell const *>(this)) ); Graphic aRet; - SwPaM* pCrsr = GetCrsr(); - if ( !pCrsr->HasMark() ) + SwPaM* pCursor = GetCursor(); + if ( !pCursor->HasMark() ) { - SwNode& rNd =pCrsr->GetNode(); + SwNode& rNd =pCursor->GetNode(); if( rNd.IsGrfNode() ) { SwGrfNode & rGrfNode(static_cast<SwGrfNode&>(rNd)); @@ -595,9 +595,9 @@ Graphic SwEditShell::GetIMapGraphic() const } else { - SwFlyFrm* pFlyFrm = rNd.GetContentNode()->getLayoutFrm( GetLayout() )->FindFlyFrm(); - if(pFlyFrm) - aRet = pFlyFrm->GetFormat()->MakeGraphic(); + SwFlyFrame* pFlyFrame = rNd.GetContentNode()->getLayoutFrame( GetLayout() )->FindFlyFrame(); + if(pFlyFrame) + aRet = pFlyFrame->GetFormat()->MakeGraphic(); } } return aRet; @@ -614,12 +614,12 @@ bool SwEditShell::InsertURL( const SwFormatINetFormat& rFormat, const OUString& if( !rStr.isEmpty() ) { - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->HasMark() && *pCrsr->GetPoint() != *pCrsr->GetMark() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->HasMark() && *pCursor->GetPoint() != *pCursor->GetMark() ) { // Selection existent, multi selection? bool bDelText = true; - if( !pCrsr->IsMultiSelection() ) + if( !pCursor->IsMultiSelection() ) { // einfach Selection -> Text ueberpruefen const OUString sText(comphelper::string::stripEnd(GetSelText(), ' ')); @@ -632,7 +632,7 @@ bool SwEditShell::InsertURL( const SwFormatINetFormat& rFormat, const OUString& if( bDelText ) Delete(); } - else if( pCrsr->IsMultiSelection() && rFormat.GetValue() == rStr ) + else if( pCursor->IsMultiSelection() && rFormat.GetValue() == rStr ) bInsText = false; if( bInsText ) @@ -646,7 +646,7 @@ bool SwEditShell::InsertURL( const SwFormatINetFormat& rFormat, const OUString& bInsText = false; SetAttrItem( rFormat ); - if (bInsText && !IsCrsrPtAtEnd()) + if (bInsText && !IsCursorPtAtEnd()) SwapPam(); if(!bKeepSelection) ClearMark(); @@ -693,7 +693,7 @@ bool SwEditShell::DelINetAttrWithText() { bool bRet = SelectTextAttr( RES_TXTATR_INETFMT, false ); if( bRet ) - DeleteSel( *GetCrsr() ); + DeleteSel( *GetCursor() ); return bRet; } @@ -701,7 +701,7 @@ bool SwEditShell::DelINetAttrWithText() bool SwEditShell::DontExpandFormat() { bool bRet = false; - if( !IsTableMode() && GetDoc()->DontExpandFormat( *GetCrsr()->GetPoint() )) + if( !IsTableMode() && GetDoc()->DontExpandFormat( *GetCursor()->GetPoint() )) { bRet = true; CallChgLnk(); @@ -727,19 +727,19 @@ void SwEditShell::SetNumberingRestart() StartAllAction(); Push(); // iterate over all text contents - body, frames, header, footer, footnote text - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); for(int i = 0; i < 2; i++) { if(!i) - MakeFindRange(DOCPOS_START, DOCPOS_END, pCrsr); // body content + MakeFindRange(DOCPOS_START, DOCPOS_END, pCursor); // body content else - MakeFindRange(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, pCrsr); // extra content - SwPosition* pSttPos = pCrsr->Start(), *pEndPos = pCrsr->End(); + MakeFindRange(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, pCursor); // extra content + SwPosition* pSttPos = pCursor->Start(), *pEndPos = pCursor->End(); sal_uLong nCurrNd = pSttPos->nNode.GetIndex(); sal_uLong nEndNd = pEndPos->nNode.GetIndex(); if( nCurrNd <= nEndNd ) { - SwContentFrm* pCntFrm; + SwContentFrame* pContentFrame; bool bGoOn = true; // iterate over all paragraphs while( bGoOn ) @@ -748,10 +748,10 @@ void SwEditShell::SetNumberingRestart() switch( pNd->GetNodeType() ) { case ND_TEXTNODE: - if( nullptr != ( pCntFrm = static_cast<SwTextNode*>(pNd)->getLayoutFrm( GetLayout() )) ) + if( nullptr != ( pContentFrame = static_cast<SwTextNode*>(pNd)->getLayoutFrame( GetLayout() )) ) { // skip hidden frames - ignore protection! - if( !static_cast<SwTextFrm*>(pCntFrm)->IsHiddenNow() ) + if( !static_cast<SwTextFrame*>(pContentFrame)->IsHiddenNow() ) { // if the node is numbered and the starting value of the numbering equals the // start value of the numbering rule then set this value as hard starting value @@ -813,11 +813,11 @@ sal_uInt16 SwEditShell::GetLineCount( bool bActPos ) { sal_uInt16 nRet = 0; CalcLayout(); - SwPaM* pPam = GetCrsr(); + SwPaM* pPam = GetCursor(); SwNodeIndex& rPtIdx = pPam->GetPoint()->nNode; SwNodeIndex aStart( rPtIdx ); SwContentNode* pCNd; - SwContentFrm *pCntFrm = nullptr; + SwContentFrame *pContentFrame = nullptr; sal_uLong nTmpPos; if( !bActPos ) @@ -828,21 +828,21 @@ sal_uInt16 SwEditShell::GetLineCount( bool bActPos ) else { if( nullptr != ( pCNd = pPam->GetContentNode() ) && - nullptr != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) ) + nullptr != ( pContentFrame = pCNd->getLayoutFrame( GetLayout() ) ) ) { const SwStartNode *pTmp; - if( pCntFrm->IsInFly() ) // Fly + if( pContentFrame->IsInFly() ) // Fly pTmp = pCNd->FindFlyStartNode(); - else if( pCntFrm->IsInFootnote() ) // Footnote + else if( pContentFrame->IsInFootnote() ) // Footnote pTmp = pCNd->FindFootnoteStartNode(); else { // Footer/Header const sal_uInt16 nTyp = FRM_HEADER | FRM_FOOTER; - SwFrm* pFrm = pCntFrm; - while( pFrm && !(pFrm->GetType() & nTyp) ) - pFrm = pFrm->GetUpper(); - OSL_ENSURE( pFrm, "Wo bin ich?" ); - if( pFrm && ( pFrm->GetType() & FRM_FOOTER ) ) + SwFrame* pFrame = pContentFrame; + while( pFrame && !(pFrame->GetType() & nTyp) ) + pFrame = pFrame->GetUpper(); + OSL_ENSURE( pFrame, "Wo bin ich?" ); + if( pFrame && ( pFrame->GetType() & FRM_FOOTER ) ) pTmp = pCNd->FindFooterStartNode(); else pTmp = pCNd->FindHeaderStartNode(); @@ -850,17 +850,17 @@ sal_uInt16 SwEditShell::GetLineCount( bool bActPos ) OSL_ENSURE( pTmp, "Missing StartNode" ); aStart = *pTmp; } - OSL_ENSURE( pCNd && pCntFrm, "Missing Layout-Information" ); + OSL_ENSURE( pCNd && pContentFrame, "Missing Layout-Information" ); } while( nullptr != ( pCNd = GetDoc()->GetNodes().GoNextSection( &aStart, true, false )) && ( !bActPos || aStart <= rPtIdx ) ) { - if( nullptr != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTextFrm() ) + if( nullptr != ( pContentFrame = pCNd->getLayoutFrame( GetLayout() ) ) && pContentFrame->IsTextFrame() ) { const sal_Int32 nActPos = bActPos && aStart == rPtIdx ? pPam->GetPoint()->nContent.GetIndex() : COMPLETE_STRING; - nRet = nRet + static_cast<SwTextFrm*>(pCntFrm)->GetLineCount( nActPos ); + nRet = nRet + static_cast<SwTextFrame*>(pContentFrame)->GetLineCount( nActPos ); } } return nRet; @@ -919,7 +919,7 @@ void SwEditShell::SetLineNumberInfo(const SwLineNumberInfo& rInfo) StartAllAction(); SET_CURR_SHELL( this ); GetDoc()->SetLineNumberInfo(rInfo); - AddPaintRect( GetLayout()->Frm() ); + AddPaintRect( GetLayout()->Frame() ); EndAllAction(); } @@ -936,9 +936,9 @@ void SwEditShell::SetLinkUpdMode( sal_uInt16 nMode ) // Interface for TextInputData - (for text input of japanese/chinese characters) SwExtTextInput* SwEditShell::CreateExtTextInput(LanguageType eInputLanguage) { - SwExtTextInput* pRet = GetDoc()->CreateExtTextInput( *GetCrsr() ); + SwExtTextInput* pRet = GetDoc()->CreateExtTextInput( *GetCursor() ); pRet->SetLanguage(eInputLanguage); - pRet->SetOverwriteCursor( SwCrsrShell::IsOverwriteCrsr() ); + pRet->SetOverwriteCursor( SwCursorShell::IsOverwriteCursor() ); return pRet; } @@ -946,7 +946,7 @@ OUString SwEditShell::DeleteExtTextInput( SwExtTextInput* pDel, bool bInsText ) { if( !pDel ) { - const SwPosition& rPos = *GetCrsr()->GetPoint(); + const SwPosition& rPos = *GetCursor()->GetPoint(); pDel = GetDoc()->GetExtTextInput( rPos.nNode.GetNode(), rPos.nContent.GetIndex() ); if( !pDel ) @@ -966,14 +966,14 @@ OUString SwEditShell::DeleteExtTextInput( SwExtTextInput* pDel, bool bInsText ) SET_CURR_SHELL( this ); StartAllAction(); pDel->SetInsText( bInsText ); - SetOverwriteCrsr( pDel->IsOverwriteCursor() ); + SetOverwriteCursor( pDel->IsOverwriteCursor() ); const SwPosition aPos( *pDel->GetPoint() ); GetDoc()->DeleteExtTextInput( pDel ); // In this case, the "replace" function did not set the cursor // to the original position. Therefore we have to do this manually. - if ( ! bInsText && IsOverwriteCrsr() ) - *GetCrsr()->GetPoint() = aPos; + if ( ! bInsText && IsOverwriteCursor() ) + *GetCursor()->GetPoint() = aPos; EndAllAction(); } @@ -982,7 +982,7 @@ OUString SwEditShell::DeleteExtTextInput( SwExtTextInput* pDel, bool bInsText ) void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) { - const SwPosition& rPos = *GetCrsr()->GetPoint(); + const SwPosition& rPos = *GetCursor()->GetPoint(); SwExtTextInput* pInput = GetDoc()->GetExtTextInput( rPos.nNode.GetNode() ); if( pInput ) { @@ -993,22 +993,22 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) pInput->SetInputData( rData ); // position cursor const SwPosition& rStt = *pInput->Start(); - const sal_Int32 nNewCrsrPos = rStt.nContent.GetIndex() + rData.GetCursorPos(); + const sal_Int32 nNewCursorPos = rStt.nContent.GetIndex() + rData.GetCursorPos(); // ugly but works - ShowCrsr(); - const sal_Int32 nDiff = nNewCrsrPos - rPos.nContent.GetIndex(); + ShowCursor(); + const sal_Int32 nDiff = nNewCursorPos - rPos.nContent.GetIndex(); if( 0 > nDiff ) Left( (sal_Int32)-nDiff, CRSR_SKIP_CHARS ); else if( 0 < nDiff ) Right( (sal_Int32)nDiff, CRSR_SKIP_CHARS ); - SetOverwriteCrsr( rData.IsCursorOverwrite() ); + SetOverwriteCursor( rData.IsCursorOverwrite() ); EndAllAction(); if( !rData.IsCursorVisible() ) // must be called after the EndAction - HideCrsr(); + HideCursor(); } } @@ -1018,11 +1018,11 @@ void SwEditShell::TransliterateText( sal_uInt32 nType ) StartAllAction(); SET_CURR_SHELL( this ); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor ) { GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, nullptr); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( rPaM.HasMark() ) GetDoc()->getIDocumentContentOperations().TransliterateText( rPaM, aTrans ); @@ -1030,14 +1030,14 @@ void SwEditShell::TransliterateText( sal_uInt32 nType ) GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, nullptr); } else - GetDoc()->getIDocumentContentOperations().TransliterateText( *pCrsr, aTrans ); + GetDoc()->getIDocumentContentOperations().TransliterateText( *pCursor, aTrans ); EndAllAction(); } void SwEditShell::CountWords( SwDocStat& rStat ) const { - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( rPaM.HasMark() ) SwDoc::CountWords( rPaM, rStat ); @@ -1047,7 +1047,7 @@ void SwEditShell::CountWords( SwDocStat& rStat ) const void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt ) { - SwCrsrShell::StartAction(); + SwCursorShell::StartAction(); SwViewShell::ApplyViewOptions( rOpt ); SwEditShell::EndAction(); } 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; diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 2e862cd530fe..7a585db7bd58 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -130,18 +130,18 @@ bool SwEditShell::NoNum() bool bRet = true; StartAllAction(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr ) // Multiple selection? + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor ) // Multiple selection? { GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->NoNum( aRangeArr.SetPam( n, aPam )); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); } else - bRet = GetDoc()->NoNum( *pCrsr ); + bRet = GetDoc()->NoNum( *pCursor ); EndAllAction(); return bRet; @@ -151,10 +151,10 @@ bool SwEditShell::SelectionHasNumber() const { bool bResult = HasNumber(); const SwTextNode * pTextNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); + GetCursor()->GetPoint()->nNode.GetNode().GetTextNode(); if (!bResult && pTextNd && pTextNd->Len()==0 && !pTextNd->GetNumRule()) { - SwPamRanges aRangeArr( *GetCrsr() ); - SwPaM aPam( *GetCrsr()->GetPoint() ); + SwPamRanges aRangeArr( *GetCursor() ); + SwPaM aPam( *GetCursor()->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) { aRangeArr.SetPam( n, aPam ); @@ -197,10 +197,10 @@ bool SwEditShell::SelectionHasBullet() const { bool bResult = HasBullet(); const SwTextNode * pTextNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); + GetCursor()->GetPoint()->nNode.GetNode().GetTextNode(); if (!bResult && pTextNd && pTextNd->Len()==0 && !pTextNd->GetNumRule()) { - SwPamRanges aRangeArr( *GetCrsr() ); - SwPaM aPam( *GetCrsr()->GetPoint() ); + SwPamRanges aRangeArr( *GetCursor() ); + SwPaM aPam( *GetCursor()->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) { aRangeArr.SetPam( n, aPam ); @@ -236,7 +236,7 @@ bool SwEditShell::HasNumber() const bool bResult = false; const SwTextNode * pTextNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); + GetCursor()->GetPoint()->nNode.GetNode().GetTextNode(); if (pTextNd) { @@ -259,7 +259,7 @@ bool SwEditShell::HasBullet() const bool bResult = false; const SwTextNode * pTextNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); + GetCursor()->GetPoint()->nNode.GetNode().GetTextNode(); if (pTextNd) { @@ -275,12 +275,12 @@ void SwEditShell::DelNumRules() { StartAllAction(); - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->IsMultiSelection() ) + SwPaM* pCursor = GetCursor(); + if( pCursor->IsMultiSelection() ) { GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) { GetDoc()->DelNumRules( aRangeArr.SetPam( n, aPam ) ); @@ -288,7 +288,7 @@ void SwEditShell::DelNumRules() GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); } else - GetDoc()->DelNumRules( *pCrsr ); + GetDoc()->DelNumRules( *pCursor ); // Call AttrChangeNotify on the UI-side. Should actually be redundant but there was a bug once. CallChgLnk(); @@ -306,14 +306,14 @@ bool SwEditShell::NumUpDown( bool bDown ) StartAllAction(); bool bRet = true; - SwPaM* pCrsr = GetCrsr(); - if( !pCrsr->IsMultiSelection() ) - bRet = GetDoc()->NumUpDown( *pCrsr, bDown ); + SwPaM* pCursor = GetCursor(); + if( !pCursor->IsMultiSelection() ) + bRet = GetDoc()->NumUpDown( *pCursor, bDown ); else { GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->NumUpDown( aRangeArr.SetPam( n, aPam ), bDown ); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); @@ -330,9 +330,9 @@ bool SwEditShell::NumUpDown( bool bDown ) return bRet; } -bool SwEditShell::IsFirstOfNumRuleAtCrsrPos() const +bool SwEditShell::IsFirstOfNumRuleAtCursorPos() const { - return SwDoc::IsFirstOfNumRuleAtPos( *GetCrsr()->GetPoint() ); + return SwDoc::IsFirstOfNumRuleAtPos( *GetCursor()->GetPoint() ); } // -> #i23725#, #i90078# @@ -340,7 +340,7 @@ void SwEditShell::ChangeIndentOfAllListLevels( const short nDiff ) { StartAllAction(); - const SwNumRule *pCurNumRule = GetNumRuleAtCurrCrsrPos(); + const SwNumRule *pCurNumRule = GetNumRuleAtCurrCursorPos(); if ( pCurNumRule != nullptr ) { SwNumRule aRule(*pCurNumRule); @@ -367,7 +367,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos) if (pCurNumRule) { SwNumRule aRule(*pCurNumRule); - if ( !IsMultiSelection() && IsFirstOfNumRuleAtCrsrPos() ) + if ( !IsMultiSelection() && IsFirstOfNumRuleAtCursorPos() ) { aRule.SetIndentOfFirstListLevelAndChangeOthers( nIndent ); } @@ -393,15 +393,15 @@ bool SwEditShell::MoveParagraph( long nOffset ) { StartAllAction(); - SwPaM *pCrsr = GetCrsr(); - if( !pCrsr->HasMark() ) + SwPaM *pCursor = GetCursor(); + if( !pCursor->HasMark() ) { // Ensures that Bound1 and Bound2 are in the same Node - pCrsr->SetMark(); - pCrsr->DeleteMark(); + pCursor->SetMark(); + pCursor->DeleteMark(); } - bool bRet = GetDoc()->MoveParagraph( *pCrsr, nOffset ); + bool bRet = GetDoc()->MoveParagraph( *pCursor, nOffset ); GetDoc()->getIDocumentState().SetModified(); EndAllAction(); @@ -412,8 +412,8 @@ int SwEditShell::GetCurrentParaOutlineLevel( ) const { int nLevel = 0; - SwPaM* pCrsr = GetCrsr(); - const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + SwPaM* pCursor = GetCursor(); + const SwTextNode* pTextNd = pCursor->GetNode().GetTextNode(); if( pTextNd ) nLevel = pTextNd->GetAttrOutlineLevel(); return nLevel; @@ -421,12 +421,12 @@ int SwEditShell::GetCurrentParaOutlineLevel( ) const void SwEditShell::GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower ) { - SwPaM* pCrsr = GetCrsr(); - SwPaM aCrsr( *pCrsr->Start() ); - aCrsr.SetMark(); - if( pCrsr->HasMark() ) - *aCrsr.GetPoint() = *pCrsr->End(); - SwDoc::GotoNextNum( *aCrsr.GetPoint(), false, &rUpper, &rLower ); + SwPaM* pCursor = GetCursor(); + SwPaM aCursor( *pCursor->Start() ); + aCursor.SetMark(); + if( pCursor->HasMark() ) + *aCursor.GetPoint() = *pCursor->End(); + SwDoc::GotoNextNum( *aCursor.GetPoint(), false, &rUpper, &rLower ); } bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) @@ -434,16 +434,16 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) StartAllAction(); // On all selections? - SwPaM* pCrsr = GetCrsr(); - SwPaM aCrsr( *pCrsr->Start() ); - aCrsr.SetMark(); + SwPaM* pCursor = GetCursor(); + SwPaM aCursor( *pCursor->Start() ); + aCursor.SetMark(); - if( pCrsr->HasMark() ) - *aCrsr.GetPoint() = *pCrsr->End(); + if( pCursor->HasMark() ) + *aCursor.GetPoint() = *pCursor->End(); bool bRet = false; sal_uInt8 nUpperLevel, nLowerLevel; - if( SwDoc::GotoNextNum( *aCrsr.GetPoint(), false, + if( SwDoc::GotoNextNum( *aCursor.GetPoint(), false, &nUpperLevel, &nLowerLevel )) { if( bUpperLower ) @@ -454,10 +454,10 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) if( bUpperLeft ) // move up { - SwPosition aPos( *aCrsr.GetMark() ); + SwPosition aPos( *aCursor.GetMark() ); if( SwDoc::GotoPrevNum( aPos, false ) ) nOffset = aPos.nNode.GetIndex() - - aCrsr.GetMark()->nNode.GetIndex(); + aCursor.GetMark()->nNode.GetIndex(); else { sal_uLong nStt = aPos.nNode.GetIndex(), nIdx = nStt - 1; @@ -471,11 +471,11 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) } else // move down { - const SwNumRule* pOrig = aCrsr.GetNode(false).GetTextNode()->GetNumRule(); - if( aCrsr.GetNode().IsTextNode() && - pOrig == aCrsr.GetNode().GetTextNode()->GetNumRule() ) + const SwNumRule* pOrig = aCursor.GetNode(false).GetTextNode()->GetNumRule(); + if( aCursor.GetNode().IsTextNode() && + pOrig == aCursor.GetNode().GetTextNode()->GetNumRule() ) { - sal_uLong nStt = aCrsr.GetPoint()->nNode.GetIndex(), nIdx = nStt+1; + sal_uLong nStt = aCursor.GetPoint()->nNode.GetIndex(), nIdx = nStt+1; while (nIdx < GetDoc()->GetNodes().Count()-1) { @@ -506,14 +506,14 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) if( nOffset ) { - aCrsr.Move( fnMoveBackward, fnGoNode ); - bRet = GetDoc()->MoveParagraph( aCrsr, nOffset ); + aCursor.Move( fnMoveBackward, fnGoNode ); + bRet = GetDoc()->MoveParagraph( aCursor, nOffset ); } } else if( (bUpperLeft ? nUpperLevel : nLowerLevel+1) < MAXLEVEL ) { - aCrsr.Move( fnMoveBackward, fnGoNode ); - bRet = GetDoc()->NumUpDown( aCrsr, !bUpperLeft ); + aCursor.Move( fnMoveBackward, fnGoNode ); + bRet = GetDoc()->NumUpDown( aCursor, !bUpperLeft ); } } @@ -527,14 +527,14 @@ bool SwEditShell::OutlineUpDown( short nOffset ) StartAllAction(); bool bRet = true; - SwPaM* pCrsr = GetCrsr(); - if( !pCrsr->IsMultiSelection() ) - bRet = GetDoc()->OutlineUpDown( *pCrsr, nOffset ); + SwPaM* pCursor = GetCursor(); + if( !pCursor->IsMultiSelection() ) + bRet = GetDoc()->OutlineUpDown( *pCursor, nOffset ); else { GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) bRet = bRet && GetDoc()->OutlineUpDown( aRangeArr.SetPam( n, aPam ), nOffset ); @@ -548,7 +548,7 @@ bool SwEditShell::OutlineUpDown( short nOffset ) bool SwEditShell::MoveOutlinePara( short nOffset ) { StartAllAction(); - bool bRet = GetDoc()->MoveOutlinePara( *GetCrsr(), nOffset ); + bool bRet = GetDoc()->MoveOutlinePara( *GetCursor(), nOffset ); EndAllAction(); return bRet; } @@ -557,7 +557,7 @@ bool SwEditShell::MoveOutlinePara( short nOffset ) bool SwEditShell::IsProtectedOutlinePara() const { bool bRet = false; - const SwNode& rNd = GetCrsr()->Start()->nNode.GetNode(); + const SwNode& rNd = GetCursor()->Start()->nNode.GetNode(); if( rNd.IsTextNode() ) { const SwOutlineNodes& rOutlNd = GetDoc()->GetNodes().GetOutLineNds(); @@ -638,7 +638,7 @@ bool SwEditShell::NumOrNoNum( && ( !bChkStart || IsSttPara() ) ) { StartAllAction(); - bRet = GetDoc()->NumOrNoNum( GetCrsr()->GetPoint()->nNode, !bNumOn ); + bRet = GetDoc()->NumOrNoNum( GetCursor()->GetPoint()->nNode, !bNumOn ); EndAllAction(); } return bRet; @@ -653,7 +653,7 @@ bool SwEditShell::IsNoNum( bool bChkStart ) const && !HasSelection() && ( !bChkStart || IsSttPara() ) ) { - const SwTextNode* pTextNd = GetCrsr()->GetNode().GetTextNode(); + const SwTextNode* pTextNd = GetCursor()->GetNode().GetTextNode(); if ( pTextNd != nullptr ) { bResult = !pTextNd->IsCountedInList(); @@ -668,8 +668,8 @@ sal_uInt8 SwEditShell::GetNumLevel() const // return current level where the point of the cursor is sal_uInt8 nLevel = MAXLEVEL; - SwPaM* pCrsr = GetCrsr(); - const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + SwPaM* pCursor = GetCursor(); + const SwTextNode* pTextNd = pCursor->GetNode().GetTextNode(); OSL_ENSURE( pTextNd, "GetNumLevel() without text node" ); if ( pTextNd == nullptr ) @@ -688,9 +688,9 @@ sal_uInt8 SwEditShell::GetNumLevel() const return nLevel; } -const SwNumRule* SwEditShell::GetNumRuleAtCurrCrsrPos() const +const SwNumRule* SwEditShell::GetNumRuleAtCurrCursorPos() const { - return SwDoc::GetNumRuleAtPos( *GetCrsr()->GetPoint() ); + return SwDoc::GetNumRuleAtPos( *GetCursor()->GetPoint() ); } const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const @@ -698,11 +698,11 @@ const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const const SwNumRule* pNumRuleAtCurrentSelection = nullptr; bool bDifferentNumRuleFound = false; - for(const SwPaM& rCurrentCrsr : GetCrsr()->GetRingContainer()) + for(const SwPaM& rCurrentCursor : GetCursor()->GetRingContainer()) { - const SwNodeIndex aEndNode = rCurrentCrsr.End()->nNode; + const SwNodeIndex aEndNode = rCurrentCursor.End()->nNode; - for ( SwNodeIndex aNode = rCurrentCrsr.Start()->nNode; aNode <= aEndNode; ++aNode ) + for ( SwNodeIndex aNode = rCurrentCursor.Start()->nNode; aNode <= aEndNode; ++aNode ) { const SwNumRule* pNumRule = SwDoc::GetNumRuleAtPos( SwPosition( aNode ) ); if ( pNumRule == nullptr ) @@ -739,11 +739,11 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); if( IsMultiSelection() ) { - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); OUString sContinuedListId(rContinuedListId); for( size_t n = 0; n < aRangeArr.Count(); ++n ) { @@ -765,10 +765,10 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, } else { - GetDoc()->SetNumRule( *pCrsr, rRule, + GetDoc()->SetNumRule( *pCursor, rRule, bCreateNewList, rContinuedListId, true, bResetIndentAttrs ); - GetDoc()->SetCounted( *pCrsr, true ); + GetDoc()->SetCounted( *pCursor, true ); } GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); @@ -790,7 +790,7 @@ void SwEditShell::ChgNumRuleFormats( const SwNumRule& rRule ) bool SwEditShell::ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule ) { StartAllAction(); - bool bRet = GetDoc()->ReplaceNumRule( *GetCrsr()->GetPoint(), rOldRule, rNewRule ); + bool bRet = GetDoc()->ReplaceNumRule( *GetCursor()->GetPoint(), rOldRule, rNewRule ); EndAllAction(); return bRet; } @@ -798,26 +798,26 @@ bool SwEditShell::ReplaceNumRule( const OUString& rOldRule, const OUString& rNew void SwEditShell::SetNumRuleStart( bool bFlag, SwPaM* pPaM ) { StartAllAction(); - SwPaM* pCrsr = pPaM ? pPaM : GetCrsr(); - if( pCrsr->IsMultiSelection() ) // multiple selection ? + SwPaM* pCursor = pPaM ? pPaM : GetCursor(); + if( pCursor->IsMultiSelection() ) // multiple selection ? { GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->SetNumRuleStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), bFlag ); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); } else - GetDoc()->SetNumRuleStart( *pCrsr->GetPoint(), bFlag ); + GetDoc()->SetNumRuleStart( *pCursor->GetPoint(), bFlag ); EndAllAction(); } bool SwEditShell::IsNumRuleStart( SwPaM* pPaM ) const { - SwPaM* pCrsr = pPaM ? pPaM : GetCrsr( ); - const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + SwPaM* pCursor = pPaM ? pPaM : GetCursor( ); + const SwTextNode* pTextNd = pCursor->GetNode().GetTextNode(); return pTextNd && pTextNd->IsListRestart(); } @@ -825,26 +825,26 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt, SwPaM* pPaM ) { StartAllAction(); - SwPaM* pCrsr = pPaM ? pPaM : GetCrsr(); - if( pCrsr->IsMultiSelection() ) // multiple selection ? + SwPaM* pCursor = pPaM ? pPaM : GetCursor(); + if( pCursor->IsMultiSelection() ) // multiple selection ? { GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, nullptr ); - SwPamRanges aRangeArr( *pCrsr ); - SwPaM aPam( *pCrsr->GetPoint() ); + SwPamRanges aRangeArr( *pCursor ); + SwPaM aPam( *pCursor->GetPoint() ); for( size_t n = 0; n < aRangeArr.Count(); ++n ) GetDoc()->SetNodeNumStart( *aRangeArr.SetPam( n, aPam ).GetPoint(), nStt ); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, nullptr ); } else - GetDoc()->SetNodeNumStart( *pCrsr->GetPoint(), nStt ); + GetDoc()->SetNodeNumStart( *pCursor->GetPoint(), nStt ); EndAllAction(); } sal_uInt16 SwEditShell::GetNodeNumStart( SwPaM* pPaM ) const { - SwPaM* pCrsr = pPaM ? pPaM : GetCrsr(); - const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + SwPaM* pCursor = pPaM ? pPaM : GetCursor(); + const SwTextNode* pTextNd = pCursor->GetNode().GetTextNode(); // correction: check, if list restart value is set at text node and // use new method <SwTextNode::GetAttrListRestartValue()>. // return USHRT_MAX, if no list restart value is found. @@ -861,7 +861,7 @@ const SwNumRule * SwEditShell::SearchNumRule( const bool bForward, int nNonEmptyAllowed, OUString& sListId ) { - return GetDoc()->SearchNumRule( *(bForward ? GetCrsr()->End() : GetCrsr()->Start()), + return GetDoc()->SearchNumRule( *(bForward ? GetCursor()->End() : GetCursor()->Start()), bForward, bNum, bOutline, nNonEmptyAllowed, sListId ); } diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx index 769d872cbafc..79290dcad908 100644 --- a/sw/source/core/edit/edredln.cxx +++ b/sw/source/core/edit/edredln.cxx @@ -92,7 +92,7 @@ bool SwEditShell::AcceptRedlinesInSelection() { SET_CURR_SHELL( this ); StartAllAction(); - bool bRet = GetDoc()->getIDocumentRedlineAccess().AcceptRedline( *GetCrsr(), true ); + bool bRet = GetDoc()->getIDocumentRedlineAccess().AcceptRedline( *GetCursor(), true ); EndAllAction(); return bRet; } @@ -101,7 +101,7 @@ bool SwEditShell::RejectRedlinesInSelection() { SET_CURR_SHELL( this ); StartAllAction(); - bool bRet = GetDoc()->getIDocumentRedlineAccess().RejectRedline( *GetCrsr(), true ); + bool bRet = GetDoc()->getIDocumentRedlineAccess().RejectRedline( *GetCursor(), true ); EndAllAction(); return bRet; } @@ -110,7 +110,7 @@ bool SwEditShell::RejectRedlinesInSelection() bool SwEditShell::SetRedlineComment( const OUString& rS ) { bool bRet = false; - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { bRet = bRet || GetDoc()->getIDocumentRedlineAccess().SetRedlineComment( rPaM, rS ); } @@ -120,7 +120,7 @@ bool SwEditShell::SetRedlineComment( const OUString& rS ) const SwRangeRedline* SwEditShell::GetCurrRedline() const { - return GetDoc()->getIDocumentRedlineAccess().GetRedline( *GetCrsr()->GetPoint(), nullptr ); + return GetDoc()->getIDocumentRedlineAccess().GetRedline( *GetCursor()->GetPoint(), nullptr ); } void SwEditShell::UpdateRedlineAttr() diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index 52b3cfa02511..f26d5484fd34 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -41,7 +41,7 @@ SwEditShell::InsertSection( StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_INSSECTION, nullptr ); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { SwSection const*const pNew = GetDoc()->InsertSwSection( rPaM, rNewData, nullptr, pAttr ); @@ -59,11 +59,11 @@ bool SwEditShell::IsInsRegionAvailable() const { if( IsTableMode() ) return false; - SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() != pCrsr ) + SwPaM* pCursor = GetCursor(); + if( pCursor->GetNext() != pCursor ) return false; - if( pCrsr->HasMark() ) - return 0 != SwDoc::IsInsRegionAvailable( *pCrsr ); + if( pCursor->HasMark() ) + return 0 != SwDoc::IsInsRegionAvailable( *pCursor ); return true; } @@ -73,7 +73,7 @@ const SwSection* SwEditShell::GetCurrSection() const if( IsTableMode() ) return nullptr; - return SwDoc::GetCurrSection( *GetCrsr()->GetPoint() ); + return SwDoc::GetCurrSection( *GetCursor()->GetPoint() ); } /** Deliver the responsible area of the columns. @@ -82,28 +82,28 @@ const SwSection* SwEditShell::GetCurrSection() const */ SwSection* SwEditShell::GetAnySection( bool bOutOfTab, const Point* pPt ) { - SwFrm *pFrm; + SwFrame *pFrame; if ( pPt ) { - SwPosition aPos( *GetCrsr()->GetPoint() ); + SwPosition aPos( *GetCursor()->GetPoint() ); Point aPt( *pPt ); - GetLayout()->GetCrsrOfst( &aPos, aPt ); + GetLayout()->GetCursorOfst( &aPos, aPt ); SwContentNode *pNd = aPos.nNode.GetNode().GetContentNode(); - pFrm = pNd->getLayoutFrm( GetLayout(), pPt ); + pFrame = pNd->getLayoutFrame( GetLayout(), pPt ); } else - pFrm = GetCurrFrm( false ); + pFrame = GetCurrFrame( false ); - if( bOutOfTab && pFrm ) - pFrm = pFrm->FindTabFrm(); - if( pFrm && pFrm->IsInSct() ) + if( bOutOfTab && pFrame ) + pFrame = pFrame->FindTabFrame(); + if( pFrame && pFrame->IsInSct() ) { - SwSectionFrm* pSect = pFrm->FindSctFrm(); + SwSectionFrame* pSect = pFrame->FindSctFrame(); OSL_ENSURE( pSect, "GetAnySection: Where's my Sect?" ); if( pSect->IsInFootnote() && pSect->GetUpper()->IsInSct() ) { - pSect = pSect->GetUpper()->FindSctFrm(); - OSL_ENSURE( pSect, "GetAnySection: Where's my SectFrm?" ); + pSect = pSect->GetUpper()->FindSctFrame(); + OSL_ENSURE( pSect, "GetAnySection: Where's my SectFrame?" ); } return pSect->GetSection(); } @@ -181,7 +181,7 @@ void SwEditShell::SetSectionAttr( const SfxItemSet& rSet, { // for all section in the selection - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { const SwPosition* pStt = rPaM.Start(), * pEnd = rPaM.End(); @@ -251,7 +251,7 @@ void SwEditShell::_SetSectionAttr( SwSectionFormat& rSectFormat, sal_uInt16 SwEditShell::GetFullSelectedSectionCount() const { sal_uInt16 nRet = 0; - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { const SwPosition* pStt = rPaM.Start(), @@ -391,7 +391,7 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) */ bool SwEditShell::CanSpecialInsert() const { - return nullptr != lcl_SpecialInsertNode( GetCrsr()->GetPoint() ); + return nullptr != lcl_SpecialInsertNode( GetCursor()->GetPoint() ); } /** check whether a node can be special-inserted (alt-Enter), and do so. Return @@ -402,7 +402,7 @@ bool SwEditShell::DoSpecialInsert() bool bRet = false; // get current node - SwPosition* pCursorPos = GetCrsr()->GetPoint(); + SwPosition* pCursorPos = GetCursor()->GetPoint(); const SwNode* pInsertNode = lcl_SpecialInsertNode( pCursorPos ); if( pInsertNode != nullptr ) { diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index ce789117b54b..6ff9ca6c8811 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -96,7 +96,7 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTableOp const SwTableAutoFormat* pTAFormat ) { StartAllAction(); - SwPosition* pPos = GetCrsr()->GetPoint(); + SwPosition* pPos = GetCursor()->GetPoint(); bool bEndUndo = 0 != pPos->nContent.GetIndex(); if( bEndUndo ) @@ -126,7 +126,7 @@ bool SwEditShell::TextToTable( const SwInsertTableOptions& rInsTableOpts, SwWait aWait( *GetDoc()->GetDocShell(), true ); bool bRet = false; StartAllAction(); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( rPaM.HasMark() ) bRet |= nullptr != GetDoc()->TextToTable( rInsTableOpts, rPaM, cCh, @@ -140,15 +140,15 @@ bool SwEditShell::TableToText( sal_Unicode cCh ) { SwWait aWait( *GetDoc()->GetDocShell(), true ); bool bRet = false; - SwPaM* pCrsr = GetCrsr(); + SwPaM* pCursor = GetCursor(); const SwTableNode* pTableNd = - GetDoc()->IsIdxInTable( pCrsr->GetPoint()->nNode ); + GetDoc()->IsIdxInTable( pCursor->GetPoint()->nNode ); if( IsTableMode() ) { ClearMark(); - pCrsr = GetCrsr(); + pCursor = GetCursor(); } - else if( !pTableNd || pCrsr->GetNext() != pCrsr ) + else if( !pTableNd || pCursor->GetNext() != pCursor ) return bRet; // TL_CHART2: @@ -159,25 +159,25 @@ bool SwEditShell::TableToText( sal_Unicode cCh ) // move current Cursor out of the listing area SwNodeIndex aTabIdx( *pTableNd ); - pCrsr->DeleteMark(); - pCrsr->GetPoint()->nNode = *pTableNd->EndOfSectionNode(); - pCrsr->GetPoint()->nContent.Assign( nullptr, 0 ); + pCursor->DeleteMark(); + pCursor->GetPoint()->nNode = *pTableNd->EndOfSectionNode(); + pCursor->GetPoint()->nContent.Assign( nullptr, 0 ); // move sPoint and Mark out of the area! - pCrsr->SetMark(); - pCrsr->DeleteMark(); + pCursor->SetMark(); + pCursor->DeleteMark(); //Modified for bug #i119954# Application crashed if undo/redo covert nest table to text StartUndo(); bRet = ConvertTableToText( pTableNd, cCh ); EndUndo(); //End for bug #i119954# - pCrsr->GetPoint()->nNode = aTabIdx; + pCursor->GetPoint()->nNode = aTabIdx; - SwContentNode* pCNd = pCrsr->GetContentNode(); + SwContentNode* pCNd = pCursor->GetContentNode(); if( !pCNd ) - pCrsr->Move( fnMoveForward, fnGoContent ); + pCursor->Move( fnMoveForward, fnGoContent ); else - pCrsr->GetPoint()->nContent.Assign( pCNd, 0 ); + pCursor->GetPoint()->nContent.Assign( pCNd, 0 ); EndAllAction(); return bRet; @@ -186,7 +186,7 @@ bool SwEditShell::TableToText( sal_Unicode cCh ) bool SwEditShell::IsTextToTableAvailable() const { bool bOnlyText = false; - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { if( rPaM.HasMark() && *rPaM.GetPoint() != *rPaM.GetMark() ) { @@ -217,7 +217,7 @@ void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTableOpts, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdj ) { - SwPosition* pPos = GetCrsr()->GetPoint(); + SwPosition* pPos = GetCursor()->GetPoint(); StartAllAction(); @@ -247,7 +247,7 @@ void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTableOpts, /** update fields of a listing */ void SwEditShell::UpdateTable() { - const SwTableNode* pTableNd = IsCrsrInTable(); + const SwTableNode* pTableNd = IsCursorInTable(); // Keine Arme keine Kekse if( pTableNd ) @@ -269,7 +269,7 @@ void SwEditShell::UpdateTable() TableChgMode SwEditShell::GetTableChgMode() const { TableChgMode eMode; - const SwTableNode* pTableNd = IsCrsrInTable(); + const SwTableNode* pTableNd = IsCursorInTable(); if( pTableNd ) eMode = pTableNd->GetTable().GetTableChgMode(); else @@ -279,7 +279,7 @@ TableChgMode SwEditShell::GetTableChgMode() const void SwEditShell::SetTableChgMode( TableChgMode eMode ) { - const SwTableNode* pTableNd = IsCrsrInTable(); + const SwTableNode* pTableNd = IsCursorInTable(); if( pTableNd ) { @@ -300,13 +300,13 @@ bool SwEditShell::GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const else { do { - SwFrm *pFrm = GetCurrFrm(); + SwFrame *pFrame = GetCurrFrame(); do { - pFrm = pFrm->GetUpper(); - } while ( pFrm && !pFrm->IsCellFrm() ); - if ( pFrm ) + pFrame = pFrame->GetUpper(); + } while ( pFrame && !pFrame->IsCellFrame() ); + if ( pFrame ) { - SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox())); + SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox())); aBoxes.insert( pBox ); } } while( false ); @@ -342,13 +342,13 @@ void SwEditShell::SetTableBoxFormulaAttrs( const SfxItemSet& rSet ) else { do { - SwFrm *pFrm = GetCurrFrm(); + SwFrame *pFrame = GetCurrFrame(); do { - pFrm = pFrm->GetUpper(); - } while ( pFrm && !pFrm->IsCellFrm() ); - if ( pFrm ) + pFrame = pFrame->GetUpper(); + } while ( pFrame && !pFrame->IsCellFrame() ); + if ( pFrame ) { - SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox())); + SwTableBox *pBox = const_cast<SwTableBox*>(static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox())); aBoxes.insert( pBox ); } } while( false ); @@ -375,12 +375,12 @@ bool SwEditShell::IsTableBoxTextFormat() const const SwTableBox *pBox = nullptr; { - SwFrm *pFrm = GetCurrFrm(); + SwFrame *pFrame = GetCurrFrame(); do { - pFrm = pFrm->GetUpper(); - } while ( pFrm && !pFrm->IsCellFrm() ); - if ( pFrm ) - pBox = static_cast<const SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox()); + pFrame = pFrame->GetUpper(); + } while ( pFrame && !pFrame->IsCellFrame() ); + if ( pFrame ) + pBox = static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); } if( !pBox ) @@ -415,12 +415,12 @@ OUString SwEditShell::GetTableBoxText() const { const SwTableBox *pBox = nullptr; { - SwFrm *pFrm = GetCurrFrm(); + SwFrame *pFrame = GetCurrFrame(); do { - pFrm = pFrm->GetUpper(); - } while ( pFrm && !pFrm->IsCellFrm() ); - if ( pFrm ) - pBox = static_cast<const SwTableBox*>(static_cast<SwCellFrm*>(pFrm)->GetTabBox()); + pFrame = pFrame->GetUpper(); + } while ( pFrame && !pFrame->IsCellFrame() ); + if ( pFrame ) + pBox = static_cast<const SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()); } sal_uLong nNd; @@ -433,13 +433,13 @@ OUString SwEditShell::GetTableBoxText() const bool SwEditShell::SplitTable( sal_uInt16 eMode ) { bool bRet = false; - SwPaM *pCrsr = GetCrsr(); - if( pCrsr->GetNode().FindTableNode() ) + SwPaM *pCursor = GetCursor(); + if( pCursor->GetNode().FindTableNode() ) { StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, nullptr); - bRet = GetDoc()->SplitTable( *pCrsr->GetPoint(), eMode, true ); + bRet = GetDoc()->SplitTable( *pCursor->GetPoint(), eMode, true ); GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, nullptr); ClearFEShellTabCols(); @@ -451,13 +451,13 @@ bool SwEditShell::SplitTable( sal_uInt16 eMode ) bool SwEditShell::MergeTable( bool bWithPrev, sal_uInt16 nMode ) { bool bRet = false; - SwPaM *pCrsr = GetCrsr(); - if( pCrsr->GetNode().FindTableNode() ) + SwPaM *pCursor = GetCursor(); + if( pCursor->GetNode().FindTableNode() ) { StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, nullptr); - bRet = GetDoc()->MergeTable( *pCrsr->GetPoint(), bWithPrev, nMode ); + bRet = GetDoc()->MergeTable( *pCursor->GetPoint(), bWithPrev, nMode ); GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, nullptr); ClearFEShellTabCols(); @@ -469,8 +469,8 @@ bool SwEditShell::MergeTable( bool bWithPrev, sal_uInt16 nMode ) bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const { bool bRet = false; - const SwPaM *pCrsr = GetCrsr(); - const SwTableNode* pTableNd = pCrsr->GetNode().FindTableNode(); + const SwPaM *pCursor = GetCursor(); + const SwTableNode* pTableNd = pCursor->GetNode().FindTableNode(); if( pTableNd && dynamic_cast< const SwDDETable* >(&pTableNd->GetTable()) == nullptr) { bool bNew = pTableNd->GetTable().IsNewModel(); @@ -515,7 +515,7 @@ bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const /** create InsertDB as table Undo */ void SwEditShell::AppendUndoForInsertFromDB( bool bIsTable ) { - GetDoc()->AppendUndoForInsertFromDB( *GetCrsr(), bIsTable ); + GetDoc()->AppendUndoForInsertFromDB( *GetCursor(), bIsTable ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 630a3ac3ab93..3935c67853cd 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -60,7 +60,7 @@ void SwEditShell::Insert(const SwTOXMark& rMark) { bool bInsAtPos = rMark.IsAlternativeText(); StartAllAction(); - for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) + for(SwPaM& rPaM : GetCursor()->GetRingContainer()) { const SwPosition *pStt = rPaM.Start(), *pEnd = rPaM.End(); @@ -92,7 +92,7 @@ void SwEditShell::DeleteTOXMark( SwTOXMark* pMark ) /// Collect all listing markers sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const { - return SwDoc::GetCurTOXMark( *GetCrsr()->Start(), rMarks ); + return SwDoc::GetCurTOXMark( *GetCursor()->Start(), rMarks ); } bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) @@ -136,7 +136,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) // Insert listing const SwTOXBaseSection* pTOX = mpDoc->InsertTableOf( - *GetCrsr()->GetPoint(), rTOX, pSet, true ); + *GetCursor()->GetPoint(), rTOX, pSet, true ); OSL_ENSURE(pTOX, "No current TOx"); // start formatting @@ -145,7 +145,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) // insert page numbering const_cast<SwTOXBaseSection*>(pTOX)->UpdatePageNum(); - pTOX->SetPosAtStartEnd( *GetCrsr()->GetPoint() ); + pTOX->SetPosAtStartEnd( *GetCursor()->GetPoint() ); // Fix for empty listing InvalidateWindows( maVisArea ); @@ -180,7 +180,7 @@ bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) // correct Cursor if( bInIndex ) - pTOX->SetPosAtStartEnd( *GetCrsr()->GetPoint() ); + pTOX->SetPosAtStartEnd( *GetCursor()->GetPoint() ); // start formatting CalcLayout(); @@ -199,7 +199,7 @@ bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) /// Get current listing before or at the Cursor const SwTOXBase* SwEditShell::GetCurTOX() const { - return SwDoc::GetCurTOX( *GetCrsr()->GetPoint() ); + return SwDoc::GetCurTOX( *GetCursor()->GetPoint() ); } bool SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes ) diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index 1a6f18be7f7d..ed40e7c450b2 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -68,17 +68,17 @@ void SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext) else { Point aPt; - SwFlyFrm *const pFly = - static_cast<SwFlyFrameFormat*>(pSelFormat)->GetFrm(& aPt); + SwFlyFrame *const pFly = + static_cast<SwFlyFrameFormat*>(pSelFormat)->GetFrame(& aPt); if (pFly) { // fdo#36681: Invalidate the content and layout to refresh // the picture anchoring properly - SwPageFrm* pPageFrm = pFly->FindPageFrmOfAnchor(); - pPageFrm->InvalidateFlyLayout(); - pPageFrm->InvalidateContent(); + SwPageFrame* pPageFrame = pFly->FindPageFrameOfAnchor(); + pPageFrame->InvalidateFlyLayout(); + pPageFrame->InvalidateContent(); - static_cast<SwFEShell*>(this)->SelectFlyFrm(*pFly, true); + static_cast<SwFEShell*>(this)->SelectFlyFrame(*pFly, true); } } } @@ -86,11 +86,11 @@ void SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext) { lcl_SelectSdrMarkList( this, pMarkList ); } - else if (GetCrsr()->GetNext() != GetCrsr()) + else if (GetCursor()->GetNext() != GetCursor()) { // current cursor is the last one: // go around the ring, to the first cursor - GoNextCrsr(); + GoNextCursor(); } } @@ -114,7 +114,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) // the same position for autoformat or autocorrection SwUndoId nLastUndoId(UNDO_EMPTY); GetLastUndoInfo(nullptr, & nLastUndoId); - const bool bRestoreCrsr = nCount == 1 + const bool bRestoreCursor = nCount == 1 && ( UNDO_AUTOFORMAT == nLastUndoId || UNDO_AUTOCORRECT == nLastUndoId || UNDO_SETDEFTATTR == nLastUndoId ); @@ -136,11 +136,11 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) "SwEditShell::Undo(): exception caught: " << e.Message); } - if (bRestoreCrsr) + if (bRestoreCursor) { // fdo#39003 Pop does not touch the rest of the cursor ring KillPams(); // so call this first to get rid of unwanted cursors } - Pop( !bRestoreCrsr ); + Pop( !bRestoreCursor ); GetDoc()->getIDocumentRedlineAccess().SetRedlineMode( eOld ); GetDoc()->getIDocumentRedlineAccess().CompressRedlines(); @@ -173,7 +173,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) SwUndoId nFirstRedoId(UNDO_EMPTY); GetDoc()->GetIDocumentUndoRedo().GetFirstRedoInfo(nullptr, & nFirstRedoId); - const bool bRestoreCrsr = nCount == 1 && UNDO_SETDEFTATTR == nFirstRedoId; + const bool bRestoreCursor = nCount == 1 && UNDO_SETDEFTATTR == nFirstRedoId; Push(); // Destroy stored TableBoxPtr. A dection is only permitted for the new "Box"! @@ -192,7 +192,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) "SwEditShell::Redo(): exception caught: " << e.Message); } - Pop( !bRestoreCrsr ); + Pop( !bRestoreCursor ); GetDoc()->getIDocumentRedlineAccess().SetRedlineMode( eOld ); GetDoc()->getIDocumentRedlineAccess().CompressRedlines(); @@ -214,7 +214,7 @@ bool SwEditShell::Repeat(sal_uInt16 const nCount) StartAllAction(); try { - ::sw::RepeatContext context(*GetDoc(), *GetCrsr()); + ::sw::RepeatContext context(*GetDoc(), *GetCursor()); bRet = GetDoc()->GetIDocumentUndoRedo().Repeat( context, nCount ) || bRet; } catch (const css::uno::Exception & e) { diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index 7c8bf15d00ae..e2376eaf02bf 100644 --- a/sw/source/core/edit/edws.cxx +++ b/sw/source/core/edit/edws.cxx @@ -33,12 +33,12 @@ // masqueraded copy constructor SwEditShell::SwEditShell( SwEditShell& rEdSH, vcl::Window *pWindow ) - : SwCrsrShell( rEdSH, pWindow ) + : SwCursorShell( rEdSH, pWindow ) { } SwEditShell::SwEditShell( SwDoc& rDoc, vcl::Window *pWindow, const SwViewOption *pOptions ) - : SwCrsrShell( rDoc, pWindow, pOptions ) + : SwCursorShell( rDoc, pWindow, pOptions ) { GetDoc()->GetIDocumentUndoRedo().DoUndo(true); } @@ -114,7 +114,7 @@ sal_uInt16 SwEditShell::GetCntType() const if( IsTableMode() ) nRet = CNT_TXT; else - switch( GetCrsr()->GetNode().GetNodeType() ) + switch( GetCursor()->GetNode().GetNodeType() ) { case ND_TEXTNODE: nRet = CNT_TXT; break; case ND_GRFNODE: nRet = CNT_GRF; break; @@ -161,17 +161,17 @@ SwActContext::~SwActContext() SwMvContext::SwMvContext(SwEditShell *pShell) : m_rShell(*pShell) { - m_rShell.SttCrsrMove(); + m_rShell.SttCursorMove(); } SwMvContext::~SwMvContext() { - m_rShell.EndCrsrMove(); + m_rShell.EndCursorMove(); } SwFrameFormat *SwEditShell::GetTableFormat() // fastest test on a table { - const SwTableNode* pTableNd = IsCrsrInTable(); + const SwTableNode* pTableNd = IsCursorInTable(); return pTableNd ? static_cast<SwFrameFormat*>(pTableNd->GetTable().GetFrameFormat()) : nullptr; } @@ -241,17 +241,17 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, bool bInsert, StartAllAction(); - SwPaM* pCrsr = getShellCrsr( true ); - SwTextNode* pTNd = pCrsr->GetNode().GetTextNode(); + SwPaM* pCursor = getShellCursor( true ); + SwTextNode* pTNd = pCursor->GetNode().GetTextNode(); - SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar ); + SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCursor, cChar ); // FIXME: this _must_ be called with reference to the actual node text! OUString const& rNodeText(pTNd->GetText()); rACorr.DoAutoCorrect( aSwAutoCorrDoc, - rNodeText, pCrsr->GetPoint()->nContent.GetIndex(), + rNodeText, pCursor->GetPoint()->nContent.GetIndex(), cChar, bInsert, GetWin() ); if( cChar ) - SaveTableBoxContent( pCrsr->GetPoint() ); + SaveTableBoxContent( pCursor->GetPoint() ); EndAllAction(); } @@ -265,12 +265,12 @@ bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect& rACorr, OUString& rWord ) SET_CURR_SHELL( this ); bool bRet; - SwPaM* pCrsr = getShellCrsr( true ); - const sal_Int32 nPos = pCrsr->GetPoint()->nContent.GetIndex(); - SwTextNode* pTNd = pCrsr->GetNode().GetTextNode(); + SwPaM* pCursor = getShellCursor( true ); + const sal_Int32 nPos = pCursor->GetPoint()->nContent.GetIndex(); + SwTextNode* pTNd = pCursor->GetNode().GetTextNode(); if( pTNd && nPos ) { - SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, 0 ); + SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCursor, 0 ); bRet = rACorr.GetPrevAutoCorrWord( aSwAutoCorrDoc, pTNd->GetText(), nPos, rWord ); } |