diff options
Diffstat (limited to 'svtools/source/edit/textdoc.cxx')
-rw-r--r-- | svtools/source/edit/textdoc.cxx | 206 |
1 files changed, 103 insertions, 103 deletions
diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index 1f7fa9745c8c..2dfb014117b1 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -65,7 +65,7 @@ CompareStart( const void* pFirst, const void* pSecond ) // ------------------------------------------------------------------------- // (+) class TextCharAttrib // ------------------------------------------------------------------------- -TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd ) +TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) { mpAttr = rAttr.Clone(); mnStart = nStart, @@ -90,7 +90,7 @@ TextCharAttrib::~TextCharAttrib() TextCharAttribList::TextCharAttribList() { - mbHasEmptyAttribs = FALSE; + mbHasEmptyAttribs = sal_False; } TextCharAttribList::~TextCharAttribList() @@ -98,7 +98,7 @@ TextCharAttribList::~TextCharAttribList() // PTRARR_DEL } -void TextCharAttribList::Clear( BOOL bDestroyAttribs ) +void TextCharAttribList::Clear( sal_Bool bDestroyAttribs ) { if ( bDestroyAttribs ) TextCharAttribs::DeleteAndDestroy( 0, Count() ); @@ -110,18 +110,18 @@ void TextCharAttribList::Clear( BOOL bDestroyAttribs ) void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib ) { if ( pAttrib->IsEmpty() ) - mbHasEmptyAttribs = TRUE; + mbHasEmptyAttribs = sal_True; - const USHORT nCount = Count(); - const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. - BOOL bInserted = FALSE; - for ( USHORT x = 0; x < nCount; x++ ) + const sal_uInt16 nCount = Count(); + const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. + sal_Bool bInserted = sal_False; + for ( sal_uInt16 x = 0; x < nCount; x++ ) { TextCharAttrib* pCurAttrib = GetObject( x ); if ( pCurAttrib->GetStart() > nStart ) { Insert( pAttrib, x ); - bInserted = TRUE; + bInserted = sal_True; break; } } @@ -135,12 +135,12 @@ void TextCharAttribList::ResortAttribs() qsort( (void*)GetData(), Count(), sizeof( TextCharAttrib* ), CompareStart ); } -TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) +TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { TextCharAttrib* pAttr = GetObject( --nAttr ); @@ -153,11 +153,11 @@ TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) return NULL; } -TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos ) const +TextCharAttrib* TextCharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos ) const { DBG_ASSERT( nWhich, "FindNextAttrib: Which?" ); - const USHORT nAttribs = Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( ( pAttr->GetStart() >= nFromPos ) && @@ -168,41 +168,41 @@ TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromP return NULL; } -BOOL TextCharAttribList::HasAttrib( USHORT nWhich ) const +sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const { - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { const TextCharAttrib* pAttr = GetObject( --nAttr ); if ( pAttr->Which() == nWhich ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL TextCharAttribList::HasBoundingAttrib( USHORT nBound ) +sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - for ( USHORT nAttr = Count(); nAttr; ) + for ( sal_uInt16 nAttr = Count(); nAttr; ) { TextCharAttrib* pAttr = GetObject( --nAttr ); if ( pAttr->GetEnd() < nBound ) - return FALSE; + return sal_False; if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) +TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { if ( !mbHasEmptyAttribs ) return 0; - const USHORT nAttribs = Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->GetStart() > nPos ) @@ -216,7 +216,7 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos void TextCharAttribList::DeleteEmptyAttribs() { - for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->IsEmpty() ) @@ -226,19 +226,19 @@ void TextCharAttribList::DeleteEmptyAttribs() nAttr--; } } - mbHasEmptyAttribs = FALSE; + mbHasEmptyAttribs = sal_False; } #ifdef DBG_UTIL -BOOL TextCharAttribList::DbgCheckAttribs() +sal_Bool TextCharAttribList::DbgCheckAttribs() { - BOOL bOK = TRUE; - for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ ) + sal_Bool bOK = sal_True; + for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ ) { TextCharAttrib* pAttr = GetObject( nAttr ); if ( pAttr->GetStart() > pAttr->GetEnd() ) { - bOK = FALSE; + bOK = sal_False; DBG_ERROR( "Attr verdreht" ); } } @@ -255,14 +255,14 @@ TextNode::TextNode( const String& rText ) : { } -void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) +void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) { if ( !nNew ) return; - BOOL bResort = FALSE; - USHORT nAttribs = maCharAttribs.Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + sal_Bool bResort = sal_False; + sal_uInt16 nAttribs = maCharAttribs.Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); if ( pAttrib->GetEnd() >= nIndex ) @@ -293,7 +293,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) pAttrib->Expand( nNew ); } else - bResort = TRUE; + bResort = sal_True; } // 2: Attribut startet davor, geht hinter Index... else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -306,7 +306,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) if ( nIndex == 0 ) { pAttrib->Expand( nNew ); -// bResort = TRUE; // es gibt ja keine Features mehr... +// bResort = sal_True; // es gibt ja keine Features mehr... } else pAttrib->MoveForward( nNew ); @@ -326,18 +326,18 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew ) #endif } -void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) +void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) { if ( !nDeleted ) return; - BOOL bResort = FALSE; - USHORT nEndChanges = nIndex+nDeleted; + sal_Bool bResort = sal_False; + sal_uInt16 nEndChanges = nIndex+nDeleted; - for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); - BOOL bDelAttr = FALSE; + sal_Bool bDelAttr = sal_False; if ( pAttrib->GetEnd() >= nIndex ) { // Alles Attribute hinter der Einfuegeposition verschieben... @@ -353,7 +353,7 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) pAttrib->GetEnd() = nIndex; // leer else - bDelAttr = TRUE; + bDelAttr = sal_True; } // 2. Attribut beginnt davor, endet drinnen oder dahinter... else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -376,13 +376,13 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" ); if ( bDelAttr /* || pAttrib->IsEmpty() */ ) { - bResort = TRUE; + bResort = sal_True; maCharAttribs.RemoveAttrib( nAttr ); delete pAttrib; nAttr--; } else if ( pAttrib->IsEmpty() ) - maCharAttribs.HasEmptyAttribs() = TRUE; + maCharAttribs.HasEmptyAttribs() = sal_True; } if ( bResort ) @@ -393,25 +393,25 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted ) #endif } -void TextNode::InsertText( USHORT nPos, const String& rText ) +void TextNode::InsertText( sal_uInt16 nPos, const String& rText ) { maText.Insert( rText, nPos ); ExpandAttribs( nPos, rText.Len() ); } -void TextNode::InsertText( USHORT nPos, sal_Unicode c ) +void TextNode::InsertText( sal_uInt16 nPos, sal_Unicode c ) { maText.Insert( c, nPos ); ExpandAttribs( nPos, 1 ); } -void TextNode::RemoveText( USHORT nPos, USHORT nChars ) +void TextNode::RemoveText( sal_uInt16 nPos, sal_uInt16 nChars ) { maText.Erase( nPos, nChars ); CollapsAttribs( nPos, nChars ); } -TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) +TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs ) { String aNewText; if ( nPos < maText.Len() ) @@ -421,7 +421,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) } TextNode* pNew = new TextNode( aNewText ); - for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ ) { TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr ); if ( pAttrib->GetEnd() < nPos ) @@ -469,7 +469,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs ) void TextNode::Append( const TextNode& rNode ) { - USHORT nOldLen = maText.Len(); + sal_uInt16 nOldLen = maText.Len(); maText += rNode.GetText(); @@ -477,16 +477,16 @@ void TextNode::Append( const TextNode& rNode ) DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" ); #endif - const USHORT nAttribs = rNode.GetCharAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = rNode.GetCharAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr ); - BOOL bMelted = FALSE; + sal_Bool bMelted = sal_False; if ( pAttrib->GetStart() == 0 ) { // Evtl koennen Attribute zusammengefasst werden: - USHORT nTmpAttribs = maCharAttribs.Count(); - for ( USHORT nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ ) + sal_uInt16 nTmpAttribs = maCharAttribs.Count(); + for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ ) { TextCharAttrib* pTmpAttrib = maCharAttribs.GetAttrib( nTmpAttr ); @@ -497,7 +497,7 @@ void TextNode::Append( const TextNode& rNode ) { pTmpAttrib->GetEnd() = pTmpAttrib->GetEnd() + pAttrib->GetLen(); - bMelted = TRUE; + bMelted = sal_True; break; // es kann nur eins von der Sorte an der Stelle geben } } @@ -539,15 +539,15 @@ void TextDoc::Clear() void TextDoc::DestroyTextNodes() { - for ( ULONG nNode = 0; nNode < maTextNodes.Count(); nNode++ ) + for ( sal_uLong nNode = 0; nNode < maTextNodes.Count(); nNode++ ) delete maTextNodes.GetObject( nNode ); maTextNodes.clear(); } String TextDoc::GetText( const sal_Unicode* pSep ) const { - ULONG nLen = GetTextLen( pSep ); - ULONG nNodes = maTextNodes.Count(); + sal_uLong nLen = GetTextLen( pSep ); + sal_uLong nNodes = maTextNodes.Count(); if ( nLen > STRING_MAXLEN ) { @@ -556,8 +556,8 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const } String aASCIIText; - ULONG nLastNode = nNodes-1; - for ( ULONG nNode = 0; nNode < nNodes; nNode++ ) + sal_uLong nLastNode = nNodes-1; + for ( sal_uLong nNode = 0; nNode < nNodes; nNode++ ) { TextNode* pNode = maTextNodes.GetObject( nNode ); String aTmp( pNode->GetText() ); @@ -569,7 +569,7 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const return aASCIIText; } -XubString TextDoc::GetText( ULONG nPara ) const +XubString TextDoc::GetText( sal_uLong nPara ) const { XubString aText; TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0; @@ -580,26 +580,26 @@ XubString TextDoc::GetText( ULONG nPara ) const } -ULONG TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const +sal_uLong TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const { - ULONG nLen = 0; - ULONG nNodes = maTextNodes.Count(); + sal_uLong nLen = 0; + sal_uLong nNodes = maTextNodes.Count(); if ( nNodes ) { - ULONG nStartNode = 0; - ULONG nEndNode = nNodes-1; + sal_uLong nStartNode = 0; + sal_uLong nEndNode = nNodes-1; if ( pSel ) { nStartNode = pSel->GetStart().GetPara(); nEndNode = pSel->GetEnd().GetPara(); } - for ( ULONG nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uLong nNode = nStartNode; nNode <= nEndNode; nNode++ ) { TextNode* pNode = maTextNodes.GetObject( nNode ); - USHORT nS = 0; - ULONG nE = pNode->GetText().Len(); + sal_uInt16 nS = 0; + sal_uLong nE = pNode->GetText().Len(); if ( pSel && ( nNode == pSel->GetStart().GetPara() ) ) nS = pSel->GetStart().GetIndex(); if ( pSel && ( nNode == pSel->GetEnd().GetPara() ) ) @@ -639,7 +639,7 @@ TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr ) return aPaM; } -TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) +TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs ) { TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() ); TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs ); @@ -652,20 +652,20 @@ TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs ) TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight ) { - USHORT nPrevLen = pLeft->GetText().Len(); + sal_uInt16 nPrevLen = pLeft->GetText().Len(); pLeft->Append( *pRight ); // der rechte verschwindet. - ULONG nRight = maTextNodes.GetPos( pRight ); + sal_uLong nRight = maTextNodes.GetPos( pRight ); maTextNodes.Remove( nRight ); delete pRight; - ULONG nLeft = maTextNodes.GetPos( pLeft ); + sal_uLong nLeft = maTextNodes.GetPos( pLeft ); TextPaM aPaM( nLeft, nPrevLen ); return aPaM; } -TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars ) +TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars ) { TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() ); pNode->RemoveText( rPaM.GetIndex(), nChars ); @@ -673,25 +673,25 @@ TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars ) return rPaM; } -BOOL TextDoc::IsValidPaM( const TextPaM& rPaM ) +sal_Bool TextDoc::IsValidPaM( const TextPaM& rPaM ) { if ( rPaM.GetPara() >= maTextNodes.Count() ) { DBG_ERROR( "PaM: Para out of range" ); - return FALSE; + return sal_False; } TextNode * pNode = maTextNodes.GetObject( rPaM.GetPara() ); if ( rPaM.GetIndex() > pNode->GetText().Len() ) { DBG_ERROR( "PaM: Index out of range" ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } /* -void TextDoc::InsertAttribInSelection( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void TextDoc::InsertAttribInSelection( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); @@ -727,14 +727,14 @@ void TextDoc::InsertAttribInSelection( TextNode* pNode, USHORT nStart, USHORT nE pNode->GetCharAttribs().ResortAttribs(); } -BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich ) +sal_Bool TextDoc::RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich ) { TextCharAttrib* pStarting; TextCharAttrib* pEnding; return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich ); } -BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich ) +sal_Bool TextDoc::RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich ) { DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); @@ -744,22 +744,22 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh // dieses startet am Ende der Selektion => kann erweitert werden rpStarting = 0; - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; DBG_ASSERT( nStart <= nEnd, "Kleiner Rechenfehler in InsertAttribInSelection" ); // ueber die Attribute iterieren... - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { - BOOL bRemoveAttrib = FALSE; + sal_Bool bRemoveAttrib = sal_False; if ( !nWhich || ( pAttr->Which() == nWhich ) ) { // Attribut beginnt in Selection if ( ( pAttr->GetStart() >= nStart ) && ( pAttr->GetStart() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetEnd() > nEnd ) { pAttr->GetStart() = nEnd; // dann faengt es dahinter an @@ -769,14 +769,14 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Feature nur loeschen, wenn genau an der Stelle - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribut endet in Selection else if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetEnd() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( ( pAttr->GetStart() < nStart ) && !pAttr->IsFeature() ) { pAttr->GetEnd() = nStart; // dann hoert es hier auf @@ -785,13 +785,13 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Feature nur loeschen, wenn genau an der Stelle - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribut ueberlappt die Selektion else if ( ( pAttr->GetStart() <= nStart ) && ( pAttr->GetEnd() >= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetStart() == nStart ) { pAttr->GetStart() = nEnd; @@ -806,10 +806,10 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh } else // Attribut muss gesplittet werden... { - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; rpEnding = pAttr; -// ULONG nSavePos = pNode->GetCharAttribs().GetStartList().GetCurPos(); +// sal_uLong nSavePos = pNode->GetCharAttribs().GetStartList().GetCurPos(); InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd ); // pNode->GetCharAttribs().GetStartList().Seek( nSavePos ); break; // es kann weitere Attribute geben! @@ -832,14 +832,14 @@ BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCh #pragma SEG_FUNCDEF(editdoc_3f) -void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHORT nStart, USHORT nEnd ) +void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ) { // Diese Methode prueft nicht mehr, ob ein entspr. Attribut // schon an der Stelle existiert! // pruefen, ob neues Attrib oder einfach nur Ende eines Attribs... // const SfxPoolItem& rDefItem = pNode->GetContentAttribs().GetItem( rPoolItem.Which() ); -// BOOL bCreateAttrib = ( rDefItem != rPoolItem ); +// sal_Bool bCreateAttrib = ( rDefItem != rPoolItem ); // Durch den Verlust der Exclude-Liste geht es nicht mehr, dass ich // kein neues Attribut benoetige und nur das alte nicht expandiere... @@ -848,7 +848,7 @@ void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHOR // => Wenn schon Default-Item, dann wenigstens nur dann einstellen, // wenn davor wirklich ein entsprechendes Attribut. // if ( pNode->GetCharAttribs().FindAttrib( rPoolItem.Which(), nStart ) ) -// bCreateAttrib = TRUE; +// bCreateAttrib = sal_True; // Aber kleiner Trost: // Die wenigsten schreiben, aendern das Attr, schreiben, und // stellen dann wieder das Default-Attr ein. @@ -877,7 +877,7 @@ void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHOR #pragma SEG_FUNCDEF(editdoc_40) -void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void TextDoc::InsertAttrib( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { if ( nStart != nEnd ) { @@ -903,7 +903,7 @@ void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const S // ??????????????????????????????? // eigentlich noch pruefen, ob wirklich splittet, oder return ! // ??????????????????????????????? - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; pAttr = MakeCharAttrib( *pCurPool, *(pAttr->GetItem()), nStart, nOldEnd ); pNode->GetCharAttribs().InsertAttrib( pAttr ); @@ -922,12 +922,12 @@ void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const S #pragma SEG_FUNCDEF(editdoc_41) -void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ) +void TextDoc::FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ) { DBG_ASSERT( pNode, "Wo soll ich suchen ?" ); DBG_ASSERT( nStartPos <= nEndPos, "Ungueltiger Bereich!" ); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); // keine Selection... if ( nStartPos == nEndPos ) @@ -961,7 +961,7 @@ void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, Sf if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); @@ -1020,7 +1020,7 @@ void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, Sf if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); |