diff options
Diffstat (limited to 'svtools/source/edit/textundo.cxx')
-rw-r--r-- | svtools/source/edit/textundo.cxx | 75 |
1 files changed, 34 insertions, 41 deletions
diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx index 4c243de16c31..742c3ed4c707 100644 --- a/svtools/source/edit/textundo.cxx +++ b/svtools/source/edit/textundo.cxx @@ -54,33 +54,33 @@ TextUndoManager::~TextUndoManager() { } -BOOL __EXPORT TextUndoManager::Undo( USHORT nCount ) +sal_Bool __EXPORT TextUndoManager::Undo() { if ( GetUndoActionCount() == 0 ) - return FALSE; + return sal_False; UndoRedoStart(); - mpTextEngine->SetIsInUndo( TRUE ); - BOOL bDone = SfxUndoManager::Undo( nCount ); - mpTextEngine->SetIsInUndo( FALSE ); + mpTextEngine->SetIsInUndo( sal_True ); + sal_Bool bDone = SfxUndoManager::Undo(); + mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); return bDone; } -BOOL __EXPORT TextUndoManager::Redo( USHORT nCount ) +sal_Bool __EXPORT TextUndoManager::Redo() { if ( GetRedoActionCount() == 0 ) - return FALSE; + return sal_False; UndoRedoStart(); - mpTextEngine->SetIsInUndo( TRUE ); - BOOL bDone = SfxUndoManager::Redo( nCount ); - mpTextEngine->SetIsInUndo( FALSE ); + mpTextEngine->SetIsInUndo( sal_True ); + sal_Bool bDone = SfxUndoManager::Redo(); + mpTextEngine->SetIsInUndo( sal_False ); UndoRedoEnd(); @@ -110,9 +110,8 @@ void TextUndoManager::UndoRedoEnd() } -TextUndo::TextUndo( USHORT nI, TextEngine* p ) +TextUndo::TextUndo( TextEngine* p ) { - mnId = nI; mpTextEngine = p; } @@ -120,12 +119,6 @@ TextUndo::~TextUndo() { } -USHORT __EXPORT TextUndo::GetId() const -{ - //nId sollte mal entfallen => GetId ueberall ueberladen... - return mnId; -} - XubString __EXPORT TextUndo::GetComment() const { // return mpTextEngine->GetUndoComment( this ); @@ -139,12 +132,12 @@ void TextUndo::SetSelection( const TextSelection& rSel ) } -TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara ) - : TextUndo( TEXTUNDO_DELCONTENT, pTextEngine ) +TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara ) + : TextUndo( pTextEngine ) { mpNode = pNode; mnPara = nPara; - mbDelObject = TRUE; + mbDelObject = sal_True; } TextUndoDelPara::~TextUndoDelPara() @@ -156,7 +149,7 @@ TextUndoDelPara::~TextUndoDelPara() void __EXPORT TextUndoDelPara::Undo() { GetTextEngine()->InsertContent( mpNode, mnPara ); - mbDelObject = FALSE; // gehoert wieder der Engine + mbDelObject = sal_False; // gehoert wieder der Engine if ( GetView() ) { @@ -178,10 +171,10 @@ void __EXPORT TextUndoDelPara::Redo() GetDoc()->GetNodes().Remove( mnPara ); GetTextEngine()->ImpParagraphRemoved( mnPara ); - mbDelObject = TRUE; // gehoert wieder dem Undo + mbDelObject = sal_True; // gehoert wieder dem Undo - ULONG nParas = GetDoc()->GetNodes().Count(); - ULONG n = mnPara < nParas ? mnPara : (nParas-1); + sal_uLong nParas = GetDoc()->GetNodes().Count(); + sal_uLong n = mnPara < nParas ? mnPara : (nParas-1); TextNode* pN = GetDoc()->GetNodes().GetObject( n ); TextPaM aPaM( n, pN->GetText().Len() ); SetSelection( aPaM ); @@ -190,8 +183,8 @@ void __EXPORT TextUndoDelPara::Redo() // ----------------------------------------------------------------------- // TextUndoConnectParas // ------------------------------------------------------------------------ -TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos ) - : TextUndo( TEXTUNDO_CONNECTPARAS, pTextEngine ) +TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos ) + : TextUndo( pTextEngine ) { mnPara = nPara; mnSepPos = nPos; @@ -214,8 +207,8 @@ void __EXPORT TextUndoConnectParas::Redo() } -TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos ) - : TextUndo( TEXTUNDO_SPLITPARA, pTextEngine ) +TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos ) + : TextUndo( pTextEngine ) { mnPara = nPara; mnSepPos = nPos; @@ -239,7 +232,7 @@ void __EXPORT TextUndoSplitPara::Redo() TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr ) - : TextUndo( TEXTUNDO_INSERTCHARS, pTextEngine ), + : TextUndo( pTextEngine ), maTextPaM( rTextPaM ), maText( rStr ) { } @@ -261,27 +254,27 @@ void __EXPORT TextUndoInsertChars::Redo() SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) ); } -BOOL __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) +sal_Bool __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction ) { if ( !pNextAction->ISA( TextUndoInsertChars ) ) - return FALSE; + return sal_False; TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction; if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() ) - return FALSE; + return sal_False; if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() ) { maText += pNext->maText; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr ) - : TextUndo( TEXTUNDO_REMOVECHARS, pTextEngine ), + : TextUndo( pTextEngine ), maTextPaM( rTextPaM ), maText( rStr ) { } @@ -304,11 +297,11 @@ void __EXPORT TextUndoRemoveChars::Redo() TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rSel ) - : TextUndo( TEXTUNDO_ATTRIBS, pTextEngine ), maSelection( rSel ) + : TextUndo( pTextEngine ), maSelection( rSel ) { maSelection.Justify(); // aNewAttribs.Set( rNewItems ); -// mbSetIsRemove = FALSE; +// mbSetIsRemove = sal_False; // mnRemoveWhich = 0; // mnSpecial = 0; } @@ -320,12 +313,12 @@ TextUndoSetAttribs::~TextUndoSetAttribs() void __EXPORT TextUndoSetAttribs::Undo() { - for ( ULONG nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ ) + for ( sal_uLong nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ ) { -// ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ]; +// ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ]; // GetTextEngine()->RemoveCharAttribs( nPara ); // TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara ); -// for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) +// for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) // { // GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() ); // } |