diff options
Diffstat (limited to 'sw/source/core/crsr')
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 18 | ||||
-rw-r--r-- | sw/source/core/crsr/callnk.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/crsr/callnk.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 505 | ||||
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 322 | ||||
-rw-r--r-- | sw/source/core/crsr/crstrvl1.cxx | 30 | ||||
-rw-r--r-- | sw/source/core/crsr/findattr.cxx | 243 | ||||
-rw-r--r-- | sw/source/core/crsr/findcoll.cxx | 31 | ||||
-rw-r--r-- | sw/source/core/crsr/findfmt.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 94 | ||||
-rw-r--r-- | sw/source/core/crsr/makefile.mk | 80 | ||||
-rw-r--r-- | sw/source/core/crsr/pam.cxx | 220 | ||||
-rw-r--r-- | sw/source/core/crsr/paminit.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/crsr/swcrsr.cxx | 454 | ||||
-rw-r--r-- | sw/source/core/crsr/trvlcol.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/crsr/trvlfnfl.cxx | 60 | ||||
-rw-r--r-- | sw/source/core/crsr/trvlreg.cxx | 74 | ||||
-rw-r--r-- | sw/source/core/crsr/trvltbl.cxx | 124 | ||||
-rw-r--r-- | sw/source/core/crsr/unocrsr.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 52 |
20 files changed, 1179 insertions, 1220 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index d91787ac01..f4f60b2220 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -32,13 +32,14 @@ #include <bookmrk.hxx> #include <IDocumentMarkAccess.hxx> +#include <IDocumentUndoRedo.hxx> #include <doc.hxx> #include <ndtxt.hxx> #include <pam.hxx> #include <swserv.hxx> #include <sfx2/linkmgr.hxx> #include <swtypes.hxx> -#include <undobj.hxx> +#include <UndoBookmark.hxx> #include <unobookmark.hxx> #include <rtl/random.h> #include <xmloff/odffields.hxx> @@ -79,14 +80,15 @@ namespace { SwPosition& rStart = pField->GetMarkStart(); SwPosition& rEnd = pField->GetMarkEnd(); - SwTxtNode const * const pStartTxtNode = io_pDoc->GetNodes()[rStart.nNode]->GetTxtNode(); - SwTxtNode const * const pEndTxtNode = io_pDoc->GetNodes()[rEnd.nNode]->GetTxtNode(); + SwTxtNode const*const pStartTxtNode = + rStart.nNode.GetNode().GetTxtNode(); + SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode(); const sal_Unicode ch_start=pStartTxtNode->GetTxt().GetChar(rStart.nContent.GetIndex()); xub_StrLen nEndPos = rEnd == rStart ? rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1; const sal_Unicode ch_end=pEndTxtNode->GetTxt().GetChar( nEndPos ); SwPaM aStartPaM(rStart); SwPaM aEndPaM(rEnd); - io_pDoc->StartUndo(UNDO_UI_REPLACE, NULL); + io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL); if( ( ch_start != aStartMark ) && ( aEndMark != CH_TXT_ATR_FORMELEMENT ) ) { io_pDoc->InsertString(aStartPaM, aStartMark); @@ -97,7 +99,7 @@ namespace io_pDoc->InsertString(aEndPaM, aEndMark); rEnd.nContent++; } - io_pDoc->EndUndo(UNDO_UI_REPLACE, NULL); + io_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_UI_REPLACE, NULL); }; } @@ -232,10 +234,10 @@ namespace sw { namespace mark void Bookmark::InitDoc(SwDoc* const io_pDoc) { - if(io_pDoc->DoesUndo()) + if (io_pDoc->GetIDocumentUndoRedo().DoesUndo()) { - io_pDoc->ClearRedo(); - io_pDoc->AppendUndo(new SwUndoInsBookmark(*this)); + io_pDoc->GetIDocumentUndoRedo().AppendUndo( + new SwUndoInsBookmark(*this)); } io_pDoc->SetModified(); } diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index 64363ef14e..c6b691a725 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -52,8 +52,8 @@ #include<vcl/window.hxx> -SwCallLink::SwCallLink( SwCrsrShell & rSh, ULONG nAktNode, xub_StrLen nAktCntnt, - BYTE nAktNdTyp, long nLRPos, bool bAktSelection ) +SwCallLink::SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCntnt, + sal_uInt8 nAktNdTyp, long nLRPos, bool bAktSelection ) : rShell( rSh ), nNode( nAktNode ), nCntnt( nAktCntnt ), nNdTyp( nAktNdTyp ), nLeftFrmPos( nLRPos ), bHasSelection( bAktSelection ) @@ -140,8 +140,8 @@ SwCallLink::~SwCallLink() } xub_StrLen nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex(); - USHORT nNdWhich = pCNd->GetNodeType(); - ULONG nAktNode = pCurCrsr->GetPoint()->nNode.GetIndex(); + sal_uInt16 nNdWhich = pCNd->GetNodeType(); + sal_uLong nAktNode = pCurCrsr->GetPoint()->nNode.GetIndex(); // Register the Shell as dependent at the current Node. By doing this all // attribute changes can be signaled over the link. @@ -176,7 +176,7 @@ SwCallLink::~SwCallLink() { const SwpHints &rHts = ((SwTxtNode*)pCNd)->GetSwpHints(); - USHORT n; + sal_uInt16 n; xub_StrLen nStart; const xub_StrLen *pEnd; @@ -230,7 +230,7 @@ SwCallLink::~SwCallLink() const SwFrm* pFrm; const SwFlyFrm *pFlyFrm; - if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->GetFrm(0,0,FALSE) ) && + if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->GetFrm(0,0,sal_False) ) && 0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() ) { const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx(); @@ -247,7 +247,7 @@ SwCallLink::~SwCallLink() } } -long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ) +long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ) { SwTxtFrm* pFrm = (SwTxtFrm*)rNd.GetFrm(0,0,bCalcFrm), *pNext = pFrm; if ( pFrm && !pFrm->IsHiddenNow() ) diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx index 4d238b3664..65a8b94496 100644 --- a/sw/source/core/crsr/callnk.hxx +++ b/sw/source/core/crsr/callnk.hxx @@ -37,19 +37,19 @@ class SwCallLink { public: SwCrsrShell & rShell; - ULONG nNode; + sal_uLong nNode; xub_StrLen nCntnt; - BYTE nNdTyp; + sal_uInt8 nNdTyp; long nLeftFrmPos; bool bHasSelection; SwCallLink( SwCrsrShell & rSh ); - SwCallLink( SwCrsrShell & rSh, ULONG nAktNode, xub_StrLen nAktCntnt, - BYTE nAktNdTyp, long nLRPos, + SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCntnt, + sal_uInt8 nAktNdTyp, long nLRPos, bool bAktSelection ); ~SwCallLink(); - static long GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm ); + static long GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ); }; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 832f298d24..6f616e59c9 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -155,27 +155,42 @@ SwPaM * SwCrsrShell::CreateCrsr() // loesche den aktuellen Cursor und der folgende wird zum Aktuellen -BOOL SwCrsrShell::DestroyCrsr() +sal_Bool SwCrsrShell::DestroyCrsr() { // Innerhalb der Tabellen-SSelection keinen neuen Crsr loeschen OSL_ENSURE( !IsTableMode(), "in Tabellen SSelection" ); // ist ueberhaupt ein naechtser vorhanden ? if(pCurCrsr->GetNext() == pCurCrsr) - return FALSE; + return sal_False; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, SwCursor* pNextCrsr = (SwCursor*)pCurCrsr->GetNext(); delete pCurCrsr; pCurCrsr = dynamic_cast<SwShellCrsr*>(pNextCrsr); UpdateCrsr(); - return TRUE; + return sal_True; +} + + +SwPaM & SwCrsrShell::CreateNewShellCursor() +{ + if (HasSelection()) + { + (void) CreateCrsr(); // n.b. returns old cursor + } + return *GetCrsr(); +} + +SwPaM & SwCrsrShell::GetCurrentShellCursor() +{ + return *GetCrsr(); } // gebe den aktuellen zurueck -SwPaM* SwCrsrShell::GetCrsr( BOOL bMakeTblCrsr ) const +SwPaM* SwCrsrShell::GetCrsr( sal_Bool bMakeTblCrsr ) const { if( pTblCrsr ) { @@ -186,7 +201,7 @@ SwPaM* SwCrsrShell::GetCrsr( BOOL bMakeTblCrsr ) const if( pTblCrsr->GetPoint()->nNode.GetIndex() && pTblCrsr->GetMark()->nNode.GetIndex() && 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->GetFrm() && - 0 != ( pCNd = pTblCrsr->GetCntntNode(FALSE) ) && pCNd->GetFrm()) + 0 != ( pCNd = pTblCrsr->GetCntntNode(sal_False) ) && pCNd->GetFrm()) { SwShellTableCrsr* pTC = (SwShellTableCrsr*)pTblCrsr; GetLayout()->MakeTblCrsrs( *pTC ); @@ -214,7 +229,7 @@ void SwCrsrShell::StartAction() nAktNdTyp = rNd.GetNodeType(); bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark(); if( ND_TEXTNODE & nAktNdTyp ) - nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nAktCntnt, TRUE ); + nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nAktCntnt, sal_True ); else nLeftFrmPos = 0; } @@ -222,10 +237,10 @@ void SwCrsrShell::StartAction() } -void SwCrsrShell::EndAction( const BOOL bIdleEnd ) +void SwCrsrShell::EndAction( const sal_Bool bIdleEnd ) { - BOOL bVis = bSVCrsrVis; + sal_Bool bVis = bSVCrsrVis; // Idle-Formatierung ? if( bIdleEnd && Imp()->GetRegion() ) @@ -239,8 +254,8 @@ void SwCrsrShell::EndAction( const BOOL bIdleEnd ) // Task: 76923: dont show the cursor in the ViewShell::EndAction() - call. // Only the UpdateCrsr shows the cursor. - BOOL bSavSVCrsrVis = bSVCrsrVis; - bSVCrsrVis = FALSE; + sal_Bool bSavSVCrsrVis = bSVCrsrVis; + bSVCrsrVis = sal_False; ViewShell::EndAction( bIdleEnd ); //der ViewShell den Vortritt lassen @@ -265,20 +280,20 @@ void SwCrsrShell::EndAction( const BOOL bIdleEnd ) { // Crsr-Moves ueberwachen, evt. Link callen // der DTOR ist das interressante!! - SwCallLink aLk( *this, nAktNode, nAktCntnt, (BYTE)nAktNdTyp, + SwCallLink aLk( *this, nAktNode, nAktCntnt, (sal_uInt8)nAktNdTyp, nLeftFrmPos, bAktSelection ); } if( bCallChgLnk && bChgCallFlag && aChgLnk.IsSet() ) { aChgLnk.Call( this ); - bChgCallFlag = FALSE; // Flag zuruecksetzen + bChgCallFlag = sal_False; // Flag zuruecksetzen } } return; } - USHORT nParm = SwCrsrShell::CHKRANGE; + sal_uInt16 nParm = SwCrsrShell::CHKRANGE; if ( !bIdleEnd ) nParm |= SwCrsrShell::SCROLLWIN; UpdateCrsr( nParm, bIdleEnd ); // Cursor-Aenderungen anzeigen @@ -286,19 +301,19 @@ void SwCrsrShell::EndAction( const BOOL bIdleEnd ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, aLk.nNode = nAktNode; // evt. Link callen - aLk.nNdTyp = (BYTE)nAktNdTyp; + aLk.nNdTyp = (sal_uInt8)nAktNdTyp; aLk.nCntnt = nAktCntnt; aLk.nLeftFrmPos = nLeftFrmPos; if( !nCrsrMove || ( 1 == nCrsrMove && bInCMvVisportChgd ) ) - ShowCrsrs( bSVCrsrVis ? TRUE : FALSE ); // Cursor & Selektionen wieder anzeigen + ShowCrsrs( bSVCrsrVis ? sal_True : sal_False ); // Cursor & Selektionen wieder anzeigen } // falls noch ein ChgCall vorhanden ist, dann rufe ihn if( bCallChgLnk && bChgCallFlag && aChgLnk.IsSet() ) { aChgLnk.Call( this ); - bChgCallFlag = FALSE; // Flag zuruecksetzen + bChgCallFlag = sal_False; // Flag zuruecksetzen } } @@ -312,25 +327,25 @@ void SwCrsrShell::SttCrsrMove() StartAction(); } -void SwCrsrShell::EndCrsrMove( const BOOL bIdleEnd ) +void SwCrsrShell::EndCrsrMove( const sal_Bool bIdleEnd ) { OSL_ENSURE( nCrsrMove, "EndCrsrMove() ohne SttCrsrMove()." ); EndAction( bIdleEnd ); if( !--nCrsrMove ) - bInCMvVisportChgd = FALSE; + bInCMvVisportChgd = sal_False; } #endif -BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, - BOOL bVisualAllowed ) +sal_Bool SwCrsrShell::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, + sal_Bool bVisualAllowed ) { if( IsTableMode() ) return bLeft ? GoPrevCell() : GoNextCell(); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // #i27615# Handle cursor in front of label. const SwTxtNode* pTxtNd = 0; @@ -345,8 +360,8 @@ BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, SwShellCrsr* pShellCrsr = getShellCrsr( true ); if ( !bLeft && pShellCrsr->IsInFrontOfLabel() ) { - SetInFrontOfLabel( FALSE ); - bRet = TRUE; + SetInFrontOfLabel( sal_False ); + bRet = sal_True; } // // 2. CASE: Cursor is at beginning of numbered paragraph. A move @@ -357,25 +372,25 @@ BOOL SwCrsrShell::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, 0 != ( pTxtNd = pShellCrsr->GetNode()->GetTxtNode() ) && pTxtNd->HasVisibleNumberingOrBullet() ) { - SetInFrontOfLabel( TRUE ); - bRet = TRUE; + SetInFrontOfLabel( sal_True ); + bRet = sal_True; } // // 3. CASE: Regular cursor move. Reset the bInFrontOfLabel flag: // else { - const BOOL bSkipHidden = !GetViewOptions()->IsShowHiddenChar(); + const sal_Bool bSkipHidden = !GetViewOptions()->IsShowHiddenChar(); // #i107447# // To avoid loop the reset of <bInFrontOfLabel> flag is no longer // reflected in the return value <bRet>. - const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( FALSE ); + const bool bResetOfInFrontOfLabel = SetInFrontOfLabel( sal_False ); bRet = pShellCrsr->LeftRight( bLeft, nCnt, nMode, bVisualAllowed, bSkipHidden, !IsOverwriteCrsr() ); if ( !bRet && bLeft && bResetOfInFrontOfLabel ) { // undo reset of <bInFrontOfLabel> flag - SetInFrontOfLabel( TRUE ); + SetInFrontOfLabel( sal_True ); } } @@ -393,11 +408,11 @@ void SwCrsrShell::MarkListLevel( const String& sListId, nListLevel != nMarkedListLevel) { if ( sMarkedListId.Len() > 0 ) - pDoc->MarkListLevel( sMarkedListId, nMarkedListLevel, FALSE ); + pDoc->MarkListLevel( sMarkedListId, nMarkedListLevel, sal_False ); if ( sListId.Len() > 0 ) { - pDoc->MarkListLevel( sListId, nListLevel, TRUE ); + pDoc->MarkListLevel( sListId, nListLevel, sal_True ); } sMarkedListId = sListId; @@ -413,7 +428,7 @@ void SwCrsrShell::UpdateMarkedListLevel() { if ( !pTxtNd->IsNumbered() ) { - pCurCrsr->_SetInFrontOfLabel( FALSE ); + pCurCrsr->_SetInFrontOfLabel( sal_False ); MarkListLevel( String(), 0 ); } else if ( pCurCrsr->IsInFrontOfLabel() ) @@ -434,17 +449,17 @@ void SwCrsrShell::UpdateMarkedListLevel() } // <-- -BOOL SwCrsrShell::UpDown( BOOL bUp, USHORT nCnt ) +sal_Bool SwCrsrShell::UpDown( sal_Bool bUp, sal_uInt16 nCnt ) { SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - BOOL bTableMode = IsTableMode(); + sal_Bool bTableMode = IsTableMode(); SwShellCrsr* pTmpCrsr = getShellCrsr( true ); - BOOL bRet = pTmpCrsr->UpDown( bUp, nCnt ); + sal_Bool bRet = pTmpCrsr->UpDown( bUp, nCnt ); // #i40019# UpDown should always reset the bInFrontOfLabel flag: - bRet = SetInFrontOfLabel(FALSE) || bRet; + bRet = SetInFrontOfLabel(sal_False) || bRet; if( pBlockCrsr ) pBlockCrsr->clearPoints(); @@ -458,39 +473,39 @@ BOOL SwCrsrShell::UpDown( BOOL bUp, USHORT nCnt ) if( !bTableMode ) eUpdtMode = (CrsrFlag) (eUpdtMode | SwCrsrShell::UPDOWN | SwCrsrShell::CHKRANGE); - UpdateCrsr( static_cast<USHORT>(eUpdtMode) ); + UpdateCrsr( static_cast<sal_uInt16>(eUpdtMode) ); } } return bRet; } -BOOL SwCrsrShell::LRMargin( BOOL bLeft, BOOL bAPI) +sal_Bool SwCrsrShell::LRMargin( sal_Bool bLeft, sal_Bool bAPI) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SET_CURR_SHELL( this ); eMvState = MV_LEFTMARGIN; // Status fuers Crsr-Travelling - GetCrsrOfst - const BOOL bTableMode = IsTableMode(); + const sal_Bool bTableMode = IsTableMode(); SwShellCrsr* pTmpCrsr = getShellCrsr( true ); if( pBlockCrsr ) pBlockCrsr->clearPoints(); - const BOOL bWasAtLM = + const sal_Bool bWasAtLM = ( 0 == _GetCrsr()->GetPoint()->nContent.GetIndex() ); - BOOL bRet = pTmpCrsr->LeftRightMargin( bLeft, bAPI ); + sal_Bool bRet = pTmpCrsr->LeftRightMargin( bLeft, bAPI ); if ( bLeft && !bTableMode && bRet && bWasAtLM && !_GetCrsr()->HasMark() ) { const SwTxtNode * pTxtNd = _GetCrsr()->GetNode()->GetTxtNode(); if ( pTxtNd && pTxtNd->HasVisibleNumberingOrBullet() ) - SetInFrontOfLabel( TRUE ); + SetInFrontOfLabel( sal_True ); } else if ( !bLeft ) { - bRet = SetInFrontOfLabel( FALSE ) || bRet; + bRet = SetInFrontOfLabel( sal_False ) || bRet; } if( bRet ) @@ -500,19 +515,19 @@ BOOL SwCrsrShell::LRMargin( BOOL bLeft, BOOL bAPI) return bRet; } -BOOL SwCrsrShell::IsAtLRMargin( BOOL bLeft, BOOL bAPI ) const +sal_Bool SwCrsrShell::IsAtLRMargin( sal_Bool bLeft, sal_Bool bAPI ) const { const SwShellCrsr* pTmpCrsr = getShellCrsr( true ); return pTmpCrsr->IsAtLeftRightMargin( bLeft, bAPI ); } -BOOL SwCrsrShell::SttEndDoc( BOOL bStt ) +sal_Bool SwCrsrShell::SttEndDoc( sal_Bool bStt ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SwShellCrsr* pTmpCrsr = pBlockCrsr ? &pBlockCrsr->getShellCrsr() : pCurCrsr; - BOOL bRet = pTmpCrsr->SttEndDoc( bStt ); + sal_Bool bRet = pTmpCrsr->SttEndDoc( bStt ); if( bRet ) { if( bStt ) @@ -540,9 +555,9 @@ void SwCrsrShell::ExtendedSelectAll() pPos->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); } -BOOL SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage ) +sal_Bool SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // Springe beim Selektieren nie ueber Section-Grenzen !! if( !pCurCrsr->HasMark() || !pCurCrsr->IsNoCntnt() ) @@ -554,35 +569,35 @@ BOOL SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage ) Point& rPt = pCurCrsr->GetPtPos(); SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()-> GetFrm( &rPt, pCurCrsr->GetPoint() ); - if( pFrm && TRUE == ( bRet = GetFrmInPage( pFrm, fnWhichPage, + if( pFrm && sal_True == ( bRet = GetFrmInPage( pFrm, fnWhichPage, fnPosPage, pCurCrsr ) ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS )) UpdateCrsr(); else - bRet = FALSE; + bRet = sal_False; } return bRet; } -BOOL SwCrsrShell::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara ) +sal_Bool SwCrsrShell::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SwCursor* pTmpCrsr = getShellCrsr( true ); - BOOL bRet = pTmpCrsr->MovePara( fnWhichPara, fnPosPara ); + sal_Bool bRet = pTmpCrsr->MovePara( fnWhichPara, fnPosPara ); if( bRet ) UpdateCrsr(); return bRet; } -BOOL SwCrsrShell::MoveSection( SwWhichSection fnWhichSect, +sal_Bool SwCrsrShell::MoveSection( SwWhichSection fnWhichSect, SwPosSection fnPosSect) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SwCursor* pTmpCrsr = getShellCrsr( true ); - BOOL bRet = pTmpCrsr->MoveSection( fnWhichSect, fnPosSect ); + sal_Bool bRet = pTmpCrsr->MoveSection( fnWhichSect, fnPosSect ); if( bRet ) UpdateCrsr(); return bRet; @@ -599,7 +614,7 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt ) SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); if( pCNd ) { - pFrm = pCNd->GetFrm( &rPt, 0, FALSE )->GetUpper(); + pFrm = pCNd->GetFrm( &rPt, 0, sal_False )->GetUpper(); while( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() ) pFrm = pFrm->IsFlyFrm() ? ((SwFlyFrm*)pFrm)->AnchorFrm() : pFrm->GetUpper(); @@ -607,7 +622,7 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt ) return pFrm; } -BOOL SwCrsrShell::IsInHeaderFooter( BOOL* pbInHeader ) const +sal_Bool SwCrsrShell::IsInHeaderFooter( sal_Bool* pbInHeader ) const { Point aPt; SwFrm* pFrm = ::lcl_IsInHeaderFooter( pCurCrsr->GetPoint()->nNode, aPt ); @@ -616,7 +631,7 @@ BOOL SwCrsrShell::IsInHeaderFooter( BOOL* pbInHeader ) const return 0 != pFrm; } -int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock ) +int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock ) { SET_CURR_SHELL( this ); @@ -636,11 +651,11 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock ) // <-- pTxtNd->HasVisibleNumberingOrBullet() ) { - aTmpState.bInFrontOfLabel = TRUE; // #i27615# + aTmpState.bInFrontOfLabel = sal_True; // #i27615# } else { - aTmpState.bInFrontOfLabel = FALSE; + aTmpState.bInFrontOfLabel = sal_False; } int bRet = CRSR_POSOLD | @@ -686,9 +701,9 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock ) { // im gleichen Frame gelandet? SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm( - &aCharRect.Pos(), 0, FALSE ); + &aCharRect.Pos(), 0, sal_False ); SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm( - &aPt, 0, FALSE ); + &aPt, 0, sal_False ); if( pNew == pOld ) return bRet; } @@ -698,7 +713,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock ) { // SSelection ueber nicht erlaubte Sections oder wenn im Header/Footer // dann in verschiedene - if( !CheckNodesRange( aPos.nNode, pCrsr->GetMark()->nNode, TRUE ) + if( !CheckNodesRange( aPos.nNode, pCrsr->GetMark()->nNode, sal_True ) || ( pFrm && !pFrm->Frm().IsInside( pCrsr->GetMkPos() ) )) return bRet; @@ -721,7 +736,7 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock ) if( !pCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) ) { - USHORT nFlag = SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE; + sal_uInt16 nFlag = SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE; UpdateCrsr( nFlag ); bRet &= ~CRSR_POSOLD; } @@ -743,10 +758,10 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock ) // es gibt keinen gueltigen Inhalt -> Cursor verstecken pVisCrsr->Hide(); // sichtbaren Cursor immer verstecken eMvState = MV_NONE; // Status fuers Crsr-Travelling - bAllProtect = TRUE; + bAllProtect = sal_True; if( GetDoc()->GetDocShell() ) { - GetDoc()->GetDocShell()->SetReadOnlyUI( TRUE ); + GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True ); CallChgLnk(); // UI bescheid sagen! } } @@ -839,7 +854,7 @@ void SwCrsrShell::ClearMark() } -void SwCrsrShell::NormalizePam(BOOL bPointFirst) +void SwCrsrShell::NormalizePam(sal_Bool bPointFirst) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen pCurCrsr->Normalize(bPointFirst); @@ -859,8 +874,8 @@ void SwCrsrShell::SwapPam() // Ansonsten wird er auf die gewaehlte SSelection gesetzt. -BOOL SwCrsrShell::ChgCurrPam( const Point & rPt, - BOOL bTstOnly, BOOL bTstHit ) +sal_Bool SwCrsrShell::ChgCurrPam( const Point & rPt, + sal_Bool bTstOnly, sal_Bool bTstHit ) { SET_CURR_SHELL( this ); @@ -876,7 +891,7 @@ BOOL SwCrsrShell::ChgCurrPam( const Point & rPt, SwCrsrMoveState aTmpState( MV_NONE ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); if ( !GetLayout()->GetCrsrOfst( &aPtPos, aPt, &aTmpState ) && bTstHit ) - return FALSE; + return sal_False; // suche in allen Selektionen nach dieser Position SwShellCrsr* pCmp = (SwShellCrsr*)pCurCrsr; // sicher den Pointer auf Cursor @@ -885,15 +900,15 @@ BOOL SwCrsrShell::ChgCurrPam( const Point & rPt, *pCmp->Start() <= aPtPos && *pCmp->End() > aPtPos ) { if( bTstOnly || pCurCrsr == pCmp ) // ist der aktuelle. - return TRUE; // return ohne Update + return sal_True; // return ohne Update pCurCrsr = pCmp; UpdateCrsr(); // Cursor steht schon richtig - return TRUE; + return sal_True; } } while( pCurCrsr != ( pCmp = dynamic_cast<SwShellCrsr*>(pCmp->GetNext()) ) ); - return FALSE; + return sal_False; } @@ -977,20 +992,20 @@ int SwCrsrShell::CompareCursor( CrsrCompareType eType ) const } -BOOL SwCrsrShell::IsSttPara() const -{ return( pCurCrsr->GetPoint()->nContent == 0 ? TRUE : FALSE ); } +sal_Bool SwCrsrShell::IsSttPara() const +{ return( pCurCrsr->GetPoint()->nContent == 0 ? sal_True : sal_False ); } -BOOL SwCrsrShell::IsEndPara() const -{ return( pCurCrsr->GetPoint()->nContent == pCurCrsr->GetCntntNode()->Len() ? TRUE : FALSE ); } +sal_Bool SwCrsrShell::IsEndPara() const +{ return( pCurCrsr->GetPoint()->nContent == pCurCrsr->GetCntntNode()->Len() ? sal_True : sal_False ); } -BOOL SwCrsrShell::IsInFrontOfLabel() const +sal_Bool SwCrsrShell::IsInFrontOfLabel() const { return pCurCrsr->IsInFrontOfLabel(); } -bool SwCrsrShell::SetInFrontOfLabel( BOOL bNew ) +bool SwCrsrShell::SetInFrontOfLabel( sal_Bool bNew ) { if ( bNew != IsInFrontOfLabel() ) { @@ -1001,12 +1016,12 @@ bool SwCrsrShell::SetInFrontOfLabel( BOOL bNew ) return false; } -BOOL SwCrsrShell::GotoPage( USHORT nPage ) +sal_Bool SwCrsrShell::GotoPage( sal_uInt16 nPage ) { SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SwCrsrSaveState aSaveState( *pCurCrsr ); - BOOL bRet = GetLayout()->SetCurrPage( pCurCrsr, nPage ) && + sal_Bool bRet = GetLayout()->SetCurrPage( pCurCrsr, nPage ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ); if( bRet ) @@ -1015,8 +1030,8 @@ BOOL SwCrsrShell::GotoPage( USHORT nPage ) } -void SwCrsrShell::GetPageNum( USHORT &rnPhyNum, USHORT &rnVirtNum, - BOOL bAtCrsrPos, const BOOL bCalcFrm ) +void SwCrsrShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, + sal_Bool bAtCrsrPos, const sal_Bool bCalcFrm ) { SET_CURR_SHELL( this ); // Seitennummer: die erste sichtbare Seite oder die am Cursor @@ -1037,7 +1052,7 @@ void SwCrsrShell::GetPageNum( USHORT &rnPhyNum, USHORT &rnVirtNum, } -USHORT SwCrsrShell::GetNextPrevPageNum( BOOL bNext ) +sal_uInt16 SwCrsrShell::GetNextPrevPageNum( sal_Bool bNext ) { SET_CURR_SHELL( this ); @@ -1078,7 +1093,7 @@ USHORT SwCrsrShell::GetNextPrevPageNum( BOOL bNext ) } -USHORT SwCrsrShell::GetPageCnt() +sal_uInt16 SwCrsrShell::GetPageCnt() { SET_CURR_SHELL( this ); // gebe die Anzahl der Seiten zurueck @@ -1088,11 +1103,11 @@ USHORT SwCrsrShell::GetPageCnt() // Gehe zur naechsten SSelection -BOOL SwCrsrShell::GoNextCrsr() +sal_Bool SwCrsrShell::GoNextCrsr() { // besteht ueberhaupt ein Ring ? if( pCurCrsr->GetNext() == pCurCrsr ) - return FALSE; + return sal_False; SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -1104,17 +1119,17 @@ BOOL SwCrsrShell::GoNextCrsr() UpdateCrsr(); pCurCrsr->Show(); } - return TRUE; + return sal_True; } // gehe zur vorherigen SSelection -BOOL SwCrsrShell::GoPrevCrsr() +sal_Bool SwCrsrShell::GoPrevCrsr() { // besteht ueberhaupt ein Ring ? if( pCurCrsr->GetNext() == pCurCrsr ) - return FALSE; + return sal_False; SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -1127,7 +1142,7 @@ BOOL SwCrsrShell::GoPrevCrsr() pCurCrsr->Show(); } - return TRUE; + return sal_True; } @@ -1138,11 +1153,11 @@ void SwCrsrShell::Paint( const Rectangle &rRect) // beim Painten immer alle Cursor ausschalten SwRect aRect( rRect ); - BOOL bVis = FALSE; + sal_Bool bVis = sal_False; // ist Cursor sichtbar, dann verstecke den SV-Cursor if( pVisCrsr->IsVisible() && !aRect.IsOver( aCharRect ) ) //JP 18.06.97: ??? { - bVis = TRUE; + bVis = sal_True; pVisCrsr->Hide(); } @@ -1172,13 +1187,13 @@ void SwCrsrShell::Paint( const Rectangle &rRect) void SwCrsrShell::VisPortChgd( const SwRect & rRect ) { SET_CURR_SHELL( this ); - BOOL bVis; // beim Scrollen immer alle Cursor ausschalten + sal_Bool bVis; // beim Scrollen immer alle Cursor ausschalten // ist Cursor sichtbar, dann verstecke den SV-Cursor - if( TRUE == ( bVis = pVisCrsr->IsVisible() )) + if( sal_True == ( bVis = pVisCrsr->IsVisible() )) pVisCrsr->Hide(); - bVisPortChgd = TRUE; + bVisPortChgd = sal_True; aOldRBPos.X() = VisArea().Right(); aOldRBPos.Y() = VisArea().Bottom(); @@ -1192,9 +1207,9 @@ void SwCrsrShell::VisPortChgd( const SwRect & rRect ) pVisCrsr->Show(); if( nCrsrMove ) - bInCMvVisportChgd = TRUE; + bInCMvVisportChgd = sal_True; - bVisPortChgd = FALSE; + bVisPortChgd = sal_False; } // aktualisiere den Crsrs, d.H. setze ihn wieder in den Content. @@ -1286,7 +1301,7 @@ class SwNotifyAccAboutInvalidTextSelections } }; // <-- -void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) +void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd ) { SET_CURR_SHELL( this ); @@ -1298,7 +1313,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) if( ActionPend() && BasicActionPend() ) { if ( eFlags & SwCrsrShell::READONLY ) - bIgnoreReadonly = TRUE; + bIgnoreReadonly = sal_True; return; // wenn nicht, dann kein Update !! } @@ -1307,7 +1322,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) if ( bIgnoreReadonly ) { - bIgnoreReadonly = FALSE; + bIgnoreReadonly = sal_False; eFlags |= SwCrsrShell::READONLY; } @@ -1323,8 +1338,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) if( pTstCrsr->HasMark() && !pBlockCrsr && pDoc->IsIdxInTbl( pTstCrsr->GetPoint()->nNode ) && ( pTblCrsr || - pTstCrsr->GetNode( TRUE )->StartOfSectionNode() != - pTstCrsr->GetNode( FALSE )->StartOfSectionNode() ) ) + pTstCrsr->GetNode( sal_True )->StartOfSectionNode() != + pTstCrsr->GetNode( sal_False )->StartOfSectionNode() ) ) { SwShellCrsr* pITmpCrsr = getShellCrsr( true ); Point aTmpPt( pITmpCrsr->GetPtPos() ); @@ -1361,7 +1376,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) // Second check if mark is in repeated headline: if ( !bInRepeatedHeadline ) { - SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() ); + SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( sal_False )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() ); OSL_ENSURE( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" ); if ( pMarkTblFrm ) @@ -1416,7 +1431,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) } SwCrsrMoveState aTmpState( MV_NONE ); - aTmpState.bRealHeight = TRUE; + aTmpState.bRealHeight = sal_True; if( !pTblFrm->GetCharRect( aCharRect, *pTblCrsr->GetPoint(), &aTmpState ) ) { Point aCentrPt( aCharRect.Center() ); @@ -1485,7 +1500,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) // sind wir vielleicht in einer geschuetzten/versteckten Section ? { SwShellCrsr* pShellCrsr = getShellCrsr( true ); - BOOL bChgState = TRUE; + sal_Bool bChgState = sal_True; const SwSectionNode* pSectNd = pShellCrsr->GetNode()->FindSectionNode(); if( pSectNd && ( pSectNd->GetSection().IsHiddenFlag() || ( !IsReadOnlyAvailable() && @@ -1499,14 +1514,14 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) // alles ist geschuetzt / versteckt -> besonderer Mode if( bAllProtect && !IsReadOnlyAvailable() && pSectNd->GetSection().IsProtectFlag() ) - bChgState = FALSE; + bChgState = sal_False; else { eMvState = MV_NONE; // Status fuers Crsr-Travelling - bAllProtect = TRUE; + bAllProtect = sal_True; if( GetDoc()->GetDocShell() ) { - GetDoc()->GetDocShell()->SetReadOnlyUI( TRUE ); + GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True ); CallChgLnk(); // UI bescheid sagen! } return; @@ -1515,12 +1530,12 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) } if( bChgState ) { - BOOL bWasAllProtect = bAllProtect; - bAllProtect = FALSE; + sal_Bool bWasAllProtect = bAllProtect; + bAllProtect = sal_False; if( bWasAllProtect && GetDoc()->GetDocShell() && GetDoc()->GetDocShell()->IsReadOnlyUI() ) { - GetDoc()->GetDocShell()->SetReadOnlyUI( FALSE ); + GetDoc()->GetDocShell()->SetReadOnlyUI( sal_False ); CallChgLnk(); // UI bescheid sagen! } } @@ -1563,15 +1578,15 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) SwRect aOld( aCharRect ); - BOOL bFirst = TRUE; + sal_Bool bFirst = sal_True; SwCntntFrm *pFrm; int nLoopCnt = 100; SwShellCrsr* pShellCrsr = getShellCrsr( true ); do { - BOOL bAgainst; + sal_Bool bAgainst; do { - bAgainst = FALSE; + bAgainst = sal_False; pFrm = pShellCrsr->GetCntntNode()->GetFrm( &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() ); // ist der Frm nicht mehr vorhanden, dann muss das gesamte Layout @@ -1597,20 +1612,20 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) !pDoc->GetDocShell()->IsReadOnly() || bAllProtect ) ) { // dann suche eine gueltige Position - BOOL bChgState = TRUE; + sal_Bool bChgState = sal_True; if( !FindValidCntntNode(!HasDrawView() || 0 == Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount())) { // alles ist geschuetzt / versteckt -> besonderer Mode if( bAllProtect ) - bChgState = FALSE; + bChgState = sal_False; else { eMvState = MV_NONE; // Status fuers Crsr-Travelling - bAllProtect = TRUE; + bAllProtect = sal_True; if( GetDoc()->GetDocShell() ) { - GetDoc()->GetDocShell()->SetReadOnlyUI( TRUE ); + GetDoc()->GetDocShell()->SetReadOnlyUI( sal_True ); CallChgLnk(); // UI bescheid sagen! } return; @@ -1619,16 +1634,16 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) if( bChgState ) { - BOOL bWasAllProtect = bAllProtect; - bAllProtect = FALSE; + sal_Bool bWasAllProtect = bAllProtect; + bAllProtect = sal_False; if( bWasAllProtect && GetDoc()->GetDocShell() && GetDoc()->GetDocShell()->IsReadOnlyUI() ) { - GetDoc()->GetDocShell()->SetReadOnlyUI( FALSE ); + GetDoc()->GetDocShell()->SetReadOnlyUI( sal_False ); CallChgLnk(); // UI bescheid sagen! } - bAllProtect = FALSE; - bAgainst = TRUE; // nochmal den richigen Frm suchen + bAllProtect = sal_False; + bAgainst = sal_True; // nochmal den richigen Frm suchen } } } while( bAgainst ); @@ -1637,7 +1652,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) { SwCrsrMoveState aTmpState( eMvState ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); - aTmpState.bRealHeight = TRUE; + aTmpState.bRealHeight = sal_True; aTmpState.bRealWidth = IsOverwriteCrsr(); aTmpState.nCursorBidiLevel = pShellCrsr->GetCrsrBidiLevel(); @@ -1683,7 +1698,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) break; } aOld = aCharRect; - bFirst = FALSE; + bFirst = sal_False; // Cursor-Points auf die neuen Positionen setzen pShellCrsr->GetPtPos().X() = aCharRect.Left(); @@ -1705,7 +1720,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd ) //JP 30.04.99: damit das EndAction, beim evtuellen Scrollen, den // SV-Crsr nicht wieder sichtbar macht, wird hier das Flag // gesichert und zurueckgesetzt. - BOOL bSav = bSVCrsrVis; bSVCrsrVis = FALSE; + sal_Bool bSav = bSVCrsrVis; bSVCrsrVis = sal_False; MakeSelVisible(); bSVCrsrVis = bSav; } @@ -1890,20 +1905,20 @@ void SwCrsrShell::Push() /* * Loescht einen Cursor (gesteuert durch bOldCrsr) - * - vom Stack oder ( bOldCrsr = TRUE ) + * - vom Stack oder ( bOldCrsr = sal_True ) * - den aktuellen und der auf dem Stack stehende wird zum aktuellen * * Return: es war auf dem Stack noch einer vorhanden */ -BOOL SwCrsrShell::Pop( BOOL bOldCrsr ) +sal_Bool SwCrsrShell::Pop( sal_Bool bOldCrsr ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen // noch weitere vorhanden ? if( 0 == pCrsrStk ) - return FALSE; + return sal_False; SwShellCrsr *pTmp = 0, *pOldStk = pCrsrStk; @@ -1944,12 +1959,12 @@ BOOL SwCrsrShell::Pop( BOOL bOldCrsr ) pCurCrsr->GetPtPos() = pOldStk->GetPtPos(); delete pOldStk; - if( !pCurCrsr->IsInProtectTable( TRUE ) && + if( !pCurCrsr->IsInProtectTable( sal_True ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) ) UpdateCrsr(); // akt. Cursor Updaten } - return TRUE; + return sal_True; } /* @@ -1969,10 +1984,10 @@ void SwCrsrShell::Combine() if( pCrsrStk->HasMark() ) // nur wenn GetMark gesetzt wurde { #if OSL_DEBUG_LEVEL > 1 - if( !CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, TRUE )) + if( !CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True )) OSL_ENSURE( !this, "StackCrsr & akt. Crsr nicht in gleicher Section." ); #else - CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, TRUE ); + CheckNodesRange( pCrsrStk->GetMark()->nNode, pCurCrsr->GetPoint()->nNode, sal_True ); #endif // kopiere das GetMark if( !pCurCrsr->HasMark() ) @@ -1988,7 +2003,7 @@ void SwCrsrShell::Combine() } delete pCrsrStk; pCrsrStk = pTmp; - if( !pCurCrsr->IsInProtectTable( TRUE ) && + if( !pCurCrsr->IsInProtectTable( sal_True ) && !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) ) UpdateCrsr(); // akt. Cursor Updaten @@ -2013,7 +2028,7 @@ void SwCrsrShell::HideCrsrs() -void SwCrsrShell::ShowCrsrs( BOOL bCrsrVis ) +void SwCrsrShell::ShowCrsrs( sal_Bool bCrsrVis ) { if( !bHasFocus || bAllProtect || bBasicHideCrsr ) return; @@ -2033,7 +2048,7 @@ void SwCrsrShell::ShowCrsr() { if( !bBasicHideCrsr ) { - bSVCrsrVis = TRUE; + bSVCrsrVis = sal_True; UpdateCrsr(); } } @@ -2043,7 +2058,7 @@ void SwCrsrShell::HideCrsr() { if( !bBasicHideCrsr ) { - bSVCrsrVis = FALSE; + bSVCrsrVis = sal_False; // evt. die sel. Bereiche aufheben !! SET_CURR_SHELL( this ); pVisCrsr->Hide(); @@ -2055,25 +2070,25 @@ void SwCrsrShell::ShLooseFcs() { if( !bBasicHideCrsr ) HideCrsrs(); - bHasFocus = FALSE; + bHasFocus = sal_False; } -void SwCrsrShell::ShGetFcs( BOOL bUpdate ) +void SwCrsrShell::ShGetFcs( sal_Bool bUpdate ) { - bHasFocus = TRUE; + bHasFocus = sal_True; if( !bBasicHideCrsr && VisArea().Width() ) { - UpdateCrsr( static_cast<USHORT>( bUpdate ? + UpdateCrsr( static_cast<sal_uInt16>( bUpdate ? SwCrsrShell::CHKRANGE|SwCrsrShell::SCROLLWIN : SwCrsrShell::CHKRANGE ) ); - ShowCrsrs( bSVCrsrVis ? TRUE : FALSE ); + ShowCrsrs( bSVCrsrVis ? sal_True : sal_False ); } } // gebe den aktuellen Frame, in dem der Cursor steht, zurueck -SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const +SwCntntFrm *SwCrsrShell::GetCurrFrm( const sal_Bool bCalcFrm ) const { SET_CURR_SHELL( (ViewShell*)this ); SwCntntFrm *pRet = 0; @@ -2082,16 +2097,16 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const { if ( bCalcFrm ) { - const USHORT* pST = &nStartAction; - ++(*((USHORT*)pST)); + const sal_uInt16* pST = &nStartAction; + ++(*((sal_uInt16*)pST)); const Size aOldSz( GetDocSize() ); pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() ); - --(*((USHORT*)pST)); + --(*((sal_uInt16*)pST)); if( aOldSz != GetDocSize() ) ((SwCrsrShell*)this)->SizeChgNotify(); } else - pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), FALSE); + pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), sal_False); } return pRet; } @@ -2103,11 +2118,11 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const void SwCrsrShell::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) { - const USHORT nWhich = pOld ? + const sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : - sal::static_int_cast<USHORT>(RES_MSG_BEGIN); + sal::static_int_cast<sal_uInt16>(RES_MSG_BEGIN); if( bCallChgLnk && ( nWhich < RES_MSG_BEGIN || nWhich >= RES_MSG_END || @@ -2115,7 +2130,7 @@ void SwCrsrShell::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) nWhich == RES_ATTRSET_CHG )) // die Messages werden nicht weitergemeldet //MA 07. Apr. 94 fix(6681): RES_UPDATE_ATTR wird implizit vom - //SwTxtNode::Insert(SwTxtHint*, USHORT) abgesetzt; hier wird reagiert und + //SwTxtNode::Insert(SwTxtHint*, sal_uInt16) abgesetzt; hier wird reagiert und //vom Insert brauch nicht mehr die Keule RES_FMT_CHG versandt werden. CallChgLnk(); @@ -2129,12 +2144,12 @@ void SwCrsrShell::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) // also, ob GetMark gesetzt und SPoint und GetMark unterschiedlich sind. -BOOL SwCrsrShell::HasSelection() const +sal_Bool SwCrsrShell::HasSelection() const { const SwPaM* pCrsr = getShellCrsr( true ); return( IsTableMode() || ( pCrsr->HasMark() && *pCrsr->GetPoint() != *pCrsr->GetMark()) - ? TRUE : FALSE ); + ? sal_True : sal_False ); } @@ -2143,12 +2158,12 @@ void SwCrsrShell::CallChgLnk() // innerhalb von Start-/End-Action kein Call, sondern nur merken, // das sich etwas geaendert hat. Wird bei EndAction beachtet. if( BasicActionPend() ) - bChgCallFlag = TRUE; // das Change merken + bChgCallFlag = sal_True; // das Change merken else if( aChgLnk.IsSet() ) { if( bCallChgLnk ) aChgLnk.Call( this ); - bChgCallFlag = FALSE; // Flag zuruecksetzen + bChgCallFlag = sal_False; // Flag zuruecksetzen } } @@ -2190,7 +2205,7 @@ String SwCrsrShell::GetText() const } // hole vom Start/Ende der akt. SSelection das nte Zeichen -sal_Unicode SwCrsrShell::GetChar( BOOL bEnd, long nOffset ) +sal_Unicode SwCrsrShell::GetChar( sal_Bool bEnd, long nOffset ) { if( IsTableMode() ) // im TabelleMode nicht moeglich return 0; @@ -2214,10 +2229,10 @@ sal_Unicode SwCrsrShell::GetChar( BOOL bEnd, long nOffset ) // erweiter die akt. SSelection am Anfang/Ende um n Zeichen -BOOL SwCrsrShell::ExtendSelection( BOOL bEnd, xub_StrLen nCount ) +sal_Bool SwCrsrShell::ExtendSelection( sal_Bool bEnd, xub_StrLen nCount ) { if( !pCurCrsr->HasMark() || IsTableMode() ) - return FALSE; // keine Selektion + return sal_False; // keine Selektion SwPosition* pPos = bEnd ? pCurCrsr->End() : pCurCrsr->Start(); SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); @@ -2229,47 +2244,47 @@ BOOL SwCrsrShell::ExtendSelection( BOOL bEnd, xub_StrLen nCount ) if( ( nPos + nCount ) <= pTxtNd->GetTxt().Len() ) nPos = nPos + nCount; else - return FALSE; // nicht mehr moeglich + return sal_False; // nicht mehr moeglich } else if( nPos >= nCount ) nPos = nPos - nCount; else - return FALSE; // nicht mehr moeglich + return sal_False; // nicht mehr moeglich SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, pPos->nContent = nPos; UpdateCrsr(); - return TRUE; + return sal_True; } // setze nur den sichtbaren Cursor an die angegebene Dokument-Pos. -// returnt FALSE: wenn der SPoint vom Layout korrigiert wurde. +// returnt sal_False: wenn der SPoint vom Layout korrigiert wurde. -BOOL SwCrsrShell::SetVisCrsr( const Point &rPt ) +sal_Bool SwCrsrShell::SetVisCrsr( const Point &rPt ) { SET_CURR_SHELL( this ); Point aPt( rPt ); SwPosition aPos( *pCurCrsr->GetPoint() ); SwCrsrMoveState aTmpState( MV_SETONLYTEXT ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); - aTmpState.bRealHeight = TRUE; + aTmpState.bRealHeight = sal_True; - BOOL bRet = GetLayout()->GetCrsrOfst( &aPos, aPt /*, &aTmpState*/ ); + sal_Bool bRet = GetLayout()->GetCrsrOfst( &aPos, aPt /*, &aTmpState*/ ); - SetInFrontOfLabel( FALSE ); // #i27615# + SetInFrontOfLabel( sal_False ); // #i27615# // nur in TextNodes anzeigen !! SwTxtNode* pTxtNd = aPos.nNode.GetNode().GetTxtNode(); if( !pTxtNd ) - return FALSE; + return sal_False; const SwSectionNode* pSectNd = pTxtNd->FindSectionNode(); if( pSectNd && (pSectNd->GetSection().IsHiddenFlag() || ( !IsReadOnlyAvailable() && pSectNd->GetSection().IsProtectFlag())) ) - return FALSE; + return sal_False; SwCntntFrm *pFrm = pTxtNd->GetFrm( &aPt, &aPos ); if ( Imp()->IsIdleAction() ) @@ -2280,7 +2295,7 @@ BOOL SwCrsrShell::SetVisCrsr( const Point &rPt ) if( aTmp == aCharRect && // BUG 10137: bleibt der Cursor auf der pVisCrsr->IsVisible() ) // Position nicht hidden & showen - return TRUE; + return sal_True; pVisCrsr->Hide(); // sichtbaren Cursor immer verstecken if( IsScrollMDI( this, aCharRect )) @@ -2298,13 +2313,13 @@ BOOL SwCrsrShell::SetVisCrsr( const Point &rPt ) aCrsrHeight.Y() = aCharRect.Height(); } - pVisCrsr->SetDragCrsr( TRUE ); + pVisCrsr->SetDragCrsr( sal_True ); pVisCrsr->Show(); // wieder anzeigen } return bRet; } -BOOL SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const +sal_Bool SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const { Point aPt( rPt ); SwPaM aPam( *pCurCrsr->GetPoint() ); @@ -2316,10 +2331,10 @@ BOOL SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const // returne die Anzahl der Cursor im Ring (Flag besagt ob man nur // aufgepspannte haben will - sprich etwas selektiert ist (Basic)) -USHORT SwCrsrShell::GetCrsrCnt( BOOL bAll ) const +sal_uInt16 SwCrsrShell::GetCrsrCnt( sal_Bool bAll ) const { Ring* pTmp = GetCrsr()->GetNext(); - USHORT n = (bAll || ( pCurCrsr->HasMark() && + sal_uInt16 n = (bAll || ( pCurCrsr->HasMark() && *pCurCrsr->GetPoint() != *pCurCrsr->GetMark())) ? 1 : 0; while( pTmp != pCurCrsr ) { @@ -2332,10 +2347,10 @@ USHORT SwCrsrShell::GetCrsrCnt( BOOL bAll ) const } -BOOL SwCrsrShell::IsStartOfDoc() const +sal_Bool SwCrsrShell::IsStartOfDoc() const { if( pCurCrsr->GetPoint()->nContent.GetIndex() ) - return FALSE; + return sal_False; // Hinter EndOfIcons kommt die Content-Section (EndNd+StNd+CntntNd) SwNodeIndex aIdx( GetDoc()->GetNodes().GetEndOfExtras(), 2 ); @@ -2345,7 +2360,7 @@ BOOL SwCrsrShell::IsStartOfDoc() const } -BOOL SwCrsrShell::IsEndOfDoc() const +sal_Bool SwCrsrShell::IsEndOfDoc() const { SwNodeIndex aIdx( GetDoc()->GetNodes().GetEndOfContent(), -1 ); SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); @@ -2361,10 +2376,10 @@ BOOL SwCrsrShell::IsEndOfDoc() const // Cursor auf seinen TextNode (oder StartNode?). // Beim naechsten ::GetCrsr werden sie wieder alle erzeugt // Wird fuers Drag&Drop / ClipBorad-Paste in Tabellen benoetigt. -BOOL SwCrsrShell::ParkTblCrsr() +sal_Bool SwCrsrShell::ParkTblCrsr() { if( !pTblCrsr ) - return FALSE; + return sal_False; pTblCrsr->ParkCrsr(); @@ -2376,7 +2391,7 @@ BOOL SwCrsrShell::ParkTblCrsr() *pCurCrsr->GetMark() = *pCurCrsr->GetPoint() = *pTblCrsr->GetPoint(); pCurCrsr->DeleteMark(); - return TRUE; + return sal_True; } /*********************************************************************** @@ -2394,7 +2409,7 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing ) SwPaM *pTmpDel = 0, *pTmp = *ppDelRing; // durchsuche den gesamten Ring - BOOL bGoNext; + sal_Bool bGoNext; do { const SwPosition *pTmpStt = pTmp->Start(), *pTmpEnd = pTmp->GetPoint() == pTmpStt ? @@ -2415,22 +2430,22 @@ void SwCrsrShell::_ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing ) if( *pStt < *pTmpEnd ) pTmpDel = pTmp; - bGoNext = TRUE; + bGoNext = sal_True; if( pTmpDel ) // ist der Pam im Bereich ?? loesche ihn { - BOOL bDelete = TRUE; + sal_Bool bDelete = sal_True; if( *ppDelRing == pTmpDel ) { if( *ppDelRing == pCurCrsr ) { - if( TRUE == ( bDelete = GoNextCrsr() )) + if( sal_True == ( bDelete = GoNextCrsr() )) { - bGoNext = FALSE; + bGoNext = sal_False; pTmp = (SwPaM*)pTmp->GetNext(); } } else - bDelete = FALSE; // StackCrsr nie loeschen !! + bDelete = sal_False; // StackCrsr nie loeschen !! } if( bDelete ) @@ -2531,9 +2546,9 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin ) bAllProtect = bVisPortChgd = bChgCallFlag = bInCMvVisportChgd = bGCAttr = bIgnoreReadonly = bSelTblCells = bBasicHideCrsr = - bOverwriteCrsr = FALSE; - bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = TRUE; - bSetCrsrInReadOnly = TRUE; + bOverwriteCrsr = sal_False; + bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = sal_True; + bSetCrsrInReadOnly = sal_True; pVisCrsr = new SwVisCrsr( this ); mbMacroExecAllowed = rShell.IsMacroExecAllowed(); } @@ -2570,9 +2585,9 @@ SwCrsrShell::SwCrsrShell( SwDoc& rDoc, Window *pInitWin, bAllProtect = bVisPortChgd = bChgCallFlag = bInCMvVisportChgd = bGCAttr = bIgnoreReadonly = bSelTblCells = bBasicHideCrsr = - bOverwriteCrsr = FALSE; - bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = TRUE; - bSetCrsrInReadOnly = TRUE; + bOverwriteCrsr = sal_False; + bCallChgLnk = bHasFocus = bSVCrsrVis = bAutoUpdateCells = sal_True; + bSetCrsrInReadOnly = sal_True; pVisCrsr = new SwVisCrsr( this ); mbMacroExecAllowed = true; @@ -2627,13 +2642,13 @@ SwShellCrsr* SwCrsrShell::getShellCrsr( bool bBlock ) //Sollte fuer das Clipboard der WaitPtr geschaltet werden? //Warten bei TableMode, Mehrfachselektion und mehr als x Selektieren Absaetzen. -BOOL SwCrsrShell::ShouldWait() const +sal_Bool SwCrsrShell::ShouldWait() const { if ( IsTableMode() || GetCrsrCnt() > 1 ) - return TRUE; + return sal_True; if( HasDrawView() && GetDrawView()->GetMarkedObjectList().GetMarkCount() ) - return TRUE; + return sal_True; SwPaM* pPam = GetCrsr(); return pPam->Start()->nNode.GetIndex() + 10 < @@ -2641,7 +2656,7 @@ BOOL SwCrsrShell::ShouldWait() const } -USHORT SwCrsrShell::UpdateTblSelBoxes() +sal_uInt16 SwCrsrShell::UpdateTblSelBoxes() { if( pTblCrsr && ( pTblCrsr->IsChgd() || !pTblCrsr->GetBoxesCount() )) GetLayout()->MakeTblCrsrs( *pTblCrsr ); @@ -2685,18 +2700,18 @@ void SwCrsrShell::MakeSelVisible() // suche eine gueltige ContentPosition (nicht geschuetzt/nicht versteckt) -BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) +sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText ) { if( pTblCrsr ) // was soll ich jetzt machen ?? { OSL_ENSURE( !this, "TabellenSelection nicht aufgehoben!" ); - return FALSE; + return sal_False; } //JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt if( !bAllProtect && GetDoc()->GetDocShell() && GetDoc()->GetDocShell()->IsReadOnlyUI() ) - return TRUE; + return sal_True; // dann raus da! if( pCurCrsr->HasMark() ) @@ -2704,12 +2719,12 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) // als erstes mal auf Rahmen abpruefen SwNodeIndex& rNdIdx = pCurCrsr->GetPoint()->nNode; - ULONG nNdIdx = rNdIdx.GetIndex(); // sichern + sal_uLong nNdIdx = rNdIdx.GetIndex(); // sichern SwNodes& rNds = pDoc->GetNodes(); SwCntntNode* pCNd = rNdIdx.GetNode().GetCntntNode(); const SwCntntFrm * pFrm; - if( pCNd && 0 != (pFrm = pCNd->GetFrm(0,pCurCrsr->GetPoint(),FALSE)) && + if( pCNd && 0 != (pFrm = pCNd->GetFrm(0,pCurCrsr->GetPoint(),sal_False)) && !IsReadOnlyAvailable() && pFrm->IsProtected() && nNdIdx < rNds.GetEndOfExtras().GetIndex() ) { @@ -2719,17 +2734,17 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) aPam.GetMark()->nNode = rNds.GetEndOfContent(); aPam.GetPoint()->nNode = *pCNd->EndOfSectionNode(); - BOOL bFirst = FALSE; - if( 0 == (pCNd = ::GetNode( aPam, bFirst, fnMoveForward, FALSE ))) + sal_Bool bFirst = sal_False; + if( 0 == (pCNd = ::GetNode( aPam, bFirst, fnMoveForward, sal_False ))) { aPam.GetMark()->nNode = *rNds.GetEndOfPostIts().StartOfSectionNode(); - pCNd = ::GetNode( aPam, bFirst, fnMoveBackward, FALSE ); + pCNd = ::GetNode( aPam, bFirst, fnMoveBackward, sal_False ); } if( !pCNd ) // sollte nie passieren !!! { rNdIdx = nNdIdx; // alten Node zurueck - return FALSE; + return sal_False; } *pCurCrsr->GetPoint() = *aPam.GetPoint(); } @@ -2742,7 +2757,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) nNdIdx = rNdIdx.GetIndex(); } - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; // #i9059# cursor may not stand in protected cells // (unless cursor in protected areas is OK.) @@ -2785,15 +2800,15 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) typedef SwCntntNode* (SwNodes:: *FNGoSection)( SwNodeIndex *, int, int ) const; FNGoSection funcGoSection = &SwNodes::GoNextSection; - bOk = FALSE; + bOk = sal_False; for( int nLoopCnt = 0; !bOk && nLoopCnt < 2; ++nLoopCnt ) { - BOOL bWeiter; + sal_Bool bWeiter; do { - bWeiter = FALSE; + bWeiter = sal_False; while( 0 != ( pCNd = (rNds.*funcGoSection)( &rNdIdx, - TRUE, !IsReadOnlyAvailable() )) ) + sal_True, !IsReadOnlyAvailable() )) ) { // in eine Tabelle verschoben -> pruefe ob die // vielleicht geschuetzt ist @@ -2802,14 +2817,14 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) SwCallLink aTmp( *this ); SwCrsrSaveState aSaveState( *pCurCrsr ); aTmp.nNdTyp = 0; // im DTOR nichts machen! - if( !pCurCrsr->IsInProtectTable( TRUE, TRUE ) ) + if( !pCurCrsr->IsInProtectTable( sal_True, sal_True ) ) { const SwSectionNode* pSNd = pCNd->FindSectionNode(); if( !pSNd || !pSNd->GetSection().IsHiddenFlag() || (!IsReadOnlyAvailable() && pSNd->GetSection().IsProtectFlag() )) { - bOk = TRUE; + bOk = sal_True; break; // eine nicht geschuetzte Zelle gef. } continue; // dann weiter suchen @@ -2817,7 +2832,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) } else { - bOk = TRUE; + bOk = sal_True; break; // eine nicht geschuetzte Zelle gef. } } @@ -2825,13 +2840,13 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) if( bOk && rNdIdx.GetIndex() < rNds.GetEndOfExtras().GetIndex() ) { // Teste mal auf Fly - kann auch noch geschuetzt sein!! - if( 0 == (pFrm = pCNd->GetFrm(0,0,FALSE)) || + if( 0 == (pFrm = pCNd->GetFrm(0,0,sal_False)) || ( !IsReadOnlyAvailable() && pFrm->IsProtected() ) || ( bOnlyText && pCNd->IsNoTxtNode() ) ) { // dann weiter suchen! - bOk = FALSE; - bWeiter = TRUE; + bOk = sal_False; + bWeiter = sal_True; } } } while( bWeiter ); @@ -2856,7 +2871,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText ) // falls Cursor im versteckten Bereich ist, auf jedenfall schon mal // verschieben!! - if( !pCNd || !pCNd->GetFrm(0,0,FALSE) ) + if( !pCNd || !pCNd->GetFrm(0,0,sal_False) ) { SwCrsrMoveState aTmpState( MV_NONE ); aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); @@ -2873,13 +2888,13 @@ void SwCrsrShell::NewCoreSelection() } -BOOL SwCrsrShell::IsCrsrReadonly() const +sal_Bool SwCrsrShell::IsCrsrReadonly() const { if ( GetViewOptions()->IsReadonly() || // Formular view GetViewOptions()->IsFormView() ) { - SwFrm *pFrm = GetCurrFrm( FALSE ); + SwFrm *pFrm = GetCurrFrm( sal_False ); const SwFlyFrm* pFly; const SwSection* pSection; @@ -2889,24 +2904,24 @@ BOOL SwCrsrShell::IsCrsrReadonly() const !pFly->Lower()->IsNoTxtFrm() && !GetDrawView()->GetMarkedObjectList().GetMarkCount() ) { - return FALSE; + return sal_False; } // edit in readonly sections else if ( pFrm && pFrm->IsInSct() && 0 != ( pSection = pFrm->FindSctFrm()->GetSection() ) && pSection->IsEditInReadonlyFlag() ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // darf der Cursor in ReadOnlyBereiche? -void SwCrsrShell::SetReadOnlyAvailable( BOOL bFlag ) +void SwCrsrShell::SetReadOnlyAvailable( sal_Bool bFlag ) { // im GlobalDoc darf NIE umgeschaltet werden if( (!GetDoc()->GetDocShell() || @@ -2925,9 +2940,9 @@ void SwCrsrShell::SetReadOnlyAvailable( BOOL bFlag ) } } -BOOL SwCrsrShell::HasReadonlySel() const +sal_Bool SwCrsrShell::HasReadonlySel() const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( IsReadOnlyAvailable() || GetViewOptions()->IsFormView() ) { if( pTblCrsr ) @@ -2939,16 +2954,16 @@ BOOL SwCrsrShell::HasReadonlySel() const do { if( pCrsr->HasReadonlySel( GetViewOptions()->IsFormView() ) ) - bRet = TRUE; + bRet = sal_True; } while( !bRet && pCurCrsr != ( pCrsr = (SwPaM*)pCrsr->GetNext() )); } } return bRet; } -BOOL SwCrsrShell::IsSelFullPara() const +sal_Bool SwCrsrShell::IsSelFullPara() const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pCurCrsr->GetPoint()->nNode.GetIndex() == pCurCrsr->GetMark()->nNode.GetIndex() && pCurCrsr == pCurCrsr->GetNext() ) @@ -2982,13 +2997,13 @@ short SwCrsrShell::GetTextDirection( const Point* pPt ) const return pDoc->GetTextDirection( aPos, &aPt ); } -BOOL SwCrsrShell::IsInVerticalText( const Point* pPt ) const +sal_Bool SwCrsrShell::IsInVerticalText( const Point* pPt ) const { const short nDir = GetTextDirection( pPt ); return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir; } -BOOL SwCrsrShell::IsInRightToLeftText( const Point* pPt ) const +sal_Bool SwCrsrShell::IsInRightToLeftText( const Point* pPt ) const { const short nDir = GetTextDirection( pPt ); // GetTextDirection uses FRMDIR_VERT_TOP_LEFT to indicate RTL in @@ -3029,39 +3044,39 @@ bool SwCrsrShell::SelectHiddenRange() } // die Suchfunktionen -ULONG SwCrsrShell::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes, +sal_uLong SwCrsrShell::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnde, - BOOL& bCancel, + sal_Bool& bCancel, FindRanges eRng, int bReplace ) { if( pTblCrsr ) GetCrsr(); delete pTblCrsr, pTblCrsr = 0; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - ULONG nRet = pCurCrsr->Find( rSearchOpt, bSearchInNotes, eStart, eEnde, bCancel, eRng, bReplace ); + sal_uLong nRet = pCurCrsr->Find( rSearchOpt, bSearchInNotes, eStart, eEnde, bCancel, eRng, bReplace ); if( nRet || bCancel ) UpdateCrsr(); return nRet; } -ULONG SwCrsrShell::Find( const SwTxtFmtColl& rFmtColl, +sal_uLong SwCrsrShell::Find( const SwTxtFmtColl& rFmtColl, SwDocPositions eStart, SwDocPositions eEnde, - BOOL& bCancel, + sal_Bool& bCancel, FindRanges eRng, const SwTxtFmtColl* pReplFmt ) { if( pTblCrsr ) GetCrsr(); delete pTblCrsr, pTblCrsr = 0; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - ULONG nRet = pCurCrsr->Find( rFmtColl, eStart, eEnde, bCancel, eRng, pReplFmt ); + sal_uLong nRet = pCurCrsr->Find( rFmtColl, eStart, eEnde, bCancel, eRng, pReplFmt ); if( nRet ) UpdateCrsr(); return nRet; } -ULONG SwCrsrShell::Find( const SfxItemSet& rSet, BOOL bNoCollections, +sal_uLong SwCrsrShell::Find( const SfxItemSet& rSet, sal_Bool bNoCollections, SwDocPositions eStart, SwDocPositions eEnde, - BOOL& bCancel, + sal_Bool& bCancel, FindRanges eRng, const SearchOptions* pSearchOpt, const SfxItemSet* rReplSet ) { @@ -3069,7 +3084,7 @@ ULONG SwCrsrShell::Find( const SfxItemSet& rSet, BOOL bNoCollections, GetCrsr(); delete pTblCrsr, pTblCrsr = 0; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - ULONG nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnde, bCancel, + sal_uLong nRet = pCurCrsr->Find( rSet, bNoCollections, eStart, eEnde, bCancel, eRng, pSearchOpt, rReplSet ); if( nRet ) UpdateCrsr(); @@ -3239,7 +3254,7 @@ void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes, std::vector< rtl::OUString > aSmartTagTypes; std::vector< uno::Reference< container::XStringKeyMap > > aStringKeyMaps; - for ( USHORT i = 0; i < rSmartTagList.Count(); ++i ) + for ( sal_uInt16 i = 0; i < rSmartTagList.Count(); ++i ) { const xub_StrLen nSTPos = rSmartTagList.Pos( i ); const xub_StrLen nSTLen = rSmartTagList.Len( i ); @@ -3261,7 +3276,7 @@ void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes, rStringKeyMaps.realloc( aSmartTagTypes.size() ); std::vector< rtl::OUString >::const_iterator aTypesIter = aSmartTagTypes.begin(); - USHORT i = 0; + sal_uInt16 i = 0; for ( aTypesIter = aSmartTagTypes.begin(); aTypesIter != aSmartTagTypes.end(); ++aTypesIter ) rSmartTagTypes[i++] = *aTypesIter; @@ -3310,7 +3325,7 @@ void SwCrsrShell::GetSmartTagTerm( uno::Sequence< rtl::OUString >& rSmartTagType if( pSmartTagList->InWrongWord( nBegin, nLen ) && !pNode->IsSymbol(nBegin) ) { - const USHORT nIndex = pSmartTagList->GetWrongPos( nBegin ); + const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin ); const SwWrongList* pSubList = pSmartTagList->SubList( nIndex ); if ( pSubList ) { @@ -3354,7 +3369,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, if( pSmartTagList->InWrongWord( nBegin, nLen ) && !pNode->IsSymbol(nBegin) ) { - const USHORT nIndex = pSmartTagList->GetWrongPos( nBegin ); + const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin ); const SwWrongList* pSubList = pSmartTagList->SubList( nIndex ); if ( pSubList ) { @@ -3374,7 +3389,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, xub_StrLen nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); RightMargin(); xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); - Pop(FALSE); + Pop(sal_False); // make sure the selection build later from the // data below does not include footnotes and other @@ -3405,16 +3420,16 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, rContent = nWordStart; SwRect aStartRect; SwCrsrMoveState aState; - aState.bRealWidth = TRUE; + aState.bRealWidth = sal_True; SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); - SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), FALSE); + SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), sal_False); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd - 1; SwRect aEndRect; pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); - Pop(FALSE); + Pop(sal_False); } } } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 94c1603d30..d46a5a4601 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -38,6 +38,7 @@ #include <svx/svdobj.hxx> #include <crsrsh.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <pagefrm.hxx> #include <cntfrm.hxx> #include <rootfrm.hxx> @@ -80,9 +81,9 @@ using namespace ::com::sun::star; // zum naechsten/vorhergehenden Punkt auf gleicher Ebene -BOOL SwCrsrShell::GotoNextNum() +sal_Bool SwCrsrShell::GotoNextNum() { - BOOL bRet = GetDoc()->GotoNextNum( *pCurCrsr->GetPoint() ); + sal_Bool bRet = GetDoc()->GotoNextNum( *pCurCrsr->GetPoint() ); if( bRet ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, @@ -120,9 +121,9 @@ BOOL SwCrsrShell::GotoNextNum() } -BOOL SwCrsrShell::GotoPrevNum() +sal_Bool SwCrsrShell::GotoPrevNum() { - BOOL bRet = GetDoc()->GotoPrevNum( *pCurCrsr->GetPoint() ); + sal_Bool bRet = GetDoc()->GotoPrevNum( *pCurCrsr->GetPoint() ); if( bRet ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, @@ -161,7 +162,7 @@ BOOL SwCrsrShell::GotoPrevNum() // springe aus dem Content zum Header -BOOL SwCrsrShell::GotoHeaderTxt() +sal_Bool SwCrsrShell::GotoHeaderTxt() { const SwFrm* pFrm = GetCurrFrm()->FindPageFrm(); while( pFrm && !pFrm->IsHeaderFrm() ) @@ -190,7 +191,7 @@ BOOL SwCrsrShell::GotoHeaderTxt() // springe aus dem Content zum Footer -BOOL SwCrsrShell::GotoFooterTxt() +sal_Bool SwCrsrShell::GotoFooterTxt() { const SwPageFrm* pFrm = GetCurrFrm()->FindPageFrm(); if( pFrm ) @@ -226,9 +227,9 @@ BOOL SwCrsrShell::GotoFooterTxt() return 0 != pFrm; } -BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader ) +sal_Bool SwCrsrShell::SetCrsrInHdFt( sal_uInt16 nDescNo, sal_Bool bInHeader ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SwDoc *pMyDoc = GetDoc(); SET_CURR_SHELL( this ); @@ -238,7 +239,7 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader ) // dann den akt. nehmen const SwPageFrm* pPage = GetCurrFrm()->FindPageFrm(); if( pPage ) - for( USHORT i = 0; i < pMyDoc->GetPageDescCnt(); ++i ) + for( sal_uInt16 i = 0; i < pMyDoc->GetPageDescCnt(); ++i ) if( pPage->GetPageDesc() == &const_cast<const SwDoc *>(pMyDoc)->GetPageDesc( i ) ) { @@ -277,7 +278,7 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader ) const SwFrm* pFrm; Point aPt( pCurCrsr->GetPtPos() ); - if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt, 0, FALSE ) )) + if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt, 0, sal_False ) )) { // dann kann der Cursor ja auch hinein gesetzt werden SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -301,13 +302,13 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader ) // springe zum naechsten Verzeichnis -BOOL SwCrsrShell::GotoNextTOXBase( const String* pName ) +sal_Bool SwCrsrShell::GotoNextTOXBase( const String* pName ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwSectionFmts& rFmts = GetDoc()->GetSections(); SwCntntNode* pFnd = 0; - for( USHORT n = rFmts.Count(); n; ) + for( sal_uInt16 n = rFmts.Count(); n; ) { const SwSection* pSect = rFmts[ --n ]->GetSection(); const SwSectionNode* pSectNd; @@ -348,13 +349,13 @@ BOOL SwCrsrShell::GotoNextTOXBase( const String* pName ) // springe zum vorherigen Verzeichnis -BOOL SwCrsrShell::GotoPrevTOXBase( const String* pName ) +sal_Bool SwCrsrShell::GotoPrevTOXBase( const String* pName ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwSectionFmts& rFmts = GetDoc()->GetSections(); SwCntntNode* pFnd = 0; - for( USHORT n = rFmts.Count(); n; ) + for( sal_uInt16 n = rFmts.Count(); n; ) { const SwSection* pSect = rFmts[ --n ]->GetSection(); const SwSectionNode* pSectNd; @@ -395,12 +396,12 @@ BOOL SwCrsrShell::GotoPrevTOXBase( const String* pName ) // springe zum Verzeichnis vom TOXMark -BOOL SwCrsrShell::GotoTOXMarkBase() +sal_Bool SwCrsrShell::GotoTOXMarkBase() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SwTOXMarks aMarks; - USHORT nCnt = GetDoc()->GetCurTOXMark( *pCurCrsr->GetPoint(), aMarks ); + sal_uInt16 nCnt = GetDoc()->GetCurTOXMark( *pCurCrsr->GetPoint(), aMarks ); if( nCnt ) { // dann nehme den 1. und hole den Verzeichnis-Typ. @@ -446,12 +447,12 @@ BOOL SwCrsrShell::GotoTOXMarkBase() // springe zur naechsten (vorherigen) Tabellenformel // optional auch nur zu kaputten Formeln springen -BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) +sal_Bool SwCrsrShell::GotoNxtPrvTblFormula( sal_Bool bNext, sal_Bool bOnlyErrors ) { if( IsTableMode() ) - return FALSE; + return sal_False; - BOOL bFnd = FALSE; + sal_Bool bFnd = sal_False; SwPosition& rPos = *pCurCrsr->GetPoint(); Point aPt; @@ -474,15 +475,15 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() ) // auch beim Einsammeln wird nur der erste Frame benutzt! aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->GetFrm( - &aPt, &rPos, FALSE ) ); + &aPt, &rPos, sal_False ) ); { const SfxPoolItem* pItem; const SwTableBox* pTBox; - USHORT n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount( RES_BOXATR_FORMULA ); + sal_uInt32 n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_BOXATR_FORMULA ); for( n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem( + if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2( RES_BOXATR_FORMULA, n ) ) && 0 != (pTBox = ((SwTblBoxFormula*)pItem)->GetTableBox() ) && pTBox->GetSttNd() && @@ -493,7 +494,7 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) const SwCntntFrm* pCFrm; SwNodeIndex aIdx( *pTBox->GetSttNd() ); const SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx ); - if( pCNd && 0 != ( pCFrm = pCNd->GetFrm( &aPt, 0, FALSE ) ) && + if( pCNd && 0 != ( pCFrm = pCNd->GetFrm( &aPt, 0, sal_False ) ) && (IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { _SetGetExpFld aCmp( *pTBox ); @@ -503,7 +504,7 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) : ( aCmp < aCurGEF && aFndGEF < aCmp )) { aFndGEF = aCmp; - bFnd = TRUE; + bFnd = sal_True; } } } @@ -527,12 +528,12 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors ) } // springe zum naechsten (vorherigen) Verzeichniseintrag -BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext ) +sal_Bool SwCrsrShell::GotoNxtPrvTOXMark( sal_Bool bNext ) { if( IsTableMode() ) - return FALSE; + return sal_False; - BOOL bFnd = FALSE; + sal_Bool bFnd = sal_False; SwPosition& rPos = *pCurCrsr->GetPoint(); Point aPt; @@ -544,21 +545,21 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext ) if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() ) // auch beim Einsammeln wird nur der erste Frame benutzt! aCurGEF.SetBodyPos( *rPos.nNode.GetNode(). - GetCntntNode()->GetFrm( &aPt, &rPos, FALSE ) ); + GetCntntNode()->GetFrm( &aPt, &rPos, sal_False ) ); { const SfxPoolItem* pItem; const SwCntntFrm* pCFrm; const SwTxtNode* pTxtNd; const SwTxtTOXMark* pTxtTOX; - USHORT n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount( RES_TXTATR_TOXMARK ); + sal_uInt32 n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_TXTATR_TOXMARK ); for( n = 0; n < nMaxItems; ++n ) - if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem( + if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2( RES_TXTATR_TOXMARK, n ) ) && 0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) && ( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() && - 0 != ( pCFrm = pTxtNd->GetFrm( &aPt, 0, FALSE )) && + 0 != ( pCFrm = pTxtNd->GetFrm( &aPt, 0, sal_False )) && ( IsReadOnlyAvailable() || !pCFrm->IsProtected() )) { SwNodeIndex aNdIndex( *pTxtNd ); // UNIX benoetigt dieses Obj. @@ -569,7 +570,7 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext ) : ( aCmp < aCurGEF && aFndGEF < aCmp )) { aFndGEF = aCmp; - bFnd = TRUE; + bFnd = sal_True; } } } @@ -619,14 +620,14 @@ const SwTOXMark& SwCrsrShell::GotoTOXMark( const SwTOXMark& rStart, // springe zum naechsten / vorherigen FeldTypen void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType, - USHORT nSubType, BOOL bInReadOnly, - BOOL bChkInpFlag = FALSE ) + sal_uInt16 nSubType, sal_Bool bInReadOnly, + sal_Bool bChkInpFlag = sal_False ) { // es muss immer der 1. Frame gesucht werden Point aPt; SwTxtFld* pTxtFld; SwClientIter aIter( (SwFieldType&)rFldType ); - BOOL bSubType = nSubType != USHRT_MAX; + sal_Bool bSubType = nSubType != USHRT_MAX; for( SwClient* pLast = aIter.First( TYPE( SwFmtFld )); pLast; pLast = aIter.Next() ) if( 0 != ( pTxtFld = ((SwFmtFld*)pLast)->GetTxtFld() ) && ( !bChkInpFlag || ((SwSetExpField*)pTxtFld->GetFld().GetFld()) @@ -636,7 +637,7 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType, { SwCntntFrm* pCFrm; const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); - if( 0 != ( pCFrm = rTxtNode.GetFrm( &aPt, 0, FALSE )) && + if( 0 != ( pCFrm = rTxtNode.GetFrm( &aPt, 0, sal_False )) && ( bInReadOnly || !pCFrm->IsProtected() )) { _SetGetExpFld* pNew = new _SetGetExpFld( @@ -648,8 +649,8 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType, } -BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, - USHORT nSubType, USHORT nResType ) +sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext, + sal_uInt16 nSubType, sal_uInt16 nResType ) { // sortierte Liste aller Felder _SetGetExpFlds aSrtLst( 64 ); @@ -657,7 +658,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, if (pFldType) { if( RES_INPUTFLD != pFldType->Which() && !pFldType->GetDepends() ) - return FALSE; + return sal_False; // Modify-Object gefunden, trage alle Felder ins Array ein ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType, IsReadOnlyAvailable() ); @@ -666,22 +667,22 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, { // es gibt noch versteckte InputFelder in den SetExp. Feldern const SwFldTypes& rFldTypes = *pDoc->GetFldTypes(); - const USHORT nSize = rFldTypes.Count(); + const sal_uInt16 nSize = rFldTypes.Count(); // Alle Typen abklappern - for( USHORT i=0; i < nSize; ++i ) + for( sal_uInt16 i=0; i < nSize; ++i ) if( RES_SETEXPFLD == ( pFldType = rFldTypes[ i ] )->Which() ) ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType, - IsReadOnlyAvailable(), TRUE ); + IsReadOnlyAvailable(), sal_True ); } } else { const SwFldTypes& rFldTypes = *pDoc->GetFldTypes(); - const USHORT nSize = rFldTypes.Count(); + const sal_uInt16 nSize = rFldTypes.Count(); // Alle Typen abklappern - for( USHORT i=0; i < nSize; ++i ) + for( sal_uInt16 i=0; i < nSize; ++i ) if( nResType == ( pFldType = rFldTypes[ i ] )->Which() ) ::lcl_MakeFldLst( aSrtLst, *pFldType, nSubType, IsReadOnlyAvailable() ); @@ -689,9 +690,9 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, // keine Felder gefunden? if( !aSrtLst.Count() ) - return FALSE; + return sal_False; - USHORT nPos; + sal_uInt16 nPos; SwCursor* pCrsr = getShellCrsr( true ); { // JP 19.08.98: es muss immer ueber das Feld gesucht werden, damit @@ -706,14 +707,13 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, SwTxtFld * pTxtFld = static_cast<SwTxtFld *>( pTNd->GetTxtAttrForCharAt(rPos.nContent.GetIndex(), RES_TXTATR_FIELD)); - BOOL bDelFld = 0 == pTxtFld; + sal_Bool bDelFld = 0 == pTxtFld; if( bDelFld ) { SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField( (SwDateTimeFieldType*)pDoc->GetSysFldType( RES_DATETIMEFLD ) ) ); - pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(), - pDoc->IsClipBoard() ); + pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex() ); pTxtFld->ChgTxtNode( pTNd ); } @@ -722,10 +722,10 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, { // auch beim Einsammeln wird nur der erste Frame benutzt! Point aPt; - aSrch.SetBodyPos( *pTNd->GetFrm( &aPt, &rPos, FALSE ) ); + aSrch.SetBodyPos( *pTNd->GetFrm( &aPt, &rPos, sal_False ) ); } - BOOL bFound = aSrtLst.Seek_Entry( &aSrch, &nPos ); + sal_Bool bFound = aSrtLst.Seek_Entry( &aSrch, &nPos ); if( bDelFld ) { delete (SwFmtFld*)&pTxtFld->GetAttr(); @@ -737,13 +737,13 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, if( bNext ) { if( ++nPos >= aSrtLst.Count() ) - return FALSE; // schon am Ende + return sal_False; // schon am Ende } else if( !nPos-- ) - return FALSE; // weiter nach vorne geht nicht + return sal_False; // weiter nach vorne geht nicht } else if( bNext ? nPos >= aSrtLst.Count() : !nPos--) - return FALSE; + return sal_False; } const _SetGetExpFld& rFnd = **( aSrtLst.GetData() + nPos ); @@ -753,7 +753,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, SwCrsrSaveState aSaveState( *pCrsr ); rFnd.GetPosOfContent( *pCrsr->GetPoint() ); - BOOL bRet = !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | + sal_Bool bRet = !pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE ); if( bRet ) UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY); @@ -761,9 +761,9 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext, } -BOOL SwCrsrShell::GotoFld( const SwFmtFld& rFld ) +sal_Bool SwCrsrShell::GotoFld( const SwFmtFld& rFld ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( rFld.GetTxtFld() ) { SET_CURR_SHELL( this ); @@ -784,7 +784,7 @@ BOOL SwCrsrShell::GotoFld( const SwFmtFld& rFld ) } -void SwCrsrShell::GotoOutline( USHORT nIdx ) +void SwCrsrShell::GotoOutline( sal_uInt16 nIdx ) { SwCursor* pCrsr = getShellCrsr( true ); @@ -802,7 +802,7 @@ void SwCrsrShell::GotoOutline( USHORT nIdx ) } -BOOL SwCrsrShell::GotoOutline( const String& rName ) +sal_Bool SwCrsrShell::GotoOutline( const String& rName ) { SwCursor* pCrsr = getShellCrsr( true ); @@ -810,29 +810,29 @@ BOOL SwCrsrShell::GotoOutline( const String& rName ) SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SwCrsrSaveState aSaveState( *pCrsr ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pDoc->GotoOutline( *pCrsr->GetPoint(), rName ) && !pCrsr->IsSelOvr() ) { UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY); - bRet = TRUE; + bRet = sal_True; } return bRet; } -BOOL SwCrsrShell::GotoNextOutline() // naechster Node mit Outline-Num. +sal_Bool SwCrsrShell::GotoNextOutline() // naechster Node mit Outline-Num. { SwCursor* pCrsr = getShellCrsr( true ); const SwNodes& rNds = GetDoc()->GetNodes(); SwNode* pNd = pCrsr->GetNode(); - USHORT nPos; + sal_uInt16 nPos; if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos )) ++nPos; if( nPos == rNds.GetOutLineNds().Count() ) - return FALSE; + return sal_False; pNd = rNds.GetOutLineNds()[ nPos ]; @@ -842,30 +842,30 @@ BOOL SwCrsrShell::GotoNextOutline() // naechster Node mit Outline-Num. pCrsr->GetPoint()->nNode = *pNd; pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)pNd, 0 ); - BOOL bRet = !pCrsr->IsSelOvr(); + sal_Bool bRet = !pCrsr->IsSelOvr(); if( bRet ) UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY); return bRet; } -BOOL SwCrsrShell::GotoPrevOutline() // vorheriger Node mit Outline-Num. +sal_Bool SwCrsrShell::GotoPrevOutline() // vorheriger Node mit Outline-Num. { SwCursor* pCrsr = getShellCrsr( true ); const SwNodes& rNds = GetDoc()->GetNodes(); SwNode* pNd = pCrsr->GetNode(); - USHORT nPos; + sal_uInt16 nPos; rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( nPos ) { --nPos; // davor pNd = rNds.GetOutLineNds()[ nPos ]; if( pNd->GetIndex() > pCrsr->GetPoint()->nNode.GetIndex() ) - return FALSE; + return sal_False; SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -883,13 +883,13 @@ BOOL SwCrsrShell::GotoPrevOutline() // vorheriger Node mit Outline-Num. // suche die "Outline-Position" vom vorherigen Outline-Node mit dem // Level. -USHORT SwCrsrShell::GetOutlinePos( BYTE nLevel ) +sal_uInt16 SwCrsrShell::GetOutlinePos( sal_uInt8 nLevel ) { SwPaM* pCrsr = getShellCrsr( true ); const SwNodes& rNds = GetDoc()->GetNodes(); SwNode* pNd = pCrsr->GetNode(); - USHORT nPos; + sal_uInt16 nPos; if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos )) nPos++; // steht auf der Position, fuers while zum Naechsten @@ -905,13 +905,13 @@ USHORT SwCrsrShell::GetOutlinePos( BYTE nLevel ) } -BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos, - BOOL bWithChilds ) +sal_Bool SwCrsrShell::MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos, + sal_Bool bWithChilds ) { const SwNodes& rNds = GetDoc()->GetNodes(); const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds(); if( !rOutlNds.Count() ) // wie jetzt ??? - return FALSE; + return sal_False; SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -919,7 +919,7 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos, if( nSttPos > nEndPos ) // sollte jemand das vertauscht haben? { OSL_ENSURE( !this, "Start- > Ende-Position im Array" ); - USHORT nTmp = nSttPos; + sal_uInt16 nTmp = nSttPos; nSttPos = nEndPos; nEndPos = nTmp; } @@ -957,7 +957,7 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos, pCurCrsr->Move( fnMoveBackward, fnGoNode ); // ans Ende vom Vorgaenger // und schon ist alles selektiert - BOOL bRet = !pCurCrsr->IsSelOvr(); + sal_Bool bRet = !pCurCrsr->IsSelOvr(); if( bRet ) UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY); return bRet; @@ -965,14 +965,14 @@ BOOL SwCrsrShell::MakeOutlineSel( USHORT nSttPos, USHORT nEndPos, // springe zu dieser Refmark -BOOL SwCrsrShell::GotoRefMark( const String& rRefMark, USHORT nSubType, - USHORT nSeqNo ) +sal_Bool SwCrsrShell::GotoRefMark( const String& rRefMark, sal_uInt16 nSubType, + sal_uInt16 nSeqNo ) { SET_CURR_SHELL( this ); SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SwCrsrSaveState aSaveState( *pCurCrsr ); - USHORT nPos; + sal_uInt16 nPos; SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( GetDoc(), rRefMark, nSubType, nSeqNo, &nPos ); if( pTxtNd && pTxtNd->GetNodes().IsDocNodes() ) @@ -983,26 +983,26 @@ BOOL SwCrsrShell::GotoRefMark( const String& rRefMark, USHORT nSubType, if( !pCurCrsr->IsSelOvr() ) { UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } -BOOL SwCrsrShell::IsPageAtPos( const Point &rPt ) const +sal_Bool SwCrsrShell::IsPageAtPos( const Point &rPt ) const { if( GetLayout() ) return 0 != GetLayout()->GetPageAtPos( rPt ); - return FALSE; + return sal_False; } -BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, +sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt, SwContentAtPos& rCntntAtPos, - BOOL bSetCrsr, + sal_Bool bSetCrsr, SwRect* pFldRect ) { SET_CURR_SHELL( this ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !IsTableMode() ) { @@ -1013,16 +1013,16 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, SwCntntFrm *pFrm(0); SwTxtAttr* pTxtAttr; SwCrsrMoveState aTmpState; - aTmpState.bFieldInfo = TRUE; + aTmpState.bFieldInfo = sal_True; aTmpState.bExactOnly = !( SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos ); - aTmpState.bCntntCheck = (SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos) ? TRUE : FALSE; + aTmpState.bCntntCheck = (SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos) ? sal_True : sal_False; aTmpState.bSetInReadOnly = IsReadOnlyAvailable(); SwSpecialPos aSpecialPos; aTmpState.pSpecialPos = ( SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos ) ? &aSpecialPos : 0; - const BOOL bCrsrFoundExact = GetLayout()->GetCrsrOfst( &aPos, aPt, &aTmpState ); + const sal_Bool bCrsrFoundExact = GetLayout()->GetCrsrOfst( &aPos, aPt, &aTmpState ); pTxtNd = aPos.nNode.GetNode().GetTxtNode(); const SwNodes& rNds = GetDoc()->GetNodes(); @@ -1034,14 +1034,14 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, { rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_OUTLINE; rCntntAtPos.sStr = pONd->GetExpandTxt( 0, STRING_LEN, true ); - bRet = TRUE; + bRet = sal_True; } } // --> FME 2005-05-13 #i43742# New function: SW_CONTENT_CHECK else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos && bCrsrFoundExact ) { - bRet = TRUE; + bRet = sal_True; } // <-- // #i23726# @@ -1069,17 +1069,17 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, if ( pSmartTagList && pSmartTagList->InWrongWord( nCurrent, nLen ) && !pTxtNd->IsSymbol(nBegin) ) { - const USHORT nIndex = pSmartTagList->GetWrongPos( nBegin ); + const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin ); const SwWrongList* pSubList = pSmartTagList->SubList( nIndex ); if ( pSubList ) { nCurrent = aTmpState.pSpecialPos->nCharOfst; if ( pSubList->InWrongWord( nCurrent, nLen ) ) - bRet = TRUE; + bRet = sal_True; } else - bRet = TRUE; + bRet = sal_True; if( bRet && bSetCrsr ) { @@ -1089,7 +1089,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, *pCurCrsr->GetPoint() = aPos; if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE) ) - bRet = FALSE; + bRet = sal_False; else UpdateCrsr(); } @@ -1153,7 +1153,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, rCntntAtPos.aFnd.pFld = pFld; rCntntAtPos.pFndTxtAttr = pTxtAttr; rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FIELD; - bRet = TRUE; + bRet = sal_True; } } @@ -1164,7 +1164,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, if( bCrsrFoundExact && pTxtNd && pFldBookmark) { rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL; rCntntAtPos.aFnd.pFldmark = pFldBookmark; - bRet=TRUE; + bRet=sal_True; } } @@ -1173,12 +1173,12 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, if( aTmpState.bFtnNoInfo ) { // stehe ueber dem Zeichen der Fussnote (??) - bRet = TRUE; + bRet = sal_True; if( bSetCrsr ) { *pCurCrsr->GetPoint() = aPos; if( !GotoFtnAnchor() ) - bRet = FALSE; + bRet = sal_False; } if( bRet ) rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FTN; @@ -1186,7 +1186,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, else if ( 0 != ( pTxtAttr = pTxtNd->GetTxtAttrForCharAt( aPos.nContent.GetIndex(), RES_TXTATR_FTN )) ) { - bRet = TRUE; + bRet = sal_True; if( bSetCrsr ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, @@ -1194,19 +1194,19 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, pCurCrsr->GetPoint()->nNode = *((SwTxtFtn*)pTxtAttr)->GetStartNode(); SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection( &pCurCrsr->GetPoint()->nNode, - TRUE, !IsReadOnlyAvailable() ); + sal_True, !IsReadOnlyAvailable() ); if( pCNd ) { pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 ); if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE )) - bRet = FALSE; + bRet = sal_False; else UpdateCrsr(); } else - bRet = FALSE; + bRet = sal_False; } if( bRet ) @@ -1251,7 +1251,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, if( pTxtAttr ) { - bRet = TRUE; + bRet = sal_True; if( bSetCrsr ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, @@ -1260,7 +1260,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, *pCurCrsr->GetPoint() = aPos; if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE ) ) - bRet = FALSE; + bRet = sal_False; else UpdateCrsr(); } @@ -1297,7 +1297,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, // nur INetAttrs mit URLs "erkennen" if( pTxtAttr && pTxtAttr->GetINetFmt().GetValue().Len() ) { - bRet = TRUE; + bRet = sal_True; if( bSetCrsr ) { SwCrsrSaveState aSaveState( *pCurCrsr ); @@ -1306,7 +1306,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, *pCurCrsr->GetPoint() = aPos; if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE) ) - bRet = FALSE; + bRet = sal_False; else UpdateCrsr(); } @@ -1334,7 +1334,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, rCntntAtPos.aFnd.pRedl = pRedl; rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_REDLINE; rCntntAtPos.pFndTxtAttr = 0; - bRet = TRUE; + bRet = sal_True; if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) ) pFrm->GetCharRect( *pFldRect, aPos, &aTmpState ); @@ -1358,12 +1358,12 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, pSttNd->GetIndex() )) && #if OSL_DEBUG_LEVEL > 1 ( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState( - RES_BOXATR_FORMULA, FALSE, &pItem ) || + RES_BOXATR_FORMULA, sal_False, &pItem ) || SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState( - RES_BOXATR_VALUE, FALSE, &pItem )) + RES_BOXATR_VALUE, sal_False, &pItem )) #else SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState( - RES_BOXATR_FORMULA, FALSE, &pItem ) + RES_BOXATR_FORMULA, sal_False, &pItem ) #endif ) { @@ -1397,7 +1397,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, #endif ((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() ); - bRet = TRUE; + bRet = sal_True; if( bSetCrsr ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, @@ -1405,7 +1405,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, *pCurCrsr->GetPoint() = aPos; if( pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE) ) - bRet = FALSE; + bRet = sal_False; else UpdateCrsr(); } @@ -1432,7 +1432,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, POOLATTR_END - 1 ); if( pTxtNd->GetpSwpHints() ) { - for( USHORT i = 0; i < pTxtNd->GetSwpHints().Count(); ++i ) + for( sal_uInt16 i = 0; i < pTxtNd->GetSwpHints().Count(); ++i ) { const SwTxtAttr* pHt = pTxtNd->GetSwpHints()[i]; xub_StrLen nAttrStart = *pHt->GetStart(); @@ -1481,7 +1481,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, String sAttrs; SfxItemIter aIter( aSet ); const SfxPoolItem* pItem = aIter.FirstItem(); - while( TRUE ) + while( sal_True ) { if( !IsInvalidItem( pItem )) { @@ -1507,7 +1507,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt, += sAttrs; } } - bRet = TRUE; + bRet = sal_True; rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_CURR_ATTRS; } #endif @@ -1547,7 +1547,7 @@ const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const } // befindet sich der Node in einem geschuetzten Bereich? -BOOL SwContentAtPos::IsInProtectSect() const +sal_Bool SwContentAtPos::IsInProtectSect() const { const SwTxtNode* pNd = 0; if( pFndTxtAttr ) @@ -1574,7 +1574,7 @@ BOOL SwContentAtPos::IsInProtectSect() const const SwCntntFrm* pFrm; return pNd && ( pNd->IsInProtectSect() || - ( 0 != ( pFrm = pNd->GetFrm(0,0,FALSE)) && + ( 0 != ( pFrm = pNd->GetFrm(0,0,sal_False)) && pFrm->IsProtected() )); } bool SwContentAtPos::IsInRTLText()const @@ -1615,11 +1615,11 @@ bool SwContentAtPos::IsInRTLText()const return bRet; } -BOOL SwCrsrShell::SelectTxtAttr( USHORT nWhich, BOOL bExpand, +sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand, const SwTxtAttr* pTxtAttr ) { SET_CURR_SHELL( this ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !IsTableMode() ) { @@ -1648,7 +1648,7 @@ BOOL SwCrsrShell::SelectTxtAttr( USHORT nWhich, BOOL bExpand, if( !pCurCrsr->IsSelOvr() ) { UpdateCrsr(); - bRet = TRUE; + bRet = sal_True; } } } @@ -1656,9 +1656,9 @@ BOOL SwCrsrShell::SelectTxtAttr( USHORT nWhich, BOOL bExpand, } -BOOL SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) +sal_Bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( rAttr.GetpTxtNode() ) { SwCursor* pCrsr = getShellCrsr( true ); @@ -1683,14 +1683,15 @@ const SwFmtINetFmt* SwCrsrShell::FindINetAttr( const String& rName ) const return pDoc->FindINetAttr( rName ); } -BOOL SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode, +sal_Bool SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode, SwRect& rRect, sal_Int16& rOrient ) { SET_CURR_SHELL( this ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - if( !IsTableMode() && !HasSelection() && GetDoc()->DoesUndo() ) + if (!IsTableMode() && !HasSelection() + && GetDoc()->GetIDocumentUndoRedo().DoesUndo()) { Point aPt( rPt ); SwPosition aPos( *pCurCrsr->GetPoint() ); @@ -1704,18 +1705,19 @@ BOOL SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode, // Start-Position im geschuetzten Bereich? rRect = aFPos.aCrsr; rOrient = aFPos.eOrient; - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) +sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) { SET_CURR_SHELL( this ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; - if( !IsTableMode() && !HasSelection() && GetDoc()->DoesUndo() ) + if (!IsTableMode() && !HasSelection() + && GetDoc()->GetIDocumentUndoRedo().DoesUndo()) { Point aPt( rPt ); SwPosition aPos( *pCurCrsr->GetPoint() ); @@ -1739,7 +1741,7 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) pCNd && pCNd->Len() ) nUndoId = UNDO_EMPTY; - GetDoc()->StartUndo( nUndoId, NULL ); + GetDoc()->GetIDocumentUndoRedo().StartUndo( nUndoId, NULL ); SwTxtFmtColl* pNextFmt = 0; SwTxtNode* pTNd = pCNd->GetTxtNode(); @@ -1760,7 +1762,7 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) aPos.nNode = *pSectNd->EndOfSectionNode(); } - for( USHORT n = 0; n < aFPos.nParaCnt + aFPos.nColumnCnt; ++n ) + for( sal_uInt16 n = 0; n < aFPos.nParaCnt + aFPos.nColumnCnt; ++n ) { GetDoc()->AppendTxtNode( aPos ); if( !n && pNextFmt ) @@ -1842,10 +1844,10 @@ BOOL SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) break; } - GetDoc()->EndUndo( nUndoId, NULL ); + GetDoc()->GetIDocumentUndoRedo().EndUndo( nUndoId, NULL ); EndAction(); - bRet = TRUE; + bRet = sal_True; } } return bRet; @@ -1887,7 +1889,7 @@ const SwRedline* SwCrsrShell::SelPrevRedline() return pFnd; } -const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect ) +const SwRedline* SwCrsrShell::_GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect ) { const SwRedline* pFnd = 0; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen @@ -1902,7 +1904,7 @@ const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect ) SwNodeIndex* pIdx = &pCurCrsr->GetPoint()->nNode; if( !pIdx->GetNode().IsCntntNode() && 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection( pIdx, - TRUE, IsReadOnlyAvailable() )) ) + sal_True, IsReadOnlyAvailable() )) ) { if( *pIdx <= pFnd->End()->nNode ) pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 ); @@ -1925,7 +1927,7 @@ const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect ) pIdx = &pCurCrsr->GetPoint()->nNode; if( !pIdx->GetNode().IsCntntNode() && 0 != ( pCNd = GetDoc()->GetNodes().GoPrevSection( pIdx, - TRUE, IsReadOnlyAvailable() )) ) + sal_True, IsReadOnlyAvailable() )) ) { if( *pIdx >= pCurCrsr->GetMark()->nNode ) pCurCrsr->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); @@ -1955,7 +1957,7 @@ const SwRedline* SwCrsrShell::_GotoRedline( USHORT nArrPos, BOOL bSelect ) return pFnd; } -const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) +const SwRedline* SwCrsrShell::GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect ) { const SwRedline* pFnd = 0; if( !IsTableMode() ) @@ -1964,15 +1966,15 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) const SwRedlineTbl& rTbl = GetDoc()->GetRedlineTbl(); const SwRedline* pTmp = rTbl[ nArrPos ]; - USHORT nSeqNo = pTmp->GetSeqNo(); + sal_uInt16 nSeqNo = pTmp->GetSeqNo(); if( nSeqNo && bSelect ) { - BOOL bCheck = FALSE; + sal_Bool bCheck = sal_False; int nLoopCnt = 2; - USHORT nArrSavPos = nArrPos; + sal_uInt16 nArrSavPos = nArrPos; do { - pTmp = _GotoRedline( nArrPos, TRUE ); + pTmp = _GotoRedline( nArrPos, sal_True ); if( !pFnd ) pFnd = pTmp; @@ -1991,7 +1993,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) const SwPosition *pNStt = pNextPam->Start(), *pNEnd = pNextPam->End(); - BOOL bDel = TRUE; + sal_Bool bDel = sal_True; switch( ::ComparePosition( *pCStt, *pCEnd, *pNStt, *pNEnd )) { @@ -2026,7 +2028,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) break; default: - bDel = FALSE; + bDel = sal_False; } if( bDel ) @@ -2040,7 +2042,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) } } - USHORT nFndPos = 2 == nLoopCnt + sal_uInt16 nFndPos = 2 == nLoopCnt ? rTbl.FindNextOfSeqNo( nArrPos ) : rTbl.FindPrevOfSeqNo( nArrPos ); if( USHRT_MAX != nFndPos || @@ -2051,7 +2053,7 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) { // neuen Cursor erzeugen CreateCrsr(); - bCheck = TRUE; + bCheck = sal_True; } nArrPos = nFndPos; } @@ -2067,12 +2069,12 @@ const SwRedline* SwCrsrShell::GotoRedline( USHORT nArrPos, BOOL bSelect ) } -BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) +sal_Bool SwCrsrShell::SelectNxtPrvHyperlink( sal_Bool bNext ) { SwNodes& rNds = GetDoc()->GetNodes(); const SwNode* pBodyEndNd = &rNds.GetEndOfContent(); const SwNode* pBodySttNd = pBodyEndNd->StartOfSectionNode(); - ULONG nBodySttNdIdx = pBodySttNd->GetIndex(); + sal_uLong nBodySttNdIdx = pBodySttNd->GetIndex(); Point aPt; _SetGetExpFld aCmpPos( SwPosition( bNext ? *pBodyEndNd : *pBodySttNd ) ); @@ -2089,7 +2091,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) { const SwTxtNode* pTxtNd; const SwCharFmts* pFmts = GetDoc()->GetCharFmts(); - for( USHORT n = pFmts->Count(); 1 < n; ) + for( sal_uInt16 n = pFmts->Count(); 1 < n; ) { SwClientIter aIter( *(*pFmts)[ --n ] ); @@ -2125,13 +2127,13 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) // then check all the Flys with a URL or imapge map { const SwSpzFrmFmts* pFmts = GetDoc()->GetSpzFrmFmts(); - for( USHORT n = 0, nEnd = pFmts->Count(); n < nEnd; ++n ) + for( sal_uInt16 n = 0, nEnd = pFmts->Count(); n < nEnd; ++n ) { SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)(*pFmts)[ n ]; const SwFmtURL& rURLItem = pFmt->GetURL(); if( rURLItem.GetMap() || rURLItem.GetURL().Len() ) { - SwFlyFrm* pFly = pFmt->GetFrm( &aPt, FALSE ); + SwFlyFrm* pFly = pFmt->GetFrm( &aPt, sal_False ); SwPosition aTmpPos( *pBodySttNd ); if( pFly && GetBodyTxtNode( *GetDoc(), aTmpPos, *pFly->GetLower() ) ) @@ -2148,7 +2150,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) } // found any URL ? - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtINetFmt* pFndAttr = aCmpPos.GetINetFmt(); const SwFlyFrmFmt* pFndFmt = aCmpPos.GetFlyFmt(); if( pFndAttr || pFndFmt ) @@ -2170,7 +2172,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) { UpdateCrsr( SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE| SwCrsrShell::READONLY ); - bRet = TRUE; + bRet = sal_True; } } // find a draw object ? @@ -2179,16 +2181,16 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext ) const SdrObject* pSObj = pFndFmt->FindSdrObject(); ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() ); MakeSelVisible(); - bRet = TRUE; + bRet = sal_True; } else // then is it a fly { - SwFlyFrm* pFly = pFndFmt->GetFrm(&aPt, FALSE ); + SwFlyFrm* pFly = pFndFmt->GetFrm(&aPt, sal_False ); if( pFly ) { - ((SwFEShell*)this)->SelectFlyFrm( *pFly, TRUE ); + ((SwFEShell*)this)->SelectFlyFrm( *pFly, sal_True ); MakeSelVisible(); - bRet = TRUE; + bRet = sal_True; } } } diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx index b9ca251221..5a0140860d 100644 --- a/sw/source/core/crsr/crstrvl1.cxx +++ b/sw/source/core/crsr/crstrvl1.cxx @@ -34,72 +34,72 @@ #include <viscrs.hxx> #include <callnk.hxx> -BOOL SwCrsrShell::IsStartWord( sal_Int16 nWordType ) const +sal_Bool SwCrsrShell::IsStartWord( sal_Int16 nWordType ) const { return pCurCrsr->IsStartWord( nWordType ); } -BOOL SwCrsrShell::IsEndWord( sal_Int16 nWordType ) const +sal_Bool SwCrsrShell::IsEndWord( sal_Int16 nWordType ) const { return pCurCrsr->IsEndWord( nWordType ); } -BOOL SwCrsrShell::IsInWord( sal_Int16 nWordType ) const +sal_Bool SwCrsrShell::IsInWord( sal_Int16 nWordType ) const { return pCurCrsr->IsInWord( nWordType ); } -BOOL SwCrsrShell::IsStartSentence() const +sal_Bool SwCrsrShell::IsStartSentence() const { return pCurCrsr->IsStartEndSentence( false ); } -BOOL SwCrsrShell::IsEndSentence() const +sal_Bool SwCrsrShell::IsEndSentence() const { return pCurCrsr->IsStartEndSentence( true ); } -BOOL SwCrsrShell::GoStartWord() +sal_Bool SwCrsrShell::GoStartWord() { return CallCrsrFN( &SwCursor::GoStartWord ); } -BOOL SwCrsrShell::GoEndWord() +sal_Bool SwCrsrShell::GoEndWord() { return CallCrsrFN( &SwCursor::GoEndWord ); } -BOOL SwCrsrShell::GoNextWord() +sal_Bool SwCrsrShell::GoNextWord() { return CallCrsrFN( &SwCursor::GoNextWord ); } -BOOL SwCrsrShell::GoPrevWord() +sal_Bool SwCrsrShell::GoPrevWord() { return CallCrsrFN( &SwCursor::GoPrevWord ); } -BOOL SwCrsrShell::GoNextSentence() +sal_Bool SwCrsrShell::GoNextSentence() { return CallCrsrFN( &SwCursor::GoNextSentence ); } -BOOL SwCrsrShell::GoEndSentence() +sal_Bool SwCrsrShell::GoEndSentence() { return CallCrsrFN( &SwCursor::GoEndSentence ); } -BOOL SwCrsrShell::GoPrevSentence() +sal_Bool SwCrsrShell::GoPrevSentence() { return CallCrsrFN( &SwCursor::GoPrevSentence ); } -BOOL SwCrsrShell::GoStartSentence() +sal_Bool SwCrsrShell::GoStartSentence() { return CallCrsrFN( &SwCursor::GoStartSentence ); } -BOOL SwCrsrShell::SelectWord( const Point* pPt ) +sal_Bool SwCrsrShell::SelectWord( const Point* pPt ) { return pCurCrsr->SelectWord( pPt ); } -BOOL SwCrsrShell::ExpandToSentenceBorders() +sal_Bool SwCrsrShell::ExpandToSentenceBorders() { return pCurCrsr->ExpandToSentenceBorders(); } diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index bb89f05fe4..5a7150c9f0 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -46,13 +46,14 @@ #include <fchrfmt.hxx> #include <charfmt.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <swcrsr.hxx> #include <editsh.hxx> #include <ndtxt.hxx> #include <pamtyp.hxx> #include <swundo.hxx> #include <crsskip.hxx> -#include <undobj.hxx> + using namespace ::com::sun::star; using namespace ::com::sun::star::lang; @@ -83,7 +84,7 @@ int CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) } -const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos, +const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos, xub_StrLen nCntntPos ) { while( rPos < rHtsArr.Count() ) @@ -97,7 +98,7 @@ const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos, } -const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos, +const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos, xub_StrLen nCntntPos ) { while( rPos > 0 ) @@ -113,14 +114,14 @@ const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, USHORT& rPos, void lcl_SetAttrPam( SwPaM & rPam, xub_StrLen nStart, const xub_StrLen* pEnde, - const BOOL bSaveMark ) + const sal_Bool bSaveMark ) { xub_StrLen nCntntPos; if( bSaveMark ) nCntntPos = rPam.GetMark()->nContent.GetIndex(); else nCntntPos = rPam.GetPoint()->nContent.GetIndex(); - BOOL bTstEnde = rPam.GetPoint()->nNode == rPam.GetMark()->nNode; + sal_Bool bTstEnde = rPam.GetPoint()->nNode == rPam.GetMark()->nNode; SwCntntNode* pCNd = rPam.GetCntntNode(); rPam.GetPoint()->nContent.Assign( pCNd, nStart ); @@ -143,15 +144,15 @@ void lcl_SetAttrPam( SwPaM & rPam, xub_StrLen nStart, const xub_StrLen* pEnde, // umspannt, unter Beachtung des Suchbereiches -BOOL lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam, +sal_Bool lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam, const SfxPoolItem& rCmpItem, - SwMoveFn fnMove, BOOL bValue ) + SwMoveFn fnMove, sal_Bool bValue ) { if ( !rTxtNd.HasHints() ) - return FALSE; + return sal_False; const SwTxtAttr *pTxtHt = 0; - BOOL bForward = fnMove == fnMoveForward; - USHORT nPos = bForward ? 0 : rTxtNd.GetSwpHints().Count(); + sal_Bool bForward = fnMove == fnMoveForward; + sal_uInt16 nPos = bForward ? 0 : rTxtNd.GetSwpHints().Count(); xub_StrLen nCntntPos = rPam.GetPoint()->nContent.GetIndex(); while( 0 != ( pTxtHt=(*fnMove->fnGetHint)(rTxtNd.GetSwpHints(),nPos,nCntntPos))) @@ -159,9 +160,9 @@ BOOL lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam, ( !bValue || CmpAttr( pTxtHt->GetAttr(), rCmpItem ))) { lcl_SetAttrPam( rPam, *pTxtHt->GetStart(), pTxtHt->GetEnd(), bForward ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } @@ -169,7 +170,7 @@ BOOL lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam, struct _SwSrchChrAttr { - USHORT nWhich; + sal_uInt16 nWhich; xub_StrLen nStt, nEnd; _SwSrchChrAttr( const SfxPoolItem& rItem, @@ -182,11 +183,11 @@ class SwAttrCheckArr { _SwSrchChrAttr *pFndArr, *pStackArr; xub_StrLen nNdStt, nNdEnd; - USHORT nArrStart, nArrLen; - USHORT nFound, nStackCnt; + sal_uInt16 nArrStart, nArrLen; + sal_uInt16 nFound, nStackCnt; SfxItemSet aCmpSet; - BOOL bNoColls; - BOOL bForward; + sal_Bool bNoColls; + sal_Bool bForward; public: SwAttrCheckArr( const SfxItemSet& rSet, int bForward, int bNoCollections ); @@ -195,7 +196,7 @@ public: void SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam ); // wieviele Attribute ueberhaupt ?? - USHORT Count() const { return aCmpSet.Count(); } + sal_uInt16 Count() const { return aCmpSet.Count(); } int Found() const { return nFound == aCmpSet.Count(); } int CheckStack(); @@ -215,7 +216,7 @@ SwAttrCheckArr::SwAttrCheckArr( const SfxItemSet& rSet, int bFwd, int bNoCollections ) : aCmpSet( *rSet.GetPool(), RES_CHRATR_BEGIN, RES_TXTATR_END-1 ) { - aCmpSet.Put( rSet, FALSE ); + aCmpSet.Put( rSet, sal_False ); bNoColls = 0 != bNoCollections; bForward = 0 != bFwd; @@ -270,9 +271,9 @@ void SwAttrCheckArr::SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam ) SfxItemIter aIter( aCmpSet ); const SfxPoolItem* pItem = aIter.GetCurItem(); const SfxPoolItem* pFndItem; - USHORT nWhich; + sal_uInt16 nWhich; - while( TRUE ) + while( sal_True ) { // nur testen, ob vorhanden ist ? if( IsInvalidItem( pItem ) ) @@ -323,7 +324,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) // -------------------------------------------------------------- // Hier wird jetzt ausdruecklich auch in Zeichenvorlagen gesucht // -------------------------------------------------------------- - USHORT nWhch = rAttr.Which(); + sal_uInt16 nWhch = rAttr.Which(); SfxWhichIter* pIter = NULL; const SfxPoolItem* pTmpItem = NULL; const SfxItemSet* pSet = NULL; @@ -338,7 +339,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) pIter = new SfxWhichIter( *pSet ); nWhch = pIter->FirstWhich(); while( nWhch && - SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) ) + SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) ) nWhch = pIter->NextWhich(); if( !nWhch ) pTmpItem = NULL; @@ -348,10 +349,10 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) pTmpItem = &rAttr.GetAttr(); while( pTmpItem ) { - SfxItemState eState = aCmpSet.GetItemState( nWhch, FALSE, &pItem ); + SfxItemState eState = aCmpSet.GetItemState( nWhch, sal_False, &pItem ); if( SFX_ITEM_DONTCARE == eState || SFX_ITEM_SET == eState ) { - USHORT n; + sal_uInt16 n; _SwSrchChrAttr* pCmp; // loesche erstmal alle, die bis zu der Start Position schon wieder @@ -401,7 +402,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) } } - BOOL bContinue = FALSE; + sal_Bool bContinue = sal_False; if( SFX_ITEM_DONTCARE == eState ) { @@ -418,7 +419,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) else if( pCmp->nEnd < aTmp.nEnd ) // erweitern ? pCmp->nEnd = aTmp.nEnd; - bContinue = TRUE; + bContinue = sal_True; } } // wird Attribut gueltig ? @@ -426,7 +427,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) { pFndArr[ nWhch - nArrStart ] = aTmp; ++nFound; - bContinue = TRUE; + bContinue = sal_True; } // tja, dann muss es auf den Stack @@ -455,7 +456,7 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr ) { nWhch = pIter->NextWhich(); while( nWhch && - SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) ) + SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) ) nWhch = pIter->NextWhich(); if( !nWhch ) break; @@ -478,7 +479,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) // -------------------------------------------------------------- // Hier wird jetzt ausdruecklich auch in Zeichenvorlagen gesucht // -------------------------------------------------------------- - USHORT nWhch = rAttr.Which(); + sal_uInt16 nWhch = rAttr.Which(); SfxWhichIter* pIter = NULL; const SfxPoolItem* pTmpItem = NULL; const SfxItemSet* pSet = NULL; @@ -493,7 +494,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) pIter = new SfxWhichIter( *pSet ); nWhch = pIter->FirstWhich(); while( nWhch && - SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) ) + SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) ) nWhch = pIter->NextWhich(); if( !nWhch ) pTmpItem = NULL; @@ -503,10 +504,10 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) pTmpItem = &rAttr.GetAttr(); while( pTmpItem ) { - SfxItemState eState = aCmpSet.GetItemState( nWhch, FALSE, &pItem ); + SfxItemState eState = aCmpSet.GetItemState( nWhch, sal_False, &pItem ); if( SFX_ITEM_DONTCARE == eState || SFX_ITEM_SET == eState ) { - USHORT n; + sal_uInt16 n; _SwSrchChrAttr* pCmp; // loesche erstmal alle, die bis zu der Start Position schon wieder @@ -555,7 +556,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) } } - BOOL bContinue = FALSE; + sal_Bool bContinue = sal_False; if( SFX_ITEM_DONTCARE == eState ) { // wird Attribut gueltig ? @@ -571,7 +572,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) else if( pCmp->nStt > aTmp.nStt ) // erweitern ? pCmp->nStt = aTmp.nStt; - bContinue = TRUE; + bContinue = sal_True; } } // wird Attribut gueltig ? @@ -579,7 +580,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) { pFndArr[ nWhch - nArrStart ] = aTmp; ++nFound; - bContinue = TRUE; + bContinue = sal_True; } // tja, dann muss es auf den Stack @@ -608,7 +609,7 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) { nWhch = pIter->NextWhich(); while( nWhch && - SFX_ITEM_SET != pSet->GetItemState( nWhch, TRUE, &pTmpItem ) ) + SFX_ITEM_SET != pSet->GetItemState( nWhch, sal_True, &pTmpItem ) ) nWhch = pIter->NextWhich(); if( !nWhch ) break; @@ -624,7 +625,7 @@ xub_StrLen SwAttrCheckArr::Start() const { xub_StrLen nStart = nNdStt; _SwSrchChrAttr* pArrPtr = pFndArr; - for( USHORT n = 0; n < nArrLen; ++n, ++pArrPtr ) + for( sal_uInt16 n = 0; n < nArrLen; ++n, ++pArrPtr ) if( pArrPtr->nWhich && pArrPtr->nStt > nStart ) nStart = pArrPtr->nStt; @@ -636,7 +637,7 @@ xub_StrLen SwAttrCheckArr::End() const { _SwSrchChrAttr* pArrPtr = pFndArr; xub_StrLen nEnd = nNdEnd; - for( USHORT n = 0; n < nArrLen; ++n, ++pArrPtr ) + for( sal_uInt16 n = 0; n < nArrLen; ++n, ++pArrPtr ) if( pArrPtr->nWhich && pArrPtr->nEnd < nEnd ) nEnd = pArrPtr->nEnd; @@ -647,9 +648,9 @@ xub_StrLen SwAttrCheckArr::End() const int SwAttrCheckArr::CheckStack() { if( !nStackCnt ) - return FALSE; + return sal_False; - USHORT n; + sal_uInt16 n; xub_StrLen nSttPos = Start(), nEndPos = End(); _SwSrchChrAttr* pArrPtr; for( pArrPtr = pStackArr, n = 0; n < nArrLen; ++n, ++pArrPtr ) @@ -688,16 +689,16 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, if( !rTxtNd.HasHints() ) { if( !rCmpArr.Found() ) - return FALSE; + return sal_False; nEndPos = rCmpArr.GetNdEnd(); - lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, TRUE ); - return TRUE; + lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_True ); + return sal_True; } // dann gehe mal durch das nach "Start" sortierte Array const SwpHints& rHtArr = rTxtNd.GetSwpHints(); const SwTxtAttr* pAttr; - USHORT nPos = 0; + sal_uInt16 nPos = 0; // sollte jetzt schon alles vorhanden sein, dann teste, mit welchem // das wieder beendet wird. @@ -710,8 +711,8 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, { // dann haben wir unser Ende: lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), - pAttr->GetStart(), TRUE ); - return TRUE; + pAttr->GetStart(), sal_True ); + return sal_True; } // ansonsten muessen wir weiter suchen break; @@ -721,8 +722,8 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, { // dann haben wir unseren Bereich nEndPos = rCmpArr.GetNdEnd(); - lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, TRUE ); - return TRUE; + lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_True ); + return sal_True; } } @@ -741,16 +742,16 @@ int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, // dann haben wir den Bereich zusammen if( (nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) ) - return FALSE; - lcl_SetAttrPam( rPam, nSttPos, &nEndPos, TRUE ); - return TRUE; + return sal_False; + lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_True ); + return sal_True; } if( !rCmpArr.CheckStack() || (nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) ) - return FALSE; - lcl_SetAttrPam( rPam, nSttPos, &nEndPos, TRUE ); - return TRUE; + return sal_False; + lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_True ); + return sal_True; } @@ -762,16 +763,16 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, if( !rTxtNd.HasHints() ) { if( !rCmpArr.Found() ) - return FALSE; + return sal_False; nEndPos = rCmpArr.GetNdEnd(); - lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, FALSE ); - return TRUE; + lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_False ); + return sal_True; } // dann gehe mal durch das nach "Start" sortierte Array const SwpHints& rHtArr = rTxtNd.GetSwpHints(); const SwTxtAttr* pAttr; - USHORT nPos = rHtArr.Count(); + sal_uInt16 nPos = rHtArr.Count(); // sollte jetzt schon alles vorhanden sein, dann teste, mit welchem // das wieder beendet wird. @@ -785,8 +786,8 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, { // dann haben wir unser Ende: nEndPos = rCmpArr.GetNdEnd(); - lcl_SetAttrPam( rPam, nSttPos, &nEndPos, FALSE ); - return TRUE; + lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_False ); + return sal_True; } // ansonsten muessen wir weiter suchen @@ -797,8 +798,8 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, { // dann haben wir unseren Bereich nEndPos = rCmpArr.GetNdEnd(); - lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, FALSE ); - return TRUE; + lcl_SetAttrPam( rPam, rCmpArr.GetNdStt(), &nEndPos, sal_False ); + return sal_True; } } @@ -821,32 +822,32 @@ int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, // dann haben wir den Bereich zusammen if( (nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) ) - return FALSE; - lcl_SetAttrPam( rPam, nSttPos, &nEndPos, FALSE ); - return TRUE; + return sal_False; + lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_False ); + return sal_True; } if( !rCmpArr.CheckStack() || (nSttPos = rCmpArr.Start()) > (nEndPos = rCmpArr.End()) ) - return FALSE; - lcl_SetAttrPam( rPam, nSttPos, &nEndPos, FALSE ); - return TRUE; + return sal_False; + lcl_SetAttrPam( rPam, nSttPos, &nEndPos, sal_False ); + return sal_True; } -int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, BOOL bNoColls ) +int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, sal_Bool bNoColls ) { // nur die harte Attributierung suchen ? if( bNoColls && !rCNd.HasSwAttrSet() ) - return FALSE; + return sal_False; const SfxItemSet& rNdSet = rCNd.GetSwAttrSet(); SfxItemIter aIter( rCmpSet ); const SfxPoolItem* pItem = aIter.GetCurItem(); const SfxPoolItem* pNdItem; - USHORT nWhich; + sal_uInt16 nWhich; - while( TRUE ) + while( sal_True ) { // nur testen, ob vorhanden ist ? if( IsInvalidItem( pItem )) @@ -854,36 +855,36 @@ int lcl_Search( const SwCntntNode& rCNd, const SfxItemSet& rCmpSet, BOOL bNoColl nWhich = rCmpSet.GetWhichByPos( aIter.GetCurPos() ); if( SFX_ITEM_SET != rNdSet.GetItemState( nWhich, !bNoColls, &pNdItem ) || CmpAttr( *pNdItem, rNdSet.GetPool()->GetDefaultItem( nWhich ) )) - return FALSE; + return sal_False; } else { nWhich = pItem->Which(); if( !CmpAttr( rNdSet.Get( nWhich, !bNoColls ), *pItem )) - return FALSE; + return sal_False; } if( aIter.IsAtEnd() ) break; pItem = aIter.NextItem(); } - return TRUE; // wurde gefunden + return sal_True; // wurde gefunden } -BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove, - const SwPaM *pRegion, BOOL bInReadOnly ) +sal_Bool SwPaM::Find( const SfxPoolItem& rAttr, sal_Bool bValue, SwMoveFn fnMove, + const SwPaM *pRegion, sal_Bool bInReadOnly ) { // stelle fest welches Attribut gesucht wird: - USHORT nWhich = rAttr.Which(); + sal_uInt16 nWhich = rAttr.Which(); int bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich); SwPaM* pPam = MakeRegion( fnMove, pRegion ); - BOOL bFound = FALSE; - BOOL bFirst = TRUE; - BOOL bSrchForward = fnMove == fnMoveForward; + sal_Bool bFound = sal_False; + sal_Bool bFirst = sal_True; + sal_Bool bSrchForward = fnMove == fnMoveForward; SwCntntNode * pNode; const SfxPoolItem* pItem; SwpFmts aFmtArr; @@ -893,10 +894,10 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove, ? pPam->GetPoint()->nContent.GetIndex() == pPam->GetCntntNode()->Len() : !pPam->GetPoint()->nContent.GetIndex() ) { - if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, FALSE )) + if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False )) { delete pPam; - return FALSE; + return sal_False; } SwCntntNode *pNd = pPam->GetCntntNode(); xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); @@ -917,7 +918,7 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove, SetMark(); *GetPoint() = *pPam->GetPoint(); *GetMark() = *pPam->GetMark(); - bFound = TRUE; + bFound = sal_True; break; } else if (isTXTATR(nWhich)) @@ -935,7 +936,7 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove, } if( SFX_ITEM_SET == pNode->GetSwAttrSet().GetItemState( nWhich, - TRUE, &pItem ) && ( !bValue || *pItem == rAttr ) ) + sal_True, &pItem ) && ( !bValue || *pItem == rAttr ) ) { // FORWARD: Point an das Ende, GetMark zum Anfanf vom Node // BACKWARD: Point zum Anfang, GetMark an das Ende vom Node @@ -943,7 +944,7 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove, *GetPoint() = *pPam->GetPoint(); SetMark(); pNode->MakeEndIndex( &GetPoint()->nContent ); - bFound = TRUE; + bFound = sal_True; break; } } @@ -959,14 +960,14 @@ BOOL SwPaM::Find( const SfxPoolItem& rAttr, BOOL bValue, SwMoveFn fnMove, typedef int (*FnSearchAttr)( const SwTxtNode&, SwAttrCheckArr&, SwPaM& ); -BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove, - const SwPaM *pRegion, BOOL bInReadOnly, BOOL bMoveFirst ) +sal_Bool SwPaM::Find( const SfxItemSet& rSet, sal_Bool bNoColls, SwMoveFn fnMove, + const SwPaM *pRegion, sal_Bool bInReadOnly, sal_Bool bMoveFirst ) { SwPaM* pPam = MakeRegion( fnMove, pRegion ); - BOOL bFound = FALSE; - BOOL bFirst = TRUE; - BOOL bSrchForward = fnMove == fnMoveForward; + sal_Bool bFound = sal_False; + sal_Bool bFirst = sal_True; + sal_Bool bSrchForward = fnMove == fnMoveForward; SwCntntNode * pNode; SwpFmts aFmtArr; @@ -974,7 +975,7 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove, SwAttrCheckArr aCmpArr( rSet, bSrchForward, bNoColls ); SfxItemSet aOtherSet( GetDoc()->GetAttrPool(), RES_PARATR_BEGIN, RES_GRFATR_END-1 ); - aOtherSet.Put( rSet, FALSE ); // alle Invalid-Items erhalten! + aOtherSet.Put( rSet, sal_False ); // alle Invalid-Items erhalten! FnSearchAttr fnSearch = bSrchForward ? (&::lcl_SearchForward) @@ -987,10 +988,10 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove, ? pPam->GetPoint()->nContent.GetIndex() == pPam->GetCntntNode()->Len() : !pPam->GetPoint()->nContent.GetIndex() ) ) { - if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, FALSE )) + if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False )) { delete pPam; - return FALSE; + return sal_False; } SwCntntNode *pNd = pPam->GetCntntNode(); xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); @@ -1013,7 +1014,7 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove, SetMark(); *GetPoint() = *pPam->GetPoint(); *GetMark() = *pPam->GetMark(); - bFound = TRUE; + bFound = sal_True; break; } continue; // TextAttribute @@ -1040,7 +1041,7 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove, *GetPoint() = *pPam->GetPoint(); SetMark(); pNode->MakeEndIndex( &GetPoint()->nContent ); - bFound = TRUE; + bFound = sal_True; break; } } @@ -1058,13 +1059,13 @@ BOOL SwPaM::Find( const SfxItemSet& rSet, BOOL bNoColls, SwMoveFn fnMove, // Parameter fuer das Suchen vom Attributen struct SwFindParaAttr : public SwFindParas { - BOOL bValue; + sal_Bool bValue; const SfxItemSet *pSet, *pReplSet; const SearchOptions *pSearchOpt; SwCursor& rCursor; utl::TextSearch* pSTxt; - SwFindParaAttr( const SfxItemSet& rSet, BOOL bNoCollection, + SwFindParaAttr( const SfxItemSet& rSet, sal_Bool bNoCollection, const SearchOptions* pOpt, const SfxItemSet* pRSet, SwCursor& rCrsr ) : bValue( bNoCollection ), pSet( &rSet ), pReplSet( pRSet ), @@ -1072,22 +1073,22 @@ struct SwFindParaAttr : public SwFindParas virtual ~SwFindParaAttr() { delete pSTxt; } - virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, BOOL bInReadOnly ); + virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly ); virtual int IsReplaceMode() const; }; int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, - BOOL bInReadOnly ) + sal_Bool bInReadOnly ) { // String ersetzen ?? (nur wenn Text angegeben oder nicht attributiert // gesucht wird) - BOOL bReplaceTxt = pSearchOpt && ( pSearchOpt->replaceString.getLength() || + sal_Bool bReplaceTxt = pSearchOpt && ( pSearchOpt->replaceString.getLength() || !pSet->Count() ); - BOOL bReplaceAttr = pReplSet && pReplSet->Count(); - BOOL bMoveFirst = !bReplaceAttr; + sal_Bool bReplaceAttr = pReplSet && pReplSet->Count(); + sal_Bool bMoveFirst = !bReplaceAttr; if( bInReadOnly && (bReplaceAttr || bReplaceTxt )) - bInReadOnly = FALSE; + bInReadOnly = sal_False; // wir suchen nach Attributen, soll zusaetzlich Text gesucht werden ? { @@ -1095,7 +1096,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, SwPaM* pTextRegion = &aRegion; SwPaM aSrchPam( *pCrsr->GetPoint() ); - while( TRUE ) + while( sal_True ) { if( pSet->Count() ) // gibts ueberhaupt Attributierung? { @@ -1104,7 +1105,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, //JP 17.11.95: was ist mit Attributen in leeren Absaetzen !! // || *pCrsr->GetMark() == *pCrsr->GetPoint() ) // kein Bereich ?? return FIND_NOT_FOUND; - bMoveFirst = TRUE; + bMoveFirst = sal_True; if( !pSearchOpt ) break; // ok, nur Attribute, also gefunden @@ -1129,7 +1130,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, } // todo/mba: searching for attributes in Outliner text?! - BOOL bSearchInNotes = FALSE; + sal_Bool bSearchInNotes = sal_False; // Bug 24665: suche im richtigen Bereich weiter (pTextRegion!) if( aSrchPam.Find( *pSearchOpt, bSearchInNotes, *pSTxt, fnMove, pTextRegion, bInReadOnly ) && @@ -1200,11 +1201,11 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, SfxItemIter aIter( *pSet ); const SfxPoolItem* pItem = aIter.GetCurItem(); - while( TRUE ) + while( sal_True ) { // alle die nicht gesetzt sind mit Pool-Defaults aufuellen if( !IsInvalidItem( pItem ) && SFX_ITEM_SET != - pReplSet->GetItemState( pItem->Which(), FALSE )) + pReplSet->GetItemState( pItem->Which(), sal_False )) aSet.Put( pPool->GetDefaultItem( pItem->Which() )); if( aIter.IsAtEnd() ) @@ -1232,8 +1233,8 @@ int SwFindParaAttr::IsReplaceMode() const // Suchen nach Attributen -ULONG SwCursor::Find( const SfxItemSet& rSet, BOOL bNoCollections, - SwDocPositions nStart, SwDocPositions nEnde, BOOL& bCancel, +sal_uLong SwCursor::Find( const SfxItemSet& rSet, sal_Bool bNoCollections, + SwDocPositions nStart, SwDocPositions nEnde, sal_Bool& bCancel, FindRanges eFndRngs, const SearchOptions* pSearchOpt, const SfxItemSet* pReplSet ) { @@ -1242,23 +1243,27 @@ ULONG SwCursor::Find( const SfxItemSet& rSet, BOOL bNoCollections, Link aLnk( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); - BOOL bReplace = ( pSearchOpt && ( pSearchOpt->replaceString.getLength() || + sal_Bool bReplace = ( pSearchOpt && ( pSearchOpt->replaceString.getLength() || !rSet.Count() ) ) || (pReplSet && pReplSet->Count()); - BOOL bSttUndo = pDoc->DoesUndo() && bReplace; - if( bSttUndo ) - pDoc->StartUndo( UNDO_REPLACE, NULL ); + bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace; + if (bStartUndo) + { + pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_REPLACE, NULL ); + } SwFindParaAttr aSwFindParaAttr( rSet, bNoCollections, pSearchOpt, pReplSet, *this ); - ULONG nRet = FindAll(aSwFindParaAttr, nStart, nEnde, eFndRngs, bCancel ); + sal_uLong nRet = FindAll(aSwFindParaAttr, nStart, nEnde, eFndRngs, bCancel ); pDoc->SetOle2Link( aLnk ); if( nRet && bReplace ) pDoc->SetModified(); - if( bSttUndo ) - pDoc->EndUndo( UNDO_REPLACE, NULL ); + if (bStartUndo) + { + pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_REPLACE, NULL ); + } return nRet; } diff --git a/sw/source/core/crsr/findcoll.cxx b/sw/source/core/crsr/findcoll.cxx index 8bc2246d87..69eb2f548e 100644 --- a/sw/source/core/crsr/findcoll.cxx +++ b/sw/source/core/crsr/findcoll.cxx @@ -29,14 +29,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include <tools/resid.hxx> #include <swcrsr.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <pamtyp.hxx> #include <swundo.hxx> -#include <undobj.hxx> +#include <SwRewriter.hxx> #include <comcore.hrc> -#include <tools/resid.hxx> //------------------ Methoden der CrsrShell --------------------------- @@ -49,17 +50,17 @@ struct SwFindParaFmtColl : public SwFindParas const SwTxtFmtColl* pRpColl, SwCursor& rCrsr ) : pFmtColl( &rFmtColl ), pReplColl( pRpColl ), rCursor( rCrsr ) {} - virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, BOOL bInReadOnly ); + virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly ); virtual int IsReplaceMode() const; }; int SwFindParaFmtColl::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, - BOOL bInReadOnly ) + sal_Bool bInReadOnly ) { int nRet = FIND_FOUND; if( bInReadOnly && pReplColl ) - bInReadOnly = FALSE; + bInReadOnly = sal_False; if( !pCrsr->Find( *pFmtColl, fnMove, pRegion, bInReadOnly ) ) nRet = FIND_NOT_FOUND; @@ -81,8 +82,8 @@ int SwFindParaFmtColl::IsReplaceMode() const // Suchen nach Format-Collections -ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl, - SwDocPositions nStart, SwDocPositions nEnde, BOOL& bCancel, +sal_uLong SwCursor::Find( const SwTxtFmtColl& rFmtColl, + SwDocPositions nStart, SwDocPositions nEnde, sal_Bool& bCancel, FindRanges eFndRngs, const SwTxtFmtColl* pReplFmtColl ) { // OLE-Benachrichtigung abschalten !! @@ -90,27 +91,31 @@ ULONG SwCursor::Find( const SwTxtFmtColl& rFmtColl, Link aLnk( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); - BOOL bSttUndo = pDoc->DoesUndo() && pReplFmtColl; - if( bSttUndo ) + bool const bStartUndo = + pDoc->GetIDocumentUndoRedo().DoesUndo() && pReplFmtColl; + if (bStartUndo) { SwRewriter aRewriter; aRewriter.AddRule(UNDO_ARG1, rFmtColl.GetName()); aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS)); aRewriter.AddRule(UNDO_ARG3, pReplFmtColl->GetName()); - pDoc->StartUndo( UNDO_UI_REPLACE_STYLE, &aRewriter ); + pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_UI_REPLACE_STYLE, + &aRewriter ); } SwFindParaFmtColl aSwFindParaFmtColl( rFmtColl, pReplFmtColl, *this ); - ULONG nRet = FindAll( aSwFindParaFmtColl, nStart, nEnde, eFndRngs, bCancel ); + sal_uLong nRet = FindAll( aSwFindParaFmtColl, nStart, nEnde, eFndRngs, bCancel ); pDoc->SetOle2Link( aLnk ); if( nRet && pReplFmtColl ) pDoc->SetModified(); - if( bSttUndo ) - pDoc->EndUndo( UNDO_UI_REPLACE_STYLE, NULL ); + if (bStartUndo) + { + pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_END, 0); + } return nRet; } diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx index bfca6bda94..bc79ac1db8 100644 --- a/sw/source/core/crsr/findfmt.cxx +++ b/sw/source/core/crsr/findfmt.cxx @@ -34,11 +34,11 @@ #include <pamtyp.hxx> -BOOL SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove, - const SwPaM *pRegion, BOOL bInReadOnly ) +sal_Bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove, + const SwPaM *pRegion, sal_Bool bInReadOnly ) { - BOOL bFound = FALSE; - BOOL bSrchForward = fnMove == fnMoveForward; + sal_Bool bFound = sal_False; + sal_Bool bSrchForward = fnMove == fnMoveForward; SwPaM* pPam = MakeRegion( fnMove, pRegion ); // Wenn am Anfang/Ende, aus dem Node moven @@ -46,17 +46,17 @@ BOOL SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove, ? pPam->GetPoint()->nContent.GetIndex() == pPam->GetCntntNode()->Len() : !pPam->GetPoint()->nContent.GetIndex() ) { - if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, FALSE )) + if( !(*fnMove->fnNds)( &pPam->GetPoint()->nNode, sal_False )) { delete pPam; - return FALSE; + return sal_False; } SwCntntNode *pNd = pPam->GetPoint()->nNode.GetNode().GetCntntNode(); xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); pPam->GetPoint()->nContent.Assign( pNd, nTmpPos ); } - BOOL bFirst = TRUE; + sal_Bool bFirst = sal_True; SwCntntNode* pNode; while( !bFound && 0 != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly ))) diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index f95e83d12e..c2faef33dd 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -28,15 +28,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> - - #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS #include <svl/svstdarr.hxx> + #include <vcl/svapp.hxx> +#include <vcl/window.hxx> + #include <txatritr.hxx> #include <fldbas.hxx> #include <fmtfld.hxx> @@ -44,15 +46,16 @@ #include <txtfld.hxx> #include <swcrsr.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <pamtyp.hxx> #include <ndtxt.hxx> #include <swundo.hxx> +#include <UndoInsert.hxx> #include <breakit.hxx> #include <docsh.hxx> #include <PostItMgr.hxx> #include <viewsh.hxx> -#include <vcl/window.hxx> using namespace ::com::sun::star; using namespace util; @@ -69,7 +72,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, const SwpHints *pHts = rNd.GetpSwpHints(); - USHORT n = 0; + sal_uInt16 n = 0; xub_StrLen nSoftHyphen = nStart; xub_StrLen nHintStart = STRING_LEN; bool bNewHint = true; @@ -142,10 +145,9 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, // wir sie einfach. // Fuer das Ende merken wir uns die Ersetzungen und entferenen // hinterher alle am Stringende (koenten ja 'normale' 0x7f drinstehen - BOOL bEmpty = RES_TXTATR_FIELD != pHt->Which() || + sal_Bool bEmpty = RES_TXTATR_FIELD != pHt->Which() || !(static_cast<SwTxtFld const*>(pHt) - ->GetFld().GetFld()->ExpandField( - rNd.GetDoc()->IsClipBoard()).Len()); + ->GetFld().GetFld()->ExpandField(true).Len()); if ( bEmpty && nStart == nAkt ) { rArr.Insert( nAkt, rArr.Count() ); @@ -178,7 +180,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart, } while ( true ); - for( USHORT i = aReplaced.Count(); i; ) + for( sal_uInt16 i = aReplaced.Count(); i; ) { const xub_StrLen nTmp = aReplaced[ --i ]; if( nTmp == rRet.Len() - 1 ) @@ -224,15 +226,15 @@ xub_StrLen GetPostIt(xub_StrLen aCount,const SwpHints *pHts) return aIndex; } -BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::TextSearch& rSTxt, +sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes , utl::TextSearch& rSTxt, SwMoveFn fnMove, const SwPaM * pRegion, - BOOL bInReadOnly ) + sal_Bool bInReadOnly ) { if( !rSearchOpt.searchString.getLength() ) - return FALSE; + return sal_False; SwPaM* pPam = MakeRegion( fnMove, pRegion ); - BOOL bSrchForward = fnMove == fnMoveForward; + sal_Bool bSrchForward = fnMove == fnMoveForward; SwNodeIndex& rNdIdx = pPam->GetPoint()->nNode; SwIndex& rCntntIdx = pPam->GetPoint()->nContent; @@ -243,10 +245,10 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te rCntntIdx.GetIndex() ) : !rCntntIdx.GetIndex() && pPam->GetCntntNode()->Len() ) { - if( !(*fnMove->fnNds)( &rNdIdx, FALSE )) + if( !(*fnMove->fnNds)( &rNdIdx, sal_False )) { delete pPam; - return FALSE; + return sal_False; } SwCntntNode *pNd = rNdIdx.GetNode().GetCntntNode(); xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); @@ -254,14 +256,14 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te } /* - * Ist bFound == TRUE, dann wurde der String gefunden und in + * Ist bFound == sal_True, dann wurde der String gefunden und in * nStart und nEnde steht der gefundenen String */ - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; /* * StartPostion im Text oder Anfangsposition */ - BOOL bFirst = TRUE; + sal_Bool bFirst = sal_True; SwCntntNode * pNode; //testarea //String sCleanStr; @@ -270,11 +272,11 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te xub_StrLen nStart, nEnde, nTxtLen; - BOOL bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType; - BOOL bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() && + sal_Bool bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType; + sal_Bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() && ( !rSearchOpt.searchString.compareToAscii( "^$" ) || !rSearchOpt.searchString.compareToAscii( "$^" ) ); - BOOL bChkParaEnd = bRegSearch && 1 == rSearchOpt.searchString.getLength() && + sal_Bool bChkParaEnd = bRegSearch && 1 == rSearchOpt.searchString.getLength() && !rSearchOpt.searchString.compareToAscii( "$" ); // LanguageType eLastLang = 0; @@ -420,7 +422,7 @@ BYTE SwPaM::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes , utl::Te bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, SwMoveFn fnMove, - BOOL bSrchForward, BOOL bRegSearch, BOOL bChkEmptyPara, BOOL bChkParaEnd, + sal_Bool bSrchForward, sal_Bool bRegSearch, sal_Bool bChkEmptyPara, sal_Bool bChkParaEnd, xub_StrLen &nStart, xub_StrLen &nEnde, xub_StrLen nTxtLen,SwNode* pNode, SwPaM* pPam) { bool bFound = false; @@ -452,8 +454,8 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, aFltArr, sCleanStr, bRemoveSoftHyphens ); SwScriptIterator* pScriptIter = 0; - USHORT nSearchScript = 0; - USHORT nCurrScript = 0; + sal_uInt16 nSearchScript = 0; + sal_uInt16 nCurrScript = 0; if ( SearchAlgorithms_APPROXIMATE == rSearchOpt.algorithmType && pBreakIt->GetBreakIter().is() ) @@ -524,7 +526,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, if( !bSrchForward ) // rueckwaerts Suche? Exchange(); // Point und Mark tauschen - bFound = TRUE; + bFound = sal_True; break; } @@ -548,7 +550,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, { if( !bSrchForward ) // rueckwaerts Suche? Exchange(); // Point und Mark tauschen - //bFound = TRUE; + //bFound = sal_True; //break; return true; } @@ -562,13 +564,13 @@ struct SwFindParaText : public SwFindParas const SearchOptions& rSearchOpt; SwCursor& rCursor; utl::TextSearch aSTxt; - BOOL bReplace; - BOOL bSearchInNotes; + sal_Bool bReplace; + sal_Bool bSearchInNotes; - SwFindParaText( const SearchOptions& rOpt, BOOL bSearchNotes, int bRepl, SwCursor& rCrsr ) + SwFindParaText( const SearchOptions& rOpt, sal_Bool bSearchNotes, int bRepl, SwCursor& rCrsr ) : rSearchOpt( rOpt ), rCursor( rCrsr ), aSTxt( rOpt ), bReplace( 0 != bRepl ), bSearchInNotes( bSearchNotes ) {} - virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, BOOL bInReadOnly ); + virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, sal_Bool bInReadOnly ); virtual int IsReplaceMode() const; virtual ~SwFindParaText(); }; @@ -578,12 +580,12 @@ SwFindParaText::~SwFindParaText() } int SwFindParaText::Find( SwPaM* pCrsr, SwMoveFn fnMove, - const SwPaM* pRegion, BOOL bInReadOnly ) + const SwPaM* pRegion, sal_Bool bInReadOnly ) { if( bInReadOnly && bReplace ) - bInReadOnly = FALSE; + bInReadOnly = sal_False; - BOOL bFnd = (BOOL)pCrsr->Find( rSearchOpt, bSearchInNotes, aSTxt, fnMove, pRegion, bInReadOnly ); + sal_Bool bFnd = (sal_Bool)pCrsr->Find( rSearchOpt, bSearchInNotes, aSTxt, fnMove, pRegion, bInReadOnly ); if( bFnd && bReplace ) // String ersetzen ?? @@ -631,9 +633,9 @@ int SwFindParaText::IsReplaceMode() const } -ULONG SwCursor::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes, +sal_uLong SwCursor::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes, SwDocPositions nStart, SwDocPositions nEnde, - BOOL& bCancel, + sal_Bool& bCancel, FindRanges eFndRngs, int bReplace ) { // OLE-Benachrichtigung abschalten !! @@ -641,21 +643,27 @@ ULONG SwCursor::Find( const SearchOptions& rSearchOpt, BOOL bSearchInNotes, Link aLnk( pDoc->GetOle2Link() ); pDoc->SetOle2Link( Link() ); - BOOL bSttUndo = pDoc->DoesUndo() && bReplace; - if( bSttUndo ) - pDoc->StartUndo( UNDO_REPLACE, NULL ); + bool const bStartUndo = pDoc->GetIDocumentUndoRedo().DoesUndo() && bReplace; + if (bStartUndo) + { + pDoc->GetIDocumentUndoRedo().StartUndo( UNDO_REPLACE, NULL ); + } - BOOL bSearchSel = 0 != (rSearchOpt.searchFlag & SearchFlags::REG_NOT_BEGINOFLINE); + sal_Bool bSearchSel = 0 != (rSearchOpt.searchFlag & SearchFlags::REG_NOT_BEGINOFLINE); if( bSearchSel ) eFndRngs = (FindRanges)(eFndRngs | FND_IN_SEL); SwFindParaText aSwFindParaText( rSearchOpt, bSearchInNotes, bReplace, *this ); - ULONG nRet = FindAll( aSwFindParaText, nStart, nEnde, eFndRngs, bCancel ); + sal_uLong nRet = FindAll( aSwFindParaText, nStart, nEnde, eFndRngs, bCancel ); pDoc->SetOle2Link( aLnk ); if( nRet && bReplace ) pDoc->SetModified(); - if( bSttUndo ) - pDoc->EndUndo( UNDO_REPLACE, NULL ); + if (bStartUndo) + { + SwRewriter rewriter(MakeUndoReplaceRewriter( + nRet, rSearchOpt.searchString, rSearchOpt.replaceString)); + pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_REPLACE, & rewriter ); + } return nRet; } @@ -665,8 +673,8 @@ String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam ) if( pPam && pPam->HasMark() && SearchAlgorithms_REGEXP == rSearchOpt.algorithmType ) { - const SwCntntNode* pTxtNode = pPam->GetCntntNode( TRUE ); - if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( FALSE ) ) + const SwCntntNode* pTxtNode = pPam->GetCntntNode( sal_True ); + if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( sal_False ) ) { utl::TextSearch aSTxt( rSearchOpt ); String aStr( pPam->GetTxt() ); diff --git a/sw/source/core/crsr/makefile.mk b/sw/source/core/crsr/makefile.mk deleted file mode 100644 index c5c59b8ba1..0000000000 --- a/sw/source/core/crsr/makefile.mk +++ /dev/null @@ -1,80 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/.. - -PRJNAME=sw -TARGET=crsr - -AUTOSEG=true - -# --- Settings ----------------------------------------------------- - -.INCLUDE : $(PRJ)$/inc$/swpre.mk -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/inc$/sw.mk - -.IF "$(mydebug)" != "" -CDEFS+=-Dmydebug -.ENDIF - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES= \ - $(SLO)$/BlockCursor.obj \ - $(SLO)$/bookmrk.obj \ - $(SLO)$/callnk.obj \ - $(SLO)$/crbm.obj \ - $(SLO)$/crossrefbookmark.obj \ - $(SLO)$/crsrsh.obj \ - $(SLO)$/crstrvl.obj \ - $(SLO)$/crstrvl1.obj \ - $(SLO)$/findattr.obj \ - $(SLO)$/findcoll.obj \ - $(SLO)$/findfmt.obj \ - $(SLO)$/findtxt.obj \ - $(SLO)$/pam.obj \ - $(SLO)$/paminit.obj \ - $(SLO)$/swcrsr.obj \ - $(SLO)$/trvlcol.obj \ - $(SLO)$/trvlfnfl.obj \ - $(SLO)$/trvlreg.obj \ - $(SLO)$/trvltbl.obj \ - $(SLO)$/unocrsr.obj \ - $(SLO)$/viscrs.obj - -SLOFILES = \ - $(EXCEPTIONSFILES) - -.IF "$(mydebug)" != "" -SLOFILES += \ - $(SLO)$/pamio.obj -.ENDIF - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 5fe642960c..21b1a11c4a 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -57,7 +57,7 @@ #include <xmloff/odffields.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(); } @@ -105,58 +105,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 ); } @@ -258,9 +258,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 ); @@ -268,14 +268,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(); @@ -284,29 +284,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 ) @@ -328,34 +328,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; @@ -364,14 +364,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; @@ -561,9 +561,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; @@ -612,7 +612,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) || @@ -624,7 +624,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) @@ -634,7 +634,7 @@ USHORT SwPaM::GetPageNum( BOOL bAtPoint, const Point* pLayPos ) const SwPosition* pPos = bAtPoint ? m_pPoint : m_pMark; if( 0 != ( pNd = pPos->nNode.GetNode().GetCntntNode() ) && - 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, FALSE )) && + 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, sal_False )) && 0 != ( pPg = pCFrm->FindPageFrm() )) return pPg->GetPhyPageNum(); return 0; @@ -667,15 +667,15 @@ 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() )) - pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), FALSE ); + pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), sal_False ); else pFrm = 0; @@ -685,31 +685,31 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const if( pFrm && ( pFrm->IsProtected() || ( bFormView && 0 == ( pSttEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) ) - bRet = TRUE; + bRet = sal_True; else if( pNd ) { const SwSectionNode* pSNd = pNd->GetSectionNode(); if( pSNd && ( pSNd->GetSection().IsProtectFlag() || (bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) ) - bRet = TRUE; + bRet = sal_True; } if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode ) { if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() )) - pFrm = pNd->GetFrm( &aTmpPt, GetMark(), FALSE ); + pFrm = pNd->GetFrm( &aTmpPt, GetMark(), sal_False ); else pFrm = 0; if( pFrm && ( pFrm->IsProtected() || ( bFormView && 0 == ( pEndEIRFrm = lcl_FindEditInReadonlyFrm( *pFrm ) ) ) ) ) - bRet = TRUE; + bRet = sal_True; else if( pNd ) { const SwSectionNode* pSNd = pNd->GetSectionNode(); if( pSNd && ( pSNd->GetSection().IsProtectFlag() || (bFormView && !pSNd->GetSection().IsEditInReadonlyFlag()) ) ) - bRet = TRUE; + bRet = sal_True; } if ( !bRet && bFormView ) @@ -717,18 +717,18 @@ 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; } // oder sollte eine geschuetzte Section innerhalb der // 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; } @@ -739,14 +739,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); OSL_ENSURE( 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() ) { @@ -756,10 +756,10 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const if( CONTENT_SECTION == rSect.GetType() ) { RestoreSavePos(); - return TRUE; + return sal_True; } */ - bRet = TRUE; + bRet = sal_True; break; } } @@ -788,7 +788,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const { // Unhandled fieldmarks case shouldn't be edited manually to avoid breaking anything if ( ( pA == pB ) && bUnhandledMark ) - bRet = TRUE; + bRet = sal_True; else { // Form protection case @@ -816,8 +816,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; @@ -826,7 +826,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove, { if( rbFirst ) { - rbFirst = FALSE; + rbFirst = sal_False; pNd = rPam.GetCntntNode(); if( pNd ) { @@ -849,18 +849,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 )); @@ -910,7 +910,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 ); } @@ -920,7 +920,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-- ); @@ -936,35 +936,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 ) ); @@ -972,35 +972,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 ); } @@ -1009,7 +1009,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 ) ) { @@ -1018,13 +1018,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(); @@ -1036,24 +1036,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 ) ) { @@ -1062,14 +1062,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 @@ -1077,10 +1077,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, @@ -1089,7 +1089,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 @@ -1100,17 +1100,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 @@ -1121,13 +1121,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; } String SwPaM::GetTxt() const @@ -1178,7 +1178,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()); } @@ -1197,7 +1197,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()); } diff --git a/sw/source/core/crsr/paminit.cxx b/sw/source/core/crsr/paminit.cxx index 7a235af5ec..c5dd82c39e 100644 --- a/sw/source/core/crsr/paminit.cxx +++ b/sw/source/core/crsr/paminit.cxx @@ -76,9 +76,9 @@ SwPosSection fnSectionStart = &aFwrd; SwPosSection fnSectionEnd = &aBwrd; // Travelling in Tabellen -BOOL GotoPrevTable( SwPaM&, SwPosTable, BOOL bInReadOnly ); -BOOL GotoCurrTable( SwPaM&, SwPosTable, BOOL bInReadOnly ); -BOOL GotoNextTable( SwPaM&, SwPosTable, BOOL bInReadOnly ); +sal_Bool GotoPrevTable( SwPaM&, SwPosTable, sal_Bool bInReadOnly ); +sal_Bool GotoCurrTable( SwPaM&, SwPosTable, sal_Bool bInReadOnly ); +sal_Bool GotoNextTable( SwPaM&, SwPosTable, sal_Bool bInReadOnly ); SwWhichTable fnTablePrev = &GotoPrevTable; SwWhichTable fnTableCurr = &GotoCurrTable; @@ -87,10 +87,10 @@ SwPosTable fnTableStart = &aFwrd; SwPosTable fnTableEnd = &aBwrd; // Travelling in Bereichen -BOOL GotoPrevRegion( SwPaM&, SwPosRegion, BOOL bInReadOnly ); -BOOL GotoCurrRegion( SwPaM&, SwPosRegion, BOOL bInReadOnly ); -BOOL GotoCurrRegionAndSkip( SwPaM&, SwPosRegion, BOOL bInReadOnly ); -BOOL GotoNextRegion( SwPaM&, SwPosRegion, BOOL bInReadOnly ); +sal_Bool GotoPrevRegion( SwPaM&, SwPosRegion, sal_Bool bInReadOnly ); +sal_Bool GotoCurrRegion( SwPaM&, SwPosRegion, sal_Bool bInReadOnly ); +sal_Bool GotoCurrRegionAndSkip( SwPaM&, SwPosRegion, sal_Bool bInReadOnly ); +sal_Bool GotoNextRegion( SwPaM&, SwPosRegion, sal_Bool bInReadOnly ); SwWhichRegion fnRegionPrev = &GotoPrevRegion; SwWhichRegion fnRegionCurr = &GotoCurrRegion; diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 2f731bf009..bbdb8c7045 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -44,6 +44,7 @@ #include <swcrsr.hxx> #include <unocrsr.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <docary.hxx> #include <ndtxt.hxx> #include <section.hxx> @@ -66,21 +67,21 @@ using namespace ::com::sun::star::i18n; -static const USHORT coSrchRplcThreshold = 60000; +static const sal_uInt16 coSrchRplcThreshold = 60000; struct _PercentHdl { SwDocShell* pDSh; - ULONG nActPos; - BOOL bBack, bNodeIdx; + sal_uLong nActPos; + sal_Bool bBack, bNodeIdx; - _PercentHdl( ULONG nStt, ULONG nEnd, SwDocShell* pSh ) + _PercentHdl( sal_uLong nStt, sal_uLong nEnd, SwDocShell* pSh ) : pDSh( pSh ) { nActPos = nStt; if( 0 != ( bBack = (nStt > nEnd )) ) { - ULONG n = nStt; nStt = nEnd; nEnd = n; + sal_uLong n = nStt; nStt = nEnd; nEnd = n; } ::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd, 0 ); } @@ -88,35 +89,35 @@ struct _PercentHdl _PercentHdl( const SwPaM& rPam ) : pDSh( (SwDocShell*)rPam.GetDoc()->GetDocShell() ) { - ULONG nStt, nEnd; + sal_uLong nStt, nEnd; if( rPam.GetPoint()->nNode == rPam.GetMark()->nNode ) { - bNodeIdx = FALSE; + bNodeIdx = sal_False; nStt = rPam.GetMark()->nContent.GetIndex(); nEnd = rPam.GetPoint()->nContent.GetIndex(); } else { - bNodeIdx = TRUE; + bNodeIdx = sal_True; nStt = rPam.GetMark()->nNode.GetIndex(); nEnd = rPam.GetPoint()->nNode.GetIndex(); } nActPos = nStt; if( 0 != ( bBack = (nStt > nEnd )) ) { - ULONG n = nStt; nStt = nEnd; nEnd = n; + sal_uLong n = nStt; nStt = nEnd; nEnd = n; } ::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd, pDSh ); } ~_PercentHdl() { ::EndProgress( pDSh ); } - void NextPos( ULONG nPos ) const + void NextPos( sal_uLong nPos ) const { ::SetProgressState( bBack ? nActPos - nPos : nPos, pDSh ); } void NextPos( SwPosition& rPos ) const { - ULONG nPos; + sal_uLong nPos; if( bNodeIdx ) nPos = rPos.nNode.GetIndex(); else @@ -158,12 +159,12 @@ bool SwCursor::IsReadOnlyAvailable() const return false; } -BOOL SwCursor::IsSkipOverHiddenSections() const +sal_Bool SwCursor::IsSkipOverHiddenSections() const { - return TRUE; + return sal_True; } -BOOL SwCursor::IsSkipOverProtectSections() const +sal_Bool SwCursor::IsSkipOverProtectSections() const { return !IsReadOnlyAvailable(); } @@ -196,7 +197,7 @@ _SwCursor_SavePos* SwCursor::CreateNewSavePos() const // stelle fest, ob sich der Point ausserhalb des Content-Bereichs // vom Nodes-Array befindet -BOOL SwCursor::IsNoCntnt() const +sal_Bool SwCursor::IsNoCntnt() const { return GetPoint()->nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex(); @@ -216,7 +217,7 @@ bool SwTableCursor::IsSelOvrCheck(int eFlags) && HasMark() ) { SwNodeIndex aOldPos( rNds, GetSavePos()->nNode ); - if( !CheckNodesRange( aOldPos, GetPoint()->nNode, TRUE )) + if( !CheckNodesRange( aOldPos, GetPoint()->nNode, sal_True )) { GetPoint()->nNode = aOldPos; GetPoint()->nContent.Assign( GetCntntNode(), GetSavePos()->nCntnt ); @@ -226,17 +227,17 @@ bool SwTableCursor::IsSelOvrCheck(int eFlags) return SwCursor::IsSelOvrCheck(eFlags); } -BOOL SwCursor::IsSelOvr( int eFlags ) +sal_Bool SwCursor::IsSelOvr( int eFlags ) { SwDoc* pDoc = GetDoc(); SwNodes& rNds = pDoc->GetNodes(); - BOOL bSkipOverHiddenSections = IsSkipOverHiddenSections(); - BOOL bSkipOverProtectSections = IsSkipOverProtectSections(); + sal_Bool bSkipOverHiddenSections = IsSkipOverHiddenSections(); + sal_Bool bSkipOverProtectSections = IsSkipOverProtectSections(); if ( IsSelOvrCheck( eFlags ) ) { - return TRUE; + return sal_True; } // neu: Bereiche ueberpruefen @@ -256,7 +257,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) { // dann wars das schon RestoreSavePos(); - return TRUE; + return sal_True; } // dann setze den Cursor auf die neue Position: @@ -274,14 +275,14 @@ BOOL SwCursor::IsSelOvr( int eFlags ) } int bIsValidPos = 0 != pCNd; - BOOL bValidNodesRange = bIsValidPos && - ::CheckNodesRange( rPtIdx, aIdx, TRUE ); + sal_Bool bValidNodesRange = bIsValidPos && + ::CheckNodesRange( rPtIdx, aIdx, sal_True ); if( !bValidNodesRange ) { rPtIdx = pSavePos->nNode; if( 0 == ( pCNd = rPtIdx.GetNode().GetCntntNode() ) ) { - bIsValidPos = FALSE; + bIsValidPos = sal_False; nCntntPos = 0; rPtIdx = aIdx; if( 0 == ( pCNd = rPtIdx.GetNode().GetCntntNode() ) ) @@ -298,32 +299,32 @@ BOOL SwCursor::IsSelOvr( int eFlags ) GetPoint()->nContent.Assign( pCNd, nTmpPos ); if( !bIsValidPos || !bValidNodesRange || // sollten wir in einer Tabelle gelandet sein? - IsInProtectTable( TRUE ) ) - return TRUE; + IsInProtectTable( sal_True ) ) + return sal_True; } // oder sollte eine geschuetzte Section innerhalb der Selektion liegen? if( HasMark() && bSkipOverProtectSections) { - 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; } const SwSectionFmts& rFmts = pDoc->GetSections(); - for( USHORT n = 0; n < rFmts.Count(); ++n ) + for( sal_uInt16 n = 0; n < rFmts.Count(); ++n ) { const SwSectionFmt* pFmt = rFmts[n]; const SvxProtectItem& rProtect = pFmt->GetProtect(); if( rProtect.IsCntntProtected() ) { - const SwFmtCntnt& rCntnt = pFmt->GetCntnt(FALSE); + const SwFmtCntnt& rCntnt = pFmt->GetCntnt(sal_False); OSL_ENSURE( rCntnt.GetCntntIdx(), "wo ist der SectionNode?" ); - ULONG nIdx = rCntnt.GetCntntIdx()->GetIndex(); + sal_uLong nIdx = rCntnt.GetCntntIdx()->GetIndex(); if( nSttIdx <= nIdx && nEndIdx >= nIdx ) { // ist es keine gelinkte Section, dann kann sie auch @@ -332,7 +333,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) if( CONTENT_SECTION == rSect.GetType() ) { RestoreSavePos(); - return TRUE; + return sal_True; } } } @@ -384,7 +385,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) GetPoint()->nContent.Assign( pCNd, nTmpPos ); // sollten wir in einer Tabelle gelandet sein? - if( IsInProtectTable( TRUE ) ) + if( IsInProtectTable( sal_True ) ) pFrm = 0; } } @@ -393,7 +394,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) { DeleteMark(); RestoreSavePos(); - return TRUE; // ohne Frames geht gar nichts! + return sal_True; // ohne Frames geht gar nichts! } } @@ -402,19 +403,19 @@ BOOL SwCursor::IsSelOvr( int eFlags ) { DeleteMark(); RestoreSavePos(); - return TRUE; + return sal_True; } if( !HasMark() ) - return FALSE; + return sal_False; //JP 19.08.98: teste mal auf ungueltige Selektion - sprich ueber // GrundSections: - if( !::CheckNodesRange( GetMark()->nNode, GetPoint()->nNode, TRUE )) + if( !::CheckNodesRange( GetMark()->nNode, GetPoint()->nNode, sal_True )) { DeleteMark(); RestoreSavePos(); - return TRUE; // ohne Frames geht gar nichts! + return sal_True; // ohne Frames geht gar nichts! } const SwTableNode* pPtNd = pNd->FindTableNode(); @@ -424,21 +425,21 @@ BOOL SwCursor::IsSelOvr( int eFlags ) { DeleteMark(); RestoreSavePos(); - return TRUE; // ohne Frames geht gar nichts! + return sal_True; // ohne Frames geht gar nichts! } const SwTableNode* pMrkNd = pNd->FindTableNode(); // beide in keinem oder beide im gleichen TableNode if( ( !pMrkNd && !pPtNd ) || pPtNd == pMrkNd ) - return FALSE; + return sal_False; // in unterschiedlichen Tabellen oder nur Mark in der Tabelle if( ( pPtNd && pMrkNd ) || pMrkNd ) { // dann lasse das nicht zu, alte Pos zurueck RestoreSavePos(); // Crsr bleibt an der alten Position - return TRUE; + return sal_True; } // ACHTUNG: dieses kann nicht im TableMode geschehen !! @@ -446,14 +447,14 @@ BOOL SwCursor::IsSelOvr( int eFlags ) { if( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) { - BOOL bSelTop = GetPoint()->nNode.GetIndex() < + sal_Bool bSelTop = GetPoint()->nNode.GetIndex() < (( nsSwCursorSelOverFlags::SELOVER_TOGGLE & eFlags ) ? pSavePos->nNode : GetMark()->nNode.GetIndex()); do { // in Schleife fuer Tabelle hinter Tabelle - ULONG nSEIdx = pPtNd->EndOfSectionIndex(); - ULONG nSttEndTbl = nSEIdx + 1; // dflt. Sel. nach unten + sal_uLong nSEIdx = pPtNd->EndOfSectionIndex(); + sal_uLong nSttEndTbl = nSEIdx + 1; // dflt. Sel. nach unten if( bSelTop ) // Sel. nach oben nSttEndTbl = rNds[ nSEIdx ]->StartOfSectionIndex() - 1; @@ -466,8 +467,8 @@ BOOL SwCursor::IsSelOvr( int eFlags ) { // die lassen wir zu: pMyNd = bSelTop - ? rNds.GoPrevSection( &GetPoint()->nNode,TRUE,FALSE ) - : rNds.GoNextSection( &GetPoint()->nNode,TRUE,FALSE ); + ? rNds.GoPrevSection( &GetPoint()->nNode,sal_True,sal_False ) + : rNds.GoNextSection( &GetPoint()->nNode,sal_True,sal_False ); /* #i12312# Handle failure of Go{Prev|Next}Section */ if ( 0 == pMyNd) @@ -479,7 +480,7 @@ BOOL SwCursor::IsSelOvr( int eFlags ) if( pMyNd->IsCntntNode() && // ist es ein ContentNode ?? ::CheckNodesRange( GetMark()->nNode, - GetPoint()->nNode, TRUE )) + GetPoint()->nNode, sal_True )) { // TABLE IN TABLE const SwTableNode* pOuterTableNd = pMyNd->FindTableNode(); @@ -490,21 +491,21 @@ BOOL SwCursor::IsSelOvr( int eFlags ) SwCntntNode* pCNd = (SwCntntNode*)pMyNd; xub_StrLen nTmpPos = bSelTop ? pCNd->Len() : 0; GetPoint()->nContent.Assign( pCNd, nTmpPos ); - return FALSE; + return sal_False; } } if( bSelTop ? ( !pMyNd->IsEndNode() || 0 == ( pPtNd = pMyNd->FindTableNode() )) : 0 == ( pPtNd = pMyNd->GetTableNode() )) break; - } while( TRUE ); + } while( sal_True ); } // dann verbleibe auf der alten Position RestoreSavePos(); - return TRUE; // Crsr bleibt an der alten Position + return sal_True; // Crsr bleibt an der alten Position } - return FALSE; // was bleibt noch ?? + return sal_False; // was bleibt noch ?? } #if defined( UNX ) @@ -514,20 +515,20 @@ BOOL SwCursor::IsSelOvr( int eFlags ) #endif -BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr ) +sal_Bool SwCursor::IsInProtectTable( sal_Bool bMove, sal_Bool bChgCrsr ) { SwCntntNode* pCNd = GetCntntNode(); if( !pCNd ) - return FALSE; + return sal_False; // No table, no protected cell: const SwTableNode* pTableNode = pCNd->FindTableNode(); if ( !pTableNode ) - return FALSE; + return sal_False; // Current position == last save position? if ( pSavePos->nNode == GetPoint()->nNode.GetIndex() ) - return FALSE; + return sal_False; // Check for convered cell: bool bInCoveredCell = false; @@ -542,11 +543,11 @@ BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr ) { // Position not protected? if ( !pCNd->IsProtect() ) - return FALSE; + return sal_False; // Cursor in protected cells allowed? if ( IsReadOnlyAvailable() ) - return FALSE; + return sal_False; } // If we reach this point, we are in a protected or covered table cell! @@ -556,7 +557,7 @@ BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr ) if( bChgCrsr ) // restore the last save position RestoreSavePos(); - return TRUE; // Crsr bleibt an der alten Position + return sal_True; // Crsr bleibt an der alten Position } // wir stehen in einer geschuetzten TabellenZelle @@ -573,7 +574,7 @@ BOOL SwCursor::IsInProtectTable( BOOL bMove, BOOL bChgCrsr ) #else SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode()->EndOfSectionNode(), 1 ); #endif - BOOL bProt = TRUE; + sal_Bool bProt = sal_True; GoNextCell: do { if( !IDX.GetNode().IsStartNode() ) @@ -597,7 +598,7 @@ SetNextCrsr: if( pTmpCNd ) { GetPoint()->nContent.Assign( pTmpCNd, 0 ); - return FALSE; + return sal_False; } return IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ); @@ -614,12 +615,12 @@ SetNextCrsr: #if defined( UNX ) delete pCellStt; #endif - return TRUE; // Crsr bleibt an der alten Position + return sal_True; // Crsr bleibt an der alten Position } else if( pNd->IsTableNode() && IDX++ ) goto GoNextCell; - bProt = FALSE; // Index steht jetzt auf einem ContentNode + bProt = sal_False; // Index steht jetzt auf einem ContentNode goto SetNextCrsr; } @@ -634,7 +635,7 @@ SetNextCrsr: SwNodeIndex aCellStt( *GetNode()->FindTableBoxStartNode(), -1 ); #endif SwNode* pNd; - BOOL bProt = TRUE; + sal_Bool bProt = sal_True; GoPrevCell: do { if( !( pNd = &IDX.GetNode())->IsEndNode() ) @@ -658,7 +659,7 @@ SetPrevCrsr: if( pTmpCNd ) { GetPoint()->nContent.Assign( pTmpCNd, 0 ); - return FALSE; + return sal_False; } return IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ); @@ -674,18 +675,18 @@ SetPrevCrsr: #if defined( UNX ) delete pCellStt; #endif - return TRUE; // Crsr bleibt an der alten Position + return sal_True; // Crsr bleibt an der alten Position } else if( pNd->StartOfSectionNode()->IsTableNode() && IDX-- ) goto GoPrevCell; - bProt = FALSE; // Index steht jetzt auf einem ContentNode + bProt = sal_False; // Index steht jetzt auf einem ContentNode goto SetPrevCrsr; } } -// TRUE: an die Position kann der Cursor gesetzt werden -BOOL SwCursor::IsAtValidPos( BOOL bPoint ) const +// sal_True: an die Position kann der Cursor gesetzt werden +sal_Bool SwCursor::IsAtValidPos( sal_Bool bPoint ) const { const SwDoc* pDoc = GetDoc(); const SwPosition* pPos = bPoint ? GetPoint() : GetMark(); @@ -694,23 +695,23 @@ BOOL SwCursor::IsAtValidPos( BOOL bPoint ) const if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->GetFrm() && !dynamic_cast<const SwUnoCrsr*>(this) ) { - return FALSE; + return sal_False; } //JP 28.10.97: Bug 45129 - im UI-ReadOnly ist alles erlaubt if( !pDoc->GetDocShell() || !pDoc->GetDocShell()->IsReadOnlyUI() ) - return TRUE; + return sal_True; - BOOL bCrsrInReadOnly = IsReadOnlyAvailable(); + sal_Bool bCrsrInReadOnly = IsReadOnlyAvailable(); if( !bCrsrInReadOnly && pNd->IsProtect() ) - return FALSE; + return sal_False; const SwSectionNode* pSectNd = pNd->FindSectionNode(); if( pSectNd && (pSectNd->GetSection().IsHiddenFlag() || ( !bCrsrInReadOnly && pSectNd->GetSection().IsProtectFlag() ))) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } void SwCursor::SaveTblBoxCntnt( const SwPosition* ) {} @@ -732,22 +733,22 @@ SwMoveFnCollection* SwCursor::MakeFindRange( SwDocPositions nStart, } -ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr, +sal_uLong lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr, SwMoveFn fnMove, SwCursor*& pFndRing, SwPaM& aRegion, FindRanges eFndRngs, - BOOL bInReadOnly, BOOL& bCancel ) + sal_Bool bInReadOnly, sal_Bool& bCancel ) { SwDoc* pDoc = pCurCrsr->GetDoc(); - BOOL bDoesUndo = pDoc->DoesUndo(); + bool const bDoesUndo = pDoc->GetIDocumentUndoRedo().DoesUndo(); int nFndRet = 0; - ULONG nFound = 0; - int bSrchBkwrd = fnMove == fnMoveBackward, bEnde = FALSE; + sal_uLong nFound = 0; + int bSrchBkwrd = fnMove == fnMoveBackward, bEnde = sal_False; SwPaM *pTmpCrsr = pCurCrsr, *pSaveCrsr = pCurCrsr; // only create progress-bar for ShellCrsr bool bIsUnoCrsr = 0 != dynamic_cast<SwUnoCrsr*>(pCurCrsr); _PercentHdl* pPHdl = 0; - USHORT nCrsrCnt = 0; + sal_uInt16 nCrsrCnt = 0; if( FND_IN_SEL & eFndRngs ) { while( pCurCrsr != ( pTmpCrsr = (SwPaM*)pTmpCrsr->GetNext() )) @@ -797,25 +798,26 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr, if( !( eFndRngs & FND_IN_SELALL) ) { - bEnde = TRUE; + bEnde = sal_True; break; } - if( coSrchRplcThreshold == nFound && pDoc->DoesUndo() + if ((coSrchRplcThreshold == nFound) + && pDoc->GetIDocumentUndoRedo().DoesUndo() && rParas.IsReplaceMode()) { short nRet = pCurCrsr->MaxReplaceArived(); if( RET_YES == nRet ) { - pDoc->DelAllUndoObj(); - pDoc->DoUndo( FALSE ); + pDoc->GetIDocumentUndoRedo().DelAllUndoObj(); + pDoc->GetIDocumentUndoRedo().DoUndo(false); } else { - bEnde = TRUE; + bEnde = sal_True; if(RET_CANCEL == nRet) { - bCancel = TRUE; + bCancel = sal_True; //unwind() ?? } break; @@ -853,7 +855,7 @@ ULONG lcl_FindSelection( SwFindParas& rParas, SwCursor* pCurCrsr, pFndRing = pCurCrsr->Create(); delete pPHdl; - pDoc->DoUndo( bDoesUndo ); + pDoc->GetIDocumentUndoRedo().DoUndo(bDoesUndo); return nFound; } @@ -862,7 +864,7 @@ int lcl_MakeSelFwrd( const SwNode& rSttNd, const SwNode& rEndNd, SwPaM& rPam, int bFirst ) { if( rSttNd.GetIndex() + 1 == rEndNd.GetIndex() ) - return FALSE; + return sal_False; SwNodes& rNds = rPam.GetDoc()->GetNodes(); rPam.DeleteMark(); @@ -872,18 +874,18 @@ int lcl_MakeSelFwrd( const SwNode& rSttNd, const SwNode& rEndNd, rPam.GetPoint()->nNode = rSttNd; pCNd = rNds.GoNext( &rPam.GetPoint()->nNode ); if( !pCNd ) - return FALSE; + return sal_False; pCNd->MakeStartIndex( &rPam.GetPoint()->nContent ); } else if( rSttNd.GetIndex() > rPam.GetPoint()->nNode.GetIndex() || rPam.GetPoint()->nNode.GetIndex() >= rEndNd.GetIndex() ) - return FALSE; // steht nicht in dieser Section + return sal_False; // steht nicht in dieser Section rPam.SetMark(); rPam.GetPoint()->nNode = rEndNd; pCNd = rNds.GoPrevious( &rPam.GetPoint()->nNode ); if( !pCNd ) - return FALSE; + return sal_False; pCNd->MakeEndIndex( &rPam.GetPoint()->nContent ); return *rPam.GetMark() < *rPam.GetPoint(); @@ -894,7 +896,7 @@ int lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd, SwPaM& rPam, int bFirst ) { if( rEndNd.GetIndex() + 1 == rSttNd.GetIndex() ) - return FALSE; + return sal_False; SwNodes& rNds = rPam.GetDoc()->GetNodes(); rPam.DeleteMark(); @@ -904,18 +906,18 @@ int lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd, rPam.GetPoint()->nNode = rSttNd; pCNd = rNds.GoPrevious( &rPam.GetPoint()->nNode ); if( !pCNd ) - return FALSE; + return sal_False; pCNd->MakeEndIndex( &rPam.GetPoint()->nContent ); } else if( rEndNd.GetIndex() > rPam.GetPoint()->nNode.GetIndex() || rPam.GetPoint()->nNode.GetIndex() >= rSttNd.GetIndex() ) - return FALSE; // steht nicht in dieser Section + return sal_False; // steht nicht in dieser Section rPam.SetMark(); rPam.GetPoint()->nNode = rEndNd; pCNd = rNds.GoNext( &rPam.GetPoint()->nNode ); if( !pCNd ) - return FALSE; + return sal_False; pCNd->MakeStartIndex( &rPam.GetPoint()->nContent ); return *rPam.GetPoint() < *rPam.GetMark(); @@ -925,20 +927,20 @@ int lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd, // diese Methode "sucht" fuer alle Anwendungsfaelle, denn in SwFindParas // steht immer die richtigen Parameter und die entsprechende Find-Methode -ULONG SwCursor::FindAll( SwFindParas& rParas, +sal_uLong SwCursor::FindAll( SwFindParas& rParas, SwDocPositions nStart, SwDocPositions nEnde, - FindRanges eFndRngs, BOOL& bCancel ) + FindRanges eFndRngs, sal_Bool& bCancel ) { - bCancel = FALSE; + bCancel = sal_False; SwCrsrSaveState aSaveState( *this ); // Region erzeugen, ohne das diese in den Ring aufgenommen wird ! SwPaM aRegion( *GetPoint() ); SwMoveFn fnMove = MakeFindRange( nStart, nEnde, &aRegion ); - ULONG nFound = 0; + sal_uLong nFound = 0; int bMvBkwrd = fnMove == fnMoveBackward; - BOOL bInReadOnly = IsReadOnlyAvailable(); + sal_Bool bInReadOnly = IsReadOnlyAvailable(); SwCursor* pFndRing = 0; SwNodes& rNds = GetDoc()->GetNodes(); @@ -1034,8 +1036,8 @@ ULONG SwCursor::FindAll( SwFindParas& rParas, : rNds.GetEndOfPostIts().StartOfSectionNode(); if( bMvBkwrd - ? lcl_MakeSelBkwrd( rNds.GetEndOfContent(), *pSttNd,*this, FALSE ) - : lcl_MakeSelFwrd( *pSttNd, rNds.GetEndOfContent(), *this, FALSE )) + ? lcl_MakeSelBkwrd( rNds.GetEndOfContent(), *pSttNd,*this, sal_False ) + : lcl_MakeSelFwrd( *pSttNd, rNds.GetEndOfContent(), *this, sal_False )) { nFound = lcl_FindSelection( rParas, this, fnMove, pFndRing, aRegion, eFndRngs, bInReadOnly, bCancel ); @@ -1090,7 +1092,7 @@ ULONG SwCursor::FindAll( SwFindParas& rParas, void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const { - BOOL bIsStart = TRUE; + sal_Bool bIsStart = sal_True; SwCntntNode* pCNd = 0; SwNodes& rNds = GetDoc()->GetNodes(); @@ -1104,18 +1106,18 @@ void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const case DOCPOS_END: rPos.nNode = rNds.GetEndOfContent(); pCNd = rNds.GoPrevious( &rPos.nNode ); - bIsStart = FALSE; + bIsStart = sal_False; break; case DOCPOS_OTHERSTART: - rPos.nNode = *rNds[ ULONG(0) ]; + rPos.nNode = *rNds[ sal_uLong(0) ]; pCNd = rNds.GoNext( &rPos.nNode ); break; case DOCPOS_OTHEREND: rPos.nNode = *rNds.GetEndOfContent().StartOfSectionNode(); pCNd = rNds.GoPrevious( &rPos.nNode ); - bIsStart = FALSE; + bIsStart = sal_False; break; // case DOCPOS_CURR: @@ -1138,49 +1140,49 @@ short SwCursor::MaxReplaceArived() } -BOOL SwCursor::IsStartWord( sal_Int16 nWordType ) const +sal_Bool SwCursor::IsStartWord( sal_Int16 nWordType ) const { return IsStartWordWT( nWordType ); } -BOOL SwCursor::IsEndWord( sal_Int16 nWordType ) const +sal_Bool SwCursor::IsEndWord( sal_Int16 nWordType ) const { return IsEndWordWT( nWordType ); } -BOOL SwCursor::IsInWord( sal_Int16 nWordType ) const +sal_Bool SwCursor::IsInWord( sal_Int16 nWordType ) const { return IsInWordWT( nWordType ); } -BOOL SwCursor::GoStartWord() +sal_Bool SwCursor::GoStartWord() { return GoStartWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); } -BOOL SwCursor::GoEndWord() +sal_Bool SwCursor::GoEndWord() { return GoEndWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); } -BOOL SwCursor::GoNextWord() +sal_Bool SwCursor::GoNextWord() { return GoNextWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); } -BOOL SwCursor::GoPrevWord() +sal_Bool SwCursor::GoPrevWord() { return GoPrevWordWT( WordType::ANYWORD_IGNOREWHITESPACES ); } -BOOL SwCursor::SelectWord( const Point* pPt ) +sal_Bool SwCursor::SelectWord( const Point* pPt ) { return SelectWordWT( WordType::ANYWORD_IGNOREWHITESPACES, pPt ); } -BOOL SwCursor::IsStartWordWT( sal_Int16 nWordType ) const +sal_Bool SwCursor::IsStartWordWT( sal_Int16 nWordType ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1193,9 +1195,9 @@ BOOL SwCursor::IsStartWordWT( sal_Int16 nWordType ) const return bRet; } -BOOL SwCursor::IsEndWordWT( sal_Int16 nWordType ) const +sal_Bool SwCursor::IsEndWordWT( sal_Int16 nWordType ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1209,9 +1211,9 @@ BOOL SwCursor::IsEndWordWT( sal_Int16 nWordType ) const return bRet; } -BOOL SwCursor::IsInWordWT( sal_Int16 nWordType ) const +sal_Bool SwCursor::IsInWordWT( sal_Int16 nWordType ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1220,7 +1222,7 @@ BOOL SwCursor::IsInWordWT( sal_Int16 nWordType ) const pTxtNd->GetTxt(), nPtPos, pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, - TRUE ); + sal_True ); bRet = aBoundary.startPos != aBoundary.endPos && aBoundary.startPos <= nPtPos && @@ -1234,9 +1236,9 @@ BOOL SwCursor::IsInWordWT( sal_Int16 nWordType ) const return bRet; } -BOOL SwCursor::IsStartEndSentence( bool bEnd ) const +sal_Bool SwCursor::IsStartEndSentence( bool bEnd ) const { - BOOL bRet = bEnd ? + sal_Bool bRet = bEnd ? GetCntntNode() && GetPoint()->nContent == GetCntntNode()->Len() : GetPoint()->nContent.GetIndex() == 0; @@ -1251,9 +1253,9 @@ BOOL SwCursor::IsStartEndSentence( bool bEnd ) const return bRet; } -BOOL SwCursor::GoStartWordWT( sal_Int16 nWordType ) +sal_Bool SwCursor::GoStartWordWT( sal_Int16 nWordType ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1263,21 +1265,21 @@ BOOL SwCursor::GoStartWordWT( sal_Int16 nWordType ) pTxtNd->GetTxt(), nPtPos, pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, - FALSE ).startPos; + sal_False ).startPos; if( nPtPos < pTxtNd->GetTxt().Len() ) { GetPoint()->nContent = nPtPos; if( !IsSelOvr() ) - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SwCursor::GoEndWordWT( sal_Int16 nWordType ) +sal_Bool SwCursor::GoEndWordWT( sal_Int16 nWordType ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1287,22 +1289,22 @@ BOOL SwCursor::GoEndWordWT( sal_Int16 nWordType ) pTxtNd->GetTxt(), nPtPos, pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, - TRUE ).endPos; + sal_True ).endPos; if( nPtPos <= pTxtNd->GetTxt().Len() && GetPoint()->nContent.GetIndex() != nPtPos ) { GetPoint()->nContent = nPtPos; if( !IsSelOvr() ) - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SwCursor::GoNextWordWT( sal_Int16 nWordType ) +sal_Bool SwCursor::GoNextWordWT( sal_Int16 nWordType ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1318,15 +1320,15 @@ BOOL SwCursor::GoNextWordWT( sal_Int16 nWordType ) { GetPoint()->nContent = nPtPos; if( !IsSelOvr() ) - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SwCursor::GoPrevWordWT( sal_Int16 nWordType ) +sal_Bool SwCursor::GoPrevWordWT( sal_Int16 nWordType ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1345,18 +1347,18 @@ BOOL SwCursor::GoPrevWordWT( sal_Int16 nWordType ) { GetPoint()->nContent = nPtPos; if( !IsSelOvr() ) - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt ) +sal_Bool SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt ) { SwCrsrSaveState aSave( *this ); - BOOL bRet = FALSE; - BOOL bForward = TRUE; + sal_Bool bRet = sal_False; + sal_Bool bForward = sal_True; DeleteMark(); SwRootFrm* pLayout; if( pPt && 0 != (pLayout = GetDoc()->GetRootFrm()) ) @@ -1388,7 +1390,7 @@ BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt ) GetMark()->nContent = rEnd.nContent; GetMark()->nContent--; //Don't select the end delimiter } - bRet = TRUE; + bRet = sal_True; } else { @@ -1407,7 +1409,7 @@ BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt ) SetMark(); GetMark()->nContent = (xub_StrLen)aBndry.startPos; if( !IsSelOvr() ) - bRet = TRUE; + bRet = sal_True; } } } @@ -1434,7 +1436,7 @@ static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd ) const bool nShowChg = IDocumentRedlineAccess::IsShowChanges( rDoc.GetRedlineMode() ); if ( nShowChg ) { - USHORT nAct = rDoc.GetRedlinePos( *pTxtNd, USHRT_MAX ); + sal_uInt16 nAct = rDoc.GetRedlinePos( *pTxtNd, USHRT_MAX ); for ( ; nAct < rDoc.GetRedlineTbl().Count(); nAct++ ) { const SwRedline* pRed = rDoc.GetRedlineTbl()[ nAct ]; @@ -1456,9 +1458,9 @@ static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd ) return aRes; } -BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) +sal_Bool SwCursor::GoSentence( SentenceMoveType eMoveType ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && pBreakIt->GetBreakIter().is() ) { @@ -1486,7 +1488,7 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) sNodeText, nPtPos, pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); - while (nPtPos != (USHORT) -1 && ++nPtPos < sNodeText.Len() + while (nPtPos != (sal_uInt16) -1 && ++nPtPos < sNodeText.Len() && sNodeText.GetChar(nPtPos)== ' ' /*isWhiteSpace( aTxt.GetChar(nPtPos)*/ ) ; break; @@ -1497,7 +1499,7 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) nPtPos, pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); if (nPtPos == 0) - return FALSE; // the previous sentence is not in this paragraph + return sal_False; // the previous sentence is not in this paragraph if (nPtPos > 0) nPtPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfSentence( sNodeText, @@ -1512,16 +1514,16 @@ BOOL SwCursor::GoSentence( SentenceMoveType eMoveType ) { GetPoint()->nContent = nPtPos; if( !IsSelOvr() ) - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SwCursor::ExpandToSentenceBorders() +sal_Bool SwCursor::ExpandToSentenceBorders() { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; const SwTxtNode* pStartNd = Start()->nNode.GetNode().GetTxtNode(); const SwTxtNode* pEndNd = End()->nNode.GetNode().GetTxtNode(); if (pStartNd && pEndNd && pBreakIt->GetBreakIter().is()) @@ -1557,14 +1559,14 @@ BOOL SwCursor::ExpandToSentenceBorders() bChanged = true; } if (bChanged && !IsSelOvr()) - bRes = TRUE; + bRes = sal_True; } return bRes; } -BOOL SwTableCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT /*nMode*/, - BOOL /*bVisualAllowed*/, BOOL /*bSkipHidden*/, BOOL /*bInsertCrsr*/ ) +sal_Bool SwTableCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 /*nMode*/, + sal_Bool /*bVisualAllowed*/, sal_Bool /*bSkipHidden*/, sal_Bool /*bInsertCrsr*/ ) { return bLeft ? GoPrevCell( nCnt ) : GoNextCell( nCnt ); @@ -1574,7 +1576,7 @@ BOOL SwTableCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT /*nMode*/, // calculate cursor bidi level: extracted from LeftRight() const SwCntntFrm* SwCursor::DoSetBidiLevelLeftRight( - BOOL & io_rbLeft, BOOL bVisualAllowed, BOOL bInsertCrsr) + sal_Bool & io_rbLeft, sal_Bool bVisualAllowed, sal_Bool bInsertCrsr) { // calculate cursor bidi level const SwCntntFrm* pSttFrm = NULL; @@ -1597,7 +1599,7 @@ SwCursor::DoSetBidiLevelLeftRight( pSttFrm = rTNd.GetFrm( &aPt, GetPoint() ); if( pSttFrm ) { - BYTE nCrsrLevel = GetCrsrBidiLevel(); + sal_uInt8 nCrsrLevel = GetCrsrBidiLevel(); sal_Bool bForward = ! io_rbLeft; ((SwTxtFrm*)pSttFrm)->PrepareVisualMove( nPos, nCrsrLevel, bForward, bInsertCrsr ); @@ -1621,8 +1623,8 @@ SwCursor::DoSetBidiLevelLeftRight( return pSttFrm; } -BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, - BOOL bVisualAllowed,BOOL bSkipHidden, BOOL bInsertCrsr ) +sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, + sal_Bool bVisualAllowed,sal_Bool bSkipHidden, sal_Bool bInsertCrsr ) { // calculate cursor bidi level SwNode& rNode = GetPoint()->nNode.GetNode(); @@ -1672,12 +1674,12 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, const long nRowSpan = pTableBox->getRowSpan(); if ( nRowSpan > 1 ) { - pTableBox = & pTableBox->FindEndOfRowSpan( pOldTabSttNode->GetTable(), (USHORT)(pTableBox->getRowSpan() + mnRowSpanOffset ) ); + pTableBox = & pTableBox->FindEndOfRowSpan( pOldTabSttNode->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset ) ); SwNodeIndex& rPtIdx = GetPoint()->nNode; SwNodeIndex aNewIdx( *pTableBox->GetSttNd() ); rPtIdx = aNewIdx; - GetDoc()->GetNodes().GoNextSection( &rPtIdx, FALSE, FALSE ); + GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_False, sal_False ); SwCntntNode* pCntntNode = GetCntntNode(); if ( pCntntNode ) { @@ -1713,7 +1715,7 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, SwNodeIndex aNewIdx( *pTableBox->GetSttNd() ); rPtIdx = aNewIdx; - GetDoc()->GetNodes().GoNextSection( &rPtIdx, FALSE, FALSE ); + GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_False, sal_False ); SwCntntNode* pCntntNode = GetCntntNode(); if ( pCntntNode ) { @@ -1747,7 +1749,7 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode, } } - return 0 == nCnt && !IsInProtectTable( TRUE ) && + return 0 == nCnt && !IsInProtectTable( sal_True ) && !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ); } @@ -1767,8 +1769,8 @@ void SwCursor::DoSetBidiLevelUpDown() if( nPos && nPos < ((SwTxtNode&)rNode).GetTxt().Len() ) { - const BYTE nCurrLevel = pSI->DirType( nPos ); - const BYTE nPrevLevel = pSI->DirType( nPos - 1 ); + const sal_uInt8 nCurrLevel = pSI->DirType( nPos ); + const sal_uInt8 nPrevLevel = pSI->DirType( nPos - 1 ); if ( nCurrLevel % 2 != nPrevLevel % 2 ) { @@ -1782,7 +1784,7 @@ void SwCursor::DoSetBidiLevelUpDown() } } -BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, +sal_Bool SwCursor::UpDown( sal_Bool bUp, sal_uInt16 nCnt, Point* pPt, long nUpDownX ) { SwTableCursor* pTblCrsr = dynamic_cast<SwTableCursor*>(this); @@ -1790,15 +1792,15 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, // vom Tabellen Crsr Point/Mark in der gleichen Box ?? // dann stelle den Point an den Anfang der Box - if( pTblCrsr && GetNode( TRUE )->StartOfSectionNode() == - GetNode( FALSE )->StartOfSectionNode() ) + if( pTblCrsr && GetNode( sal_True )->StartOfSectionNode() == + GetNode( sal_False )->StartOfSectionNode() ) { if ( End() != GetPoint() ) Exchange(); bAdjustTableCrsr = sal_True; } - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; Point aPt; if( pPt ) aPt = *pPt; @@ -1821,10 +1823,10 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, // Bei Fussnoten ist auch die Bewegung in eine andere Fussnote erlaubt. // aber keine Selection!! - const BOOL bChkRange = pFrm->IsInFtn() && !HasMark() - ? FALSE : TRUE; + const sal_Bool bChkRange = pFrm->IsInFtn() && !HasMark() + ? sal_False : sal_True; const SwPosition aOldPos( *GetPoint() ); - BOOL bInReadOnly = IsReadOnlyAvailable(); + sal_Bool bInReadOnly = IsReadOnlyAvailable(); if ( bAdjustTableCrsr && !bUp ) { @@ -1832,7 +1834,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, // has more than one paragraph. If we want to go down, we have to // set the point to the last frame in the table box. This is // only necessary if we do not already have a table selection - const SwStartNode* pTblNd = GetNode( TRUE )->FindTableBoxStartNode(); + const SwStartNode* pTblNd = GetNode( sal_True )->FindTableBoxStartNode(); OSL_ENSURE( pTblNd, "pTblCrsr without SwTableNode?" ); if ( pTblNd ) // safety first @@ -1879,7 +1881,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, } pFrm->GetCrsrOfst( GetPoint(), aPt, &eTmpState ); } - bRet = TRUE; + bRet = sal_True; } else *GetPoint() = aOldPos; @@ -1890,7 +1892,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt, return bRet; } -BOOL SwCursor::LeftRightMargin( BOOL bLeft, BOOL bAPI ) +sal_Bool SwCursor::LeftRightMargin( sal_Bool bLeft, sal_Bool bAPI ) { Point aPt; SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); @@ -1903,9 +1905,9 @@ BOOL SwCursor::LeftRightMargin( BOOL bLeft, BOOL bAPI ) pFrm->RightMargin( this, bAPI ) ); } -BOOL SwCursor::IsAtLeftRightMargin( BOOL bLeft, BOOL bAPI ) const +sal_Bool SwCursor::IsAtLeftRightMargin( sal_Bool bLeft, sal_Bool bAPI ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; Point aPt; SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() ); if( pFrm ) @@ -1920,16 +1922,16 @@ BOOL SwCursor::IsAtLeftRightMargin( BOOL bLeft, BOOL bAPI ) const return bRet; } -BOOL SwCursor::SttEndDoc( BOOL bStt ) +sal_Bool SwCursor::SttEndDoc( sal_Bool bStt ) { SwCrsrSaveState aSave( *this ); // Springe beim Selektieren nie ueber Section-Grenzen !! // kann der Cursor weiterverschoben werden ? SwMoveFn fnMove = bStt ? fnMoveBackward : fnMoveForward; - BOOL bRet = (!HasMark() || !IsNoCntnt() ) && + sal_Bool bRet = (!HasMark() || !IsNoCntnt() ) && Move( fnMove, fnGoDoc ) && - !IsInProtectTable( TRUE ) && + !IsInProtectTable( sal_True ) && !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS | nsSwCursorSelOverFlags::SELOVER_ENABLEREVDIREKTION ); @@ -1937,11 +1939,11 @@ BOOL SwCursor::SttEndDoc( BOOL bStt ) return bRet; } -BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt ) +sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt ) { const SwTableNode* pTblNd = GetPoint()->nNode.GetNode().FindTableNode(); if( !pTblNd ) - return FALSE; + return sal_False; // liegt vor dem StartNode der Cell ein weiterer EndNode, dann // gibt es auch eine vorherige Celle @@ -1959,7 +1961,7 @@ BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt ) { if ( pTableBox->getRowSpan() > 1 ) { - pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(), (USHORT)(pTableBox->getRowSpan() + mnRowSpanOffset) ); + pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(), (sal_uInt16)(pTableBox->getRowSpan() + mnRowSpanOffset) ); SwNodeIndex aNewIdx( *pTableBox->GetSttNd() ); rPtIdx = aNewIdx; pTableBoxStartNode = rPtIdx.GetNode().FindTableBoxStartNode(); @@ -1974,7 +1976,7 @@ BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt ) SwNodeIndex aCellIdx( *pTmpNode, bNext ? 1 : -1 ); if( (bNext && !aCellIdx.GetNode().IsStartNode()) || (!bNext && !aCellIdx.GetNode().IsEndNode()) ) - return FALSE; + return sal_False; rPtIdx = bNext ? aCellIdx : SwNodeIndex(*aCellIdx.GetNode().StartOfSectionNode()); @@ -1992,20 +1994,20 @@ BOOL SwCursor::GoPrevNextCell( BOOL bNext, USHORT nCnt ) rPtIdx++; if( !rPtIdx.GetNode().IsCntntNode() ) - GetDoc()->GetNodes().GoNextSection( &rPtIdx, TRUE, FALSE ); + GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_True, sal_False ); GetPoint()->nContent.Assign( GetCntntNode(), 0 ); - return !IsInProtectTable( TRUE ); + return !IsInProtectTable( sal_True ); } -BOOL SwTableCursor::GotoTable( const String& /*rName*/ ) +sal_Bool SwTableCursor::GotoTable( const String& /*rName*/ ) { - return FALSE; // invalid action + return sal_False; // invalid action } -BOOL SwCursor::GotoTable( const String& rName ) +sal_Bool SwCursor::GotoTable( const String& rName ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( !HasMark() ) { SwTable* pTmpTbl = SwTable::FindTable( GetDoc()->FindTblFmtByName( rName ) ); @@ -2022,9 +2024,9 @@ BOOL SwCursor::GotoTable( const String& rName ) return bRet; } -BOOL SwCursor::GotoTblBox( const String& rName ) +sal_Bool SwCursor::GotoTblBox( const String& rName ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTableNode* pTblNd = GetPoint()->nNode.GetNode().FindTableNode(); if( pTblNd ) { @@ -2043,7 +2045,7 @@ BOOL SwCursor::GotoTblBox( const String& rName ) return bRet; } -BOOL SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara ) +sal_Bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara ) { //for optimization test something before const SwNode* pNd = &GetPoint()->nNode.GetNode(); @@ -2078,18 +2080,18 @@ BOOL SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara ) // a same node type. SwCrsrSaveState aSave( *this ); return (*fnWhichPara)( *this, fnPosPara ) && - !IsInProtectTable( TRUE ) && + !IsInProtectTable( sal_True ) && !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ); } -BOOL SwCursor::MoveSection( SwWhichSection fnWhichSect, +sal_Bool SwCursor::MoveSection( SwWhichSection fnWhichSect, SwPosSection fnPosSect) { SwCrsrSaveState aSave( *this ); return (*fnWhichSect)( *this, fnPosSect ) && - !IsInProtectTable( TRUE ) && + !IsInProtectTable( sal_True ) && !IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE | nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ); } @@ -2109,8 +2111,8 @@ void SwCursor::RestoreSavePos() SwTableCursor::SwTableCursor( const SwPosition &rPos, SwPaM* pRing ) : SwCursor( rPos, pRing, false ) { - bParked = FALSE; - bChg = FALSE; + bParked = sal_False; + bChg = sal_False; nTblPtNd = 0, nTblMkNd = 0; nTblPtCnt = 0, nTblMkCnt = 0; } @@ -2118,32 +2120,32 @@ SwTableCursor::SwTableCursor( const SwPosition &rPos, SwPaM* pRing ) SwTableCursor::~SwTableCursor() {} -BOOL lcl_SeekEntry( const SwSelBoxes& rTmp, const SwStartNode* pSrch, USHORT& rFndPos ) +sal_Bool lcl_SeekEntry( const SwSelBoxes& rTmp, const SwStartNode* pSrch, sal_uInt16& rFndPos ) { - ULONG nIdx = pSrch->GetIndex(); + sal_uLong nIdx = pSrch->GetIndex(); - USHORT nO = rTmp.Count(); + sal_uInt16 nO = rTmp.Count(); if( nO > 0 ) { nO--; - USHORT nU = 0; + sal_uInt16 nU = 0; while( nU <= nO ) { - USHORT nM = nU + ( nO - nU ) / 2; + sal_uInt16 nM = nU + ( nO - nU ) / 2; if( rTmp[ nM ]->GetSttNd() == pSrch ) { rFndPos = nM; - return TRUE; + return sal_True; } else if( rTmp[ nM ]->GetSttIdx() < nIdx ) nU = nM + 1; else if( nM == 0 ) - return FALSE; + return sal_False; else nO = nM - 1; } } - return FALSE; + return sal_False; } @@ -2158,10 +2160,10 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) Move( fnMoveForward ); Exchange(); Move( fnMoveForward ); - bParked = FALSE; + bParked = sal_False; } - bChg = FALSE; + bChg = sal_False; // temp Kopie anlegen, damit alle Boxen, fuer die schon Cursor // existieren, entfernt werden koennen. @@ -2170,22 +2172,22 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) //Jetzt die Alten und die neuen abgleichen. SwNodes& rNds = pAktCrsr->GetDoc()->GetNodes(); - USHORT nPos; + sal_uInt16 nPos; const SwStartNode* pSttNd; SwPaM* pCur = pAktCrsr; do { - BOOL bDel = FALSE; + sal_Bool bDel = sal_False; pSttNd = pCur->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); if( !pCur->HasMark() || !pSttNd || pSttNd != pCur->GetMark()->nNode.GetNode().FindTableBoxStartNode() ) - bDel = TRUE; + bDel = sal_True; else if( lcl_SeekEntry( aTmp, pSttNd, nPos )) { SwNodeIndex aIdx( *pSttNd, 1 ); const SwNode* pNd = &aIdx.GetNode(); if( !pNd->IsCntntNode() ) - pNd = rNds.GoNextSection( &aIdx, TRUE, FALSE ); + pNd = rNds.GoNextSection( &aIdx, sal_True, sal_False ); SwPosition* pPos = pCur->GetMark(); if( pNd != &pPos->nNode.GetNode() ) @@ -2194,7 +2196,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) aIdx.Assign( *pSttNd->EndOfSectionNode(), - 1 ); if( !( pNd = &aIdx.GetNode())->IsCntntNode() ) - pNd = rNds.GoPrevSection( &aIdx, TRUE, FALSE ); + pNd = rNds.GoPrevSection( &aIdx, sal_True, sal_False ); pPos = pCur->GetPoint(); if( pNd != &pPos->nNode.GetNode() ) @@ -2204,7 +2206,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) aTmp.Remove( nPos ); } else - bDel = TRUE; + bDel = sal_True; pCur = (SwPaM*)pCur->GetNext(); if( bDel ) @@ -2227,7 +2229,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) break; const SwNode* pNd = &aIdx.GetNode(); if( !pNd->IsCntntNode() ) - pNd = rNds.GoNextSection( &aIdx, TRUE, FALSE ); + pNd = rNds.GoNextSection( &aIdx, sal_True, sal_False ); SwPaM* pNew; if( pAktCrsr->GetNext() == pAktCrsr && !pAktCrsr->HasMark() ) @@ -2247,7 +2249,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) SwPosition* pPos = pNew->GetPoint(); pPos->nNode.Assign( *pSttNd->EndOfSectionNode(), - 1 ); if( !( pNd = &pPos->nNode.GetNode())->IsCntntNode() ) - pNd = rNds.GoPrevSection( &pPos->nNode, TRUE, FALSE ); + pNd = rNds.GoPrevSection( &pPos->nNode, sal_True, sal_False ); pPos->nContent.Assign( (SwCntntNode*)pNd, ((SwCntntNode*)pNd)->Len() ); } @@ -2260,14 +2262,14 @@ void SwTableCursor::InsertBox( const SwTableBox& rTblBox ) { SwTableBox* pBox = (SwTableBox*)&rTblBox; aSelBoxes.Insert( pBox ); - bChg = TRUE; + bChg = sal_True; } bool SwTableCursor::NewTableSelection() { bool bRet = false; const SwNode *pStart = GetCntntNode()->FindTableBoxStartNode(); - const SwNode *pEnd = GetCntntNode(FALSE)->FindTableBoxStartNode(); + const SwNode *pEnd = GetCntntNode(sal_False)->FindTableBoxStartNode(); if( pStart && pEnd ) { const SwTableNode *pTableNode = pStart->FindTableNode(); @@ -2287,7 +2289,7 @@ bool SwTableCursor::NewTableSelection() void SwTableCursor::ActualizeSelection( const SwSelBoxes &rNew ) { - USHORT nOld = 0, nNew = 0; + sal_uInt16 nOld = 0, nNew = 0; while ( nOld < aSelBoxes.Count() && nNew < rNew.Count() ) { const SwTableBox* pPOld = *( aSelBoxes.GetData() + nOld ); @@ -2314,16 +2316,16 @@ void SwTableCursor::ActualizeSelection( const SwSelBoxes &rNew ) InsertBox( **( rNew.GetData() + nNew ) ); } -BOOL SwTableCursor::IsCrsrMovedUpdt() +sal_Bool SwTableCursor::IsCrsrMovedUpdt() { if( !IsCrsrMoved() ) - return FALSE; + return sal_False; nTblMkNd = GetMark()->nNode.GetIndex(); nTblPtNd = GetPoint()->nNode.GetIndex(); nTblMkCnt = GetMark()->nContent.GetIndex(); nTblPtCnt = GetPoint()->nContent.GetIndex(); - return TRUE; + return sal_True; } @@ -2343,18 +2345,18 @@ void SwTableCursor::ParkCrsr() GetMark()->nNode = *pNd; GetMark()->nContent.Assign( 0, 0 ); - bChg = TRUE; - bParked = TRUE; + bChg = sal_True; + bParked = sal_True; } -BOOL SwTableCursor::HasReadOnlyBoxSel() const +sal_Bool SwTableCursor::HasReadOnlyBoxSel() const { - BOOL bRet = FALSE; - for( USHORT n = aSelBoxes.Count(); n; ) + sal_Bool bRet = sal_False; + for( sal_uInt16 n = aSelBoxes.Count(); n; ) if( aSelBoxes[ --n ]->GetFrmFmt()->GetProtect().IsCntntProtected() ) { - bRet = TRUE; + bRet = sal_True; break; } return bRet; diff --git a/sw/source/core/crsr/trvlcol.cxx b/sw/source/core/crsr/trvlcol.cxx index 02e71efbde..cd020af4c1 100644 --- a/sw/source/core/crsr/trvlcol.cxx +++ b/sw/source/core/crsr/trvlcol.cxx @@ -92,9 +92,9 @@ SwPosColumn fnColumnStart = &GetColumnStt; SwPosColumn fnColumnEnd = &GetColumnEnd; -BOOL SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol ) +sal_Bool SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( !pTblCrsr ) { SwLayoutFrm* pLayFrm = GetCurrFrm()->GetUpper(); @@ -118,11 +118,11 @@ BOOL SwCrsrShell::MoveColumn( SwWhichColumn fnWhichCol, SwPosColumn fnPosCol ) pCnt->GetCrsrOfst( pCurCrsr->GetPoint(), aPt ); - if( !pCurCrsr->IsInProtectTable( TRUE ) && + if( !pCurCrsr->IsInProtectTable( sal_True ) && !pCurCrsr->IsSelOvr() ) { UpdateCrsr(); - bRet = TRUE; + bRet = sal_True; } } } diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index eda5fd4710..a62b24292f 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -48,21 +48,21 @@ #include <viscrs.hxx> #include <callnk.hxx> -BOOL SwCrsrShell::CallCrsrFN( FNCrsr fnCrsr ) +sal_Bool SwCrsrShell::CallCrsrFN( FNCrsr fnCrsr ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, SwCursor* pCrsr = getShellCrsr( true ); - BOOL bRet = (pCrsr->*fnCrsr)(); + sal_Bool bRet = (pCrsr->*fnCrsr)(); if( bRet ) UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE | SwCrsrShell::READONLY ); return bRet; } -BOOL SwCursor::GotoFtnTxt() +sal_Bool SwCursor::GotoFtnTxt() { // springe aus dem Content zur Fussnote - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SwTxtNode* pTxtNd = GetPoint()->nNode.GetNode().GetTxtNode(); SwTxtAttr *const pFtn( (pTxtNd) @@ -76,7 +76,7 @@ BOOL SwCursor::GotoFtnTxt() SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection( &GetPoint()->nNode, - TRUE, !IsReadOnlyAvailable() ); + sal_True, !IsReadOnlyAvailable() ); if( pCNd ) { GetPoint()->nContent.Assign( pCNd, 0 ); @@ -87,9 +87,9 @@ BOOL SwCursor::GotoFtnTxt() return bRet; } -BOOL SwCrsrShell::GotoFtnTxt() +sal_Bool SwCrsrShell::GotoFtnTxt() { - BOOL bRet = CallCrsrFN( &SwCursor::GotoFtnTxt ); + sal_Bool bRet = CallCrsrFN( &SwCursor::GotoFtnTxt ); if( !bRet ) { SwTxtNode* pTxtNd = _GetCrsr() ? @@ -135,7 +135,7 @@ BOOL SwCrsrShell::GotoFtnTxt() } -BOOL SwCursor::GotoFtnAnchor() +sal_Bool SwCursor::GotoFtnAnchor() { // springe aus der Fussnote zum Anker const SwNode* pSttNd = GetNode()->FindFootnoteStartNode(); @@ -144,7 +144,7 @@ BOOL SwCursor::GotoFtnAnchor() // durchsuche alle Fussnoten im Dokument nach diesem StartIndex const SwTxtFtn* pTxtFtn; const SwFtnIdxs& rFtnArr = pSttNd->GetDoc()->GetFtnIdxs(); - for( USHORT n = 0; n < rFtnArr.Count(); ++n ) + for( sal_uInt16 n = 0; n < rFtnArr.Count(); ++n ) if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() && pSttNd == &pTxtFtn->GetStartNode()->GetNode() ) { @@ -159,14 +159,14 @@ BOOL SwCursor::GotoFtnAnchor() nsSwCursorSelOverFlags::SELOVER_TOGGLE ); } } - return FALSE; + return sal_False; } -BOOL SwCrsrShell::GotoFtnAnchor() +sal_Bool SwCrsrShell::GotoFtnAnchor() { // springe aus der Fussnote zum Anker SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, - BOOL bRet = pCurCrsr->GotoFtnAnchor(); + sal_Bool bRet = pCurCrsr->GotoFtnAnchor(); if( bRet ) { // BUG 5996: Tabellen-Kopfzeile sonderbehandeln @@ -177,22 +177,22 @@ BOOL SwCrsrShell::GotoFtnAnchor() return bRet; } -inline sal_Bool CmpLE( const SwTxtFtn& rFtn, ULONG nNd, xub_StrLen nCnt ) +inline sal_Bool CmpLE( const SwTxtFtn& rFtn, sal_uLong nNd, xub_StrLen nCnt ) { - ULONG nTNd = rFtn.GetTxtNode().GetIndex(); + sal_uLong nTNd = rFtn.GetTxtNode().GetIndex(); return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() <= nCnt ); } -inline sal_Bool CmpL( const SwTxtFtn& rFtn, ULONG nNd, xub_StrLen nCnt ) +inline sal_Bool CmpL( const SwTxtFtn& rFtn, sal_uLong nNd, xub_StrLen nCnt ) { - ULONG nTNd = rFtn.GetTxtNode().GetIndex(); + sal_uLong nTNd = rFtn.GetTxtNode().GetIndex(); return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() < nCnt ); } -BOOL SwCursor::GotoNextFtnAnchor() +sal_Bool SwCursor::GotoNextFtnAnchor() { const SwFtnIdxs& rFtnArr = GetDoc()->GetFtnIdxs(); const SwTxtFtn* pTxtFtn = 0; - USHORT nPos; + sal_uInt16 nPos; if( rFtnArr.SeekEntry( GetPoint()->nNode, &nPos )) { @@ -200,7 +200,7 @@ BOOL SwCursor::GotoNextFtnAnchor() // naechstgelegene if( nPos < rFtnArr.Count() ) { - ULONG nNdPos = GetPoint()->nNode.GetIndex(); + sal_uLong nNdPos = GetPoint()->nNode.GetIndex(); xub_StrLen nCntPos = GetPoint()->nContent.GetIndex(); pTxtFtn = rFtnArr[ nPos ]; @@ -236,7 +236,7 @@ BOOL SwCursor::GotoNextFtnAnchor() else if( nPos < rFtnArr.Count() ) pTxtFtn = rFtnArr[ nPos ]; - BOOL bRet = 0 != pTxtFtn; + sal_Bool bRet = 0 != pTxtFtn; if( bRet ) { SwCrsrSaveState aSaveState( *this ); @@ -249,17 +249,17 @@ BOOL SwCursor::GotoNextFtnAnchor() return bRet; } -BOOL SwCursor::GotoPrevFtnAnchor() +sal_Bool SwCursor::GotoPrevFtnAnchor() { const SwFtnIdxs& rFtnArr = GetDoc()->GetFtnIdxs(); const SwTxtFtn* pTxtFtn = 0; - USHORT nPos; + sal_uInt16 nPos; if( rFtnArr.SeekEntry( GetPoint()->nNode, &nPos ) ) { // es gibt eine Fussnote mit dem Index, suche also die // naechstgelegene - ULONG nNdPos = GetPoint()->nNode.GetIndex(); + sal_uLong nNdPos = GetPoint()->nNode.GetIndex(); xub_StrLen nCntPos = GetPoint()->nContent.GetIndex(); pTxtFtn = rFtnArr[ nPos ]; @@ -294,7 +294,7 @@ BOOL SwCursor::GotoPrevFtnAnchor() else if( nPos ) pTxtFtn = rFtnArr[ nPos-1 ]; - BOOL bRet = 0 != pTxtFtn; + sal_Bool bRet = 0 != pTxtFtn; if( bRet ) { SwCrsrSaveState aSaveState( *this ); @@ -307,12 +307,12 @@ BOOL SwCursor::GotoPrevFtnAnchor() return bRet; } -BOOL SwCrsrShell::GotoNextFtnAnchor() +sal_Bool SwCrsrShell::GotoNextFtnAnchor() { return CallCrsrFN( &SwCursor::GotoNextFtnAnchor ); } -BOOL SwCrsrShell::GotoPrevFtnAnchor() +sal_Bool SwCrsrShell::GotoPrevFtnAnchor() { return CallCrsrFN( &SwCursor::GotoPrevFtnAnchor ); } @@ -320,7 +320,7 @@ BOOL SwCrsrShell::GotoPrevFtnAnchor() // springe aus dem Rahmen zum Anker -BOOL SwCrsrShell::GotoFlyAnchor() +sal_Bool SwCrsrShell::GotoFlyAnchor() { SET_CURR_SHELL( this ); const SwFrm* pFrm = GetCurrFrm(); @@ -329,7 +329,7 @@ BOOL SwCrsrShell::GotoFlyAnchor() } while( pFrm && !pFrm->IsFlyFrm() ); if( !pFrm ) // ist kein FlyFrame - return FALSE; + return sal_False; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, SwCrsrSaveState aSaveState( *pCurCrsr ); @@ -345,10 +345,10 @@ BOOL SwCrsrShell::GotoFlyAnchor() : pFrm->Frm().Left(); const SwPageFrm* pPageFrm = pFrm->FindPageFrm(); - const SwCntntFrm* pFndFrm = pPageFrm->GetCntntPos( aPt, FALSE, TRUE ); + const SwCntntFrm* pFndFrm = pPageFrm->GetCntntPos( aPt, sal_False, sal_True ); pFndFrm->GetCrsrOfst( pCurCrsr->GetPoint(), aPt ); - BOOL bRet = !pCurCrsr->IsInProtectTable() && !pCurCrsr->IsSelOvr(); + sal_Bool bRet = !pCurCrsr->IsInProtectTable() && !pCurCrsr->IsSelOvr(); if( bRet ) UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE | SwCrsrShell::READONLY ); diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index 19612cc70e..8c76cdfbf8 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -42,8 +42,8 @@ -BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, - BOOL bInReadOnly ) +sal_Bool GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, + sal_Bool bInReadOnly ) { SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode ); SwSectionNode* pNd = aIdx.GetNode().FindSectionNode(); @@ -68,7 +68,7 @@ BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, { aIdx = *pNd; SwCntntNode* pCNd = pNd->GetNodes().GoNextSection( &aIdx, - TRUE, !bInReadOnly ); + sal_True, !bInReadOnly ); if( !pCNd ) { aIdx--; @@ -80,7 +80,7 @@ BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, { aIdx = *pNd->EndOfSectionNode(); SwCntntNode* pCNd = pNd->GetNodes().GoPrevSection( &aIdx, - TRUE, !bInReadOnly ); + sal_True, !bInReadOnly ); if( !pCNd ) { aIdx.Assign( *pNd, - 1 ); @@ -90,22 +90,22 @@ BOOL GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, } rCurCrsr.GetPoint()->nNode = aIdx; - return TRUE; + return sal_True; } } while( pNd ); - return FALSE; + return sal_False; } -BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, - BOOL bInReadOnly ) +sal_Bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, + sal_Bool bInReadOnly ) { SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode ); SwSectionNode* pNd = aIdx.GetNode().FindSectionNode(); if( pNd ) aIdx.Assign( *pNd->EndOfSectionNode(), - 1 ); - ULONG nEndCount = aIdx.GetNode().GetNodes().Count()-1; + sal_uLong nEndCount = aIdx.GetNode().GetNodes().Count()-1; do { while( aIdx.GetIndex() < nEndCount && 0 == ( pNd = aIdx.GetNode().GetSectionNode()) ) @@ -124,7 +124,7 @@ BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, { aIdx = *pNd; SwCntntNode* pCNd = pNd->GetNodes().GoNextSection( &aIdx, - TRUE, !bInReadOnly ); + sal_True, !bInReadOnly ); if( !pCNd ) { aIdx.Assign( *pNd->EndOfSectionNode(), +1 ); @@ -136,7 +136,7 @@ BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, { aIdx = *pNd->EndOfSectionNode(); SwCntntNode* pCNd = pNd->GetNodes().GoPrevSection( &aIdx, - TRUE, !bInReadOnly ); + sal_True, !bInReadOnly ); if( !pCNd ) { aIdx++; @@ -146,33 +146,33 @@ BOOL GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, } rCurCrsr.GetPoint()->nNode = aIdx; - return TRUE; + return sal_True; } } while( pNd ); - return FALSE; + return sal_False; } -BOOL GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, - BOOL bInReadOnly ) +sal_Bool GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, + sal_Bool bInReadOnly ) { SwSectionNode* pNd = rCurCrsr.GetNode()->FindSectionNode(); if( !pNd ) - return FALSE; + return sal_False; SwPosition* pPos = rCurCrsr.GetPoint(); - BOOL bMoveBackward = fnPosRegion == fnMoveBackward; + sal_Bool bMoveBackward = fnPosRegion == fnMoveBackward; SwCntntNode* pCNd; if( bMoveBackward ) { SwNodeIndex aIdx( *pNd->EndOfSectionNode() ); - pCNd = pNd->GetNodes().GoPrevSection( &aIdx, TRUE, !bInReadOnly ); + pCNd = pNd->GetNodes().GoPrevSection( &aIdx, sal_True, !bInReadOnly ); } else { SwNodeIndex aIdx( *pNd ); - pCNd = pNd->GetNodes().GoNextSection( &aIdx, TRUE, !bInReadOnly ); + pCNd = pNd->GetNodes().GoNextSection( &aIdx, sal_True, !bInReadOnly ); } if( pCNd ) @@ -185,34 +185,34 @@ BOOL GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, } -BOOL GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, - BOOL bInReadOnly ) +sal_Bool GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, + sal_Bool bInReadOnly ) { SwNode* pCurrNd = rCurCrsr.GetNode(); SwSectionNode* pNd = pCurrNd->FindSectionNode(); if( !pNd ) - return FALSE; + return sal_False; SwPosition* pPos = rCurCrsr.GetPoint(); xub_StrLen nCurrCnt = pPos->nContent.GetIndex(); - BOOL bMoveBackward = fnPosRegion == fnMoveBackward; + sal_Bool bMoveBackward = fnPosRegion == fnMoveBackward; do { SwCntntNode* pCNd; if( bMoveBackward ) // ans Ende vom Bereich { SwNodeIndex aIdx( *pNd->EndOfSectionNode() ); - pCNd = pNd->GetNodes().GoPrevSection( &aIdx, TRUE, !bInReadOnly ); + pCNd = pNd->GetNodes().GoPrevSection( &aIdx, sal_True, !bInReadOnly ); if( !pCNd ) - return FALSE; + return sal_False; pPos->nNode = aIdx; } else { SwNodeIndex aIdx( *pNd ); - pCNd = pNd->GetNodes().GoNextSection( &aIdx, TRUE, !bInReadOnly ); + pCNd = pNd->GetNodes().GoNextSection( &aIdx, sal_True, !bInReadOnly ); if( !pCNd ) - return FALSE; + return sal_False; pPos->nNode = aIdx; } @@ -222,18 +222,18 @@ BOOL GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, if( &pPos->nNode.GetNode() != pCurrNd || pPos->nContent.GetIndex() != nCurrCnt ) // es gab eine Veraenderung - return TRUE; + return sal_True; // dann versuche mal den "Parent" dieser Section SwSection* pParent = pNd->GetSection().GetParent(); pNd = pParent ? pParent->GetFmt()->GetSectionNode() : 0; } while( pNd ); - return FALSE; + return sal_False; } -BOOL SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion ) +sal_Bool SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion ) { SwCrsrSaveState aSaveState( *this ); return !dynamic_cast<SwTableCursor*>(this) && @@ -243,21 +243,21 @@ BOOL SwCursor::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion GetPoint()->nContent.GetIndex() != pSavePos->nCntnt ); } -BOOL SwCrsrShell::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion ) +sal_Bool SwCrsrShell::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPosRegion ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen - BOOL bRet = !pTblCrsr && pCurCrsr->MoveRegion( fnWhichRegion, fnPosRegion ); + sal_Bool bRet = !pTblCrsr && pCurCrsr->MoveRegion( fnWhichRegion, fnPosRegion ); if( bRet ) UpdateCrsr(); return bRet; } -BOOL SwCursor::GotoRegion( const String& rName ) +sal_Bool SwCursor::GotoRegion( const String& rName ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwSectionFmts& rFmts = GetDoc()->GetSections(); - for( USHORT n = rFmts.Count(); n; ) + for( sal_uInt16 n = rFmts.Count(); n; ) { const SwSectionFmt* pFmt = rFmts[ --n ]; const SwNodeIndex* pIdx; @@ -278,10 +278,10 @@ BOOL SwCursor::GotoRegion( const String& rName ) return bRet; } -BOOL SwCrsrShell::GotoRegion( const String& rName ) +sal_Bool SwCrsrShell::GotoRegion( const String& rName ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, - BOOL bRet = !pTblCrsr && pCurCrsr->GotoRegion( rName ); + sal_Bool bRet = !pTblCrsr && pCurCrsr->GotoRegion( rName ); if( bRet ) UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE | SwCrsrShell::READONLY ); // und den akt. Updaten diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 5daf0a7bb0..7f3ef6f57d 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -52,16 +52,16 @@ // setze Crsr in die naechsten/vorherigen Celle -BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine ) +sal_Bool SwCrsrShell::GoNextCell( sal_Bool bAppendLine ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwTableNode* pTblNd = 0; if( IsTableMode() || 0 != ( pTblNd = IsCrsrInTbl() )) { SwCursor* pCrsr = pTblCrsr ? pTblCrsr : pCurCrsr; SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, - bRet = TRUE; + bRet = sal_True; // Check if we have to move the cursor to a covered cell before // proceeding: @@ -76,7 +76,7 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine ) if ( !pTblNd ) pTblNd = IsCrsrInTbl(); pTableBox = & pTableBox->FindEndOfRowSpan( pTblNd->GetTable(), - (USHORT)(pTableBox->getRowSpan() + pCrsr->GetCrsrRowSpanOffset() ) ); + (sal_uInt16)(pTableBox->getRowSpan() + pCrsr->GetCrsrRowSpanOffset() ) ); pTableBoxStartNode = pTableBox->GetSttNd(); } } @@ -89,7 +89,7 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine ) if( !aCellStt.GetNode().IsStartNode() ) { if( pCrsr->HasMark() || !bAppendLine ) - bRet = FALSE; + bRet = sal_False; else { // auf besonderen Wunsch: keine Line mehr vorhanden, dann @@ -106,7 +106,7 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine ) //nichts mitbekommen. ((SwEditShell*)this)->StartAllAction(); bRet = pDoc->InsertRow( pTblNd->GetTable(). - SelLineFromBox( pTableBox, aBoxes, FALSE )); + SelLineFromBox( pTableBox, aBoxes, sal_False )); ((SwEditShell*)this)->EndAllAction(); } } @@ -117,9 +117,9 @@ BOOL SwCrsrShell::GoNextCell( BOOL bAppendLine ) } -BOOL SwCrsrShell::GoPrevCell() +sal_Bool SwCrsrShell::GoPrevCell() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( IsTableMode() || IsCrsrInTbl() ) { SwCursor* pCrsr = pTblCrsr ? pTblCrsr : pCurCrsr; @@ -143,12 +143,12 @@ const SwFrm* lcl_FindMostUpperCellFrm( const SwFrm* pFrm ) return pFrm; } -BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) +sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) { // pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen SwFrm *pFrm = GetCurrFrm(); if( !pFrm->IsInTab() ) - return FALSE; + return sal_False; const SwTabFrm* pTabFrm = pFrm->FindTabFrm(); const SwTabFrm* pMasterTabFrm = pTabFrm->IsFollow() ? pTabFrm->FindMaster( true ) : pTabFrm; @@ -172,7 +172,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) GetTblSel( *this, aBoxes, eType ); if( !aBoxes.Count() ) - return FALSE; + return sal_False; pStt = aBoxes[0]; pEnd = aBoxes[aBoxes.Count() - 1]; @@ -184,7 +184,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) SwTable::SearchType eSearchType = bRow ? SwTable::SEARCH_ROW : SwTable::SEARCH_COL; pTable->CreateSelection( *pCrsr, aBoxes, eSearchType, bCheckProtected ); if( !aBoxes.Count() ) - return FALSE; + return sal_False; pStt = aBoxes[0]; pEnd = aBoxes[aBoxes.Count() - 1]; @@ -193,7 +193,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) { const SwShellCrsr *pCrsr = _GetCrsr(); const SwFrm* pStartFrm = pFrm; - const SwCntntNode *pCNd = pCrsr->GetCntntNode( FALSE ); + const SwCntntNode *pCNd = pCrsr->GetCntntNode( sal_False ); const SwFrm* pEndFrm = pCNd ? pCNd->GetFrm( &pCrsr->GetMkPos() ) : 0; if ( bRow ) @@ -203,7 +203,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) } if ( !pStartFrm || !pEndFrm ) - return FALSE; + return sal_False; const bool bVert = pFrm->ImplFindTabFrm()->IsVertical(); @@ -220,7 +220,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) aBoxes, bSelectUp ? 0 : &aCells, eType ); if( !aBoxes.Count() || ( !bSelectUp && 4 != aCells.Count() ) ) - return FALSE; + return sal_False; if ( bSelectUp ) { @@ -258,15 +258,15 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple ) pTblCrsr->GetPtPos() = pMasterTabFrm->IsVertical() ? pMasterTabFrm->Frm().TopRight() : pMasterTabFrm->Frm().TopLeft(); UpdateCrsr(); // und den akt. Updaten - return TRUE; + return sal_True; } -BOOL SwCrsrShell::SelTbl() +sal_Bool SwCrsrShell::SelTbl() { // pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen SwFrm *pFrm = GetCurrFrm(); if( !pFrm->IsInTab() ) - return FALSE; + return sal_False; const SwTabFrm *pTblFrm = pFrm->ImplFindTabFrm(); const SwTabFrm* pMasterTabFrm = pTblFrm->IsFollow() ? pTblFrm->FindMaster( true ) : pTblFrm; @@ -291,11 +291,11 @@ BOOL SwCrsrShell::SelTbl() pTblCrsr->GetPoint()->nNode = *pTblNd->EndOfSectionNode(); pTblCrsr->Move( fnMoveBackward, fnGoCntnt ); UpdateCrsr(); // und den akt. Updaten - return TRUE; + return sal_True; } -BOOL SwCrsrShell::SelTblBox() +sal_Bool SwCrsrShell::SelTblBox() { // if we're in a table, create a table cursor, and select the cell // that the current cursor's point resides in @@ -309,12 +309,12 @@ BOOL SwCrsrShell::SelTblBox() // frame. This should yield the same result as searching for the // table box start node, right? SwFrm *pFrm = GetCurrFrm(); - DBG_ASSERT( !pFrm->IsInTab() == !(pStartNode != NULL), + OSL_ENSURE( !pFrm->IsInTab() == !(pStartNode != NULL), "Schroedinger's table: We're in a box, and also we aren't." ); #endif if( pStartNode == NULL ) - return FALSE; + return sal_False; SET_CURR_SHELL( this ); @@ -346,7 +346,7 @@ BOOL SwCrsrShell::SelTblBox() // needs updateing UpdateCrsr(); - return TRUE; + return sal_True; } // return the next non-protected cell inside a table @@ -354,7 +354,7 @@ BOOL SwCrsrShell::SelTblBox() // return: // true - Idx points to content in a suitable cell // false - could not find a suitable cell -bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) +bool lcl_FindNextCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly ) { // ueberpruefe geschuetzte Zellen SwNodeIndex aTmp( rIdx, 2 ); // TableNode + StartNode @@ -433,7 +433,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) } // comments see lcl_FindNextCell -bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) +bool lcl_FindPrevCell( SwNodeIndex& rIdx, sal_Bool bInReadOnly ) { SwNodeIndex aTmp( rIdx, -2 ); // TableNode + EndNode @@ -493,8 +493,8 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly ) } -BOOL GotoPrevTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, - BOOL bInReadOnly ) +sal_Bool GotoPrevTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, + sal_Bool bInReadOnly ) { SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode ); @@ -550,16 +550,16 @@ BOOL GotoPrevTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, pTxtNode->Len() : 0 ); } - return TRUE; + return sal_True; } } while( pTblNd ); - return FALSE; + return sal_False; } -BOOL GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, - BOOL bInReadOnly ) +sal_Bool GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, + sal_Bool bInReadOnly ) { SwNodeIndex aIdx( rCurCrsr.GetPoint()->nNode ); SwTableNode* pTblNd = aIdx.GetNode().FindTableNode(); @@ -567,7 +567,7 @@ BOOL GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, if( pTblNd ) aIdx.Assign( *pTblNd->EndOfSectionNode(), 1 ); - ULONG nLastNd = rCurCrsr.GetDoc()->GetNodes().Count() - 1; + sal_uLong nLastNd = rCurCrsr.GetDoc()->GetNodes().Count() - 1; do { while( aIdx.GetIndex() < nLastNd && 0 == ( pTblNd = aIdx.GetNode().GetTableNode()) ) @@ -603,34 +603,34 @@ BOOL GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, pTxtNode->Len() : 0 ); } - return TRUE; + return sal_True; } } while( pTblNd ); - return FALSE; + return sal_False; } -BOOL GotoCurrTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, - BOOL bInReadOnly ) +sal_Bool GotoCurrTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, + sal_Bool bInReadOnly ) { SwTableNode* pTblNd = rCurCrsr.GetPoint()->nNode.GetNode().FindTableNode(); if( !pTblNd ) - return FALSE; + return sal_False; SwTxtNode* pTxtNode = 0; if( fnPosTbl == fnMoveBackward ) // ans Ende der Tabelle { SwNodeIndex aIdx( *pTblNd->EndOfSectionNode() ); if( !lcl_FindPrevCell( aIdx, bInReadOnly )) - return FALSE; + return sal_False; pTxtNode = aIdx.GetNode().GetTxtNode(); } else { SwNodeIndex aIdx( *pTblNd ); if( !lcl_FindNextCell( aIdx, bInReadOnly )) - return FALSE; + return sal_False; pTxtNode = aIdx.GetNode().GetTxtNode(); } @@ -642,13 +642,13 @@ BOOL GotoCurrTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, 0 ); } - return TRUE; + return sal_True; } -BOOL SwCursor::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) +sal_Bool SwCursor::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SwTableCursor* pTblCrsr = dynamic_cast<SwTableCursor*>(this); if( pTblCrsr || !HasMark() ) // nur wenn kein Mark oder ein TblCrsr @@ -661,13 +661,13 @@ BOOL SwCursor::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) return bRet; } -BOOL SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) +sal_Bool SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen SwShellCrsr* pCrsr = pTblCrsr ? pTblCrsr : pCurCrsr; - BOOL bCheckPos, bRet; - ULONG nPtNd = 0; + sal_Bool bCheckPos, bRet; + sal_uLong nPtNd = 0; xub_StrLen nPtCnt = 0; if( !pTblCrsr && pCurCrsr->HasMark() ) // wenn Mark und kein TblCrsr, @@ -678,11 +678,11 @@ BOOL SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) pCurCrsr->SwSelPaintRects::Hide(); pTblCrsr->SetMark(); pCrsr = pTblCrsr; - bCheckPos = FALSE; + bCheckPos = sal_False; } else { - bCheckPos = TRUE; + bCheckPos = sal_True; nPtNd = pCrsr->GetPoint()->nNode.GetIndex(); nPtCnt = pCrsr->GetPoint()->nContent.GetIndex(); } @@ -700,24 +700,24 @@ BOOL SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) if( bCheckPos && pCrsr->GetPoint()->nNode.GetIndex() == nPtNd && pCrsr->GetPoint()->nContent.GetIndex() == nPtCnt ) - bRet = FALSE; + bRet = sal_False; } return bRet; } -BOOL SwCrsrShell::IsTblComplex() const +sal_Bool SwCrsrShell::IsTblComplex() const { - SwFrm *pFrm = GetCurrFrm( FALSE ); + SwFrm *pFrm = GetCurrFrm( sal_False ); if ( pFrm && pFrm->IsInTab() ) return pFrm->FindTabFrm()->GetTable()->IsTblComplex(); - return FALSE; + return sal_False; } -BOOL SwCrsrShell::IsTblComplexForChart() +sal_Bool SwCrsrShell::IsTblComplexForChart() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; StartAction(); // IsTblComplexForChart() may trigger table formatting // we better do that inside an action @@ -784,10 +784,10 @@ String SwCrsrShell::GetBoxNms() const } -BOOL SwCrsrShell::GotoTable( const String& rName ) +sal_Bool SwCrsrShell::GotoTable( const String& rName ) { SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, - BOOL bRet = !pTblCrsr && pCurCrsr->GotoTable( rName ); + sal_Bool bRet = !pTblCrsr && pCurCrsr->GotoTable( rName ); if( bRet ) { pCurCrsr->GetPtPos() = Point(); @@ -798,10 +798,10 @@ BOOL SwCrsrShell::GotoTable( const String& rName ) } -BOOL SwCrsrShell::CheckTblBoxCntnt( const SwPosition* pPos ) +sal_Bool SwCrsrShell::CheckTblBoxCntnt( const SwPosition* pPos ) { if( !pBoxIdx || !pBoxPtr || IsSelTblCells() || !IsAutoUpdateCells() ) - return FALSE; + return sal_False; // ueberpruefe, ob der Box Inhalt mit dem angegebenen Format der Box // ueber einstimmt. Wenn nicht, setze neu @@ -859,7 +859,7 @@ BOOL SwCrsrShell::CheckTblBoxCntnt( const SwPosition* pPos ) // aufruf kommt. ClearTblBoxCntnt(); StartAction(); - GetDoc()->ChkBoxNumFmt( *pChkBox, TRUE ); + GetDoc()->ChkBoxNumFmt( *pChkBox, sal_True ); EndAction(); } @@ -877,13 +877,13 @@ void SwCrsrShell::SaveTblBoxCntnt( const SwPosition* pPos ) SwStartNode* pSttNd = pPos->nNode.GetNode().FindSttNodeByType( SwTableBoxStartNode ); - BOOL bCheckBox = FALSE; + sal_Bool bCheckBox = sal_False; if( pSttNd && pBoxIdx ) { if( pSttNd == &pBoxIdx->GetNode() ) pSttNd = 0; // die haben wir schon else - bCheckBox = TRUE; + bCheckBox = sal_True; } else bCheckBox = 0 != pBoxIdx; @@ -913,9 +913,9 @@ void SwCrsrShell::ClearTblBoxCntnt() pBoxPtr = 0; } -BOOL SwCrsrShell::EndAllTblBoxEdit() +sal_Bool SwCrsrShell::EndAllTblBoxEdit() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; ViewShell *pSh = this; do { if( pSh->IsA( TYPE( SwCrsrShell ) ) ) diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx index 3dc6bc55c2..38bb7d314c 100644 --- a/sw/source/core/crsr/unocrsr.cxx +++ b/sw/source/core/crsr/unocrsr.cxx @@ -42,9 +42,9 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr, 10, 10 ) SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing ) : SwCursor( rPos, pRing, false ), SwModify( 0 ), - bRemainInSection( TRUE ), - bSkipOverHiddenSections( FALSE ), - bSkipOverProtectSections( FALSE ) + bRemainInSection( sal_True ), + bSkipOverHiddenSections( sal_False ), + bSkipOverProtectSections( sal_False ) {} @@ -63,7 +63,7 @@ SwUnoCrsr::~SwUnoCrsr() { // dann muss der Cursor aus dem Array ausgetragen werden SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl(); - USHORT nDelPos = rTbl.GetPos( this ); + sal_uInt16 nDelPos = rTbl.GetPos( this ); if( USHRT_MAX != nDelPos ) rTbl.Remove( nDelPos ); @@ -113,7 +113,7 @@ bool SwUnoCrsr::IsReadOnlyAvailable() const } const SwCntntFrm* -SwUnoCrsr::DoSetBidiLevelLeftRight( BOOL &, BOOL, BOOL ) +SwUnoCrsr::DoSetBidiLevelLeftRight( sal_Bool &, sal_Bool, sal_Bool ) { return 0; // not for uno cursor } @@ -123,7 +123,7 @@ void SwUnoCrsr::DoSetBidiLevelUpDown() return; // not for uno cursor } -BOOL SwUnoCrsr::IsSelOvr( int eFlags ) +sal_Bool SwUnoCrsr::IsSelOvr( int eFlags ) { if( bRemainInSection ) { @@ -134,8 +134,8 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags ) *pNewSttNd = rPtIdx.GetNode().StartOfSectionNode(); if( pOldSttNd != pNewSttNd ) { - BOOL bMoveDown = GetSavePos()->nNode < rPtIdx.GetIndex(); - BOOL bValidPos = FALSE; + sal_Bool bMoveDown = GetSavePos()->nNode < rPtIdx.GetIndex(); + sal_Bool bValidPos = sal_False; // search the correct surrounded start node - which the index // can't leave. @@ -189,14 +189,14 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags ) } } else - bValidPos = TRUE; + bValidPos = sal_True; } while ( pInvalidNode ); } if( bValidPos ) { SwCntntNode* pCNd = GetCntntNode(); - USHORT nCnt = 0; + sal_uInt16 nCnt = 0; if( pCNd && !bMoveDown ) nCnt = pCNd->Len(); GetPoint()->nContent.Assign( pCNd, nCnt ); @@ -205,7 +205,7 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags ) { rPtIdx = GetSavePos()->nNode; GetPoint()->nContent.Assign( GetCntntNode(), GetSavePos()->nCntnt ); - return TRUE; + return sal_True; } } } @@ -218,7 +218,7 @@ BOOL SwUnoCrsr::IsSelOvr( int eFlags ) SwUnoTableCrsr::SwUnoTableCrsr(const SwPosition& rPos) : SwCursor(rPos,0,false), SwUnoCrsr(rPos), SwTableCursor(rPos), aTblSel(rPos,0,false) { - SetRemainInSection(FALSE); + SetRemainInSection(sal_False); } SwUnoTableCrsr::~SwUnoTableCrsr() @@ -227,9 +227,9 @@ SwUnoTableCrsr::~SwUnoTableCrsr() delete aTblSel.GetNext(); // und loeschen } -BOOL SwUnoTableCrsr::IsSelOvr( int eFlags ) +sal_Bool SwUnoTableCrsr::IsSelOvr( int eFlags ) { - BOOL bRet = SwUnoCrsr::IsSelOvr( eFlags ); + sal_Bool bRet = SwUnoCrsr::IsSelOvr( eFlags ); if( !bRet ) { const SwTableNode* pTNd = GetPoint()->nNode.GetNode().FindTableNode(); @@ -246,13 +246,13 @@ void SwUnoTableCrsr::MakeBoxSels() bool bMakeTblCrsrs = true; if( GetPoint()->nNode.GetIndex() && GetMark()->nNode.GetIndex() && 0 != ( pCNd = GetCntntNode() ) && pCNd->GetFrm() && - 0 != ( pCNd = GetCntntNode(FALSE) ) && pCNd->GetFrm() ) + 0 != ( pCNd = GetCntntNode(sal_False) ) && pCNd->GetFrm() ) bMakeTblCrsrs = GetDoc()->GetRootFrm()->MakeTblCrsrs( *this ); if ( !bMakeTblCrsrs ) { SwSelBoxes& rTmpBoxes = (SwSelBoxes&)GetBoxes(); - USHORT nCount = 0; + sal_uInt16 nCount = 0; while( nCount < rTmpBoxes.Count() ) DeleteBox( nCount ); } diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index b93a9094fa..21cfed8d82 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -77,11 +77,11 @@ SwVisCrsr::SwVisCrsr( const SwCrsrShell * pCShell ) { pCShell->GetWin()->SetCursor( &aTxtCrsr ); bIsVisible = aTxtCrsr.IsVisible(); - bIsDragCrsr = FALSE; + bIsDragCrsr = sal_False; aTxtCrsr.SetWidth( 0 ); #ifdef SW_CRSR_TIMER - bTimerOn = TRUE; + bTimerOn = sal_True; SetTimeout( 50 ); // 50 millisecond delay #endif } @@ -108,7 +108,7 @@ void SwVisCrsr::Show() { if( !bIsVisible ) { - bIsVisible = TRUE; + bIsVisible = sal_True; // display at all? if( pCrsrShell->VisArea().IsOver( pCrsrShell->aCharRect ) ) @@ -136,7 +136,7 @@ void SwVisCrsr::Hide() { if( bIsVisible ) { - bIsVisible = FALSE; + bIsVisible = sal_False; #ifdef SW_CRSR_TIMER if( IsActive() ) @@ -162,13 +162,13 @@ void SwVisCrsr::Timeout() } } -BOOL SwCrsrShell::ChgCrsrTimerFlag( BOOL bTimerOn ) +sal_Bool SwCrsrShell::ChgCrsrTimerFlag( sal_Bool bTimerOn ) { return pVisCrsr->ChgTimerFlag( bTimerOn ); } -BOOL SwVisCrsr::ChgTimerFlag( BOOL bFlag ) +sal_Bool SwVisCrsr::ChgTimerFlag( sal_Bool bFlag ) { bOld = bTimerOn; if( !bFlag && bIsVisible && IsActive() ) @@ -215,7 +215,7 @@ void SwVisCrsr::_SetPosAndShow() if( rNode.IsTxtNode() ) { const SwTxtNode& rTNd = *rNode.GetTxtNode(); - const SwFrm* pFrm = rTNd.GetFrm( 0, 0, FALSE ); + const SwFrm* pFrm = rTNd.GetFrm( 0, 0, sal_False ); if ( pFrm ) { const SwScriptInfo* pSI = ((SwTxtFrm*)pFrm)->GetScriptInfo(); @@ -261,7 +261,7 @@ void SwVisCrsr::_SetPosAndShow() ((SwDrawView*)pCrsrShell->GetDrawView())->SetAnimationEnabled( !pCrsrShell->IsSelection() ); - USHORT nStyle = bIsDragCrsr ? CURSOR_SHADOW : 0; + sal_uInt16 nStyle = bIsDragCrsr ? CURSOR_SHADOW : 0; if( nStyle != aTxtCrsr.GetStyle() ) { aTxtCrsr.SetStyle( nStyle ); @@ -392,7 +392,7 @@ void SwSelPaintRects::Show() void SwSelPaintRects::Invalidate( const SwRect& rRect ) { - USHORT nSz = Count(); + sal_uInt16 nSz = Count(); if( !nSz ) return; @@ -562,7 +562,7 @@ short SwShellCrsr::MaxReplaceArived() // Terminate old actions. The table-frames get constructed and // a SSelection can be created. SvUShorts aArr; - USHORT nActCnt; + sal_uInt16 nActCnt; ViewShell *pShell = GetDoc()->GetRootFrm()->GetCurrShell(), *pSh = pShell; do { @@ -575,7 +575,7 @@ short SwShellCrsr::MaxReplaceArived() nRet = QueryBox( pDlg, SW_RES( MSG_COMCORE_ASKSEARCH )).Execute(); } - for( USHORT n = 0; n < aArr.Count(); ++n ) + for( sal_uInt16 n = 0; n < aArr.Count(); ++n ) { for( nActCnt = aArr[n]; nActCnt--; ) pSh->StartAction(); @@ -594,7 +594,7 @@ void SwShellCrsr::SaveTblBoxCntnt( const SwPosition* pPos ) ((SwCrsrShell*)GetShell())->SaveTblBoxCntnt( pPos ); } -BOOL SwShellCrsr::UpDown( BOOL bUp, USHORT nCnt ) +sal_Bool SwShellCrsr::UpDown( sal_Bool bUp, sal_uInt16 nCnt ) { return SwCursor::UpDown( bUp, nCnt, &GetPtPos(), GetShell()->GetUpDownX() ); @@ -605,7 +605,7 @@ BOOL SwShellCrsr::UpDown( BOOL bUp, USHORT nCnt ) // JP 05.03.98: To test the UNO-Crsr behavior here the implementation on the // visible cursor. -BOOL SwShellCrsr::IsSelOvr( int eFlags ) +sal_Bool SwShellCrsr::IsSelOvr( int eFlags ) { return SwCursor::IsSelOvr( eFlags ); } @@ -613,13 +613,13 @@ BOOL SwShellCrsr::IsSelOvr( int eFlags ) #endif // TRUE: The cursor can be set to the position. -BOOL SwShellCrsr::IsAtValidPos( BOOL bPoint ) const +sal_Bool SwShellCrsr::IsAtValidPos( sal_Bool bPoint ) const { if( GetShell() && ( GetShell()->IsAllProtect() || GetShell()->GetViewOptions()->IsReadonly() || ( GetShell()->Imp()->GetDrawView() && GetShell()->Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ))) - return TRUE; + return sal_True; return SwCursor::IsAtValidPos( bPoint ); } @@ -671,13 +671,13 @@ void SwShellTableCrsr::FillRects() SwRegionRects aReg( GetShell()->VisArea() ); SwNodes& rNds = GetDoc()->GetNodes(); - for( USHORT n = 0; n < aSelBoxes.Count(); ++n ) + for( sal_uInt16 n = 0; n < aSelBoxes.Count(); ++n ) { const SwStartNode* pSttNd = (*(aSelBoxes.GetData() + n ))->GetSttNd(); const SwTableNode* pSelTblNd = pSttNd->FindTableNode(); SwNodeIndex aIdx( *pSttNd ); - SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, TRUE, FALSE ); + SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False ); // TABLE IN TABLE // (see also lcl_FindTopLevelTable in unoobj2.cxx for a different @@ -686,7 +686,7 @@ void SwShellTableCrsr::FillRects() while ( pSelTblNd != pCurTblNd && pCurTblNd ) { aIdx = pCurTblNd->EndOfSectionIndex(); - pCNd = rNds.GoNextSection( &aIdx, TRUE, FALSE ); + pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False ); pCurTblNd = pCNd->FindTableNode(); } @@ -713,19 +713,19 @@ void SwShellTableCrsr::FillRects() // Check if the SPoint is within the Table-SSelection. -BOOL SwShellTableCrsr::IsInside( const Point& rPt ) const +sal_Bool SwShellTableCrsr::IsInside( const Point& rPt ) const { // Calculate the new rectangles. // JP 16.01.98: If the cursor is still "parked" do nothing!! if( !aSelBoxes.Count() || bParked || !GetPoint()->nNode.GetIndex() ) - return FALSE; + return sal_False; SwNodes& rNds = GetDoc()->GetNodes(); - for( USHORT n = 0; n < aSelBoxes.Count(); ++n ) + for( sal_uInt16 n = 0; n < aSelBoxes.Count(); ++n ) { SwNodeIndex aIdx( *(*(aSelBoxes.GetData() + n ))->GetSttNd() ); - SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, TRUE, FALSE ); + SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, sal_True, sal_False ); if( !pCNd ) continue; @@ -734,23 +734,23 @@ BOOL SwShellTableCrsr::IsInside( const Point& rPt ) const pFrm = pFrm->GetUpper(); OSL_ENSURE( pFrm, "Node nicht in einer Tabelle" ); if( pFrm && pFrm->Frm().IsInside( rPt ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } #if OSL_DEBUG_LEVEL > 1 // JP 05.03.98: To test the UNO-Crsr behavior here the implementation on the // visible cursor. -BOOL SwShellTableCrsr::IsSelOvr( int eFlags ) +sal_Bool SwShellTableCrsr::IsSelOvr( int eFlags ) { return SwShellCrsr::IsSelOvr( eFlags ); } #endif -BOOL SwShellTableCrsr::IsAtValidPos( BOOL bPoint ) const +sal_Bool SwShellTableCrsr::IsAtValidPos( sal_Bool bPoint ) const { return SwShellCrsr::IsAtValidPos( bPoint ); } |