diff options
Diffstat (limited to 'sw/source/core/undo/undel.cxx')
-rw-r--r-- | sw/source/core/undo/undel.cxx | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index ef39a4e18950..9c7b5c76e17c 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -68,13 +68,13 @@ inline SwDoc& SwUndoIter::GetDoc() const { return *pAktPam->GetDoc(); } if the anchor frame has be moved via _MoveNodes(..) and DelFrms(..) */ -void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, ULONG nMovedIndex ) +void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, sal_uLong nMovedIndex ) { if( rSpzArr.Count() ) { SwFlyFrmFmt* pFmt; const SwFmtAnchor* pAnchor; - for( USHORT n = 0; n < rSpzArr.Count(); ++n ) + for( sal_uInt16 n = 0; n < rSpzArr.Count(); ++n ) { pFmt = (SwFlyFrmFmt*)rSpzArr[n]; pAnchor = &pFmt->GetAnchor(); @@ -110,12 +110,12 @@ section and the end paragraph not. Then we have to move the paragraph into this record this in nSectDiff. */ -SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) +SwUndoDelete::SwUndoDelete( SwPaM& rPam, sal_Bool bFullPara, sal_Bool bCalledByTblCpy ) : SwUndo(UNDO_DELETE), SwUndRng( rPam ), pMvStt( 0 ), pSttStr(0), pEndStr(0), pRedlData(0), pRedlSaveData(0), nNode(0), nNdDiff(0), nSectDiff(0), nReplaceDummy(0), nSetPos(0), - bGroup( FALSE ), bBackSp( FALSE ), bJoinNext( FALSE ), bTblDelLastNd( FALSE ), - bDelFullPara( bFullPara ), bResetPgDesc( FALSE ), bResetPgBrk( FALSE ), + bGroup( sal_False ), bBackSp( sal_False ), bJoinNext( sal_False ), bTblDelLastNd( sal_False ), + bDelFullPara( bFullPara ), bResetPgDesc( sal_False ), bResetPgBrk( sal_False ), bFromTableCopy( bCalledByTblCpy ) { bDelFullPara = bFullPara; // This is set e.g. if an empty paragraph before a table is deleted @@ -147,8 +147,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(), DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) ); - BOOL bDoesUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + sal_Bool bDoesUndo = pDoc->DoesUndo(); + pDoc->DoUndo( sal_False ); _DelBookmarks(pStt->nNode, pEnd->nNode); pDoc->DoUndo( bDoesUndo ); } @@ -172,8 +172,8 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) : pEnd->nNode.GetNode().GetTxtNode(); } - BOOL bMoveNds = *pStt == *pEnd // noch ein Bereich vorhanden ?? - ? FALSE + sal_Bool bMoveNds = *pStt == *pEnd // noch ein Bereich vorhanden ?? + ? sal_False : ( SaveCntnt( pStt, pEnd, pSttTxtNd, pEndTxtNd ) || bFromTableCopy ); if( pSttTxtNd && pEndTxtNd && pSttTxtNd != pEndTxtNd ) @@ -193,11 +193,11 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) { SwRegHistory aRegHist( *pEndTxtNd, pHistory ); if( SFX_ITEM_SET == pEndTxtNd->GetpSwAttrSet()->GetItemState( - RES_BREAK, FALSE ) ) + RES_BREAK, sal_False ) ) pEndTxtNd->ResetAttr( RES_BREAK ); if( pEndTxtNd->HasSwAttrSet() && SFX_ITEM_SET == pEndTxtNd->GetpSwAttrSet()->GetItemState( - RES_PAGEDESC, FALSE ) ) + RES_PAGEDESC, sal_False ) ) pEndTxtNd->ResetAttr( RES_PAGEDESC ); } } @@ -253,10 +253,10 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) ++nReplaceDummy; SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 ); SwPosition aSplitPos( *pEndTxtNd ); - BOOL bDoesUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + sal_Bool bDoesUndo = pDoc->DoesUndo(); + pDoc->DoUndo( sal_False ); pDoc->SplitNode( aSplitPos, false ); - rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, TRUE ); + rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, sal_True ); pDoc->DoUndo( bDoesUndo ); aRg.aEnd--; } @@ -279,10 +279,10 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) { SwNodeRange aMvRg( *pSttTxtNd, 0, *pSttTxtNd, 1 ); SwPosition aSplitPos( *pSttTxtNd ); - BOOL bDoesUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + sal_Bool bDoesUndo = pDoc->DoesUndo(); + pDoc->DoUndo( sal_False ); pDoc->SplitNode( aSplitPos, false ); - rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, TRUE ); + rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, sal_True ); pDoc->DoUndo( bDoesUndo ); aRg.aStart--; } @@ -319,12 +319,12 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) if( bJoinNext ) { SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 ); - rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, TRUE ); + rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, sal_True ); } else { SwNodeRange aMvRg( *pSttTxtNd, 0, *pSttTxtNd, 1 ); - rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, TRUE ); + rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, sal_True ); } } } @@ -357,14 +357,14 @@ SwUndoDelete::SwUndoDelete( SwPaM& rPam, BOOL bFullPara, BOOL bCalledByTblCpy ) DELETEZ( pHistory ); } -BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, +sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd ) { - ULONG nNdIdx = pStt->nNode.GetIndex(); + sal_uLong nNdIdx = pStt->nNode.GetIndex(); // 1 - kopiere den Anfang in den Start-String if( pSttTxtNd ) { - BOOL bOneNode = nSttNode == nEndNode; + sal_Bool bOneNode = nSttNode == nEndNode; xub_StrLen nLen = bOneNode ? nEndCntnt - nSttCntnt : pSttTxtNd->GetTxt().Len() - nSttCntnt; SwRegHistory aRHst( *pSttTxtNd, pHistory ); @@ -397,7 +397,7 @@ BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, } if( bOneNode ) - return FALSE; // keine Nodes mehr verschieben + return sal_False; // keine Nodes mehr verschieben } @@ -435,21 +435,21 @@ BOOL SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, // sind es nur zwei Nodes, dann ist schon alles erledigt. if( ( pSttTxtNd || pEndTxtNd ) && nSttNode + 1 == nEndNode ) - return FALSE; // keine Nodes mehr verschieben + return sal_False; // keine Nodes mehr verschieben - return TRUE; // verschiebe die dazwischen liegenden Nodes + return sal_True; // verschiebe die dazwischen liegenden Nodes } -BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) +sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) { // ist das Undo groesser als 1 Node ? (sprich: Start und EndString) - if( pSttStr ? !pSttStr->Len() || pEndStr : TRUE ) - return FALSE; + if( pSttStr ? !pSttStr->Len() || pEndStr : sal_True ) + return sal_False; // es kann nur das Loeschen von einzelnen char's zusammengefasst werden if( nSttNode != nEndNode || ( !bGroup && nSttCntnt+1 != nEndCntnt )) - return FALSE; + return sal_False; const SwPosition *pStt = rDelPam.Start(), *pEnd = rDelPam.GetPoint() == pStt @@ -459,26 +459,26 @@ BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) if( pStt->nNode != pEnd->nNode || pStt->nContent.GetIndex()+1 != pEnd->nContent.GetIndex() || pEnd->nNode != nSttNode ) - return FALSE; + return sal_False; // untercheide zwischen BackSpace und Delete. Es muss dann das // Undo-Array unterschiedlich aufgebaut werden !! if( pEnd->nContent == nSttCntnt ) { - if( bGroup && !bBackSp ) return FALSE; - bBackSp = TRUE; + if( bGroup && !bBackSp ) return sal_False; + bBackSp = sal_True; } else if( pStt->nContent == nSttCntnt ) { - if( bGroup && bBackSp ) return FALSE; - bBackSp = FALSE; + if( bGroup && bBackSp ) return sal_False; + bBackSp = sal_False; } else - return FALSE; + return sal_False; // sind die beiden Nodes (Nodes-/Undo-Array) ueberhaupt TextNodes? SwTxtNode * pDelTxtNd = pStt->nNode.GetNode().GetTxtNode(); - if( !pDelTxtNd ) return FALSE; + if( !pDelTxtNd ) return sal_False; xub_StrLen nUChrPos = bBackSp ? 0 : pSttStr->Len()-1; sal_Unicode cDelChar = pDelTxtNd->GetTxt().GetChar( pStt->nContent.GetIndex() ); @@ -486,19 +486,19 @@ BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) if( ( CH_TXTATR_BREAKWORD == cDelChar || CH_TXTATR_INWORD == cDelChar ) || rCC.isLetterNumeric( String( cDelChar ), 0 ) != rCC.isLetterNumeric( *pSttStr, nUChrPos ) ) - return FALSE; + return sal_False; { SwRedlineSaveDatas* pTmpSav = new SwRedlineSaveDatas; - if( !FillSaveData( rDelPam, *pTmpSav, FALSE )) + if( !FillSaveData( rDelPam, *pTmpSav, sal_False )) delete pTmpSav, pTmpSav = 0; - BOOL bOk = ( !pRedlSaveData && !pTmpSav ) || + sal_Bool bOk = ( !pRedlSaveData && !pTmpSav ) || ( pRedlSaveData && pTmpSav && SwUndo::CanRedlineGroup( *pRedlSaveData, *pTmpSav, bBackSp )); delete pTmpSav; if( !bOk ) - return FALSE; + return sal_False; pDoc->DeleteRedline( rDelPam, false, USHRT_MAX ); } @@ -515,8 +515,8 @@ BOOL SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) pSttStr->Insert( cDelChar, nUChrPos ); pDelTxtNd->EraseText( pStt->nContent, 1 ); - bGroup = TRUE; - return TRUE; + bGroup = sal_True; + return sal_True; } @@ -541,7 +541,7 @@ static SwRewriter lcl_RewriterFromHistory(SwHistory & rHistory) bool bDone = false; - for ( USHORT n = 0; n < rHistory.Count(); n++) + for ( sal_uInt16 n = 0; n < rHistory.Count(); n++) { String aDescr = rHistory[n]->GetDescription(); @@ -623,14 +623,14 @@ SwRewriter SwUndoDelete::GetRewriter() const } // Every object, anchored "AtCntnt" will be reanchored at rPos -void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos, ULONG nOldIdx ) +void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos, sal_uLong nOldIdx ) { if( rSpzArr.Count() ) { SwFlyFrmFmt* pFmt; const SwFmtAnchor* pAnchor; const SwPosition* pAPos; - for( USHORT n = 0; n < rSpzArr.Count(); ++n ) + for( sal_uInt16 n = 0; n < rSpzArr.Count(); ++n ) { pFmt = (SwFlyFrmFmt*)rSpzArr[n]; pAnchor = &pFmt->GetAnchor(); @@ -651,10 +651,10 @@ void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) { SwDoc* pDoc = &rUndoIter.GetDoc(); - BOOL bUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + sal_Bool bUndo = pDoc->DoesUndo(); + pDoc->DoUndo( sal_False ); - ULONG nCalcStt = nSttNode - nNdDiff; + sal_uLong nCalcStt = nSttNode - nNdDiff; if( nSectDiff && bBackSp ) nCalcStt += nSectDiff; @@ -687,7 +687,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) pInsNd = 0; // Node nicht loeschen !! SwNodes* pUNds = (SwNodes*)pDoc->GetUndoNds(); - BOOL bNodeMove = 0 != nNode; + sal_Bool bNodeMove = 0 != nNode; if( pEndStr ) { @@ -702,7 +702,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) if( pSttStr && !bFromTableCopy ) { - ULONG nOldIdx = aPos.nNode.GetIndex(); + sal_uLong nOldIdx = aPos.nNode.GetIndex(); pDoc->SplitNode( aPos, false ); // After the split all objects are anchored at the first paragraph, // but the pHistory of the fly frame formats relies on anchoring at @@ -726,7 +726,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) { if( nSttCntnt < pNd->GetTxt().Len() ) { - ULONG nOldIdx = aPos.nNode.GetIndex(); + sal_uLong nOldIdx = aPos.nNode.GetIndex(); pDoc->SplitNode( aPos, false ); if( bBackSp ) lcl_ReAnchorAtCntntFlyFrames( *pDoc->GetSpzFrmFmts(), aPos, nOldIdx ); @@ -738,7 +738,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) SwNode* pMovedNode = NULL; if( nSectDiff ) { - ULONG nMoveIndex = aPos.nNode.GetIndex(); + sal_uLong nMoveIndex = aPos.nNode.GetIndex(); int nDiff = 0; if( bJoinNext ) { @@ -755,7 +755,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) aPos.nNode--; if( !bJoinNext ) pMovedNode = &aPos.nNode.GetNode(); - pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, TRUE ); + pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, sal_True ); aPos.nNode++; } @@ -767,7 +767,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) if( nReplaceDummy ) { - ULONG nMoveIndex; + sal_uLong nMoveIndex; if( bJoinNext ) { nMoveIndex = nEndNode - nNdDiff; @@ -781,7 +781,7 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) SwNodeIndex aMvIdx( pDoc->GetNodes(), nMoveIndex ); SwNodeRange aRg( aPos.nNode, 0, aPos.nNode, 1 ); pMovedNode = &aPos.nNode.GetNode(); - pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, TRUE ); + pDoc->GetNodes()._MoveNodes( aRg, pDoc->GetNodes(), aMvIdx, sal_True ); pDoc->GetNodes().Delete( aMvIdx, 1 ); } } @@ -838,8 +838,8 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) if( bResetPgDesc || bResetPgBrk ) { - USHORT nStt = static_cast<USHORT>( bResetPgDesc ? RES_PAGEDESC : RES_BREAK ); - USHORT nEnd = static_cast<USHORT>( bResetPgBrk ? RES_BREAK : RES_PAGEDESC ); + sal_uInt16 nStt = static_cast<sal_uInt16>( bResetPgDesc ? RES_PAGEDESC : RES_BREAK ); + sal_uInt16 nEnd = static_cast<sal_uInt16>( bResetPgBrk ? RES_BREAK : RES_PAGEDESC ); SwNode* pNode = pDoc->GetNodes()[ nEndNode + 1 ]; if( pNode->IsCntntNode() ) @@ -855,12 +855,12 @@ void SwUndoDelete::Undo( SwUndoIter& rUndoIter ) SetSaveData( *pDoc, *pRedlSaveData ); pDoc->DoUndo( bUndo ); // Undo wieder einschalten - SetPaM( rUndoIter, TRUE ); + SetPaM( rUndoIter, sal_True ); } void SwUndoDelete::Redo( SwUndoIter& rUndoIter ) { - rUndoIter.SetUpdateAttr( TRUE ); + rUndoIter.SetUpdateAttr( sal_True ); SwPaM& rPam = *rUndoIter.pAktPam; SwDoc& rDoc = *rPam.GetDoc(); @@ -869,7 +869,7 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter ) if( pRedlSaveData ) { - bool bSuccess = FillSaveData(rPam, *pRedlSaveData, TRUE); + bool bSuccess = FillSaveData(rPam, *pRedlSaveData, sal_True); OSL_ENSURE(bSuccess, "SwUndoDelete::Redo: used to have redline data, but now none?"); if (!bSuccess) @@ -881,7 +881,7 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter ) if( !bDelFullPara ) { SwUndRng aTmpRng( rPam ); - RemoveIdxFromRange( rPam, FALSE ); + RemoveIdxFromRange( rPam, sal_False ); aTmpRng.SetPaM( rPam ); if( !bJoinNext ) // Dann Selektion von unten nach oben @@ -947,11 +947,11 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter ) const SfxPoolItem *pItem; if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_PAGEDESC, - FALSE, &pItem ) ) + sal_False, &pItem ) ) pNextNd->SetAttr( *pItem ); if( SFX_ITEM_SET == pTableFmt->GetItemState( RES_BREAK, - FALSE, &pItem ) ) + sal_False, &pItem ) ) pNextNd->SetAttr( *pItem ); } pTblNd->DelFrms(); @@ -988,8 +988,8 @@ void SwUndoDelete::Repeat( SwUndoIter& rUndoIter ) SwPaM& rPam = *rUndoIter.pAktPam; SwDoc& rDoc = *rPam.GetDoc(); - BOOL bGroupUndo = rDoc.DoesGroupUndo(); - rDoc.DoGroupUndo( FALSE ); + sal_Bool bGroupUndo = rDoc.DoesGroupUndo(); + rDoc.DoGroupUndo( sal_False ); if( !rPam.HasMark() ) { rPam.SetMark(); |