diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-05 14:19:51 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-05 16:10:37 +0100 |
commit | c17ca4c2088a7092733b67a509b5c0afb799c293 (patch) | |
tree | 1f3f8d3228454c7eb18820e03f1f5cebc5f2c28d /sw | |
parent | 41104b6ea86aacd5bc5dc68b1b6daac8f31e4982 (diff) |
move use of IsMultiSelection()
Change-Id: Ie99906ef2a97617857f5243353e51d8ab4bd6218
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/crsr/swcrsr.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/extinput.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/layact.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 2 |
11 files changed, 15 insertions, 17 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index e9ea1897e090..d57520caf610 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -890,7 +890,7 @@ inline bool SwCrsrShell::IsMultiSelection() const inline bool SwCrsrShell::IsSelOnePara() const { - return m_pCurCrsr == m_pCurCrsr->GetNext() && + return !m_pCurCrsr->IsMultiSelection() && m_pCurCrsr->GetPoint()->nNode == m_pCurCrsr->GetMark()->nNode; } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 5dd77abb9bb0..45cfd13f225e 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -146,7 +146,7 @@ bool SwCrsrShell::DestroyCrsr() OSL_ENSURE( !IsTableMode(), "in table Selection" ); // Is there a next one? Don't do anything if not. - if(m_pCurCrsr->GetNext() == m_pCurCrsr) + if(!m_pCurCrsr->IsMultiSelection()) return false; SwCallLink aLk( *this ); // watch Crsr-Moves @@ -993,7 +993,7 @@ bool SwCrsrShell::ChgCurrPam( void SwCrsrShell::KillPams() { // Does any exist for deletion? - if( !m_pTblCrsr && !m_pBlockCrsr && m_pCurCrsr->GetNext() == m_pCurCrsr ) + if( !m_pTblCrsr && !m_pBlockCrsr && !m_pCurCrsr->IsMultiSelection() ) return; while( m_pCurCrsr->GetNext() != m_pCurCrsr ) @@ -1196,8 +1196,7 @@ sal_uInt16 SwCrsrShell::GetPageCnt() /// go to the next SSelection bool SwCrsrShell::GoNextCrsr() { - // is there a ring of cursors? - if( m_pCurCrsr->GetNext() == m_pCurCrsr ) + if( !m_pCurCrsr->IsMultiSelection() ) return false; SET_CURR_SHELL( this ); @@ -1216,8 +1215,7 @@ bool SwCrsrShell::GoNextCrsr() /// go to the previous SSelection bool SwCrsrShell::GoPrevCrsr() { - // is there a ring of cursors? - if( m_pCurCrsr->GetNext() == m_pCurCrsr ) + if( !m_pCurCrsr->IsMultiSelection() ) return false; SET_CURR_SHELL( this ); @@ -3040,7 +3038,7 @@ bool SwCrsrShell::IsSelFullPara() const bool bRet = false; if( m_pCurCrsr->GetPoint()->nNode.GetIndex() == - m_pCurCrsr->GetMark()->nNode.GetIndex() && m_pCurCrsr == m_pCurCrsr->GetNext() ) + m_pCurCrsr->GetMark()->nNode.GetIndex() && !m_pCurCrsr->IsMultiSelection() ) { sal_Int32 nStt = m_pCurCrsr->GetPoint()->nContent.GetIndex(); sal_Int32 nEnd = m_pCurCrsr->GetMark()->nContent.GetIndex(); diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 347ae3637338..d0f0005ca471 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -2210,7 +2210,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) if( !pNd->IsCntntNode() ) pNd = rNds.GoNextSection( &aIdx, true, false ); - SwPaM *const pNew = (pAktCrsr->GetNext() == pAktCrsr && !pAktCrsr->HasMark()) + SwPaM *const pNew = (!pAktCrsr->IsMultiSelection() && !pAktCrsr->HasMark()) ? pAktCrsr : pAktCrsr->Create( pAktCrsr ); pNew->GetPoint()->nNode = *pNd; diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 55592156c6c9..30d2fbc5dca8 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -355,7 +355,7 @@ namespace do { pDestDoc->getIDocumentContentOperations().DeleteAndJoin( *static_cast<SwPaM*>(pDelPam->GetNext()) ); - if( pDelPam->GetNext() == pDelPam ) + if( !pDelPam->IsMultiSelection() ) break; delete pDelPam->GetNext(); } while( true ); diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx index f7109fa2765c..c3bfa25a583f 100644 --- a/sw/source/core/doc/extinput.cxx +++ b/sw/source/core/doc/extinput.cxx @@ -291,7 +291,7 @@ SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd, SwExtTextInput* SwDoc::GetExtTextInput() const { - OSL_ENSURE( !mpExtInputRing || mpExtInputRing == mpExtInputRing->GetNext(), + OSL_ENSURE( !mpExtInputRing || !mpExtInputRing->IsMultiSelection(), "more than one InputEngine available" ); return static_cast<SwExtTextInput*>(mpExtInputRing); } diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 905858e0f541..e3d7ebf92853 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -2560,7 +2560,7 @@ void SwEditShell::AutoFmtBySplitNode() { SET_CURR_SHELL( this ); SwPaM* pCrsr = GetCrsr(); - if( pCrsr->GetNext() == pCrsr && pCrsr->Move( fnMoveBackward, fnGoNode ) ) + if( !pCrsr->IsMultiSelection() && pCrsr->Move( fnMoveBackward, fnGoNode ) ) { StartAllAction(); StartUndo( UNDO_AUTOFORMAT ); diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 0dbcb9296a16..5ab5ea073ced 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -264,7 +264,7 @@ void SwEditShell::UpdateFlds( SwField &rFld ) SwTxtFld *pTxtFld; SwFmtFld *pFmtFld; - if ( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark()) + if ( !pCrsr->IsMultiSelection() && !pCrsr->HasMark()) { pTxtFld = GetTxtFldAtPos( pCrsr->Start(), true ); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index a646d20a7681..3d8afe0993d4 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -634,7 +634,7 @@ bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const OUString& rStr, boo if( bDelTxt ) Delete(); } - else if( pCrsr->GetNext() != pCrsr && rFmt.GetValue() == rStr ) + else if( pCrsr->IsMultiSelection() && rFmt.GetValue() == rStr ) bInsTxt = false; if( bInsTxt ) diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index a5ab5c0d178f..812d485cfbee 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -599,7 +599,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, bool bAnchValid, else bMoveCntnt = false; } - else if( !pCrsr->HasMark() && pCrsr->GetNext() == pCrsr ) + else if( !pCrsr->HasMark() && !pCrsr->IsMultiSelection() ) bMoveCntnt = false; const SwPosition& rPos = *pCrsr->Start(); diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index d830ed70f126..75978819b1cb 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1917,7 +1917,7 @@ bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob ) if( pSh->ISA(SwCrsrShell) && !static_cast<SwCrsrShell*>(pSh)->IsTableMode() ) { SwPaM *pCrsr = static_cast<SwCrsrShell*>(pSh)->GetCrsr(); - if( !pCrsr->HasMark() && pCrsr == pCrsr->GetNext() ) + if( !pCrsr->HasMark() && !pCrsr->IsMultiSelection() ) { pCntntNode = pCrsr->GetCntntNode(); nTxtPos = pCrsr->GetPoint()->nContent.GetIndex(); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 476a8cd459ea..d018b198f183 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1077,7 +1077,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, : ((pPortion) ? pPortion->GetCursor() : 0); if (pUnoCrsr && pDoc == rToFill.GetDoc()) { - OSL_ENSURE(pUnoCrsr->GetNext() == pUnoCrsr, + OSL_ENSURE(!pUnoCrsr->IsMultiSelection(), "what to do about rings?"); bRet = true; *rToFill.GetPoint() = *pUnoCrsr->GetPoint(); |