diff options
Diffstat (limited to 'sw/source/core/crsr/pam.cxx')
-rw-r--r-- | sw/source/core/crsr/pam.cxx | 230 |
1 files changed, 121 insertions, 109 deletions
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 238982aac785..b6615ffae076 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -56,7 +56,7 @@ #include <hints.hxx> // fuer den dummen ?MSC-? Compiler -inline xub_StrLen GetSttOrEnd( BOOL bCondition, const SwCntntNode& rNd ) +inline xub_StrLen GetSttOrEnd( sal_Bool bCondition, const SwCntntNode& rNd ) { return bCondition ? 0 : rNd.Len(); } @@ -106,58 +106,58 @@ SwPosition &SwPosition::operator=(const SwPosition &rPos) } -BOOL SwPosition::operator<(const SwPosition &rPos) const +sal_Bool SwPosition::operator<(const SwPosition &rPos) const { if( nNode < rPos.nNode ) - return TRUE; + return sal_True; if( nNode == rPos.nNode ) return ( nContent < rPos.nContent ); - return FALSE; + return sal_False; } -BOOL SwPosition::operator>(const SwPosition &rPos) const +sal_Bool SwPosition::operator>(const SwPosition &rPos) const { if(nNode > rPos.nNode ) - return TRUE; + return sal_True; if( nNode == rPos.nNode ) return ( nContent > rPos.nContent ); - return FALSE; + return sal_False; } -BOOL SwPosition::operator<=(const SwPosition &rPos) const +sal_Bool SwPosition::operator<=(const SwPosition &rPos) const { if(nNode < rPos.nNode ) - return TRUE; + return sal_True; if( nNode == rPos.nNode ) return ( nContent <= rPos.nContent ); - return FALSE; + return sal_False; } -BOOL SwPosition::operator>=(const SwPosition &rPos) const +sal_Bool SwPosition::operator>=(const SwPosition &rPos) const { if(nNode > rPos.nNode ) - return TRUE; + return sal_True; if( nNode == rPos.nNode ) return ( nContent >= rPos.nContent ); - return FALSE; + return sal_False; } -BOOL SwPosition::operator==(const SwPosition &rPos) const +sal_Bool SwPosition::operator==(const SwPosition &rPos) const { return ( ( nNode == rPos.nNode ) && ( nContent == rPos.nContent ) ? - TRUE: FALSE); + sal_True: sal_False); } -BOOL SwPosition::operator!=(const SwPosition &rPos) const +sal_Bool SwPosition::operator!=(const SwPosition &rPos) const { if( nNode != rPos.nNode ) - return TRUE; + return sal_True; return ( nContent != rPos.nContent ); } @@ -259,9 +259,9 @@ SwComparePosition ComparePosition( enum CHKSECTION { Chk_Both, Chk_One, Chk_None }; -CHKSECTION lcl_TstIdx( ULONG nSttIdx, ULONG nEndIdx, const SwNode& rEndNd ) +CHKSECTION lcl_TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, const SwNode& rEndNd ) { - ULONG nStt = rEndNd.StartOfSectionIndex(), nEnd = rEndNd.GetIndex(); + sal_uLong nStt = rEndNd.StartOfSectionIndex(), nEnd = rEndNd.GetIndex(); CHKSECTION eSec = nStt < nSttIdx && nEnd >= nSttIdx ? Chk_One : Chk_None; if( nStt < nEndIdx && nEnd >= nEndIdx ) return( eSec == Chk_One ? Chk_Both : Chk_One ); @@ -269,14 +269,14 @@ CHKSECTION lcl_TstIdx( ULONG nSttIdx, ULONG nEndIdx, const SwNode& rEndNd ) } -BOOL lcl_ChkOneRange( CHKSECTION eSec, BOOL bChkSections, - const SwNode& rBaseEnd, ULONG nStt, ULONG nEnd ) +sal_Bool lcl_ChkOneRange( CHKSECTION eSec, sal_Bool bChkSections, + const SwNode& rBaseEnd, sal_uLong nStt, sal_uLong nEnd ) { if( eSec != Chk_Both ) - return FALSE; + return sal_False; if( !bChkSections ) - return TRUE; + return sal_True; // suche die umspannende Section const SwNodes& rNds = rBaseEnd.GetNodes(); @@ -285,29 +285,29 @@ BOOL lcl_ChkOneRange( CHKSECTION eSec, BOOL bChkSections, pNd = pNd->StartOfSectionNode(); if( pNd == rNds[ nEnd ]->StartOfSectionNode() ) - return TRUE; // der gleiche StartNode, die selbe Section + return sal_True; // der gleiche StartNode, die selbe Section // steht schon auf einem GrundSection Node ? Fehler !!! if( !pNd->StartOfSectionIndex() ) - return FALSE; + return sal_False; while( ( pTmp = pNd->StartOfSectionNode())->EndOfSectionNode() != &rBaseEnd ) pNd = pTmp; - ULONG nSttIdx = pNd->GetIndex(), nEndIdx = pNd->EndOfSectionIndex(); + sal_uLong nSttIdx = pNd->GetIndex(), nEndIdx = pNd->EndOfSectionIndex(); return nSttIdx <= nStt && nStt <= nEndIdx && - nSttIdx <= nEnd && nEnd <= nEndIdx ? TRUE : FALSE; + nSttIdx <= nEnd && nEnd <= nEndIdx ? sal_True : sal_False; } -BOOL CheckNodesRange( const SwNodeIndex& rStt, - const SwNodeIndex& rEnd, BOOL bChkSection ) +sal_Bool CheckNodesRange( const SwNodeIndex& rStt, + const SwNodeIndex& rEnd, sal_Bool bChkSection ) { const SwNodes& rNds = rStt.GetNodes(); - ULONG nStt = rStt.GetIndex(), nEnd = rEnd.GetIndex(); + sal_uLong nStt = rStt.GetIndex(), nEnd = rEnd.GetIndex(); CHKSECTION eSec = lcl_TstIdx( nStt, nEnd, rNds.GetEndOfContent() ); - if( Chk_None != eSec ) return eSec == Chk_Both ? TRUE : FALSE; + if( Chk_None != eSec ) return eSec == Chk_Both ? sal_True : sal_False; eSec = lcl_TstIdx( nStt, nEnd, rNds.GetEndOfAutotext() ); if( Chk_None != eSec ) @@ -329,34 +329,34 @@ BOOL CheckNodesRange( const SwNodeIndex& rStt, return lcl_ChkOneRange( eSec, bChkSection, rNds.GetEndOfRedlines(), nStt, nEnd ); - return FALSE; // liegt irgendwo dazwischen, FEHLER + return sal_False; // liegt irgendwo dazwischen, FEHLER } -BOOL GoNext(SwNode* pNd, SwIndex * pIdx, USHORT nMode ) +sal_Bool GoNext(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode ) { if( pNd->IsCntntNode() ) return ((SwCntntNode*)pNd)->GoNext( pIdx, nMode ); - return FALSE; + return sal_False; } -BOOL GoPrevious( SwNode* pNd, SwIndex * pIdx, USHORT nMode ) +sal_Bool GoPrevious( SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode ) { if( pNd->IsCntntNode() ) return ((SwCntntNode*)pNd)->GoPrevious( pIdx, nMode ); - return FALSE; + return sal_False; } -SwCntntNode* GoNextNds( SwNodeIndex* pIdx, BOOL bChk ) +SwCntntNode* GoNextNds( SwNodeIndex* pIdx, sal_Bool bChk ) { SwNodeIndex aIdx( *pIdx ); SwCntntNode* pNd = aIdx.GetNodes().GoNext( &aIdx ); if( pNd ) { if( bChk && 1 != aIdx.GetIndex() - pIdx->GetIndex() && - !CheckNodesRange( *pIdx, aIdx, TRUE ) ) + !CheckNodesRange( *pIdx, aIdx, sal_True ) ) pNd = 0; else *pIdx = aIdx; @@ -365,14 +365,14 @@ SwCntntNode* GoNextNds( SwNodeIndex* pIdx, BOOL bChk ) } -SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, BOOL bChk ) +SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, sal_Bool bChk ) { SwNodeIndex aIdx( *pIdx ); SwCntntNode* pNd = aIdx.GetNodes().GoPrevious( &aIdx ); if( pNd ) { if( bChk && 1 != pIdx->GetIndex() - aIdx.GetIndex() && - !CheckNodesRange( *pIdx, aIdx, TRUE ) ) + !CheckNodesRange( *pIdx, aIdx, sal_True ) ) pNd = 0; else *pIdx = aIdx; @@ -564,9 +564,9 @@ void SwPaM::Exchange() // Bewegen des Cursors -BOOL SwPaM::Move( SwMoveFn fnMove, SwGoInDoc fnGo ) +sal_Bool SwPaM::Move( SwMoveFn fnMove, SwGoInDoc fnGo ) { - BOOL bRet = (*fnGo)( *this, fnMove ); + sal_Bool bRet = (*fnGo)( *this, fnMove ); m_bIsInFrontOfLabel = false; @@ -618,7 +618,7 @@ SwPaM* SwPaM::MakeRegion( SwMoveFn fnMove, const SwPaM * pOrigRg ) return pPam; } -SwPaM & SwPaM::Normalize(BOOL bPointFirst) +SwPaM & SwPaM::Normalize(sal_Bool bPointFirst) { if (HasMark()) if ( ( bPointFirst && *m_pPoint > *m_pMark) || @@ -630,7 +630,7 @@ SwPaM & SwPaM::Normalize(BOOL bPointFirst) return *this; } -USHORT SwPaM::GetPageNum( BOOL bAtPoint, const Point* pLayPos ) +sal_uInt16 SwPaM::GetPageNum( sal_Bool bAtPoint, const Point* pLayPos ) { // return die Seitennummer am Cursor // (fuer Reader + Seitengebundene Rahmen) @@ -640,7 +640,11 @@ USHORT SwPaM::GetPageNum( BOOL bAtPoint, const Point* pLayPos ) const SwPosition* pPos = bAtPoint ? m_pPoint : m_pMark; if( 0 != ( pNd = pPos->nNode.GetNode().GetCntntNode() ) && +<<<<<<< local 0 != ( pCFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), pLayPos, pPos, FALSE )) && +======= + 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, sal_False )) && +>>>>>>> other 0 != ( pPg = pCFrm->FindPageFrm() )) return pPg->GetPhyPageNum(); return 0; @@ -675,15 +679,19 @@ const SwFrm* lcl_FindEditInReadonlyFrm( const SwFrm& rFrm ) // steht in etwas geschuetztem oder in die Selektion umspannt // etwas geschuetztes. -BOOL SwPaM::HasReadonlySel( bool bFormView ) const +sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; Point aTmpPt; const SwCntntNode *pNd; const SwCntntFrm *pFrm; if( 0 != ( pNd = GetPoint()->nNode.GetNode().GetCntntNode() )) +<<<<<<< local pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), FALSE ); +======= + pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), sal_False ); +>>>>>>> other else pFrm = 0; @@ -697,7 +705,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const ( bFormView && 0 == ( pSttEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) ) // <-- - bRet = TRUE; + bRet = sal_True; else if( pNd ) { const SwSectionNode* pSNd = pNd->GetSectionNode(); @@ -705,13 +713,17 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const // --> FME 2004-06-29 #114856# Formular view (bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) ) // <-- - bRet = TRUE; + bRet = sal_True; } if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode ) { if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() )) +<<<<<<< local pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), FALSE ); +======= + pFrm = pNd->GetFrm( &aTmpPt, GetMark(), sal_False ); +>>>>>>> other else pFrm = 0; @@ -720,7 +732,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const ( bFormView && 0 == ( pEndEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) ) // <-- - bRet = TRUE; + bRet = sal_True; else if( pNd ) { const SwSectionNode* pSNd = pNd->GetSectionNode(); @@ -728,7 +740,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const // --> FME 2004-06-29 #114856# Formular view (bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) ) // <-- - bRet = TRUE; + bRet = sal_True; } // --> FME 2004-06-29 #114856# Formular view @@ -737,7 +749,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const // Check if start and end frame are inside the _same_ // edit-in-readonly-environment. Otherwise we better return 'true' if ( pSttEIRFrm != pEndEIRFrm ) - bRet = TRUE; + bRet = sal_True; } // <-- @@ -745,11 +757,11 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const // Selektion liegen? if( !bRet ) { - ULONG nSttIdx = GetMark()->nNode.GetIndex(), + sal_uLong nSttIdx = GetMark()->nNode.GetIndex(), nEndIdx = GetPoint()->nNode.GetIndex(); if( nEndIdx <= nSttIdx ) { - ULONG nTmp = nSttIdx; + sal_uLong nTmp = nSttIdx; nSttIdx = nEndIdx; nEndIdx = nTmp; } @@ -760,14 +772,14 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const if( nSttIdx + 3 < nEndIdx ) { const SwSectionFmts& rFmts = GetDoc()->GetSections(); - for( USHORT n = rFmts.Count(); n; ) + for( sal_uInt16 n = rFmts.Count(); n; ) { const SwSectionFmt* pFmt = rFmts[ --n ]; if( pFmt->GetProtect().IsCntntProtected() ) { - const SwFmtCntnt& rCntnt = pFmt->GetCntnt(FALSE); + const SwFmtCntnt& rCntnt = pFmt->GetCntnt(sal_False); ASSERT( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" ); - ULONG nIdx = rCntnt.GetCntntIdx()->GetIndex(); + sal_uLong nIdx = rCntnt.GetCntntIdx()->GetIndex(); if( nSttIdx <= nIdx && nEndIdx >= nIdx && rCntnt.GetCntntIdx()->GetNode().GetNodes().IsDocNodes() ) { @@ -777,10 +789,10 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const if( CONTENT_SECTION == rSect.GetType() ) { RestoreSavePos(); - return TRUE; + return sal_True; } */ - bRet = TRUE; + bRet = sal_True; break; } } @@ -799,18 +811,18 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const { SwFrmFmt* pFmt = (SwFrmFmt*)rFmts[ --n ]; const SwTable* pTbl = SwTable::FindTable( pFmt ); - ULONG nIdx = pTbl ? pTbl->GetTabSortBoxes()[0]->GetSttIdx() + sal_uLong nIdx = pTbl ? pTbl->GetTabSortBoxes()[0]->GetSttIdx() : 0; if( nSttIdx <= nIdx && nEndIdx >= nIdx ) { // dann teste mal alle Boxen const SwTableSortBoxes& rBoxes = pTbl->GetTabSortBoxes(); - for( USHORT i = rBoxes.Count(); i; ) + for( sal_uInt16 i = rBoxes.Count(); i; ) if( rBoxes[ --i ]->GetFrmFmt()->GetProtect(). IsCntntProtected() ) { - bRet = TRUE; + bRet = sal_True; break; } @@ -852,8 +864,8 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const // Fall, darf die Position vom Pam nicht veraendert werden! -SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, - BOOL bInReadOnly ) +SwCntntNode* GetNode( SwPaM & rPam, sal_Bool& rbFirst, SwMoveFn fnMove, + sal_Bool bInReadOnly ) { SwCntntNode * pNd = 0; SwCntntFrm* pFrm; @@ -862,7 +874,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, { if( rbFirst ) { - rbFirst = FALSE; + rbFirst = sal_False; pNd = rPam.GetCntntNode(); if( pNd ) { @@ -885,18 +897,18 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, if( !pNd ) // steht Cursor auf keinem ContentNode ? { SwPosition aPos( *rPam.GetPoint() ); - BOOL bSrchForward = fnMove == fnMoveForward; + sal_Bool bSrchForward = fnMove == fnMoveForward; SwNodes& rNodes = aPos.nNode.GetNodes(); // zum naechsten / vorherigen ContentNode // Funktioniert noch alles, wenn die Uerbpruefung vom ueberspringen der // Sektions herausgenommen wird ?? // if( (*fnMove->fnNds)( rNodes, &aPos.nNode ) ) - while( TRUE ) + while( sal_True ) { pNd = bSrchForward - ? rNodes.GoNextSection( &aPos.nNode, TRUE, !bInReadOnly ) - : rNodes.GoPrevSection( &aPos.nNode, TRUE, !bInReadOnly ); + ? rNodes.GoNextSection( &aPos.nNode, sal_True, !bInReadOnly ) + : rNodes.GoPrevSection( &aPos.nNode, sal_True, !bInReadOnly ); if( pNd ) { aPos.nContent.Assign( pNd, ::GetSttOrEnd( bSrchForward,*pNd )); @@ -952,7 +964,7 @@ void GoEndDoc( SwPosition * pPos ) { SwNodes& rNodes = pPos->nNode.GetNodes(); pPos->nNode = rNodes.GetEndOfContent(); - SwCntntNode* pCNd = GoPreviousNds( &pPos->nNode, TRUE ); + SwCntntNode* pCNd = GoPreviousNds( &pPos->nNode, sal_True ); if( pCNd ) pCNd->MakeEndIndex( &pPos->nContent ); } @@ -962,7 +974,7 @@ void GoStartSection( SwPosition * pPos ) { // springe zum Anfang der Section SwNodes& rNodes = pPos->nNode.GetNodes(); - USHORT nLevel = rNodes.GetSectionLevel( pPos->nNode ); + sal_uInt16 nLevel = rNodes.GetSectionLevel( pPos->nNode ); if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() ) nLevel--; do { rNodes.GoStartOfSection( &pPos->nNode ); } while( nLevel-- ); @@ -978,35 +990,35 @@ void GoEndSection( SwPosition * pPos ) { // springe zum Anfang/Ende der Section SwNodes& rNodes = pPos->nNode.GetNodes(); - USHORT nLevel = rNodes.GetSectionLevel( pPos->nNode ); + sal_uInt16 nLevel = rNodes.GetSectionLevel( pPos->nNode ); if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() ) nLevel--; do { rNodes.GoEndOfSection( &pPos->nNode ); } while( nLevel-- ); // steht jetzt auf einem EndNode, also zum vorherigen CntntNode - if( GoPreviousNds( &pPos->nNode, TRUE ) ) + if( GoPreviousNds( &pPos->nNode, sal_True ) ) pPos->nNode.GetNode().GetCntntNode()->MakeEndIndex( &pPos->nContent ); } -BOOL GoInDoc( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoInDoc( SwPaM & rPam, SwMoveFn fnMove ) { (*fnMove->fnDoc)( rPam.GetPoint() ); - return TRUE; + return sal_True; } -BOOL GoInSection( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoInSection( SwPaM & rPam, SwMoveFn fnMove ) { (*fnMove->fnSections)( (SwPosition*)rPam.GetPoint() ); - return TRUE; + return sal_True; } -BOOL GoInNode( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoInNode( SwPaM & rPam, SwMoveFn fnMove ) { - SwCntntNode *pNd = (*fnMove->fnNds)( &rPam.GetPoint()->nNode, TRUE ); + SwCntntNode *pNd = (*fnMove->fnNds)( &rPam.GetPoint()->nNode, sal_True ); if( pNd ) rPam.GetPoint()->nContent.Assign( pNd, ::GetSttOrEnd( fnMove == fnMoveForward, *pNd ) ); @@ -1014,35 +1026,35 @@ BOOL GoInNode( SwPaM & rPam, SwMoveFn fnMove ) } -BOOL GoInCntnt( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoInCntnt( SwPaM & rPam, SwMoveFn fnMove ) { if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(), &rPam.GetPoint()->nContent, CRSR_SKIP_CHARS )) - return TRUE; + return sal_True; return GoInNode( rPam, fnMove ); } -BOOL GoInCntntCells( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoInCntntCells( SwPaM & rPam, SwMoveFn fnMove ) { if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(), &rPam.GetPoint()->nContent, CRSR_SKIP_CELLS )) - return TRUE; + return sal_True; return GoInNode( rPam, fnMove ); } -BOOL GoInCntntSkipHidden( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoInCntntSkipHidden( SwPaM & rPam, SwMoveFn fnMove ) { if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(), &rPam.GetPoint()->nContent, CRSR_SKIP_CHARS | CRSR_SKIP_HIDDEN ) ) - return TRUE; + return sal_True; return GoInNode( rPam, fnMove ); } -BOOL GoInCntntCellsSkipHidden( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoInCntntCellsSkipHidden( SwPaM & rPam, SwMoveFn fnMove ) { if( (*fnMove->fnNd)( &rPam.GetPoint()->nNode.GetNode(), &rPam.GetPoint()->nContent, CRSR_SKIP_CELLS | CRSR_SKIP_HIDDEN ) ) - return TRUE; + return sal_True; return GoInNode( rPam, fnMove ); } @@ -1051,7 +1063,7 @@ BOOL GoInCntntCellsSkipHidden( SwPaM & rPam, SwMoveFn fnMove ) // --------- Funktionsdefinitionen fuer die SwCrsrShell -------------- -BOOL GoPrevPara( SwPaM & rPam, SwPosPara aPosPara ) +sal_Bool GoPrevPara( SwPaM & rPam, SwPosPara aPosPara ) { if( rPam.Move( fnMoveBackward, fnGoNode ) ) { @@ -1060,13 +1072,13 @@ BOOL GoPrevPara( SwPaM & rPam, SwPosPara aPosPara ) SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode(); rPos.nContent.Assign( pNd, ::GetSttOrEnd( aPosPara == fnMoveForward, *pNd ) ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL GoCurrPara( SwPaM & rPam, SwPosPara aPosPara ) +sal_Bool GoCurrPara( SwPaM & rPam, SwPosPara aPosPara ) { SwPosition& rPos = *rPam.GetPoint(); SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode(); @@ -1078,24 +1090,24 @@ BOOL GoCurrPara( SwPaM & rPam, SwPosPara aPosPara ) if( nOld != nNew ) { rPos.nContent.Assign( pNd, nNew ); - return TRUE; + return sal_True; } } // den Node noch etwas bewegen ( auf den naechsten/vorh. CntntNode) if( ( aPosPara==fnParaStart && 0 != ( pNd = - GoPreviousNds( &rPos.nNode, TRUE ))) || + GoPreviousNds( &rPos.nNode, sal_True ))) || ( aPosPara==fnParaEnd && 0 != ( pNd = - GoNextNds( &rPos.nNode, TRUE ))) ) + GoNextNds( &rPos.nNode, sal_True ))) ) { rPos.nContent.Assign( pNd, ::GetSttOrEnd( aPosPara == fnMoveForward, *pNd )); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL GoNextPara( SwPaM & rPam, SwPosPara aPosPara ) +sal_Bool GoNextPara( SwPaM & rPam, SwPosPara aPosPara ) { if( rPam.Move( fnMoveForward, fnGoNode ) ) { @@ -1104,14 +1116,14 @@ BOOL GoNextPara( SwPaM & rPam, SwPosPara aPosPara ) SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode(); rPos.nContent.Assign( pNd, ::GetSttOrEnd( aPosPara == fnMoveForward, *pNd ) ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoCurrSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); SwPosition aSavePos( rPos ); // eine Vergleichsposition @@ -1119,10 +1131,10 @@ BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove ) (rNds.*fnMove->fnSection)( &rPos.nNode ); SwCntntNode *pNd; if( 0 == ( pNd = rPos.nNode.GetNode().GetCntntNode()) && - 0 == ( pNd = (*fnMove->fnNds)( &rPos.nNode, TRUE )) ) + 0 == ( pNd = (*fnMove->fnNds)( &rPos.nNode, sal_True )) ) { rPos = aSavePos; // Cusror nicht veraendern - return FALSE; + return sal_False; } rPos.nContent.Assign( pNd, @@ -1131,7 +1143,7 @@ BOOL GoCurrSection( SwPaM & rPam, SwMoveFn fnMove ) } -BOOL GoNextSection( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoNextSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); SwPosition aSavePos( rPos ); // eine Vergleichsposition @@ -1142,17 +1154,17 @@ BOOL GoNextSection( SwPaM & rPam, SwMoveFn fnMove ) if( !GoInCntnt( rPam, fnMoveForward ) ) { rPos = aSavePos; // Cusror nicht veraendern - return FALSE; + return sal_False; } (rNds.*fnMove->fnSection)( &rPos.nNode ); SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode(); rPos.nContent.Assign( pNd, ::GetSttOrEnd( fnMove == fnMoveForward, *pNd ) ); - return TRUE; + return sal_True; } -BOOL GoPrevSection( SwPaM & rPam, SwMoveFn fnMove ) +sal_Bool GoPrevSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); SwPosition aSavePos( rPos ); // eine Vergleichsposition @@ -1163,13 +1175,13 @@ BOOL GoPrevSection( SwPaM & rPam, SwMoveFn fnMove ) if( !GoInCntnt( rPam, fnMoveBackward )) { rPos = aSavePos; // Cusror nicht veraendern - return FALSE; + return sal_False; } (rNds.*fnMove->fnSection)( &rPos.nNode ); SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode(); rPos.nContent.Assign( pNd, ::GetSttOrEnd( fnMove == fnMoveForward, *pNd )); - return TRUE; + return sal_True; } // #111827# @@ -1221,7 +1233,7 @@ String SwPaM::GetTxt() const return aResult; } -BOOL SwPaM::Overlap(const SwPaM & a, const SwPaM & b) +sal_Bool SwPaM::Overlap(const SwPaM & a, const SwPaM & b) { return !(*b.End() <= *a.Start() || *a.End() <= *b.End()); } @@ -1240,7 +1252,7 @@ void SwPaM::InvalidatePaM() } } -BOOL SwPaM::LessThan(const SwPaM & a, const SwPaM & b) +sal_Bool SwPaM::LessThan(const SwPaM & a, const SwPaM & b) { return (*a.Start() < *b.Start()) || (*a.Start() == *b.Start() && *a.End() < *b.End()); } |