diff options
author | Carsten Driesner <cd@openoffice.org> | 2011-01-10 16:17:07 +0100 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2011-01-10 16:17:07 +0100 |
commit | ed3c4beb53a618ac8777f33a0abdf32fc64fa1a8 (patch) | |
tree | 760ae01919a24f57904c35e3d16f57f33cec4e87 /editeng/source/editeng | |
parent | 12149cec8bcaf0e234def8d435025f07be24e15b (diff) |
removetooltypes01: #i112600# Remove tool types
Diffstat (limited to 'editeng/source/editeng')
-rw-r--r-- | editeng/source/editeng/editattr.cxx | 78 | ||||
-rw-r--r-- | editeng/source/editeng/editattr.hxx | 100 | ||||
-rw-r--r-- | editeng/source/editeng/editdbg.cxx | 26 | ||||
-rw-r--r-- | editeng/source/editeng/editdbg.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 432 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.hxx | 382 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc2.cxx | 118 | ||||
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 124 | ||||
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 388 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 126 | ||||
-rw-r--r-- | editeng/source/editeng/editsel.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/editstt2.hxx | 60 | ||||
-rw-r--r-- | editeng/source/editeng/editundo.hxx | 52 | ||||
-rw-r--r-- | editeng/source/editeng/edtspell.hxx | 90 | ||||
-rwxr-xr-x | editeng/source/editeng/impedit.hxx | 158 | ||||
-rw-r--r-- | editeng/source/editeng/textconv.cxx | 20 | ||||
-rw-r--r-- | editeng/source/editeng/textconv.hxx | 12 |
17 files changed, 1087 insertions, 1087 deletions
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 81e211988a09..584d3d6904d1 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -76,13 +76,13 @@ EditAttrib::~EditAttrib() // ------------------------------------------------------------------------- // class EditCharAttrib // ------------------------------------------------------------------------- -EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) +EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) : EditAttrib( rAttr ) { nStart = nS; nEnd = nE; - bFeature = FALSE; - bEdge = FALSE; + bFeature = sal_False; + bEdge = sal_False; DBG_ASSERT( ( rAttr.Which() >= EE_ITEMS_START ) && ( rAttr.Which() <= EE_ITEMS_END ), "EditCharAttrib CTOR: Invalid id!" ); DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" ); @@ -96,7 +96,7 @@ void EditCharAttrib::SetFont( SvxFont&, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribFont // ------------------------------------------------------------------------- -EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTINFO || rAttr.Which() == EE_CHAR_FONTINFO_CJK || rAttr.Which() == EE_CHAR_FONTINFO_CTL, "Kein Fontattribut!" ); @@ -115,7 +115,7 @@ void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribItalic // ------------------------------------------------------------------------- -EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_ITALIC || rAttr.Which() == EE_CHAR_ITALIC_CJK || rAttr.Which() == EE_CHAR_ITALIC_CTL, "Kein Italicattribut!" ); @@ -129,7 +129,7 @@ void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribWeight // ------------------------------------------------------------------------- -EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_WEIGHT || rAttr.Which() == EE_CHAR_WEIGHT_CJK || rAttr.Which() == EE_CHAR_WEIGHT_CTL, "Kein Weightttribut!" ); @@ -143,7 +143,7 @@ void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribUnderline // ------------------------------------------------------------------------- -EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_UNDERLINE, "Kein Underlineattribut!" ); @@ -159,7 +159,7 @@ void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) // ------------------------------------------------------------------------- // class EditCharAttribOverline // ------------------------------------------------------------------------- -EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_OVERLINE, "Kein Overlineattribut!" ); @@ -175,7 +175,7 @@ void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) // ------------------------------------------------------------------------- // class EditCharAttribFontHeight // ------------------------------------------------------------------------- -EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTHEIGHT || rAttr.Which() == EE_CHAR_FONTHEIGHT_CJK || rAttr.Which() == EE_CHAR_FONTHEIGHT_CTL, "Kein Heightattribut!" ); @@ -190,7 +190,7 @@ void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribFontWidth // ------------------------------------------------------------------------- -EditCharAttribFontWidth::EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribFontWidth::EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTWIDTH, "Kein Widthattribut!" ); @@ -204,7 +204,7 @@ void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribStrikeout // ------------------------------------------------------------------------- -EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Kein Sizeattribut!" ); @@ -218,7 +218,7 @@ void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribColor // ------------------------------------------------------------------------- -EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_COLOR, "Kein Colorattribut!" ); @@ -232,7 +232,7 @@ void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribLanguage // ------------------------------------------------------------------------- -EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( ( rAttr.Which() == EE_CHAR_LANGUAGE ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CJK ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CTL ), "Kein Languageattribut!" ); @@ -246,7 +246,7 @@ void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribShadow // ------------------------------------------------------------------------- -EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_SHADOW, "Kein Shadowattribut!" ); @@ -254,13 +254,13 @@ EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetShadow( (BOOL)((const SvxShadowedItem*)GetItem())->GetValue() ); + rFont.SetShadow( (sal_Bool)((const SvxShadowedItem*)GetItem())->GetValue() ); } // ------------------------------------------------------------------------- // class EditCharAttribEscapement // ------------------------------------------------------------------------- -EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Kein Escapementattribut!" ); @@ -268,8 +268,8 @@ EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAt void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) { - USHORT nProp = ((const SvxEscapementItem*)GetItem())->GetProp(); - rFont.SetPropr( (BYTE)nProp ); + sal_uInt16 nProp = ((const SvxEscapementItem*)GetItem())->GetProp(); + rFont.SetPropr( (sal_uInt8)nProp ); short nEsc = ((const SvxEscapementItem*)GetItem())->GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) @@ -282,7 +282,7 @@ void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribOutline // ------------------------------------------------------------------------- -EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_OUTLINE, "Kein Outlineattribut!" ); @@ -290,16 +290,16 @@ EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, USHOR void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetOutline( (BOOL)((const SvxContourItem*)GetItem())->GetValue() ); + rFont.SetOutline( (sal_Bool)((const SvxContourItem*)GetItem())->GetValue() ); } // ------------------------------------------------------------------------- // class EditCharAttribTab // ------------------------------------------------------------------------- -EditCharAttribTab::EditCharAttribTab( const SfxVoidItem& rAttr, USHORT nPos ) +EditCharAttribTab::EditCharAttribTab( const SfxVoidItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( TRUE ); + SetFeature( sal_True ); } void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* ) @@ -309,10 +309,10 @@ void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribLineBreak // ------------------------------------------------------------------------- -EditCharAttribLineBreak::EditCharAttribLineBreak( const SfxVoidItem& rAttr, USHORT nPos ) +EditCharAttribLineBreak::EditCharAttribLineBreak( const SfxVoidItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( TRUE ); + SetFeature( sal_True ); } void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) @@ -322,10 +322,10 @@ void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribField // ------------------------------------------------------------------------- -EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, USHORT nPos ) +EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( TRUE ); // !!! + SetFeature( sal_True ); // !!! pTxtColor = 0; pFldColor = 0; } @@ -335,7 +335,7 @@ void EditCharAttribField::SetFont( SvxFont& rFont, OutputDevice* ) if ( pFldColor ) { rFont.SetFillColor( *pFldColor ); - rFont.SetTransparent( FALSE ); + rFont.SetTransparent( sal_False ); } if ( pTxtColor ) rFont.SetColor( *pTxtColor ); @@ -356,28 +356,28 @@ EditCharAttribField::~EditCharAttribField() Reset(); } -BOOL EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const +sal_Bool EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const { if ( aFieldValue != rAttr.aFieldValue ) - return FALSE; + return sal_False; if ( ( pTxtColor && !rAttr.pTxtColor ) || ( !pTxtColor && rAttr.pTxtColor ) ) - return FALSE; + return sal_False; if ( ( pTxtColor && rAttr.pTxtColor ) && ( *pTxtColor != *rAttr.pTxtColor ) ) - return FALSE; + return sal_False; if ( ( pFldColor && !rAttr.pFldColor ) || ( !pFldColor && rAttr.pFldColor ) ) - return FALSE; + return sal_False; if ( ( pFldColor && rAttr.pFldColor ) && ( *pFldColor != *rAttr.pFldColor ) ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } // ------------------------------------------------------------------------- // class EditCharAttribPairKerning // ------------------------------------------------------------------------- -EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_PAIRKERNING, "Kein PairKerning!" ); @@ -391,7 +391,7 @@ void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribKerning // ------------------------------------------------------------------------- -EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_KERNING, "Kein Kerning!" ); @@ -405,7 +405,7 @@ void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribWordLineMode // ------------------------------------------------------------------------- -EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_WLM, "Kein Kerning!" ); @@ -419,7 +419,7 @@ void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribEmphasisMark // ------------------------------------------------------------------------- -EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_EMPHASISMARK, "Kein Emphasisattribut!" ); @@ -433,7 +433,7 @@ void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribRelief // ------------------------------------------------------------------------- -EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_RELIEF, "Not a relief attribute!" ); diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx index 9f07969ee74d..a078aac55a16 100644 --- a/editeng/source/editeng/editattr.hxx +++ b/editeng/source/editeng/editattr.hxx @@ -83,7 +83,7 @@ public: // RemoveFromPool muss immer vorm DTOR Aufruf erfolgen!! void RemoveFromPool( SfxItemPool& rPool ); - USHORT Which() const { return pItem->Which(); } + sal_uInt16 Which() const { return pItem->Which(); } const SfxPoolItem* GetItem() const { return pItem; } }; @@ -96,72 +96,72 @@ class EditCharAttrib : public EditAttrib { protected: - USHORT nStart; - USHORT nEnd; - BOOL bFeature :1; - BOOL bEdge :1; + sal_uInt16 nStart; + sal_uInt16 nEnd; + sal_Bool bFeature :1; + sal_Bool bEdge :1; public: - EditCharAttrib( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); - USHORT& GetStart() { return nStart; } - USHORT& GetEnd() { return nEnd; } + sal_uInt16& GetStart() { return nStart; } + sal_uInt16& GetEnd() { return nEnd; } - USHORT GetStart() const { return nStart; } - USHORT GetEnd() const { return nEnd; } + sal_uInt16 GetStart() const { return nStart; } + sal_uInt16 GetEnd() const { return nEnd; } - inline USHORT GetLen() const; + inline sal_uInt16 GetLen() const; - inline void MoveForward( USHORT nDiff ); - inline void MoveBackward( USHORT nDiff ); + inline void MoveForward( sal_uInt16 nDiff ); + inline void MoveBackward( sal_uInt16 nDiff ); - inline void Expand( USHORT nDiff ); - inline void Collaps( USHORT nDiff ); + inline void Expand( sal_uInt16 nDiff ); + inline void Collaps( sal_uInt16 nDiff ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); - BOOL IsIn( USHORT nIndex ) + sal_Bool IsIn( sal_uInt16 nIndex ) { return ( ( nStart <= nIndex ) && ( nEnd >= nIndex ) ); } - BOOL IsInside( USHORT nIndex ) + sal_Bool IsInside( sal_uInt16 nIndex ) { return ( ( nStart < nIndex ) && ( nEnd > nIndex ) ); } - BOOL IsEmpty() + sal_Bool IsEmpty() { return nStart == nEnd; } - BOOL IsFeature() const { return bFeature; } - void SetFeature( BOOL b) { bFeature = b; } + sal_Bool IsFeature() const { return bFeature; } + void SetFeature( sal_Bool b) { bFeature = b; } - BOOL IsEdge() const { return bEdge; } - void SetEdge( BOOL b ) { bEdge = b; } + sal_Bool IsEdge() const { return bEdge; } + void SetEdge( sal_Bool b ) { bEdge = b; } }; -inline USHORT EditCharAttrib::GetLen() const +inline sal_uInt16 EditCharAttrib::GetLen() const { DBG_ASSERT( nEnd >= nStart, "EditCharAttrib: nEnd < nStart!" ); return nEnd-nStart; } -inline void EditCharAttrib::MoveForward( USHORT nDiff ) +inline void EditCharAttrib::MoveForward( sal_uInt16 nDiff ) { DBG_ASSERT( ((long)nEnd + nDiff) <= 0xFFFF, "EditCharAttrib: MoveForward?!" ); nStart = nStart + nDiff; nEnd = nEnd + nDiff; } -inline void EditCharAttrib::MoveBackward( USHORT nDiff ) +inline void EditCharAttrib::MoveBackward( sal_uInt16 nDiff ) { DBG_ASSERT( ((long)nStart - nDiff) >= 0, "EditCharAttrib: MoveBackward?!" ); nStart = nStart - nDiff; nEnd = nEnd - nDiff; } -inline void EditCharAttrib::Expand( USHORT nDiff ) +inline void EditCharAttrib::Expand( sal_uInt16 nDiff ) { DBG_ASSERT( ( ((long)nEnd + nDiff) <= (long)0xFFFF ), "EditCharAttrib: Expand?!" ); DBG_ASSERT( !bFeature, "Bitte keine Features expandieren!" ); nEnd = nEnd + nDiff; } -inline void EditCharAttrib::Collaps( USHORT nDiff ) +inline void EditCharAttrib::Collaps( sal_uInt16 nDiff ) { DBG_ASSERT( (long)nEnd - nDiff >= (long)nStart, "EditCharAttrib: Collaps?!" ); DBG_ASSERT( !bFeature, "Bitte keine Features schrumpfen!" ); @@ -174,7 +174,7 @@ inline void EditCharAttrib::Collaps( USHORT nDiff ) class EditCharAttribFont: public EditCharAttrib { public: - EditCharAttribFont( const SvxFontItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -185,7 +185,7 @@ public: class EditCharAttribWeight : public EditCharAttrib { public: - EditCharAttribWeight( const SvxWeightItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -195,7 +195,7 @@ public: class EditCharAttribItalic : public EditCharAttrib { public: - EditCharAttribItalic( const SvxPostureItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -206,7 +206,7 @@ public: class EditCharAttribShadow : public EditCharAttrib { public: - EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribShadow( const SvxShadowedItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -217,7 +217,7 @@ public: class EditCharAttribEscapement : public EditCharAttrib { public: - EditCharAttribEscapement( const SvxEscapementItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribEscapement( const SvxEscapementItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -228,7 +228,7 @@ public: class EditCharAttribOutline : public EditCharAttrib { public: - EditCharAttribOutline( const SvxContourItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribOutline( const SvxContourItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -239,7 +239,7 @@ public: class EditCharAttribStrikeout : public EditCharAttrib { public: - EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -250,7 +250,7 @@ public: class EditCharAttribUnderline : public EditCharAttrib { public: - EditCharAttribUnderline( const SvxUnderlineItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribUnderline( const SvxUnderlineItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -261,7 +261,7 @@ public: class EditCharAttribOverline : public EditCharAttrib { public: - EditCharAttribOverline( const SvxOverlineItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribOverline( const SvxOverlineItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -272,7 +272,7 @@ public: class EditCharAttribEmphasisMark : public EditCharAttrib { public: - EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -283,7 +283,7 @@ public: class EditCharAttribRelief : public EditCharAttrib { public: - EditCharAttribRelief( const SvxCharReliefItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -294,7 +294,7 @@ public: class EditCharAttribFontHeight : public EditCharAttrib { public: - EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -305,7 +305,7 @@ public: class EditCharAttribFontWidth : public EditCharAttrib { public: - EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -316,7 +316,7 @@ public: class EditCharAttribColor : public EditCharAttrib { public: - EditCharAttribColor( const SvxColorItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -327,7 +327,7 @@ public: class EditCharAttribLanguage : public EditCharAttrib { public: - EditCharAttribLanguage( const SvxLanguageItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribLanguage( const SvxLanguageItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -338,7 +338,7 @@ public: class EditCharAttribTab : public EditCharAttrib { public: - EditCharAttribTab( const SfxVoidItem& rAttr, USHORT nPos ); + EditCharAttribTab( const SfxVoidItem& rAttr, sal_uInt16 nPos ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -349,7 +349,7 @@ public: class EditCharAttribLineBreak : public EditCharAttrib { public: - EditCharAttribLineBreak( const SfxVoidItem& rAttr, USHORT nPos ); + EditCharAttribLineBreak( const SfxVoidItem& rAttr, sal_uInt16 nPos ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -366,12 +366,12 @@ class EditCharAttribField: public EditCharAttrib EditCharAttribField& operator = ( const EditCharAttribField& rAttr ) const; public: - EditCharAttribField( const SvxFieldItem& rAttr, USHORT nPos ); + EditCharAttribField( const SvxFieldItem& rAttr, sal_uInt16 nPos ); EditCharAttribField( const EditCharAttribField& rAttr ); ~EditCharAttribField(); - BOOL operator == ( const EditCharAttribField& rAttr ) const; - BOOL operator != ( const EditCharAttribField& rAttr ) const + sal_Bool operator == ( const EditCharAttribField& rAttr ) const; + sal_Bool operator != ( const EditCharAttribField& rAttr ) const { return !(operator == ( rAttr ) ); } virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); @@ -395,7 +395,7 @@ public: class EditCharAttribPairKerning : public EditCharAttrib { public: - EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -406,7 +406,7 @@ public: class EditCharAttribKerning : public EditCharAttrib { public: - EditCharAttribKerning( const SvxKerningItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribKerning( const SvxKerningItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -417,7 +417,7 @@ public: class EditCharAttribWordLineMode: public EditCharAttrib { public: - EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index a21c6ed345c6..a57708dc5d67 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -298,7 +298,7 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) return aDebStr; } -void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL bShowALL ) +void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, sal_Bool bSearchInParent, sal_Bool bShowALL ) { for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { @@ -319,7 +319,7 @@ void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL } } -void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) +void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) { #if defined UNX FILE* fp = fopen( "/tmp/debug.log", "w" ); @@ -347,10 +347,10 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) if ( pStyle ) fprintf( fp, " %s", ByteString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nAbsatzattribute:" ); - DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), FALSE, FALSE ); + DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), sal_False, sal_False ); fprintf( fp, "\nZeichenattribute:" ); - BOOL bZeroAttr = FALSE; + sal_Bool bZeroAttr = sal_False; USHORT z; for ( z = 0; z < pPPortion->GetNode()->GetCharAttribs().Count(); z++ ) { @@ -365,7 +365,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) aCharAttribs += '\t'; aCharAttribs += ByteString::CreateFromInt32( pAttr->GetEnd() ); if ( pAttr->IsEmpty() ) - bZeroAttr = TRUE; + bZeroAttr = sal_True; fprintf( fp, "%s => ", aCharAttribs.GetBuffer() ); ByteString aDebStr = DbgOutItem( rPool, *pAttr->GetItem() ); @@ -443,7 +443,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\nVorlage: %s", ByteString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nParent: %s", ByteString( pStyle->GetParent(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nFollow: %s", ByteString( pStyle->GetFollow(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); - DbgOutItemSet( fp, pStyle->GetItemSet(), FALSE, FALSE ); + DbgOutItemSet( fp, pStyle->GetItemSet(), sal_False, sal_False ); fprintf( fp, "\n----------------------------------" ); pStyle = aIter.Next(); @@ -453,7 +453,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== Defaults ================================================" ); fprintf( fp, "\n================================================================================" ); - DbgOutItemSet( fp, pEE->pImpEditEngine->GetEmptyItemSet(), TRUE, TRUE ); + DbgOutItemSet( fp, pEE->pImpEditEngine->GetEmptyItemSet(), sal_True, sal_True ); fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== EditEngine & Views ======================================" ); @@ -482,7 +482,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== Aktuelle View ===========================================" ); fprintf( fp, "\n================================================================================" ); - DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), TRUE, FALSE ); + DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), sal_True, sal_False ); } fclose( fp ); if ( bInfoBox ) @@ -558,16 +558,16 @@ void EditDbg::ShowPortionData( ParaPortion* pPortion ) } -BOOL ParaPortion::DbgCheckTextPortions() +sal_Bool ParaPortion::DbgCheckTextPortions() { // pruefen, ob Portionlaenge ok: USHORT nXLen = 0; for ( USHORT nPortion = 0; nPortion < aTextPortionList.Count(); nPortion++ ) nXLen = nXLen + aTextPortionList[nPortion]->GetLen(); - return nXLen == pNode->Len() ? TRUE : FALSE; + return nXLen == pNode->Len() ? sal_True : sal_False; } -BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart ) +sal_Bool CheckOrderedList( CharAttribArray& rAttribs, sal_Bool bStart ) { USHORT nPrev = 0; for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) @@ -575,11 +575,11 @@ BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart ) EditCharAttrib* pAttr = rAttribs[nAttr]; USHORT nCur = bStart ? pAttr->GetStart() : pAttr->GetEnd(); if ( nCur < nPrev ) - return FALSE; + return sal_False; nPrev = nCur; } - return TRUE; + return sal_True; } #endif diff --git a/editeng/source/editeng/editdbg.hxx b/editeng/source/editeng/editdbg.hxx index efe3248e9af4..ebaa60bd1306 100644 --- a/editeng/source/editeng/editdbg.hxx +++ b/editeng/source/editeng/editdbg.hxx @@ -41,12 +41,12 @@ class SfxItemPool; class SfxPoolItem; ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ); -void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL bShowALL ); +void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, sal_Bool bSearchInParent, sal_Bool bShowALL ); class EditDbg { public: - static void ShowEditEngineData( EditEngine* pEditEngine, BOOL bInfoBox = TRUE ); + static void ShowEditEngineData( EditEngine* pEditEngine, sal_Bool bInfoBox = sal_True ); static void ShowPortionData( ParaPortion* pPortion ); static ByteString GetPortionInfo( ParaPortion* pPPortion ); static ByteString GetTextPortionInfo( TextPortionList& rPortions ); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index a8b9efd1fff7..422d83bda4c0 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -71,9 +71,9 @@ using namespace ::com::sun::star; // ------------------------------------------------------------ -USHORT GetScriptItemId( USHORT nItemId, short nScriptType ) +sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, short nScriptType ) { - USHORT nId = nItemId; + sal_uInt16 nId = nItemId; if ( ( nScriptType == i18n::ScriptType::ASIAN ) || ( nScriptType == i18n::ScriptType::COMPLEX ) ) @@ -101,9 +101,9 @@ USHORT GetScriptItemId( USHORT nItemId, short nScriptType ) return nId; } -BOOL IsScriptItemValid( USHORT nItemId, short nScriptType ) +sal_Bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ) { - BOOL bValid = TRUE; + sal_Bool bValid = sal_True; switch ( nItemId ) { @@ -221,23 +221,23 @@ SfxItemInfo aItemInfos[EDITITEMCOUNT] = { { SID_FIELD, SFX_ITEM_POOLABLE } }; -USHORT aV1Map[] = { +sal_uInt16 aV1Map[] = { 3999, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4017, 4018, 4019 // MI: 4019? }; -USHORT aV2Map[] = { +sal_uInt16 aV2Map[] = { 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4018, 4019, 4020 }; -USHORT aV3Map[] = { +sal_uInt16 aV3Map[] = { 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021 }; -USHORT aV4Map[] = { +sal_uInt16 aV4Map[] = { 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, @@ -245,7 +245,7 @@ USHORT aV4Map[] = { 4034, 4035, 4036, 4037 }; -USHORT aV5Map[] = { +sal_uInt16 aV5Map[] = { 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, @@ -265,7 +265,7 @@ int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) return 0; } -EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) +EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) { // das neue Attribut im Pool anlegen const SfxPoolItem& rNew = rPool.Put( rAttr ); @@ -418,8 +418,8 @@ EditLine::EditLine() nTxtWidth = 0; nCrsrHeight = 0; nMaxAscent = 0; - bHangingPunctuation = FALSE; - bInvalid = TRUE; + bHangingPunctuation = sal_False; + bInvalid = sal_True; } EditLine::EditLine( const EditLine& r ) @@ -438,7 +438,7 @@ EditLine::EditLine( const EditLine& r ) nTxtWidth = 0; nCrsrHeight = 0; nMaxAscent = 0; - bInvalid = TRUE; + bInvalid = sal_True; } EditLine::~EditLine() @@ -467,21 +467,21 @@ EditLine* EditLine::Clone() const return pL; } -BOOL operator == ( const EditLine& r1, const EditLine& r2 ) +sal_Bool operator == ( const EditLine& r1, const EditLine& r2 ) { if ( r1.nStart != r2.nStart ) - return FALSE; + return sal_False; if ( r1.nEnd != r2.nEnd ) - return FALSE; + return sal_False; if ( r1.nStartPortion != r2.nStartPortion ) - return FALSE; + return sal_False; if ( r1.nEndPortion != r2.nEndPortion ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } EditLine& EditLine::operator = ( const EditLine& r ) @@ -494,7 +494,7 @@ EditLine& EditLine::operator = ( const EditLine& r ) } -BOOL operator != ( const EditLine& r1, const EditLine& r2 ) +sal_Bool operator != ( const EditLine& r1, const EditLine& r2 ) { return !( r1 == r2 ); } @@ -505,11 +505,11 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion ) Size aTmpSz; TextPortion* pPortion; - USHORT nIndex = GetStart(); + sal_uInt16 nIndex = GetStart(); DBG_ASSERT( rParaPortion.GetTextPortions().Count(), "GetTextSize vor CreatePortions !" ); - for ( USHORT n = nStartPortion; n <= nEndPortion; n++ ) + for ( sal_uInt16 n = nStartPortion; n <= nEndPortion; n++ ) { pPortion = rParaPortion.GetTextPortions().GetObject(n); switch ( pPortion->GetKind() ) @@ -534,7 +534,7 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion ) nIndex = nIndex + pPortion->GetLen(); } - SetHeight( (USHORT)aSz.Height() ); + SetHeight( (sal_uInt16)aSz.Height() ); return aSz; } @@ -552,22 +552,22 @@ EditLineList::~EditLineList() void EditLineList::Reset() { - for ( USHORT nLine = 0; nLine < Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < Count(); nLine++ ) delete GetObject(nLine); Remove( 0, Count() ); } -void EditLineList::DeleteFromLine( USHORT nDelFrom ) +void EditLineList::DeleteFromLine( sal_uInt16 nDelFrom ) { DBG_ASSERT( nDelFrom <= (Count() - 1), "DeleteFromLine: Out of range" ); - for ( USHORT nL = nDelFrom; nL < Count(); nL++ ) + for ( sal_uInt16 nL = nDelFrom; nL < Count(); nL++ ) delete GetObject(nL); Remove( nDelFrom, Count()-nDelFrom ); } -USHORT EditLineList::FindLine( USHORT nChar, BOOL bInclEnd ) +sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, sal_Bool bInclEnd ) { - for ( USHORT nLine = 0; nLine < Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < Count(); nLine++ ) { EditLine* pLine = GetObject( nLine ); if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) || @@ -584,26 +584,26 @@ USHORT EditLineList::FindLine( USHORT nChar, BOOL bInclEnd ) // ------------------------------------------------------------------------- // class EditSelection // ------------------------------------------------------------------------- -BOOL EditPaM::DbgIsBuggy( EditDoc& rDoc ) +sal_Bool EditPaM::DbgIsBuggy( EditDoc& rDoc ) { if ( !pNode ) - return TRUE; + return sal_True; if ( rDoc.GetPos( pNode ) >= rDoc.Count() ) - return TRUE; + return sal_True; if ( nIndex > pNode->Len() ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } -BOOL EditSelection::DbgIsBuggy( EditDoc& rDoc ) +sal_Bool EditSelection::DbgIsBuggy( EditDoc& rDoc ) { if ( aStartPaM.DbgIsBuggy( rDoc ) ) - return TRUE; + return sal_True; if ( aEndPaM.DbgIsBuggy( rDoc ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } EditSelection::EditSelection() @@ -632,20 +632,20 @@ EditSelection& EditSelection::operator = ( const EditPaM& rPaM ) return *this; } -BOOL EditSelection::IsInvalid() const +sal_Bool EditSelection::IsInvalid() const { EditPaM aEmptyPaM; if ( aStartPaM == aEmptyPaM ) - return TRUE; + return sal_True; if ( aEndPaM == aEmptyPaM ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } -BOOL EditSelection::Adjust( const ContentList& rNodes ) +sal_Bool EditSelection::Adjust( const ContentList& rNodes ) { DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index im Wald in Adjust(1)" ); DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index im Wald in Adjust(2)" ); @@ -653,17 +653,17 @@ BOOL EditSelection::Adjust( const ContentList& rNodes ) ContentNode* pStartNode = aStartPaM.GetNode(); ContentNode* pEndNode = aEndPaM.GetNode(); - USHORT nStartNode = rNodes.GetPos( pStartNode ); - USHORT nEndNode = rNodes.GetPos( pEndNode ); + sal_uInt16 nStartNode = rNodes.GetPos( pStartNode ); + sal_uInt16 nEndNode = rNodes.GetPos( pEndNode ); DBG_ASSERT( nStartNode != USHRT_MAX, "Node im Wald in Adjust(1)" ); DBG_ASSERT( nEndNode != USHRT_MAX, "Node im Wald in Adjust(2)" ); - BOOL bSwap = FALSE; + sal_Bool bSwap = sal_False; if ( nStartNode > nEndNode ) - bSwap = TRUE; + bSwap = sal_True; else if ( ( nStartNode == nEndNode ) && ( aStartPaM.GetIndex() > aEndPaM.GetIndex() ) ) - bSwap = TRUE; + bSwap = sal_True; if ( bSwap ) { @@ -679,15 +679,15 @@ BOOL EditSelection::Adjust( const ContentList& rNodes ) // ------------------------------------------------------------------------- // class EditPaM // ------------------------------------------------------------------------- -BOOL operator == ( const EditPaM& r1, const EditPaM& r2 ) +sal_Bool operator == ( const EditPaM& r1, const EditPaM& r2 ) { if ( r1.GetNode() != r2.GetNode() ) - return FALSE; + return sal_False; if ( r1.GetIndex() != r2.GetIndex() ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } EditPaM& EditPaM::operator = ( const EditPaM& rPaM ) @@ -697,7 +697,7 @@ EditPaM& EditPaM::operator = ( const EditPaM& rPaM ) return *this; } -BOOL operator != ( const EditPaM& r1, const EditPaM& r2 ) +sal_Bool operator != ( const EditPaM& r1, const EditPaM& r2 ) { return !( r1 == r2 ); } @@ -727,7 +727,7 @@ ContentNode::~ContentNode() #endif } -void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemPool ) +void ContentNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew, SfxItemPool& rItemPool ) { if ( !nNew ) return; @@ -740,10 +740,10 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP // Die wahrscheinlichste Moeglichkeit erhaelt kein bResort, // so dass nicht neu sortiert wird, wenn sich alle Attribute // gleich verhalten. - BOOL bResort = FALSE; - BOOL bExpandedEmptyAtIndexNull = FALSE; + sal_Bool bResort = sal_False; + sal_Bool bExpandedEmptyAtIndexNull = sal_False; - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( aCharAttribList.GetAttribs(), nAttr ); while ( pAttrib ) { @@ -764,7 +764,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP // if ( pAttrib->GetStart() == nIndex ) pAttrib->Expand( nNew ); if ( pAttrib->GetStart() == 0 ) - bExpandedEmptyAtIndexNull = TRUE; + bExpandedEmptyAtIndexNull = sal_True; } // 1: Attribut startet davor, geht bis Index... else if ( pAttrib->GetEnd() == nIndex ) // Start muss davor liegen @@ -779,7 +779,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP pAttrib->Expand( nNew ); } else - bResort = TRUE; + bResort = sal_True; } // 2: Attribut startet davor, geht hinter Index... else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -793,24 +793,24 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP if ( pAttrib->IsFeature() ) { pAttrib->MoveForward( nNew ); - bResort = TRUE; + bResort = sal_True; } else { - BOOL bExpand = FALSE; + sal_Bool bExpand = sal_False; if ( nIndex == 0 ) { - bExpand = TRUE; + bExpand = sal_True; if( bExpandedEmptyAtIndexNull ) { // Check if this kind of attribut was empty and expanded here... - USHORT nW = pAttrib->GetItem()->Which(); - for ( USHORT nA = 0; nA < nAttr; nA++ ) + sal_uInt16 nW = pAttrib->GetItem()->Which(); + for ( sal_uInt16 nA = 0; nA < nAttr; nA++ ) { EditCharAttrib* pA = aCharAttribList.GetAttribs()[nA]; if ( ( pA->GetStart() == 0 ) && ( pA->GetItem()->Which() == nW ) ) { - bExpand = FALSE; + bExpand = sal_False; break; } } @@ -820,7 +820,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP if ( bExpand ) { pAttrib->Expand( nNew ); - bResort = TRUE; + bResort = sal_True; } else { @@ -831,7 +831,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP } if ( pAttrib->IsEdge() ) - pAttrib->SetEdge( FALSE ); + pAttrib->SetEdge( sal_False ); DBG_ASSERT( !pAttrib->IsFeature() || ( pAttrib->GetLen() == 1 ), "Expand: FeaturesLen != 1" ); @@ -840,7 +840,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP if ( pAttrib->IsEmpty() ) { DBG_ERROR( "Leeres Attribut nach ExpandAttribs?" ); - bResort = TRUE; + bResort = sal_True; aCharAttribList.GetAttribs().Remove( nAttr ); rItemPool.Remove( *pAttrib->GetItem() ); delete pAttrib; @@ -856,32 +856,32 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP #ifndef SVX_LIGHT if ( pWrongList ) { - BOOL bSep = ( GetChar( nIndex ) == ' ' ) || IsFeature( nIndex ); + sal_Bool bSep = ( GetChar( nIndex ) == ' ' ) || IsFeature( nIndex ); pWrongList->TextInserted( nIndex, nNew, bSep ); } #endif // !SVX_LIGHT #ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Expand: Start-Liste verdreht" ); + DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), sal_True ), "Expand: Start-Liste verdreht" ); #endif } -void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& rItemPool ) +void ContentNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted, SfxItemPool& rItemPool ) { if ( !nDeleted ) return; // Da Features anders behandelt werden als normale Zeichenattribute, // kann sich hier auch die Sortierung der Start-Liste aendern! - BOOL bResort = FALSE; - BOOL bDelAttr = FALSE; - USHORT nEndChanges = nIndex+nDeleted; + sal_Bool bResort = sal_False; + sal_Bool bDelAttr = sal_False; + sal_uInt16 nEndChanges = nIndex+nDeleted; - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( aCharAttribList.GetAttribs(), nAttr ); while ( pAttrib ) { - bDelAttr = FALSE; + bDelAttr = sal_False; if ( pAttrib->GetEnd() >= nIndex ) { // Alles Attribute hinter der Einfuegeposition verschieben... @@ -897,7 +897,7 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r if ( !pAttrib->IsFeature() && ( 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 ) ) @@ -915,7 +915,7 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r if ( pAttrib->IsFeature() ) { pAttrib->MoveBackward( nDeleted ); - bResort = TRUE; + bResort = sal_True; } else { @@ -930,14 +930,14 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r DBG_ASSERT( ( pAttrib->GetEnd() <= Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" ); if ( bDelAttr /* || pAttrib->IsEmpty() */ ) { - bResort = TRUE; + bResort = sal_True; aCharAttribList.GetAttribs().Remove( nAttr ); rItemPool.Remove( *pAttrib->GetItem() ); delete pAttrib; nAttr--; } else if ( pAttrib->IsEmpty() ) - aCharAttribList.HasEmptyAttribs() = TRUE; + aCharAttribList.HasEmptyAttribs() = sal_True; nAttr++; pAttrib = GetAttrib( aCharAttribList.GetAttribs(), nAttr ); @@ -952,17 +952,17 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r #endif // !SVX_LIGHT #ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Collaps: Start-Liste verdreht" ); + DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), sal_True ), "Collaps: Start-Liste verdreht" ); #endif } -void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs ) +void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, sal_Bool bKeepEndingAttribs ) { DBG_ASSERT( pPrevNode, "kopieren von Attributen auf einen NULL-Pointer ?" ); xub_StrLen nCut = pPrevNode->Len(); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( pPrevNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttrib ) { @@ -1012,22 +1012,22 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) { DBG_ASSERT( pNextNode, "kopieren von Attributen von einen NULL-Pointer ?" ); - USHORT nNewStart = Len(); + sal_uInt16 nNewStart = Len(); #ifdef EDITDEBUG DBG_ASSERT( aCharAttribList.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" ); #endif - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( pNextNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttrib ) { // alle Attribute verschieben in den aktuellen Node (this) - BOOL bMelted = FALSE; + sal_Bool bMelted = sal_False; if ( ( pAttrib->GetStart() == 0 ) && ( !pAttrib->IsFeature() ) ) { // Evtl koennen Attribute zusammengefasst werden: - USHORT nTmpAttr = 0; + sal_uInt16 nTmpAttr = 0; EditCharAttrib* pTmpAttrib = GetAttrib( aCharAttribList.GetAttribs(), nTmpAttr ); while ( !bMelted && pTmpAttrib ) { @@ -1041,7 +1041,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) pNextNode->GetCharAttribs().GetAttribs().Remove( nAttr ); // Vom Pool abmelden ?! delete pAttrib; - bMelted = TRUE; + bMelted = sal_True; } } ++nTmpAttr; @@ -1089,7 +1089,7 @@ void ContentNode::SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyl GetContentAttribs().GetItems(), pS == NULL ); } -void ContentNode::SetStyleSheet( SfxStyleSheet* pS, BOOL bRecalcFont ) +void ContentNode::SetStyleSheet( SfxStyleSheet* pS, sal_Bool bRecalcFont ) { aContentAttribs.SetStyleSheet( pS ); if ( bRecalcFont ) @@ -1137,10 +1137,10 @@ ContentAttribs::~ContentAttribs() { } -SvxTabStop ContentAttribs::FindTabStop( long nCurPos, USHORT nDefTab ) +SvxTabStop ContentAttribs::FindTabStop( long nCurPos, sal_uInt16 nDefTab ) { const SvxTabStopItem& rTabs = (const SvxTabStopItem&) GetItem( EE_PARA_TABS ); - for ( USHORT i = 0; i < rTabs.Count(); i++ ) + for ( sal_uInt16 i = 0; i < rTabs.Count(); i++ ) { const SvxTabStop& rTab = rTabs[i]; if ( rTab.GetTabPos() > nCurPos ) @@ -1156,7 +1156,7 @@ SvxTabStop ContentAttribs::FindTabStop( long nCurPos, USHORT nDefTab ) void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) { - BOOL bStyleChanged = ( pStyle != pS ); + sal_Bool bStyleChanged = ( pStyle != pS ); pStyle = pS; // #104799# Only when other style sheet, not when current style sheet modified if ( pStyle && bStyleChanged ) @@ -1164,7 +1164,7 @@ void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) // Gezielt die Attribute aus der Absatzformatierung entfernen, die im Style // spezifiziert sind, damit die Attribute des Styles wirken koennen. const SfxItemSet& rStyleAttribs = pStyle->GetItemSet(); - for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { // #99635# Don't change bullet on/off if ( ( nWhich != EE_PARA_BULLETSTATE ) && ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON ) ) @@ -1173,23 +1173,23 @@ void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) } } -const SfxPoolItem& ContentAttribs::GetItem( USHORT nWhich ) +const SfxPoolItem& ContentAttribs::GetItem( sal_uInt16 nWhich ) { // Harte Absatzattribute haben Vorrang! SfxItemSet* pTakeFrom = &aAttribSet; - if ( pStyle && ( aAttribSet.GetItemState( nWhich, FALSE ) != SFX_ITEM_ON ) ) + if ( pStyle && ( aAttribSet.GetItemState( nWhich, sal_False ) != SFX_ITEM_ON ) ) pTakeFrom = &pStyle->GetItemSet(); return pTakeFrom->Get( nWhich ); } -BOOL ContentAttribs::HasItem( USHORT nWhich ) +sal_Bool ContentAttribs::HasItem( sal_uInt16 nWhich ) { - BOOL bHasItem = FALSE; - if ( aAttribSet.GetItemState( nWhich, FALSE ) == SFX_ITEM_ON ) - bHasItem = TRUE; + sal_Bool bHasItem = sal_False; + if ( aAttribSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_ON ) + bHasItem = sal_True; else if ( pStyle && pStyle->GetItemSet().GetItemState( nWhich ) == SFX_ITEM_ON ) - bHasItem = TRUE; + bHasItem = sal_True; return bHasItem; } @@ -1199,7 +1199,7 @@ BOOL ContentAttribs::HasItem( USHORT nWhich ) // ---------------------------------------------------------------------- // class ItemList // ---------------------------------------------------------------------- -const SfxPoolItem* ItemList::FindAttrib( USHORT nWhich ) +const SfxPoolItem* ItemList::FindAttrib( sal_uInt16 nWhich ) { const SfxPoolItem* pItem = First(); while ( pItem && ( pItem->Which() != nWhich ) ) @@ -1216,21 +1216,21 @@ EditDoc::EditDoc( SfxItemPool* pPool ) if ( pPool ) { pItemPool = pPool; - bOwnerOfPool = FALSE; + bOwnerOfPool = sal_False; } else { - pItemPool = new EditEngineItemPool( FALSE ); - bOwnerOfPool = TRUE; + pItemPool = new EditEngineItemPool( sal_False ); + bOwnerOfPool = sal_True; } nDefTab = DEFTAB; - bIsVertical = FALSE; - bIsFixedCellHeight = FALSE; + bIsVertical = sal_False; + bIsFixedCellHeight = sal_False; // Don't create a empty node, Clear() will be called in EditEngine-CTOR - SetModified( FALSE ); + SetModified( sal_False ); }; EditDoc::~EditDoc() @@ -1242,14 +1242,14 @@ EditDoc::~EditDoc() void EditDoc::ImplDestroyContents() { - for ( USHORT nNode = Count(); nNode; ) + for ( sal_uInt16 nNode = Count(); nNode; ) RemoveItemsFromPool( GetObject( --nNode ) ); DeleteAndDestroy( 0, Count() ); } void EditDoc::RemoveItemsFromPool( ContentNode* pNode ) { - for ( USHORT nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) { EditCharAttrib* pAttr = pNode->GetCharAttribs().GetAttribs()[nAttr]; GetItemPool().Remove( *pAttr->GetItem() ); @@ -1260,13 +1260,13 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s { Font aPrevFont( rFont ); rFont.SetAlign( ALIGN_BASELINE ); - rFont.SetTransparent( TRUE ); + rFont.SetTransparent( sal_True ); - USHORT nWhich_FontInfo = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); - USHORT nWhich_Language = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); - USHORT nWhich_FontHeight = GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ); - USHORT nWhich_Weight = GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ); - USHORT nWhich_Italic = GetScriptItemId( EE_CHAR_ITALIC, nScriptType ); + sal_uInt16 nWhich_FontInfo = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); + sal_uInt16 nWhich_Language = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); + sal_uInt16 nWhich_FontHeight = GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ); + sal_uInt16 nWhich_Weight = GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ); + sal_uInt16 nWhich_Italic = GetScriptItemId( EE_CHAR_ITALIC, nScriptType ); if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontInfo ) == SFX_ITEM_ON ) ) { @@ -1300,8 +1300,8 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s { const SvxEscapementItem& rEsc = (const SvxEscapementItem&) rSet.Get( EE_CHAR_ESCAPEMENT ); - USHORT nProp = rEsc.GetProp(); - rFont.SetPropr( (BYTE)nProp ); + sal_uInt16 nProp = rEsc.GetProp(); + rFont.SetPropr( (sal_uInt8)nProp ); short nEsc = rEsc.GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) @@ -1329,14 +1329,14 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s rFont = aPrevFont; // => Gleicher ImpPointer fuer IsSameInstance } -void EditDoc::CreateDefFont( BOOL bUseStyles ) +void EditDoc::CreateDefFont( sal_Bool bUseStyles ) { SfxItemSet aTmpSet( GetItemPool(), EE_PARA_START, EE_CHAR_END ); CreateFont( aDefFont, aTmpSet ); aDefFont.SetVertical( IsVertical() ); aDefFont.SetOrientation( IsVertical() ? 2700 : 0 ); - for ( USHORT nNode = 0; nNode < Count(); nNode++ ) + for ( sal_uInt16 nNode = 0; nNode < Count(); nNode++ ) { ContentNode* pNode = GetObject( nNode ); pNode->GetCharAttribs().GetDefFont() = aDefFont; @@ -1363,11 +1363,11 @@ XubString EditDoc::GetSepStr( LineEnd eEnd ) XubString EditDoc::GetText( LineEnd eEnd ) const { - ULONG nLen = GetTextLen(); - USHORT nNodes = Count(); + sal_uInt32 nLen = GetTextLen(); + sal_uInt16 nNodes = Count(); String aSep = EditDoc::GetSepStr( eEnd ); - USHORT nSepSize = aSep.Len(); + sal_uInt16 nSepSize = aSep.Len(); if ( nSepSize ) nLen += nNodes * nSepSize; @@ -1378,8 +1378,8 @@ XubString EditDoc::GetText( LineEnd eEnd ) const } xub_Unicode* pStr = new xub_Unicode[nLen+1]; xub_Unicode* pCur = pStr; - USHORT nLastNode = nNodes-1; - for ( USHORT nNode = 0; nNode < nNodes; nNode++ ) + sal_uInt16 nLastNode = nNodes-1; + for ( sal_uInt16 nNode = 0; nNode < nNodes; nNode++ ) { XubString aTmp( GetParaAsString( GetObject(nNode) ) ); memcpy( pCur, aTmp.GetBuffer(), aTmp.Len()*sizeof(sal_Unicode) ); @@ -1396,24 +1396,24 @@ XubString EditDoc::GetText( LineEnd eEnd ) const return aASCIIText; } -XubString EditDoc::GetParaAsString( USHORT nNode ) const +XubString EditDoc::GetParaAsString( sal_uInt16 nNode ) const { return GetParaAsString( SaveGetObject( nNode ) ); } -XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, BOOL bResolveFields ) const +XubString EditDoc::GetParaAsString( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, sal_Bool bResolveFields ) const { if ( nEndPos > pNode->Len() ) nEndPos = pNode->Len(); DBG_ASSERT( nStartPos <= nEndPos, "Start und Ende vertauscht?" ); - USHORT nIndex = nStartPos; + sal_uInt16 nIndex = nStartPos; XubString aStr; EditCharAttrib* pNextFeature = pNode->GetCharAttribs().FindFeature( nIndex ); while ( nIndex < nEndPos ) { - USHORT nEnd = nEndPos; + sal_uInt16 nEnd = nEndPos; if ( pNextFeature && ( pNextFeature->GetStart() < nEnd ) ) nEnd = pNextFeature->GetStart(); else @@ -1445,21 +1445,21 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT return aStr; } -ULONG EditDoc::GetTextLen() const +sal_uInt32 EditDoc::GetTextLen() const { - ULONG nLen = 0; - for ( USHORT nNode = 0; nNode < Count(); nNode++ ) + sal_uInt32 nLen = 0; + for ( sal_uInt16 nNode = 0; nNode < Count(); nNode++ ) { ContentNode* pNode = GetObject( nNode ); nLen += pNode->Len(); // Felder k”nnen laenger sein als der Platzhalter im Node. const CharAttribArray& rAttrs = pNode->GetCharAttribs().GetAttribs(); - for ( USHORT nAttr = rAttrs.Count(); nAttr; ) + for ( sal_uInt16 nAttr = rAttrs.Count(); nAttr; ) { EditCharAttrib* pAttr = rAttrs[--nAttr]; if ( pAttr->Which() == EE_FEATURE_FIELD ) { - USHORT nFieldLen = ((EditCharAttribField*)pAttr)->GetFieldValue().Len(); + sal_uInt16 nFieldLen = ((EditCharAttribField*)pAttr)->GetFieldValue().Len(); if ( !nFieldLen ) nLen--; else @@ -1477,15 +1477,15 @@ EditPaM EditDoc::Clear() ContentNode* pNode = new ContentNode( GetItemPool() ); Insert( pNode, 0 ); - CreateDefFont( FALSE ); + CreateDefFont( sal_False ); - SetModified( FALSE ); + SetModified( sal_False ); EditPaM aPaM( pNode, 0 ); return aPaM; } -void EditDoc::SetModified( BOOL b ) +void EditDoc::SetModified( sal_Bool b ) { bModified = b; if ( bModified ) @@ -1507,11 +1507,11 @@ EditPaM EditDoc::RemoveText() ContentNode* pNode = new ContentNode( GetItemPool() ); Insert( pNode, 0 ); - pNode->SetStyleSheet( pPrevStyle, FALSE ); + pNode->SetStyleSheet( pPrevStyle, sal_False ); pNode->GetContentAttribs().GetItems().Set( aPrevSet ); pNode->GetCharAttribs().GetDefFont() = aPrevFont; - SetModified( TRUE ); + SetModified( sal_True ); EditPaM aPaM( pNode, 0 ); return aPaM; @@ -1526,7 +1526,7 @@ void EditDoc::InsertText( const EditPaM& rPaM, xub_Unicode c ) rPaM.GetNode()->Insert( c, rPaM.GetIndex() ); rPaM.GetNode()->ExpandAttribs( rPaM.GetIndex(), 1, GetItemPool() ); - SetModified( TRUE ); + SetModified( sal_True ); } EditPaM EditDoc::InsertText( EditPaM aPaM, const XubString& rStr ) @@ -1540,16 +1540,16 @@ EditPaM EditDoc::InsertText( EditPaM aPaM, const XubString& rStr ) aPaM.GetNode()->ExpandAttribs( aPaM.GetIndex(), rStr.Len(), GetItemPool() ); aPaM.GetIndex() = aPaM.GetIndex() + rStr.Len(); - SetModified( TRUE ); + SetModified( sal_True ); return aPaM; } -EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) +EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs ) { DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertParaBreak" ); ContentNode* pCurNode = aPaM.GetNode(); - USHORT nPos = GetPos( pCurNode ); + sal_uInt16 nPos = GetPos( pCurNode ); XubString aStr = aPaM.GetNode()->Copy( aPaM.GetIndex() ); aPaM.GetNode()->Erase( aPaM.GetIndex() ); @@ -1557,7 +1557,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) ContentAttribs aContentAttribs( aPaM.GetNode()->GetContentAttribs() ); // for a new paragraph we like to have the bullet/numbering visible by default - aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, TRUE), EE_PARA_BULLETSTATE ); + aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, sal_True), EE_PARA_BULLETSTATE ); // ContenNode-CTOR kopiert auch die Absatzattribute ContentNode* pNode = new ContentNode( aStr, aContentAttribs ); @@ -1580,7 +1580,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) Insert( pNode, nPos+1 ); - SetModified( TRUE ); + SetModified( sal_True ); aPaM.SetNode( pNode ); aPaM.SetIndex( 0 ); @@ -1599,7 +1599,7 @@ EditPaM EditDoc::InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ) DBG_ASSERT( pAttrib, "Warum kann ich kein Feature anlegen ?" ); aPaM.GetNode()->GetCharAttribs().InsertAttrib( pAttrib ); - SetModified( TRUE ); + SetModified( sal_True ); aPaM.GetIndex()++; return aPaM; @@ -1616,27 +1616,27 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ) // der rechte verschwindet. RemoveItemsFromPool( pRight ); - USHORT nRight = GetPos( pRight ); + sal_uInt16 nRight = GetPos( pRight ); Remove( nRight ); delete pRight; - SetModified( TRUE ); + SetModified( sal_True ); return aPaM; } -EditPaM EditDoc::RemoveChars( EditPaM aPaM, USHORT nChars ) +EditPaM EditDoc::RemoveChars( EditPaM aPaM, sal_uInt16 nChars ) { // Evtl. Features entfernen! aPaM.GetNode()->Erase( aPaM.GetIndex(), nChars ); aPaM.GetNode()->CollapsAttribs( aPaM.GetIndex(), nChars, GetItemPool() ); - SetModified( TRUE ); + SetModified( sal_True ); return aPaM; } -void EditDoc::InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void EditDoc::InsertAttribInSelection( ContentNode* 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!" ); @@ -1671,17 +1671,17 @@ void EditDoc::InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT if ( pStartingAttrib ) pNode->GetCharAttribs().ResortAttribs(); - SetModified( TRUE ); + SetModified( sal_True ); } -BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich ) +sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich ) { EditCharAttrib* pStarting; EditCharAttrib* pEnding; return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich ); } -BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich ) +sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich ) { DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); @@ -1691,27 +1691,27 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi // 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; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { - BOOL bRemoveAttrib = FALSE; + sal_Bool bRemoveAttrib = sal_False; // MT 11.9.97: // Ich denke dass in dieser Methode generell keine Features geloescht // werden sollen. // => Dann koennen die Feature-Abfragen weiter unten entfallen - USHORT nAttrWhich = pAttr->Which(); + sal_uInt16 nAttrWhich = pAttr->Which(); if ( ( nAttrWhich < EE_FEATURE_START ) && ( !nWhich || ( nAttrWhich == 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 @@ -1722,14 +1722,14 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi 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 @@ -1738,13 +1738,13 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi 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; @@ -1761,7 +1761,7 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi } else // Attribut muss gesplittet werden... { - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; rpEnding = pAttr; InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd ); @@ -1788,13 +1788,13 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi // char attributes need to be sorted by start again pNode->GetCharAttribs().ResortAttribs(); - SetModified( TRUE ); + SetModified( sal_True ); } return bChanged; } -void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, USHORT nStart, USHORT nEnd ) +void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ) { // Diese Methode prueft nicht mehr, ob ein entspr. Attribut // schon an der Stelle existiert! @@ -1803,10 +1803,10 @@ void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, US DBG_ASSERT( pAttrib, "MakeCharAttrib fehlgeschlagen!" ); pNode->GetCharAttribs().InsertAttrib( pAttrib ); - SetModified( TRUE ); + SetModified( sal_True ); } -void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void EditDoc::InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { if ( nStart != nEnd ) { @@ -1832,7 +1832,7 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons // ??????????????????????????????? // eigentlich noch pruefen, ob wirklich splittet, oder return ! // ??????????????????????????????? - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; pAttr = MakeCharAttrib( GetItemPool(), *(pAttr->GetItem()), nStart, nOldEnd ); pNode->GetCharAttribs().InsertAttrib( pAttr ); @@ -1848,15 +1848,15 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons InsertAttrib( rPoolItem, pNode, nStart, nStart ); } - SetModified( TRUE ); + SetModified( sal_True ); } -void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ) +void EditDoc::FindAttribs( ContentNode* 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; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); // keine Selection... if ( nStartPos == nEndPos ) @@ -1887,7 +1887,7 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); @@ -1945,7 +1945,7 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); @@ -1973,14 +1973,14 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, CharAttribList::CharAttribList() { DBG_CTOR( EE_CharAttribList, 0 ); - bHasEmptyAttribs = FALSE; + bHasEmptyAttribs = sal_False; } CharAttribList::~CharAttribList() { DBG_DTOR( EE_CharAttribList, 0 ); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr ) { @@ -2004,20 +2004,20 @@ void CharAttribList::InsertAttrib( EditCharAttrib* pAttrib ) // Hier waere auch binaere Suche nicht optimal. // => Wuerde einiges bringen! - const USHORT nCount = Count(); - const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. + const sal_uInt16 nCount = Count(); + const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. if ( pAttrib->IsEmpty() ) - bHasEmptyAttribs = TRUE; + bHasEmptyAttribs = sal_True; - BOOL bInserted = FALSE; - for ( USHORT x = 0; x < nCount; x++ ) + sal_Bool bInserted = sal_False; + for ( sal_uInt16 x = 0; x < nCount; x++ ) { EditCharAttribPtr pCurAttrib = aAttribs[x]; if ( pCurAttrib->GetStart() > nStart ) { aAttribs.Insert( pAttrib, x ); - bInserted = TRUE; + bInserted = sal_True; break; } } @@ -2041,10 +2041,10 @@ void CharAttribList::ResortAttribs() void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool ) { - for ( USHORT n = 0; n < aAttribs.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aAttribs.Count(); n++ ) { EditCharAttrib* pAttr = aAttribs.GetObject( n ); - for ( USHORT nNext = n+1; nNext < aAttribs.Count(); nNext++ ) + for ( sal_uInt16 nNext = n+1; nNext < aAttribs.Count(); nNext++ ) { EditCharAttrib* p = aAttribs.GetObject( nNext ); if ( !pAttr->IsFeature() && ( p->GetStart() == pAttr->GetEnd() ) && ( p->Which() == pAttr->Which() ) ) @@ -2066,11 +2066,11 @@ void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool ) } } -EditCharAttrib* CharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) +EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - USHORT nAttr = aAttribs.Count()-1; + sal_uInt16 nAttr = aAttribs.Count()-1; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr ) { @@ -2081,11 +2081,11 @@ EditCharAttrib* CharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) return 0; } -EditCharAttrib* CharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos ) const +EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos ) const { DBG_ASSERT( nWhich, "FindNextAttrib: Which?" ); - const USHORT nAttribs = aAttribs.Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = aAttribs.Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { EditCharAttrib* pAttr = aAttribs[ nAttr ]; if ( ( pAttr->GetStart() >= nFromPos ) && ( pAttr->Which() == nWhich ) ) @@ -2094,50 +2094,50 @@ EditCharAttrib* CharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos ) return 0; } -BOOL CharAttribList::HasAttrib( USHORT nWhich ) const +sal_Bool CharAttribList::HasAttrib( sal_uInt16 nWhich ) const { - for ( USHORT nAttr = aAttribs.Count(); nAttr; ) + for ( sal_uInt16 nAttr = aAttribs.Count(); nAttr; ) { const EditCharAttrib* pAttr = aAttribs[--nAttr]; if ( pAttr->Which() == nWhich ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL CharAttribList::HasAttrib( USHORT nStartPos, USHORT nEndPos ) const +sal_Bool CharAttribList::HasAttrib( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) const { - BOOL bAttr = FALSE; - for ( USHORT nAttr = aAttribs.Count(); nAttr && !bAttr; ) + sal_Bool bAttr = sal_False; + for ( sal_uInt16 nAttr = aAttribs.Count(); nAttr && !bAttr; ) { const EditCharAttrib* pAttr = aAttribs[--nAttr]; if ( ( pAttr->GetStart() < nEndPos ) && ( pAttr->GetEnd() > nStartPos ) ) - return bAttr = TRUE; + return bAttr = sal_True; } return bAttr; } -BOOL CharAttribList::HasBoundingAttrib( USHORT nBound ) +sal_Bool CharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) { // Rueckwaerts, falls eins dort endet, das naechste startet. // => Das startende gilt... - USHORT nAttr = aAttribs.Count()-1; + sal_uInt16 nAttr = aAttribs.Count()-1; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr && ( pAttr->GetEnd() >= nBound ) ) { if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) ) - return TRUE; + return sal_True; pAttr = GetAttrib( aAttribs, --nAttr ); } - return FALSE; + return sal_False; } -EditCharAttrib* CharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) +EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { if ( !bHasEmptyAttribs ) return 0; - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr && ( pAttr->GetStart() <= nPos ) ) { @@ -2149,10 +2149,10 @@ EditCharAttrib* CharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) return 0; } -EditCharAttrib* CharAttribList::FindFeature( USHORT nPos ) const +EditCharAttrib* CharAttribList::FindFeature( sal_uInt16 nPos ) const { - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pNextAttrib = GetAttrib( aAttribs, nAttr ); // erstmal zur gewuenschten Position... @@ -2175,7 +2175,7 @@ EditCharAttrib* CharAttribList::FindFeature( USHORT nPos ) const void CharAttribList::DeleteEmptyAttribs( SfxItemPool& rItemPool ) { - for ( USHORT nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = aAttribs[nAttr]; if ( pAttr->IsEmpty() ) @@ -2186,30 +2186,30 @@ void CharAttribList::DeleteEmptyAttribs( SfxItemPool& rItemPool ) nAttr--; } } - bHasEmptyAttribs = FALSE; + bHasEmptyAttribs = sal_False; } -BOOL CharAttribList::DbgCheckAttribs() +sal_Bool CharAttribList::DbgCheckAttribs() { #ifdef DBG_UTIL - BOOL bOK = TRUE; - for ( USHORT nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) + sal_Bool bOK = sal_True; + for ( sal_uInt16 nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = aAttribs[nAttr]; if ( pAttr->GetStart() > pAttr->GetEnd() ) { - bOK = FALSE; + bOK = sal_False; DBG_ERROR( "Attr verdreht" ); } else if ( pAttr->IsFeature() && ( pAttr->GetLen() != 1 ) ) { - bOK = FALSE; + bOK = sal_False; DBG_ERROR( "Feature, Len != 1" ); } } return bOK; #else - return TRUE; + return sal_True; #endif } @@ -2229,7 +2229,7 @@ SvxFontTable::~SvxFontTable() } } -ULONG SvxFontTable::GetId( const SvxFontItem& rFontItem ) +sal_uInt32 SvxFontTable::GetId( const SvxFontItem& rFontItem ) { SvxFontItem* pItem = First(); while ( pItem ) @@ -2256,7 +2256,7 @@ SvxColorList::~SvxColorList() } } -ULONG SvxColorList::GetId( const SvxColorItem& rColorItem ) +sal_uInt32 SvxColorList::GetId( const SvxColorItem& rColorItem ) { SvxColorItem* pItem = First(); while ( pItem ) @@ -2269,7 +2269,7 @@ ULONG SvxColorList::GetId( const SvxColorItem& rColorItem ) return 0; } -EditEngineItemPool::EditEngineItemPool( BOOL bPersistenRefCounts ) +EditEngineItemPool::EditEngineItemPool( sal_Bool bPersistenRefCounts ) : SfxItemPool( String( "EditEngineItemPool", RTL_TEXTENCODING_ASCII_US ), EE_ITEMS_START, EE_ITEMS_END, aItemInfos, 0, bPersistenRefCounts ) { @@ -2297,8 +2297,8 @@ SvStream& EditEngineItemPool::Store( SvStream& rStream ) const // erst die ItemSets gespeichert werden... long nVersion = rStream.GetVersion(); - BOOL b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) - ? TRUE : FALSE; + sal_Bool b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) + ? sal_True : sal_False; EditEngineItemPool* pThis = (EditEngineItemPool*)this; if ( b31Format ) diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 16b4da6f8429..28fad49c71c8 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -52,45 +52,45 @@ DBG_NAMEEX( EE_TextPortion ) #define DEFTAB 720 void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent = true, short nScriptType = 0 ); -USHORT GetScriptItemId( USHORT nItemId, short nScriptType ); -BOOL IsScriptItemValid( USHORT nItemId, short nScriptType ); +sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, short nScriptType ); +sal_Bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ); -EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, USHORT nS, USHORT nE ); +EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ); class ContentNode; class EditDoc; struct EPaM { - USHORT nPara; - USHORT nIndex; + sal_uInt16 nPara; + sal_uInt16 nIndex; EPaM() { nPara = 0; nIndex = 0; } - EPaM( USHORT nP, USHORT nI ) { nPara = nP; nIndex = nI; } + EPaM( sal_uInt16 nP, sal_uInt16 nI ) { nPara = nP; nIndex = nI; } EPaM( const EPaM& r) { nPara = r.nPara; nIndex = r.nIndex; } EPaM& operator = ( const EPaM& r ) { nPara = r.nPara; nIndex = r.nIndex; return *this; } - inline BOOL operator == ( const EPaM& r ) const; - inline BOOL operator < ( const EPaM& r ) const; + inline sal_Bool operator == ( const EPaM& r ) const; + inline sal_Bool operator < ( const EPaM& r ) const; }; -inline BOOL EPaM::operator < ( const EPaM& r ) const +inline sal_Bool EPaM::operator < ( const EPaM& r ) const { return ( ( nPara < r.nPara ) || - ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? TRUE : FALSE; + ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? sal_True : sal_False; } -inline BOOL EPaM::operator == ( const EPaM& r ) const +inline sal_Bool EPaM::operator == ( const EPaM& r ) const { - return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? TRUE : FALSE; + return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? sal_True : sal_False; } struct ScriptTypePosInfo { short nScriptType; - USHORT nStartPos; - USHORT nEndPos; + sal_uInt16 nStartPos; + sal_uInt16 nEndPos; - ScriptTypePosInfo( short _Type, USHORT _Start, USHORT _End ) + ScriptTypePosInfo( short _Type, sal_uInt16 _Start, sal_uInt16 _End ) { nScriptType = _Type; nStartPos = _Start; @@ -102,11 +102,11 @@ typedef std::deque< ScriptTypePosInfo > ScriptTypePosInfos; struct WritingDirectionInfo { - BYTE nType; - USHORT nStartPos; - USHORT nEndPos; + sal_uInt8 nType; + sal_uInt16 nStartPos; + sal_uInt16 nEndPos; - WritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End ) + WritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End ) { nType = _Type; nStartPos = _Start; @@ -148,7 +148,7 @@ public: SvxFontTable(); ~SvxFontTable(); - ULONG GetId( const SvxFontItem& rFont ); + sal_uInt32 GetId( const SvxFontItem& rFont ); }; // ---------------------------------------------------------------------- @@ -162,7 +162,7 @@ public: SvxColorList(); ~SvxColorList(); - ULONG GetId( const SvxColorItem& rColor ); + sal_uInt32 GetId( const SvxColorItem& rColor ); }; // ---------------------------------------------------------------------- @@ -173,7 +173,7 @@ DECLARE_LIST( DummyItemList, ConstPoolItemPtr ) class ItemList : public DummyItemList { public: - const SfxPoolItem* FindAttrib( USHORT nWhich ); + const SfxPoolItem* FindAttrib( sal_uInt16 nWhich ); }; // ------------------------------------------------------------------------- @@ -190,13 +190,13 @@ public: ContentAttribs( const ContentAttribs& ); ~ContentAttribs(); // erst bei umfangreicheren Tabs - SvxTabStop FindTabStop( long nCurPos, USHORT nDefTab ); + SvxTabStop FindTabStop( long nCurPos, sal_uInt16 nDefTab ); SfxItemSet& GetItems() { return aAttribSet; } SfxStyleSheet* GetStyleSheet() const { return pStyle; } void SetStyleSheet( SfxStyleSheet* pS ); - const SfxPoolItem& GetItem( USHORT nWhich ); - BOOL HasItem( USHORT nWhich ); + const SfxPoolItem& GetItem( sal_uInt16 nWhich ); + sal_Bool HasItem( sal_uInt16 nWhich ); }; // ------------------------------------------------------------------------- @@ -207,7 +207,7 @@ class CharAttribList private: CharAttribArray aAttribs; SvxFont aDefFont; // schneller, als jedesmal vom Pool! - BOOL bHasEmptyAttribs; + sal_Bool bHasEmptyAttribs; CharAttribList( const CharAttribList& ) {;} @@ -218,32 +218,32 @@ public: void DeleteEmptyAttribs( SfxItemPool& rItemPool ); void RemoveItemsFromPool( SfxItemPool* pItemPool ); - EditCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos ); - EditCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos ) const; - EditCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos ); - EditCharAttrib* FindFeature( USHORT nPos ) const; + EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + EditCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos ) const; + EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + EditCharAttrib* FindFeature( sal_uInt16 nPos ) const; void ResortAttribs(); void OptimizeRanges( SfxItemPool& rItemPool ); - USHORT Count() { return aAttribs.Count(); } + sal_uInt16 Count() { return aAttribs.Count(); } void Clear() { aAttribs.Remove( 0, aAttribs.Count()); } void InsertAttrib( EditCharAttrib* pAttrib ); SvxFont& GetDefFont() { return aDefFont; } - BOOL HasEmptyAttribs() const { return bHasEmptyAttribs; } - BOOL& HasEmptyAttribs() { return bHasEmptyAttribs; } - BOOL HasBoundingAttrib( USHORT nBound ); - BOOL HasAttrib( USHORT nWhich ) const; - BOOL HasAttrib( USHORT nStartPos, USHORT nEndPos ) const; + sal_Bool HasEmptyAttribs() const { return bHasEmptyAttribs; } + sal_Bool& HasEmptyAttribs() { return bHasEmptyAttribs; } + sal_Bool HasBoundingAttrib( sal_uInt16 nBound ); + sal_Bool HasAttrib( sal_uInt16 nWhich ) const; + sal_Bool HasAttrib( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) const; CharAttribArray& GetAttribs() { return aAttribs; } const CharAttribArray& GetAttribs() const { return aAttribs; } // Debug: - BOOL DbgCheckAttribs(); + sal_Bool DbgCheckAttribs(); }; // ------------------------------------------------------------------------- @@ -264,12 +264,12 @@ public: ContentAttribs& GetContentAttribs() { return aContentAttribs; } CharAttribList& GetCharAttribs() { return aCharAttribList; } - void ExpandAttribs( USHORT nIndex, USHORT nNewChars, SfxItemPool& rItemPool ); - void CollapsAttribs( USHORT nIndex, USHORT nDelChars, SfxItemPool& rItemPool ); + void ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars, SfxItemPool& rItemPool ); + void CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars, SfxItemPool& rItemPool ); void AppendAttribs( ContentNode* pNextNode ); - void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs ); + void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, sal_Bool bKeepEndingAttribs ); - void SetStyleSheet( SfxStyleSheet* pS, BOOL bRecalcFont = TRUE ); + void SetStyleSheet( SfxStyleSheet* pS, sal_Bool bRecalcFont = sal_True ); void SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle ); SfxStyleSheet* GetStyleSheet() { return aContentAttribs.GetStyleSheet(); } @@ -281,7 +281,7 @@ public: void CreateWrongList(); void DestroyWrongList(); - BOOL IsFeature( USHORT nPos ) const { return ( GetChar( nPos ) == CH_FEATURE ); } + sal_Bool IsFeature( sal_uInt16 nPos ) const { return ( GetChar( nPos ) == CH_FEATURE ); } }; typedef ContentNode* ContentNodePtr; @@ -289,10 +289,10 @@ SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 ) class ContentList : public DummyContentList { - USHORT nLastCache; + sal_uInt16 nLastCache; public: ContentList() : DummyContentList( 0, 4 ), nLastCache(0) {} - USHORT GetPos( const ContentNodePtr &rPtr ) const; + sal_uInt16 GetPos( const ContentNodePtr &rPtr ) const; }; // ------------------------------------------------------------------------- @@ -302,27 +302,27 @@ class EditPaM { private: ContentNode* pNode; - USHORT nIndex; + sal_uInt16 nIndex; public: EditPaM() { pNode = NULL; nIndex = 0; } - EditPaM( ContentNode* p, USHORT n ) { pNode = p; nIndex = n; } + EditPaM( ContentNode* p, sal_uInt16 n ) { pNode = p; nIndex = n; } ContentNode* GetNode() const { return pNode; } void SetNode( ContentNode* p) { pNode = p; } - USHORT GetIndex() const { return nIndex; } - USHORT& GetIndex() { return nIndex; } - void SetIndex( USHORT n ) { nIndex = n; } + sal_uInt16 GetIndex() const { return nIndex; } + sal_uInt16& GetIndex() { return nIndex; } + void SetIndex( sal_uInt16 n ) { nIndex = n; } - BOOL IsParaStart() const { return nIndex == 0; } - BOOL IsParaEnd() const { return nIndex == pNode->Len(); } + sal_Bool IsParaStart() const { return nIndex == 0; } + sal_Bool IsParaEnd() const { return nIndex == pNode->Len(); } - BOOL DbgIsBuggy( EditDoc& rDoc ); + sal_Bool DbgIsBuggy( EditDoc& rDoc ); EditPaM& operator = ( const EditPaM& rPaM ); - friend BOOL operator == ( const EditPaM& r1, const EditPaM& r2 ); - friend BOOL operator != ( const EditPaM& r1, const EditPaM& r2 ); + friend sal_Bool operator == ( const EditPaM& r1, const EditPaM& r2 ); + friend sal_Bool operator != ( const EditPaM& r1, const EditPaM& r2 ); }; #define PORTIONKIND_TEXT 0 @@ -351,11 +351,11 @@ struct ExtraPortionInfo long nPortionOffsetX; - USHORT nMaxCompression100thPercent; + sal_uInt16 nMaxCompression100thPercent; - BYTE nAsianCompressionTypes; - BOOL bFirstCharIsRightPunktuation; - BOOL bCompressed; + sal_uInt8 nAsianCompressionTypes; + sal_Bool bFirstCharIsRightPunktuation; + sal_Bool bCompressed; sal_Int32* pOrgDXArray; @@ -363,7 +363,7 @@ struct ExtraPortionInfo ExtraPortionInfo(); ~ExtraPortionInfo(); - void SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen ); + void SaveOrgDXArray( const sal_Int32* pDXArray, sal_uInt16 nLen ); void DestroyOrgDXArray(); }; @@ -375,44 +375,44 @@ class TextPortion { private: ExtraPortionInfo* pExtraInfos; - USHORT nLen; + sal_uInt16 nLen; Size aOutSz; - BYTE nKind; - BYTE nRightToLeft; + sal_uInt8 nKind; + sal_uInt8 nRightToLeft; sal_Unicode nExtraValue; TextPortion() { DBG_CTOR( EE_TextPortion, 0 ); - pExtraInfos = NULL; nLen = 0; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;} + pExtraInfos = NULL; nLen = 0; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = sal_False;} public: - TextPortion( USHORT nL ) : aOutSz( -1, -1 ) + TextPortion( sal_uInt16 nL ) : aOutSz( -1, -1 ) { DBG_CTOR( EE_TextPortion, 0 ); - pExtraInfos = NULL; nLen = nL; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;} + pExtraInfos = NULL; nLen = nL; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = sal_False;} TextPortion( const TextPortion& r ) : aOutSz( r.aOutSz ) { DBG_CTOR( EE_TextPortion, 0 ); pExtraInfos = NULL; nLen = r.nLen; nKind = r.nKind; nExtraValue = r.nExtraValue; nRightToLeft = r.nRightToLeft; } ~TextPortion() { DBG_DTOR( EE_TextPortion, 0 ); delete pExtraInfos; } - USHORT GetLen() const { return nLen; } - USHORT& GetLen() { return nLen; } - void SetLen( USHORT nL ) { nLen = nL; } + sal_uInt16 GetLen() const { return nLen; } + sal_uInt16& GetLen() { return nLen; } + void SetLen( sal_uInt16 nL ) { nLen = nL; } Size& GetSize() { return aOutSz; } Size GetSize() const { return aOutSz; } - BYTE& GetKind() { return nKind; } - BYTE GetKind() const { return nKind; } + sal_uInt8& GetKind() { return nKind; } + sal_uInt8 GetKind() const { return nKind; } - void SetRightToLeft( BYTE b ) { nRightToLeft = b; } - BYTE GetRightToLeft() const { return nRightToLeft; } - BOOL IsRightToLeft() const { return (nRightToLeft&1); } + void SetRightToLeft( sal_uInt8 b ) { nRightToLeft = b; } + sal_uInt8 GetRightToLeft() const { return nRightToLeft; } + sal_Bool IsRightToLeft() const { return (nRightToLeft&1); } sal_Unicode GetExtraValue() const { return nExtraValue; } void SetExtraValue( sal_Unicode n ) { nExtraValue = n; } - BOOL HasValidSize() const { return aOutSz.Width() != (-1); } + sal_Bool HasValidSize() const { return aOutSz.Width() != (-1); } ExtraPortionInfo* GetExtraInfos() const { return pExtraInfos; } void SetExtraInfos( ExtraPortionInfo* p ) { delete pExtraInfos; pExtraInfos = p; } @@ -431,9 +431,9 @@ public: ~TextPortionList(); void Reset(); - USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); - USHORT GetStartPos( USHORT nPortion ); - void DeleteFromPortion( USHORT nDelFrom ); + sal_uInt16 FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, sal_Bool bPreferStartingPortion = sal_False ); + sal_uInt16 GetStartPos( sal_uInt16 nPortion ); + void DeleteFromPortion( sal_uInt16 nDelFrom ); }; class ParaPortion; @@ -448,84 +448,84 @@ class EditLine private: CharPosArray aPositions; long nTxtWidth; - USHORT nStartPosX; - USHORT nStart; // koennte durch nStartPortion ersetzt werden - USHORT nEnd; // koennte durch nEndPortion ersetzt werden - USHORT nStartPortion; - USHORT nEndPortion; - USHORT nHeight; // Gesamthoehe der Zeile - USHORT nTxtHeight; // Reine Texthoehe - USHORT nCrsrHeight; // Bei Konturfluss hohe Zeilen => Cursor zu groá. - USHORT nMaxAscent; - BOOL bHangingPunctuation; - BOOL bInvalid; // fuer geschickte Formatierung + sal_uInt16 nStartPosX; + sal_uInt16 nStart; // koennte durch nStartPortion ersetzt werden + sal_uInt16 nEnd; // koennte durch nEndPortion ersetzt werden + sal_uInt16 nStartPortion; + sal_uInt16 nEndPortion; + sal_uInt16 nHeight; // Gesamthoehe der Zeile + sal_uInt16 nTxtHeight; // Reine Texthoehe + sal_uInt16 nCrsrHeight; // Bei Konturfluss hohe Zeilen => Cursor zu groá. + sal_uInt16 nMaxAscent; + sal_Bool bHangingPunctuation; + sal_Bool bInvalid; // fuer geschickte Formatierung public: EditLine(); EditLine( const EditLine& ); ~EditLine(); - BOOL IsIn( USHORT nIndex ) const + sal_Bool IsIn( sal_uInt16 nIndex ) const { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); } - BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const + sal_Bool IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const { return ( ( nIndex >= nStart ) && ( bInclEnd ? ( nIndex <= nEnd ) : ( nIndex < nEnd ) ) ); } - void SetStart( USHORT n ) { nStart = n; } - USHORT GetStart() const { return nStart; } - USHORT& GetStart() { return nStart; } + void SetStart( sal_uInt16 n ) { nStart = n; } + sal_uInt16 GetStart() const { return nStart; } + sal_uInt16& GetStart() { return nStart; } - void SetEnd( USHORT n ) { nEnd = n; } - USHORT GetEnd() const { return nEnd; } - USHORT& GetEnd() { return nEnd; } + void SetEnd( sal_uInt16 n ) { nEnd = n; } + sal_uInt16 GetEnd() const { return nEnd; } + sal_uInt16& GetEnd() { return nEnd; } - void SetStartPortion( USHORT n ) { nStartPortion = n; } - USHORT GetStartPortion() const { return nStartPortion; } - USHORT& GetStartPortion() { return nStartPortion; } + void SetStartPortion( sal_uInt16 n ) { nStartPortion = n; } + sal_uInt16 GetStartPortion() const { return nStartPortion; } + sal_uInt16& GetStartPortion() { return nStartPortion; } - void SetEndPortion( USHORT n ) { nEndPortion = n; } - USHORT GetEndPortion() const { return nEndPortion; } - USHORT& GetEndPortion() { return nEndPortion; } + void SetEndPortion( sal_uInt16 n ) { nEndPortion = n; } + sal_uInt16 GetEndPortion() const { return nEndPortion; } + sal_uInt16& GetEndPortion() { return nEndPortion; } - void SetHeight( USHORT nH, USHORT nTxtH = 0, USHORT nCrsrH = 0 ) + void SetHeight( sal_uInt16 nH, sal_uInt16 nTxtH = 0, sal_uInt16 nCrsrH = 0 ) { nHeight = nH; nTxtHeight = ( nTxtH ? nTxtH : nH ); nCrsrHeight = ( nCrsrH ? nCrsrH : nTxtHeight ); } - USHORT GetHeight() const { return nHeight; } - USHORT GetTxtHeight() const { return nTxtHeight; } - USHORT GetCrsrHeight() const { return nCrsrHeight; } + sal_uInt16 GetHeight() const { return nHeight; } + sal_uInt16 GetTxtHeight() const { return nTxtHeight; } + sal_uInt16 GetCrsrHeight() const { return nCrsrHeight; } void SetTextWidth( long n ) { nTxtWidth = n; } long GetTextWidth() const { return nTxtWidth; } - void SetMaxAscent( USHORT n ) { nMaxAscent = n; } - USHORT GetMaxAscent() const { return nMaxAscent; } + void SetMaxAscent( sal_uInt16 n ) { nMaxAscent = n; } + sal_uInt16 GetMaxAscent() const { return nMaxAscent; } - void SetHangingPunctuation( BOOL b ) { bHangingPunctuation = b; } - BOOL IsHangingPunctuation() const { return bHangingPunctuation; } + void SetHangingPunctuation( sal_Bool b ) { bHangingPunctuation = b; } + sal_Bool IsHangingPunctuation() const { return bHangingPunctuation; } - USHORT GetLen() const { return nEnd - nStart; } + sal_uInt16 GetLen() const { return nEnd - nStart; } - USHORT GetStartPosX() const { return nStartPosX; } - void SetStartPosX( USHORT start ) { nStartPosX = start; } + sal_uInt16 GetStartPosX() const { return nStartPosX; } + void SetStartPosX( sal_uInt16 start ) { nStartPosX = start; } Size CalcTextSize( ParaPortion& rParaPortion ); - BOOL IsInvalid() const { return bInvalid; } - BOOL IsValid() const { return !bInvalid; } - void SetInvalid() { bInvalid = TRUE; } - void SetValid() { bInvalid = FALSE; } + sal_Bool IsInvalid() const { return bInvalid; } + sal_Bool IsValid() const { return !bInvalid; } + void SetInvalid() { bInvalid = sal_True; } + void SetValid() { bInvalid = sal_False; } - BOOL IsEmpty() const { return (nEnd > nStart) ? FALSE : TRUE; } + sal_Bool IsEmpty() const { return (nEnd > nStart) ? sal_False : sal_True; } CharPosArray& GetCharPosArray() { return aPositions; } EditLine* Clone() const; EditLine& operator = ( const EditLine& rLine ); - friend BOOL operator == ( const EditLine& r1, const EditLine& r2 ); - friend BOOL operator != ( const EditLine& r1, const EditLine& r2 ); + friend sal_Bool operator == ( const EditLine& r1, const EditLine& r2 ); + friend sal_Bool operator != ( const EditLine& r1, const EditLine& r2 ); }; @@ -542,8 +542,8 @@ public: ~EditLineList(); void Reset(); - void DeleteFromLine( USHORT nDelFrom ); - USHORT FindLine( USHORT nChar, BOOL bInclEnd ); + void DeleteFromLine( sal_uInt16 nDelFrom ); + sal_uInt16 FindLine( sal_uInt16 nChar, sal_Bool bInclEnd ); }; // ------------------------------------------------------------------------- @@ -561,15 +561,15 @@ private: ScriptTypePosInfos aScriptInfos; WritingDirectionInfos aWritingDirectionInfos; - USHORT nInvalidPosStart; - USHORT nFirstLineOffset; // Fuer Writer-LineSpacing-Interpretation - USHORT nBulletX; + sal_uInt16 nInvalidPosStart; + sal_uInt16 nFirstLineOffset; // Fuer Writer-LineSpacing-Interpretation + sal_uInt16 nBulletX; short nInvalidDiff; - BOOL bInvalid : 1; - BOOL bSimple : 1; // nur lineares Tippen - BOOL bVisible : 1; // MT 05/00: Gehoert an den Node!!! - BOOL bForceRepaint : 1; + sal_Bool bInvalid : 1; + sal_Bool bSimple : 1; // nur lineares Tippen + sal_Bool bVisible : 1; // MT 05/00: Gehoert an den Node!!! + sal_Bool bForceRepaint : 1; ParaPortion( const ParaPortion& ); @@ -577,39 +577,39 @@ public: ParaPortion( ContentNode* pNode ); ~ParaPortion(); - USHORT GetLineNumber( USHORT nIndex ); + sal_uInt16 GetLineNumber( sal_uInt16 nIndex ); EditLineList& GetLines() { return aLineList; } - BOOL IsInvalid() const { return bInvalid; } - BOOL IsSimpleInvalid() const { return bSimple; } - void SetValid() { bInvalid = FALSE; bSimple = TRUE;} + sal_Bool IsInvalid() const { return bInvalid; } + sal_Bool IsSimpleInvalid() const { return bSimple; } + void SetValid() { bInvalid = sal_False; bSimple = sal_True;} - BOOL MustRepaint() const { return bForceRepaint; } - void SetMustRepaint( BOOL bRP ) { bForceRepaint = bRP; } + sal_Bool MustRepaint() const { return bForceRepaint; } + void SetMustRepaint( sal_Bool bRP ) { bForceRepaint = bRP; } - USHORT GetBulletX() const { return nBulletX; } - void SetBulletX( USHORT n ) { nBulletX = n; } + sal_uInt16 GetBulletX() const { return nBulletX; } + void SetBulletX( sal_uInt16 n ) { nBulletX = n; } - void MarkInvalid( USHORT nStart, short nDiff); - void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); + void MarkInvalid( sal_uInt16 nStart, short nDiff); + void MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd ); - void SetVisible( BOOL bVisible ); - BOOL IsVisible() { return bVisible; } + void SetVisible( sal_Bool bVisible ); + sal_Bool IsVisible() { return bVisible; } long GetHeight() const { return ( bVisible ? nHeight : 0 ); } - USHORT GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); } + sal_uInt16 GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); } void ResetHeight() { nHeight = 0; nFirstLineOffset = 0; } ContentNode* GetNode() const { return pNode; } TextPortionList& GetTextPortions() { return aTextPortionList; } - USHORT GetInvalidPosStart() const { return nInvalidPosStart; } + sal_uInt16 GetInvalidPosStart() const { return nInvalidPosStart; } short GetInvalidDiff() const { return nInvalidDiff; } - void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); + void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ); - BOOL DbgCheckTextPortions(); + sal_Bool DbgCheckTextPortions(); }; typedef ParaPortion* ParaPortionPtr; @@ -620,19 +620,19 @@ SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0, 4 ) // ------------------------------------------------------------------------- class ParaPortionList : public DummyParaPortionList { - USHORT nLastCache; + sal_uInt16 nLastCache; public: ParaPortionList(); ~ParaPortionList(); void Reset(); long GetYOffset( ParaPortion* pPPortion ); - USHORT FindParagraph( long nYOffset ); + sal_uInt16 FindParagraph( long nYOffset ); - inline ParaPortion* SaveGetObject( USHORT nPos ) const + inline ParaPortion* SaveGetObject( sal_uInt16 nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } - USHORT GetPos( const ParaPortionPtr &rPtr ) const; + sal_uInt16 GetPos( const ParaPortionPtr &rPtr ) const; // temporaer: void DbgCheck( EditDoc& rDoc ); @@ -658,17 +658,17 @@ public: const EditPaM& Min() const { return aStartPaM; } const EditPaM& Max() const { return aEndPaM; } - BOOL HasRange() const { return aStartPaM != aEndPaM; } - BOOL IsInvalid() const; - BOOL DbgIsBuggy( EditDoc& rDoc ); + sal_Bool HasRange() const { return aStartPaM != aEndPaM; } + sal_Bool IsInvalid() const; + sal_Bool DbgIsBuggy( EditDoc& rDoc ); - BOOL Adjust( const ContentList& rNodes ); + sal_Bool Adjust( const ContentList& rNodes ); EditSelection& operator = ( const EditPaM& r ); - BOOL operator == ( const EditSelection& r ) const + sal_Bool operator == ( const EditSelection& r ) const { return ( ( aStartPaM == r.aStartPaM ) && ( aEndPaM == r.aEndPaM ) ) - ? TRUE : FALSE; } - BOOL operator != ( const EditSelection& r ) const { return !( r == *this ); } + ? sal_True : sal_False; } + sal_Bool operator != ( const EditSelection& r ) const { return !( r == *this ); } }; // ------------------------------------------------------------------------- @@ -677,16 +677,16 @@ public: class DeletedNodeInfo { private: - ULONG nInvalidAdressPtr; - USHORT nInvalidParagraph; + sal_uInt32 nInvalidAdressPtr; + sal_uInt16 nInvalidParagraph; public: - DeletedNodeInfo( ULONG nInvAdr, USHORT nPos ) + DeletedNodeInfo( sal_uInt32 nInvAdr, sal_uInt16 nPos ) { nInvalidAdressPtr = nInvAdr; nInvalidParagraph = nPos; } - ULONG GetInvalidAdress() { return nInvalidAdressPtr; } - USHORT GetPosition() { return nInvalidParagraph; } + sal_uInt32 GetInvalidAdress() { return nInvalidAdressPtr; } + sal_uInt16 GetPosition() { return nInvalidParagraph; } }; typedef DeletedNodeInfo* DeletedNodeInfoPtr; @@ -702,12 +702,12 @@ private: Link aModifyHdl; SvxFont aDefFont; //schneller, als jedesmal vom Pool! - USHORT nDefTab; - BOOL bIsVertical; - BOOL bIsFixedCellHeight; + sal_uInt16 nDefTab; + sal_Bool bIsVertical; + sal_Bool bIsFixedCellHeight; - BOOL bOwnerOfPool; - BOOL bModified; + sal_Bool bOwnerOfPool; + sal_Bool bModified; protected: void ImplDestroyContents(); @@ -716,38 +716,38 @@ public: EditDoc( SfxItemPool* pItemPool ); ~EditDoc(); - BOOL IsModified() const { return bModified; } - void SetModified( BOOL b ); + sal_Bool IsModified() const { return bModified; } + void SetModified( sal_Bool b ); void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; } Link GetModifyHdl() const { return aModifyHdl; } - void CreateDefFont( BOOL bUseStyles ); + void CreateDefFont( sal_Bool bUseStyles ); const SvxFont& GetDefFont() { return aDefFont; } - void SetDefTab( USHORT nTab ) { nDefTab = nTab ? nTab : DEFTAB; } - USHORT GetDefTab() const { return nDefTab; } + void SetDefTab( sal_uInt16 nTab ) { nDefTab = nTab ? nTab : DEFTAB; } + sal_uInt16 GetDefTab() const { return nDefTab; } - void SetVertical( BOOL bVertical ) { bIsVertical = bVertical; } - BOOL IsVertical() const { return bIsVertical; } + void SetVertical( sal_Bool bVertical ) { bIsVertical = bVertical; } + sal_Bool IsVertical() const { return bIsVertical; } - void SetFixedCellHeight( BOOL bUseFixedCellHeight ) { bIsFixedCellHeight = bUseFixedCellHeight; } - BOOL IsFixedCellHeight() const { return bIsFixedCellHeight; } + void SetFixedCellHeight( sal_Bool bUseFixedCellHeight ) { bIsFixedCellHeight = bUseFixedCellHeight; } + sal_Bool IsFixedCellHeight() const { return bIsFixedCellHeight; } EditPaM Clear(); EditPaM RemoveText(); - EditPaM RemoveChars( EditPaM aPaM, USHORT nChars ); + EditPaM RemoveChars( EditPaM aPaM, sal_uInt16 nChars ); void InsertText( const EditPaM& rPaM, xub_Unicode c ); EditPaM InsertText( EditPaM aPaM, const XubString& rStr ); - EditPaM InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ); + EditPaM InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs ); EditPaM InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ); EditPaM ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ); String GetText( LineEnd eEnd ) const; - ULONG GetTextLen() const; + sal_uInt32 GetTextLen() const; - XubString GetParaAsString( USHORT nNode ) const; - XubString GetParaAsString( ContentNode* pNode, USHORT nStartPos = 0, USHORT nEndPos = 0xFFFF, BOOL bResolveFields = TRUE ) const; + XubString GetParaAsString( sal_uInt16 nNode ) const; + XubString GetParaAsString( ContentNode* pNode, sal_uInt16 nStartPos = 0, sal_uInt16 nEndPos = 0xFFFF, sal_Bool bResolveFields = sal_True ) const; inline EditPaM GetStartPaM() const; inline EditPaM GetEndPaM() const; @@ -757,15 +757,15 @@ public: void RemoveItemsFromPool( ContentNode* pNode ); - void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, USHORT nStart, USHORT nEnd ); - void InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); - void InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); - BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich = 0 ); - BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich = 0 ); - void FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ); + void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ); + void InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ); + void InsertAttribInSelection( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ); + sal_Bool RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich = 0 ); + sal_Bool RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 ); + void FindAttribs( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ); - USHORT GetPos( ContentNode* pNode ) const { return ContentList::GetPos(pNode); } - ContentNode* SaveGetObject( USHORT nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } + sal_uInt16 GetPos( ContentNode* pNode ) const { return ContentList::GetPos(pNode); } + ContentNode* SaveGetObject( sal_uInt16 nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } static XubString GetSepStr( LineEnd eEnd ); }; @@ -781,12 +781,12 @@ inline EditPaM EditDoc::GetEndPaM() const return EditPaM( pLastNode, pLastNode->Len() ); } -inline EditCharAttrib* GetAttrib( const CharAttribArray& rAttribs, USHORT nAttr ) +inline EditCharAttrib* GetAttrib( const CharAttribArray& rAttribs, sal_uInt16 nAttr ) { return ( nAttr < rAttribs.Count() ) ? rAttribs[nAttr] : 0; } -BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart ); +sal_Bool CheckOrderedList( CharAttribArray& rAttribs, sal_Bool bStart ); // ------------------------------------------------------------------------- // class EditEngineItemPool @@ -794,7 +794,7 @@ BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart ); class EditEngineItemPool : public SfxItemPool { public: - EditEngineItemPool( BOOL bPersistenRefCounts ); + EditEngineItemPool( sal_Bool bPersistenRefCounts ); protected: virtual ~EditEngineItemPool(); public: diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx index 3610423ba3c0..20b13778a025 100644 --- a/editeng/source/editeng/editdoc2.cxx +++ b/editeng/source/editeng/editdoc2.cxx @@ -70,10 +70,10 @@ SV_IMPL_VARARR( CharPosArray, sal_Int32 ); /* -BOOL EditStyleSheet::HasStyleAsAnyParent( SfxStyleSheet& rStyle ) +sal_Bool EditStyleSheet::HasStyleAsAnyParent( SfxStyleSheet& rStyle ) { if ( GetParent() == rStyle.GetName() ) - return TRUE; + return sal_True; if ( GetParent().Len() && ( GetParent() != GetName() ) ) { @@ -81,7 +81,7 @@ BOOL EditStyleSheet::HasStyleAsAnyParent( SfxStyleSheet& rStyle ) if ( pS ) return pS->HasStyleAsAnyParent( rStyle ); } - return FALSE; + return sal_False; } */ @@ -100,24 +100,24 @@ TextPortionList::~TextPortionList() void TextPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } -void TextPortionList::DeleteFromPortion( USHORT nDelFrom ) +void TextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom ) { DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" ); - for ( USHORT nP = nDelFrom; nP < Count(); nP++ ) + for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ ) delete GetObject( nP ); Remove( nDelFrom, Count()-nDelFrom ); } -USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion ) +sal_uInt16 TextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion ) { // Bei nCharPos an Portion-Grenze wird die linke Portion gefunden - USHORT nTmpPos = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + sal_uInt16 nTmpPos = 0; + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { TextPortion* pPortion = GetObject( nPortion ); nTmpPos = nTmpPos + pPortion->GetLen(); @@ -135,10 +135,10 @@ USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOO return ( Count() - 1 ); } -USHORT TextPortionList::GetStartPos( USHORT nPortion ) +sal_uInt16 TextPortionList::GetStartPos( sal_uInt16 nPortion ) { - USHORT nPos = 0; - for ( USHORT n = 0; n < nPortion; n++ ) + sal_uInt16 nPos = 0; + for ( sal_uInt16 n = 0; n < nPortion; n++ ) { TextPortion* pPortion = GetObject( n ); nPos = nPos + pPortion->GetLen(); @@ -158,8 +158,8 @@ ExtraPortionInfo::ExtraPortionInfo() nMaxCompression100thPercent = 0; nAsianCompressionTypes = 0; nPortionOffsetX = 0; - bFirstCharIsRightPunktuation = FALSE; - bCompressed = FALSE; + bFirstCharIsRightPunktuation = sal_False; + bCompressed = sal_False; pOrgDXArray = NULL; } @@ -168,7 +168,7 @@ ExtraPortionInfo::~ExtraPortionInfo() delete[] pOrgDXArray; } -void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen ) +void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, sal_uInt16 nLen ) { delete[] pOrgDXArray; pOrgDXArray = new sal_Int32[nLen]; @@ -190,10 +190,10 @@ ParaPortion::ParaPortion( ContentNode* pN ) DBG_CTOR( EE_ParaPortion, 0 ); pNode = pN; - bInvalid = TRUE; - bVisible = TRUE; - bSimple = FALSE; - bForceRepaint = FALSE; + bInvalid = sal_True; + bVisible = sal_True; + bSimple = sal_False; + bForceRepaint = sal_False; nInvalidPosStart = 0; nInvalidDiff = 0; nHeight = 0; @@ -206,9 +206,9 @@ ParaPortion::~ParaPortion() DBG_DTOR( EE_ParaPortion, 0 ); } -void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) +void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) { - if ( bInvalid == FALSE ) + if ( bInvalid == sal_False ) { // nInvalidPosEnd = nStart; // ??? => CreateLines nInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff ); @@ -232,19 +232,19 @@ void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) { // nInvalidPosEnd = pNode->Len(); DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - nInvalidPosStart = Min( nInvalidPosStart, (USHORT) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); + nInvalidPosStart = Min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); nInvalidDiff = 0; - bSimple = FALSE; + bSimple = sal_False; } } - bInvalid = TRUE; + bInvalid = sal_True; aScriptInfos.clear(); aWritingDirectionInfos.clear(); } -void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) +void ParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /* nEnd */ ) { - if ( bInvalid == FALSE ) + if ( bInvalid == sal_False ) { nInvalidPosStart = nStart; // nInvalidPosEnd = nEnd; @@ -255,18 +255,18 @@ void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) // nInvalidPosEnd = pNode->Len(); } nInvalidDiff = 0; - bInvalid = TRUE; - bSimple = FALSE; + bInvalid = sal_True; + bSimple = sal_False; aScriptInfos.clear(); aWritingDirectionInfos.clear(); } -USHORT ParaPortion::GetLineNumber( USHORT nIndex ) +sal_uInt16 ParaPortion::GetLineNumber( sal_uInt16 nIndex ) { DBG_ASSERTWARNING( aLineList.Count(), "Leere ParaPortion in GetLine!" ); DBG_ASSERT( bVisible, "Wozu GetLine() bei einem unsichtbaren Absatz?" ); - for ( USHORT nLine = 0; nLine < aLineList.Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < aLineList.Count(); nLine++ ) { if ( aLineList[nLine]->IsIn( nIndex ) ) return nLine; @@ -277,14 +277,14 @@ USHORT ParaPortion::GetLineNumber( USHORT nIndex ) return (aLineList.Count()-1); } -void ParaPortion::SetVisible( BOOL bMakeVisible ) +void ParaPortion::SetVisible( sal_Bool bMakeVisible ) { bVisible = bMakeVisible; } -void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ) +void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ) { - USHORT nLines = aLineList.Count(); + sal_uInt16 nLines = aLineList.Count(); DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { @@ -302,18 +302,18 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin int nTDiff = -( nTextDiff-1 ); if ( nPDiff || nTDiff ) { - for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ ) + for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ ) { EditLine* pLine = aLineList[ nL ]; - pLine->GetStartPortion() = sal::static_int_cast< USHORT >( + pLine->GetStartPortion() = sal::static_int_cast< sal_uInt16 >( pLine->GetStartPortion() + nPDiff); - pLine->GetEndPortion() = sal::static_int_cast< USHORT >( + pLine->GetEndPortion() = sal::static_int_cast< sal_uInt16 >( pLine->GetEndPortion() + nPDiff); - pLine->GetStart() = sal::static_int_cast< USHORT >( + pLine->GetStart() = sal::static_int_cast< sal_uInt16 >( pLine->GetStart() + nTDiff); - pLine->GetEnd() = sal::static_int_cast< USHORT >( + pLine->GetEnd() = sal::static_int_cast< sal_uInt16 >( pLine->GetEnd() + nTDiff); pLine->SetValid(); @@ -325,21 +325,21 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin // Shared reverse lookup acceleration pieces ... -static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen, - VoidPtr pPtr, USHORT &rLastPos ) +static sal_uInt16 FastGetPos( const VoidPtr *pPtrArray, sal_uInt16 nPtrArrayLen, + VoidPtr pPtr, sal_uInt16 &rLastPos ) { // Through certain filter code-paths we do a lot of appends, which in // turn call GetPos - creating some N^2 nightmares. If we have a // non-trivially large list, do a few checks from the end first. if( rLastPos > 16 ) { - USHORT nEnd; + sal_uInt16 nEnd; if (rLastPos > nPtrArrayLen - 2) nEnd = nPtrArrayLen; else nEnd = rLastPos + 2; - for( USHORT nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ ) + for( sal_uInt16 nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ ) { if( pPtrArray[ nIdx ] == pPtr ) { @@ -349,7 +349,7 @@ static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen, } } // The world's lamest linear search from svarray ... - for( USHORT nIdx = 0; nIdx < nPtrArrayLen; nIdx++ ) + for( sal_uInt16 nIdx = 0; nIdx < nPtrArrayLen; nIdx++ ) if (pPtrArray[ nIdx ] == pPtr ) return rLastPos = nIdx; return USHRT_MAX; @@ -367,14 +367,14 @@ ParaPortionList::~ParaPortionList() Reset(); } -USHORT ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const +sal_uInt16 ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const { return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), Count(), static_cast<VoidPtr>( rPtr ), ((ParaPortionList *)this)->nLastCache ); } -USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const +sal_uInt16 ContentList::GetPos( const ContentNodePtr &rPtr ) const { return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), Count(), static_cast<VoidPtr>( rPtr ), @@ -383,7 +383,7 @@ USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const void ParaPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } @@ -391,7 +391,7 @@ void ParaPortionList::Reset() long ParaPortionList::GetYOffset( ParaPortion* pPPortion ) { long nHeight = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { ParaPortion* pTmpPortion = GetObject(nPortion); if ( pTmpPortion == pPPortion ) @@ -402,10 +402,10 @@ long ParaPortionList::GetYOffset( ParaPortion* pPPortion ) return nHeight; } -USHORT ParaPortionList::FindParagraph( long nYOffset ) +sal_uInt16 ParaPortionList::FindParagraph( long nYOffset ) { long nY = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { nY += GetObject(nPortion)->GetHeight(); // sollte auch bei !bVisible richtig sein! if ( nY > nYOffset ) @@ -422,7 +422,7 @@ void ParaPortionList::DbgCheck( EditDoc& { #ifdef DBG_UTIL DBG_ASSERT( Count() == rDoc.Count(), "ParaPortionList::DbgCheck() - Count() ungleich!" ); - for ( USHORT i = 0; i < Count(); i++ ) + for ( sal_uInt16 i = 0; i < Count(); i++ ) { DBG_ASSERT( SaveGetObject(i), "ParaPortionList::DbgCheck() - Null-Pointer in Liste!" ); DBG_ASSERT( GetObject(i)->GetNode(), "ParaPortionList::DbgCheck() - Null-Pointer in Liste(2)!" ); @@ -458,8 +458,8 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxULSpaceItem ) ), "ConvertItem: Ungueltiges Item!" ); SvxULSpaceItem& rItem = (SvxULSpaceItem&)rPoolItem; - rItem.SetUpper( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) ); - rItem.SetLower( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) ); + rItem.SetUpper( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) ); + rItem.SetLower( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) ); } break; case EE_PARA_SBL: @@ -468,7 +468,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit SvxLineSpacingItem& rItem = (SvxLineSpacingItem&)rPoolItem; // #96298# SetLineHeight changes also eLineSpace! if ( rItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) - rItem.SetLineHeight( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); + rItem.SetLineHeight( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); } break; case EE_PARA_TABS: @@ -476,7 +476,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit DBG_ASSERT( rPoolItem.IsA( TYPE( SvxTabStopItem ) ), "ConvertItem: Ungueltiges Item!" ); SvxTabStopItem& rItem = (SvxTabStopItem&)rPoolItem; SvxTabStopItem aNewItem( EE_PARA_TABS ); - for ( USHORT i = 0; i < rItem.Count(); i++ ) + for ( sal_uInt16 i = 0; i < rItem.Count(); i++ ) { const SvxTabStop& rTab = rItem[i]; SvxTabStop aNewStop( OutputDevice::LogicToLogic( rTab.GetTabPos(), eSourceUnit, eDestUnit ), rTab.GetAdjustment(), rTab.GetDecimal(), rTab.GetFill() ); @@ -502,20 +502,20 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map const SfxItemPool* pSourcePool = rSource.GetPool(); const SfxItemPool* pDestPool = rDest.GetPool(); - for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { // Wenn moeglich ueber SlotID gehen... - USHORT nSourceWhich = nWhich; - USHORT nSlot = pDestPool->GetTrueSlotId( nWhich ); + sal_uInt16 nSourceWhich = nWhich; + sal_uInt16 nSlot = pDestPool->GetTrueSlotId( nWhich ); if ( nSlot ) { - USHORT nW = pSourcePool->GetTrueWhich( nSlot ); + sal_uInt16 nW = pSourcePool->GetTrueWhich( nSlot ); if ( nW ) nSourceWhich = nW; } - if ( rSource.GetItemState( nSourceWhich, FALSE ) == SFX_ITEM_ON ) + if ( rSource.GetItemState( nSourceWhich, sal_False ) == SFX_ITEM_ON ) { MapUnit eSourceUnit = pSourceUnit ? *pSourceUnit : (MapUnit)pSourcePool->GetMetric( nSourceWhich ); MapUnit eDestUnit = pDestUnit ? *pDestUnit : (MapUnit)pDestPool->GetMetric( nWhich ); diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 1b61a405dc18..83cd8d111de3 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -35,7 +35,7 @@ #define USE_SVXFONT -#define _SVSTDARR_USHORTS +#define _SVSTDARR_sal_uInt16S #include <svl/svstdarr.hxx> #include <svl/ctloptions.hxx> #include <svtools/ctrltool.hxx> @@ -167,7 +167,7 @@ void EditEngine::UndoActionEnd( sal_uInt16 nId ) pImpEditEngine->UndoActionEnd( nId ); } -BOOL EditEngine::HasTriedMergeOnLastAddUndo() const +sal_Bool EditEngine::HasTriedMergeOnLastAddUndo() const { return pImpEditEngine->mbLastTryMerge; } @@ -214,25 +214,25 @@ Color EditEngine::GetAutoColor() const return pImpEditEngine->GetAutoColor(); } -void EditEngine::EnableAutoColor( BOOL b ) +void EditEngine::EnableAutoColor( sal_Bool b ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->EnableAutoColor( b ); } -BOOL EditEngine::IsAutoColorEnabled() const +sal_Bool EditEngine::IsAutoColorEnabled() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsAutoColorEnabled(); } -void EditEngine::ForceAutoColor( BOOL b ) +void EditEngine::ForceAutoColor( sal_Bool b ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->ForceAutoColor( b ); } -BOOL EditEngine::IsForceAutoColor() const +sal_Bool EditEngine::IsForceAutoColor() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsForceAutoColor(); @@ -333,7 +333,7 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const P ( rOutRect.GetHeight() >= (long)GetTextHeight() ) && ( rOutRect.GetWidth() >= (long)CalcTextWidth() ) ) { - bClip = FALSE; + bClip = sal_False; } else { @@ -513,25 +513,25 @@ const Size& EditEngine::GetPaperSize() const return pImpEditEngine->GetPaperSize(); } -void EditEngine::SetVertical( BOOL bVertical ) +void EditEngine::SetVertical( sal_Bool bVertical ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->SetVertical( bVertical ); } -BOOL EditEngine::IsVertical() const +sal_Bool EditEngine::IsVertical() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsVertical(); } -void EditEngine::SetFixedCellHeight( BOOL bUseFixedCellHeight ) +void EditEngine::SetFixedCellHeight( sal_Bool bUseFixedCellHeight ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->SetFixedCellHeight( bUseFixedCellHeight ); } -BOOL EditEngine::IsFixedCellHeight() const +sal_Bool EditEngine::IsFixedCellHeight() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsFixedCellHeight(); @@ -549,14 +549,14 @@ EEHorizontalTextDirection EditEngine::GetDefaultHorizontalTextDirection() const return pImpEditEngine->GetDefaultHorizontalTextDirection(); } -USHORT EditEngine::GetScriptType( const ESelection& rSelection ) const +sal_uInt16 EditEngine::GetScriptType( const ESelection& rSelection ) const { DBG_CHKTHIS( EditEngine, 0 ); EditSelection aSel( pImpEditEngine->CreateSel( rSelection ) ); return pImpEditEngine->GetScriptType( aSel ); } -LanguageType EditEngine::GetLanguage( USHORT nPara, USHORT nPos ) const +LanguageType EditEngine::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const { DBG_CHKTHIS( EditEngine, 0 ); ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); @@ -571,37 +571,37 @@ void EditEngine::TransliterateText( const ESelection& rSelection, sal_Int32 nTra pImpEditEngine->TransliterateText( pImpEditEngine->CreateSel( rSelection ), nTransliterationMode ); } -void EditEngine::SetAsianCompressionMode( USHORT n ) +void EditEngine::SetAsianCompressionMode( sal_uInt16 n ) { DBG_CHKTHIS( EditView, 0 ); pImpEditEngine->SetAsianCompressionMode( n ); } -USHORT EditEngine::GetAsianCompressionMode() const +sal_uInt16 EditEngine::GetAsianCompressionMode() const { DBG_CHKTHIS( EditView, 0 ); return pImpEditEngine->GetAsianCompressionMode(); } -void EditEngine::SetKernAsianPunctuation( BOOL b ) +void EditEngine::SetKernAsianPunctuation( sal_Bool b ) { DBG_CHKTHIS( EditView, 0 ); pImpEditEngine->SetKernAsianPunctuation( b ); } -BOOL EditEngine::IsKernAsianPunctuation() const +sal_Bool EditEngine::IsKernAsianPunctuation() const { DBG_CHKTHIS( EditView, 0 ); return pImpEditEngine->IsKernAsianPunctuation(); } -void EditEngine::SetAddExtLeading( BOOL b ) +void EditEngine::SetAddExtLeading( sal_Bool b ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->SetAddExtLeading( b ); } -BOOL EditEngine::IsAddExtLeading() const +sal_Bool EditEngine::IsAddExtLeading() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsAddExtLeading(); @@ -710,7 +710,7 @@ sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) con return pImpEditEngine->GetLineLen( nParagraph, nLine ); } -void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const +void EditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const { DBG_CHKTHIS( EditEngine, 0 ); if ( !pImpEditEngine->IsFormatted() ) @@ -718,7 +718,7 @@ void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine ); } -USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +sal_uInt16 EditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const { DBG_CHKTHIS( EditEngine, 0 ); if ( !pImpEditEngine->IsFormatted() ) @@ -763,7 +763,7 @@ XubString EditEngine::GetWord( sal_uInt16 nPara, sal_uInt16 nIndex ) return pImpEditEngine->GetSelected( aSel ); } -ESelection EditEngine::GetWord( const ESelection& rSelection, USHORT nWordType ) const +ESelection EditEngine::GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -773,7 +773,7 @@ ESelection EditEngine::GetWord( const ESelection& rSelection, USHORT nWordType return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::WordLeft( const ESelection& rSelection, USHORT nWordType ) const +ESelection EditEngine::WordLeft( const ESelection& rSelection, sal_uInt16 nWordType ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -783,7 +783,7 @@ ESelection EditEngine::WordLeft( const ESelection& rSelection, USHORT nWordType return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::WordRight( const ESelection& rSelection, USHORT nWordType ) const +ESelection EditEngine::WordRight( const ESelection& rSelection, sal_uInt16 nWordType ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -793,7 +793,7 @@ ESelection EditEngine::WordRight( const ESelection& rSelection, USHORT nWordType return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::CursorLeft( const ESelection& rSelection, USHORT nCharacterIteratorMode ) const +ESelection EditEngine::CursorLeft( const ESelection& rSelection, sal_uInt16 nCharacterIteratorMode ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -803,7 +803,7 @@ ESelection EditEngine::CursorLeft( const ESelection& rSelection, USHORT nCharact return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::CursorRight( const ESelection& rSelection, USHORT nCharacterIteratorMode ) const +ESelection EditEngine::CursorRight( const ESelection& rSelection, sal_uInt16 nCharacterIteratorMode ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -834,8 +834,8 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie sal_Bool bAllowIdle = sal_True; sal_Bool bReadOnly = pEditView->IsReadOnly(); - USHORT nNewCursorFlags = 0; - BOOL bSetCursorFlags = TRUE; + sal_uInt16 nNewCursorFlags = 0; + sal_Bool bSetCursorFlags = sal_True; EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); DBG_ASSERT( !aCurSel.IsInvalid(), "Blinde Selection in EditEngine::PostKeyEvent" ); @@ -888,11 +888,11 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie { if ( rKeyEvent.GetKeyCode().IsMod1() && rKeyEvent.GetKeyCode().IsMod2() ) { - USHORT nParas = GetParagraphCount(); + sal_uInt16 nParas = GetParagraphCount(); Point aPos; Point aViewStart( pEditView->GetOutputArea().TopLeft() ); long n20 = 40 * pImpEditEngine->nOnePixelInRef; - for ( USHORT n = 0; n < nParas; n++ ) + for ( sal_uInt16 n = 0; n < nParas; n++ ) { long nH = GetTextHeight( n ); Point P1( aViewStart.X() + n20 + n20*(n%2), aViewStart.Y() + aPos.Y() ); @@ -905,7 +905,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie aPos.Y() += nH; } } - bDone = FALSE; + bDone = sal_False; } break; case KEY_F11: @@ -917,7 +917,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie aInfo += bDebugPaint ? "On" : "Off"; InfoBox( NULL, String( aInfo, RTL_TEXTENCODING_ASCII_US ) ).Execute(); } - bDone = FALSE; + bDone = sal_False; } break; case KEY_F12: @@ -937,7 +937,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie aLog << endl; #endif } - bDone = FALSE; + bDone = sal_False; } break; #endif @@ -969,13 +969,13 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie if ( !rKeyEvent.GetKeyCode().IsMod2() || ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) ) { if ( pImpEditEngine->DoVisualCursorTraveling( aCurSel.Max().GetNode() ) && ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) /* || ( nCode == KEY_HOME ) || ( nCode == KEY_END ) */ ) ) - bSetCursorFlags = FALSE; // Will be manipulated within visual cursor move + bSetCursorFlags = sal_False; // Will be manipulated within visual cursor move aCurSel = pImpEditEngine->MoveCursor( rKeyEvent, pEditView ); if ( aCurSel.HasRange() ) { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(pEditView->GetWindow()->GetPrimarySelection()); - pEditView->pImpEditView->CutCopy( aSelection, FALSE ); + pEditView->pImpEditView->CutCopy( aSelection, sal_False ); } bMoved = sal_True; @@ -1009,7 +1009,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie // now on and that will be all. Otherwise continue as usual. // ... - USHORT nPara = pImpEditEngine->GetEditDoc().GetPos( pNode ); + sal_uInt16 nPara = pImpEditEngine->GetEditDoc().GetPos( pNode ); SfxBoolItem aBulletState( (const SfxBoolItem&) pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ); bool bBulletIsVisible = aBulletState.GetValue() ? true : false; @@ -1029,7 +1029,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie break; } - BYTE nDel = 0, nMode = 0; + sal_uInt8 nDel = 0, nMode = 0; switch( nCode ) { case com::sun::star::awt::Key::DELETE_WORD_BACKWARD: @@ -1297,7 +1297,7 @@ sal_uInt32 EditEngine::GetTextHeight() const if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); - sal_uInt32 nHeight = !IsVertical() ? pImpEditEngine->GetTextHeight() : pImpEditEngine->CalcTextWidth( TRUE ); + sal_uInt32 nHeight = !IsVertical() ? pImpEditEngine->GetTextHeight() : pImpEditEngine->CalcTextWidth( sal_True ); return nHeight; } @@ -1308,7 +1308,7 @@ sal_uInt32 EditEngine::CalcTextWidth() if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); - sal_uInt32 nWidth = !IsVertical() ? pImpEditEngine->CalcTextWidth( TRUE ) : pImpEditEngine->GetTextHeight(); + sal_uInt32 nWidth = !IsVertical() ? pImpEditEngine->CalcTextWidth( sal_True ) : pImpEditEngine->GetTextHeight(); return nWidth; } @@ -1340,7 +1340,7 @@ void EditEngine::SetText( const XubString& rText ) pImpEditEngine->FormatAndUpdate(); } -ULONG EditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs /* = NULL */ ) +sal_uInt32 EditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs /* = NULL */ ) { DBG_CHKTHIS( EditEngine, 0 ); sal_Bool bUndoEnabled = pImpEditEngine->IsUndoEnabled(); @@ -1352,7 +1352,7 @@ ULONG EditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFormat e return rInput.GetError(); } -ULONG EditEngine::Write( SvStream& rOutput, EETextFormat eFormat ) +sal_uInt32 EditEngine::Write( SvStream& rOutput, EETextFormat eFormat ) { DBG_CHKTHIS( EditEngine, 0 ); EditPaM aStartPaM( pImpEditEngine->GetEditDoc().GetStartPaM() ); @@ -1662,7 +1662,7 @@ void EditEngine::GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) con pImpEditEngine->GetCharAttribs( nPara, rLst ); } -SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib ) +SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib ) { DBG_CHKTHIS( EditEngine, 0 ); EditSelection aSel( pImpEditEngine-> @@ -1670,7 +1670,7 @@ SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib return pImpEditEngine->GetAttribs( aSel, bOnlyHardAttrib ); } -SfxItemSet EditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal_uInt8 nFlags ) const +SfxItemSet EditEngine::GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->GetAttribs( nPara, nStart, nEnd, nFlags ); @@ -1888,7 +1888,7 @@ Point EditEngine::GetDocPosTopLeft( sal_uInt16 nParagraph ) return aPoint; } -const SvxNumberFormat* EditEngine::GetNumberFormat( USHORT nPara ) const +const SvxNumberFormat* EditEngine::GetNumberFormat( sal_uInt16 nPara ) const { // derived objects may overload this function to give access to // bullet information (see Outliner) @@ -1896,7 +1896,7 @@ const SvxNumberFormat* EditEngine::GetNumberFormat( USHORT nPara ) const return 0; } -BOOL EditEngine::IsRightToLeft( USHORT nPara ) const +sal_Bool EditEngine::IsRightToLeft( sal_uInt16 nPara ) const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsRightToLeft( nPara ); @@ -2153,7 +2153,7 @@ void EditEngine::SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> vos::ORef<SvxForbiddenCharactersTable> EditEngine::GetForbiddenCharsTable() const { DBG_CHKTHIS( EditEngine, 0 ); - return pImpEditEngine->GetForbiddenCharsTable( FALSE ); + return pImpEditEngine->GetForbiddenCharsTable( sal_False ); } @@ -2286,9 +2286,9 @@ sal_Bool EditEngine::ShouldCreateBigTextObject() const return ( nTextPortions >= pImpEditEngine->GetBigTextObjectStart() ) ? sal_True : sal_False; } -USHORT EditEngine::GetFieldCount( USHORT nPara ) const +sal_uInt16 EditEngine::GetFieldCount( sal_uInt16 nPara ) const { - USHORT nFields = 0; + sal_uInt16 nFields = 0; ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); if ( pNode ) { @@ -2304,12 +2304,12 @@ USHORT EditEngine::GetFieldCount( USHORT nPara ) const return nFields; } -EFieldInfo EditEngine::GetFieldInfo( USHORT nPara, USHORT nField ) const +EFieldInfo EditEngine::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const { ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); if ( pNode ) { - USHORT nCurrentField = 0; + sal_uInt16 nCurrentField = 0; const CharAttribArray& rAttrs = pNode->GetCharAttribs().GetAttribs(); for ( sal_uInt16 nAttr = 0; nAttr < rAttrs.Count(); nAttr++ ) { @@ -2396,7 +2396,7 @@ void EditEngine::CompleteOnlineSpelling() } } -USHORT EditEngine::FindParagraph( long nDocPosY ) +sal_uInt16 EditEngine::FindParagraph( long nDocPosY ) { return pImpEditEngine->GetParaPortions().FindParagraph( nDocPosY ); } @@ -2405,7 +2405,7 @@ EPosition EditEngine::FindDocPosition( const Point& rDocPos ) const { EPosition aPos; // From the point of the API, this is const.... - EditPaM aPaM = ((EditEngine*)this)->pImpEditEngine->GetPaM( rDocPos, FALSE ); + EditPaM aPaM = ((EditEngine*)this)->pImpEditEngine->GetPaM( rDocPos, sal_False ); if ( aPaM.GetNode() ) { aPos.nPara = pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); @@ -2448,7 +2448,7 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara ) DBG_ASSERT( pParaPortion && pLine, "GetParagraphInfos - Paragraph out of range" ); if ( pParaPortion && pLine ) { - aInfos.nParaHeight = (USHORT)pParaPortion->GetHeight(); + aInfos.nParaHeight = (sal_uInt16)pParaPortion->GetHeight(); aInfos.nLines = pParaPortion->GetLines().Count(); aInfos.nFirstLineStartX = pLine->GetStartPosX(); aInfos.nFirstLineOffset = pParaPortion->GetFirstLineOffset(); @@ -2471,8 +2471,8 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara ) // ===================================================================== // ====================== Virtuelle Methoden ======================= // ===================================================================== -void __EXPORT EditEngine::DrawingText( const Point&, const XubString&, USHORT, USHORT, - const sal_Int32*, const SvxFont&, sal_uInt16, sal_uInt16, BYTE, +void __EXPORT EditEngine::DrawingText( const Point&, const XubString&, sal_uInt16, sal_uInt16, + const sal_Int32*, const SvxFont&, sal_uInt16, sal_uInt16, sal_uInt8, const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool, const ::com::sun::star::lang::Locale*, const Color&, const Color&) @@ -2510,7 +2510,7 @@ void __EXPORT EditEngine::ParagraphDeleted( sal_uInt16 nPara ) pImpEditEngine->CallNotify( aNotify ); } } -void EditEngine::ParagraphConnected( USHORT /*nLeftParagraph*/, USHORT /*nRightParagraph*/ ) +void EditEngine::ParagraphConnected( sal_uInt16 /*nLeftParagraph*/, sal_uInt16 /*nRightParagraph*/ ) { DBG_CHKTHIS( EditEngine, 0 ); } @@ -2680,7 +2680,7 @@ void EditEngine::SetFontInfoInItemSet( SfxItemSet& rSet, const SvxFont& rFont ) rSet.Put( SvxCharReliefItem( rFont.GetRelief(), EE_CHAR_RELIEF ) ); } -Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet, USHORT nScriptType ) +Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet, sal_uInt16 nScriptType ) { SvxFont aFont; CreateFont( aFont, rItemSet, true, nScriptType ); @@ -2865,9 +2865,9 @@ void EditEngine::ImportBulletItem( SvxNumBulletItem& /*rNumBullet*/, sal_uInt16 */ } -BOOL EditEngine::HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable ) +sal_Bool EditEngine::HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable ) { - BOOL bValidData = FALSE; + sal_Bool bValidData = sal_False; if ( rTransferable.is() ) { @@ -2902,12 +2902,12 @@ Link EditEngine::GetEndDropHdl() const return pImpEditEngine->GetEndDropHdl(); } -void EditEngine::SetFirstWordCapitalization( BOOL bCapitalize ) +void EditEngine::SetFirstWordCapitalization( sal_Bool bCapitalize ) { pImpEditEngine->SetFirstWordCapitalization( bCapitalize ); } -BOOL EditEngine::IsFirstWordCapitalization() const +sal_Bool EditEngine::IsFirstWordCapitalization() const { return pImpEditEngine->IsFirstWordCapitalization(); } @@ -2922,7 +2922,7 @@ EFieldInfo::EFieldInfo() } -EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, USHORT nPara, USHORT nPos ) : aPosition( nPara, nPos ) +EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, sal_uInt16 nPara, sal_uInt16 nPos ) : aPosition( nPara, nPos ) { pFieldItem = new SvxFieldItem( rFieldItem ); } diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 7cd009cc52be..19bcac125bd0 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -58,7 +58,7 @@ DBG_NAME( XEditAttribute ) //-------------------------------------------------------------- -BOOL lcl_CreateBulletItem( const SvxNumBulletItem& rNumBullet, USHORT nLevel, SvxBulletItem& rBullet ) +sal_Bool lcl_CreateBulletItem( const SvxNumBulletItem& rNumBullet, sal_uInt16 nLevel, SvxBulletItem& rBullet ) { const SvxNumberFormat* pFmt = rNumBullet.GetNumRule()->Get( nLevel ); if ( pFmt ) @@ -135,11 +135,11 @@ BOOL lcl_CreateBulletItem( const SvxNumBulletItem& rNumBullet, USHORT nLevel, Sv DBG_ERROR( "Unknown or invalid NumAdjust" ); } } - return pFmt ? TRUE : FALSE; + return pFmt ? sal_True : sal_False; } -XEditAttribute* MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ) +XEditAttribute* MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, sal_uInt16 nStart, sal_uInt16 nEnd ) { // das neue Attribut im Pool anlegen const SfxPoolItem& rNew = rPool.Put( rItem ); @@ -157,7 +157,7 @@ XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr ) nEnd = 0; } -XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) +XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) { DBG_CTOR( XEditAttribute, 0 ); pItem = &rAttr; @@ -171,9 +171,9 @@ XEditAttribute::~XEditAttribute() pItem = 0; // Gehoert dem Pool. } -XEditAttribute* XEditAttributeList::FindAttrib( USHORT _nWhich, USHORT nChar ) const +XEditAttribute* XEditAttributeList::FindAttrib( sal_uInt16 _nWhich, sal_uInt16 nChar ) const { - for ( USHORT n = Count(); n; ) + for ( sal_uInt16 n = Count(); n; ) { XEditAttribute* pAttr = GetObject( --n ); if( ( pAttr->GetItem()->Which() == _nWhich ) && ( pAttr->GetStart() <= nChar ) && ( pAttr->GetEnd() > nChar ) ) @@ -208,7 +208,7 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse eFamily = rCopyFrom.GetFamily(); // Attribute kopieren... - for ( USHORT n = 0; n < rCopyFrom.GetAttribs().Count(); n++ ) + for ( sal_uInt16 n = 0; n < rCopyFrom.GetAttribs().Count(); n++ ) { XEditAttribute* pAttr = rCopyFrom.GetAttribs().GetObject( n ); XEditAttribute* pMyAttr = MakeXEditAttribute( rPoolToUse, *pAttr->GetItem(), pAttr->GetStart(), pAttr->GetEnd() ); @@ -225,7 +225,7 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse ContentInfo::~ContentInfo() { - for ( USHORT nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) { XEditAttribute* pAttr = aAttribs.GetObject(nAttr); // Item aus Pool entfernen! @@ -272,10 +272,10 @@ bool ContentInfo::operator==( const ContentInfo& rCompare ) const (eFamily == rCompare.eFamily ) && (aParaAttribs == rCompare.aParaAttribs ) ) { - const USHORT nCount = aAttribs.Count(); + const sal_uInt16 nCount = aAttribs.Count(); if( nCount == rCompare.aAttribs.Count() ) { - USHORT n; + sal_uInt16 n; for( n = 0; n < nCount; n++ ) { if( !(*aAttribs.GetObject(n) == *rCompare.aAttribs.GetObject(n)) ) @@ -289,7 +289,7 @@ bool ContentInfo::operator==( const ContentInfo& rCompare ) const return false; } -EditTextObject::EditTextObject( USHORT n) +EditTextObject::EditTextObject( sal_uInt16 n) { DBG_CTOR( EE_EditTextObject, 0 ); nWhich = n; @@ -306,38 +306,38 @@ __EXPORT EditTextObject::~EditTextObject() DBG_DTOR( EE_EditTextObject, 0 ); } -USHORT EditTextObject::GetParagraphCount() const +sal_uInt16 EditTextObject::GetParagraphCount() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return 0; } -XubString EditTextObject::GetText( USHORT /* nParagraph */ ) const +XubString EditTextObject::GetText( sal_uInt16 /* nParagraph */ ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return XubString(); } -void EditTextObject::Insert( const EditTextObject& /* rObj */, USHORT /* nPara */) +void EditTextObject::Insert( const EditTextObject& /* rObj */, sal_uInt16 /* nPara */) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -EditTextObject* EditTextObject::CreateTextObject( USHORT /*nPara*/, USHORT /*nParas*/ ) const +EditTextObject* EditTextObject::CreateTextObject( sal_uInt16 /*nPara*/, sal_uInt16 /*nParas*/ ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return 0; } -void EditTextObject::RemoveParagraph( USHORT /*nPara*/ ) +void EditTextObject::RemoveParagraph( sal_uInt16 /*nPara*/ ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -BOOL EditTextObject::HasPortionInfo() const +sal_Bool EditTextObject::HasPortionInfo() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } void EditTextObject::ClearPortionInfo() @@ -345,32 +345,32 @@ void EditTextObject::ClearPortionInfo() DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -BOOL EditTextObject::HasOnlineSpellErrors() const +sal_Bool EditTextObject::HasOnlineSpellErrors() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } -BOOL EditTextObject::HasCharAttribs( USHORT ) const +sal_Bool EditTextObject::HasCharAttribs( sal_uInt16 ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } -void EditTextObject::GetCharAttribs( USHORT /*nPara*/, EECharAttribArray& /*rLst*/ ) const +void EditTextObject::GetCharAttribs( sal_uInt16 /*nPara*/, EECharAttribArray& /*rLst*/ ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -void EditTextObject::MergeParaAttribs( const SfxItemSet& /*rAttribs*/, USHORT /*nStart*/, USHORT /*nEnd*/ ) +void EditTextObject::MergeParaAttribs( const SfxItemSet& /*rAttribs*/, sal_uInt16 /*nStart*/, sal_uInt16 /*nEnd*/ ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -BOOL EditTextObject::IsFieldObject() const +sal_Bool EditTextObject::IsFieldObject() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } const SvxFieldItem* EditTextObject::GetField() const @@ -379,56 +379,56 @@ const SvxFieldItem* EditTextObject::GetField() const return 0; } -BOOL EditTextObject::HasField( TypeId /*aType*/ ) const +sal_Bool EditTextObject::HasField( TypeId /*aType*/ ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } -SfxItemSet EditTextObject::GetParaAttribs( USHORT /*nPara*/ ) const +SfxItemSet EditTextObject::GetParaAttribs( sal_uInt16 /*nPara*/ ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return SfxItemSet( *(SfxItemPool*)NULL ); } -void EditTextObject::SetParaAttribs( USHORT /*nPara*/, const SfxItemSet& /*rAttribs*/ ) +void EditTextObject::SetParaAttribs( sal_uInt16 /*nPara*/, const SfxItemSet& /*rAttribs*/ ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -BOOL EditTextObject::RemoveCharAttribs( USHORT /*nWhich*/ ) +sal_Bool EditTextObject::RemoveCharAttribs( sal_uInt16 /*nWhich*/ ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } -BOOL EditTextObject::RemoveParaAttribs( USHORT /*nWhich*/ ) +sal_Bool EditTextObject::RemoveParaAttribs( sal_uInt16 /*nWhich*/ ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } -BOOL EditTextObject::HasStyleSheet( const XubString& /*rName*/, SfxStyleFamily /*eFamily*/ ) const +sal_Bool EditTextObject::HasStyleSheet( const XubString& /*rName*/, SfxStyleFamily /*eFamily*/ ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } -void EditTextObject::GetStyleSheet( USHORT /*nPara*/, XubString& /*rName*/, SfxStyleFamily& /*eFamily*/ ) const +void EditTextObject::GetStyleSheet( sal_uInt16 /*nPara*/, XubString& /*rName*/, SfxStyleFamily& /*eFamily*/ ) const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -void EditTextObject::SetStyleSheet( USHORT /*nPara*/, const XubString& /*rName*/, const SfxStyleFamily& /*eFamily*/ ) +void EditTextObject::SetStyleSheet( sal_uInt16 /*nPara*/, const XubString& /*rName*/, const SfxStyleFamily& /*eFamily*/ ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -BOOL __EXPORT EditTextObject::ChangeStyleSheets( const XubString&, SfxStyleFamily, +sal_Bool __EXPORT EditTextObject::ChangeStyleSheets( const XubString&, SfxStyleFamily, const XubString&, SfxStyleFamily ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } void __EXPORT EditTextObject::ChangeStyleSheetName( SfxStyleFamily /*eFamily*/, @@ -437,56 +437,56 @@ void __EXPORT EditTextObject::ChangeStyleSheetName( SfxStyleFamily /*eFamily*/, DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -USHORT EditTextObject::GetUserType() const +sal_uInt16 EditTextObject::GetUserType() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return 0; } -void EditTextObject::SetUserType( USHORT ) +void EditTextObject::SetUserType( sal_uInt16 ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -ULONG EditTextObject::GetObjectSettings() const +sal_uInt32 EditTextObject::GetObjectSettings() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return 0; } -void EditTextObject::SetObjectSettings( ULONG ) +void EditTextObject::SetObjectSettings( sal_uInt32 ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); } -BOOL EditTextObject::IsVertical() const +sal_Bool EditTextObject::IsVertical() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); - return FALSE; + return sal_False; } -void EditTextObject::SetVertical( BOOL bVertical ) +void EditTextObject::SetVertical( sal_Bool bVertical ) { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); ((BinTextObject*)this)->SetVertical( bVertical ); } -USHORT EditTextObject::GetScriptType() const +sal_uInt16 EditTextObject::GetScriptType() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return ((const BinTextObject*)this)->GetScriptType(); } -BOOL EditTextObject::Store( SvStream& rOStream ) const +sal_Bool EditTextObject::Store( SvStream& rOStream ) const { if ( rOStream.GetError() ) - return FALSE; + return sal_False; // Vorspann: sal_Size nStartPos = rOStream.Tell(); - rOStream << (USHORT)Which(); + rOStream << (sal_uInt16)Which(); sal_uInt32 nStructSz = 0; rOStream << nStructSz; @@ -501,15 +501,15 @@ BOOL EditTextObject::Store( SvStream& rOStream ) const rOStream << nStructSz; rOStream.Seek( nEndPos ); - return rOStream.GetError() ? FALSE : TRUE; + return rOStream.GetError() ? sal_False : sal_True; } EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool ) { - ULONG nStartPos = rIStream.Tell(); + sal_uInt32 nStartPos = rIStream.Tell(); // Ertmal sehen, was fuer ein Object... - USHORT nWhich; + sal_uInt16 nWhich; rIStream >> nWhich; sal_uInt32 nStructSz; @@ -546,7 +546,7 @@ void EditTextObject::Skip( SvStream& rIStream ) { sal_Size nStartPos = rIStream.Tell(); - USHORT _nWhich; + sal_uInt16 _nWhich; rIStream >> _nWhich; sal_uInt32 nStructSz; @@ -566,7 +566,7 @@ void __EXPORT EditTextObject::CreateData( SvStream& ) DBG_ERROR( "CreateData: Basisklasse!" ); } -USHORT EditTextObject::GetVersion() const +sal_uInt16 EditTextObject::GetVersion() const { DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); return 0; @@ -612,7 +612,7 @@ void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) // set local variables pPool = pNewPool; - bOwnerOfPool = TRUE; + bOwnerOfPool = sal_True; } } @@ -653,12 +653,12 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : if ( pPool ) { - bOwnerOfPool = FALSE; + bOwnerOfPool = sal_False; } else { pPool = EditEngine::CreatePool(); - bOwnerOfPool = TRUE; + bOwnerOfPool = sal_True; } if(!bOwnerOfPool && pPool) @@ -667,8 +667,8 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : pPool->AddSfxItemPoolUser(*this); } - bVertical = FALSE; - bStoreUnicodeStrings = FALSE; + bVertical = sal_False; + bStoreUnicodeStrings = sal_False; nScriptType = 0; } @@ -683,7 +683,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : bVertical = r.bVertical; nScriptType = r.nScriptType; pPortionInfo = NULL; // PortionInfo nicht kopieren - bStoreUnicodeStrings = FALSE; + bStoreUnicodeStrings = sal_False; if ( !r.bOwnerOfPool ) { @@ -691,12 +691,12 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : // since there is no other way to construct a BinTextObject // than it's regular constructor where that is ensured pPool = r.pPool; - bOwnerOfPool = FALSE; + bOwnerOfPool = sal_False; } else { pPool = EditEngine::CreatePool(); - bOwnerOfPool = TRUE; + bOwnerOfPool = sal_True; } @@ -709,7 +709,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : if ( bOwnerOfPool && pPool && r.pPool ) pPool->SetDefaultMetric( r.pPool->GetMetric( DEF_METRIC ) ); - for ( USHORT n = 0; n < r.aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < r.aContents.Count(); n++ ) { ContentInfo* pOrg = r.aContents.GetObject( n ); DBG_ASSERT( pOrg, "NULL-Pointer in ContentList!" ); @@ -731,37 +731,37 @@ __EXPORT BinTextObject::~BinTextObject() { // Nicht mehr, wegen 1xDefItems. // siehe auch ~EditDoc(). -// pPool->ReleaseDefaults( TRUE /* bDelete */ ); +// pPool->ReleaseDefaults( sal_True /* bDelete */ ); SfxItemPool::Free(pPool); } } -USHORT BinTextObject::GetUserType() const +sal_uInt16 BinTextObject::GetUserType() const { return nUserType; } -void BinTextObject::SetUserType( USHORT n ) +void BinTextObject::SetUserType( sal_uInt16 n ) { nUserType = n; } -ULONG BinTextObject::GetObjectSettings() const +sal_uInt32 BinTextObject::GetObjectSettings() const { return nObjSettings; } -void BinTextObject::SetObjectSettings( ULONG n ) +void BinTextObject::SetObjectSettings( sal_uInt32 n ) { nObjSettings = n; } -BOOL BinTextObject::IsVertical() const +sal_Bool BinTextObject::IsVertical() const { return bVertical; } -void BinTextObject::SetVertical( BOOL b ) +void BinTextObject::SetVertical( sal_Bool b ) { if ( b != bVertical ) { @@ -770,12 +770,12 @@ void BinTextObject::SetVertical( BOOL b ) } } -USHORT BinTextObject::GetScriptType() const +sal_uInt16 BinTextObject::GetScriptType() const { return nScriptType; } -void BinTextObject::SetScriptType( USHORT nType ) +void BinTextObject::SetScriptType( sal_uInt16 nType ) { nScriptType = nType; } @@ -783,7 +783,7 @@ void BinTextObject::SetScriptType( USHORT nType ) void BinTextObject::DeleteContents() { - for ( USHORT n = 0; n < aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aContents.Count(); n++ ) { ContentInfo* p = aContents.GetObject( n ); DBG_ASSERT( p, "NULL-Pointer in ContentList!" ); @@ -797,7 +797,7 @@ EditTextObject* __EXPORT BinTextObject::Clone() const return new BinTextObject( *this ); } -XEditAttribute* BinTextObject::CreateAttrib( const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ) +XEditAttribute* BinTextObject::CreateAttrib( const SfxPoolItem& rItem, sal_uInt16 nStart, sal_uInt16 nEnd ) { return MakeXEditAttribute( *pPool, rItem, nStart, nEnd ); } @@ -815,12 +815,12 @@ ContentInfo* BinTextObject::CreateAndInsertContent() return pC; } -USHORT BinTextObject::GetParagraphCount() const +sal_uInt16 BinTextObject::GetParagraphCount() const { return aContents.Count(); } -XubString BinTextObject::GetText( USHORT nPara ) const +XubString BinTextObject::GetText( sal_uInt16 nPara ) const { DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Absatz existiert nicht!" ); if ( nPara < aContents.Count() ) @@ -831,7 +831,7 @@ XubString BinTextObject::GetText( USHORT nPara ) const return XubString(); } -void BinTextObject::Insert( const EditTextObject& rObj, USHORT nDestPara ) +void BinTextObject::Insert( const EditTextObject& rObj, sal_uInt16 nDestPara ) { DBG_ASSERT( rObj.Which() == EE_FORMAT_BIN, "UTO: Unbekanntes Textobjekt" ); @@ -840,8 +840,8 @@ void BinTextObject::Insert( const EditTextObject& rObj, USHORT nDestPara ) if ( nDestPara > aContents.Count() ) nDestPara = aContents.Count(); - const USHORT nParas = rBinObj.GetContents().Count(); - for ( USHORT nP = 0; nP < nParas; nP++ ) + const sal_uInt16 nParas = rBinObj.GetContents().Count(); + for ( sal_uInt16 nP = 0; nP < nParas; nP++ ) { ContentInfo* pC = rBinObj.GetContents()[ nP ]; ContentInfo* pNew = new ContentInfo( *pC, *GetPool() ); @@ -850,7 +850,7 @@ void BinTextObject::Insert( const EditTextObject& rObj, USHORT nDestPara ) ClearPortionInfo(); } -EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) const +EditTextObject* BinTextObject::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas ) const { if ( ( nPara >= aContents.Count() ) || !nParas ) return NULL; @@ -864,8 +864,8 @@ EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) c // If text contains different ScriptTypes, this shouldn't be a problem... pObj->nScriptType = nScriptType; - const USHORT nEndPara = nPara+nParas-1; - for ( USHORT nP = nPara; nP <= nEndPara; nP++ ) + const sal_uInt16 nEndPara = nPara+nParas-1; + for ( sal_uInt16 nP = nPara; nP <= nEndPara; nP++ ) { ContentInfo* pC = aContents[ nP ]; ContentInfo* pNew = new ContentInfo( *pC, *pObj->GetPool() ); @@ -874,7 +874,7 @@ EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) c return pObj; } -void BinTextObject::RemoveParagraph( USHORT nPara ) +void BinTextObject::RemoveParagraph( sal_uInt16 nPara ) { DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Absatz existiert nicht!" ); if ( nPara < aContents.Count() ) @@ -886,63 +886,63 @@ void BinTextObject::RemoveParagraph( USHORT nPara ) } } -BOOL BinTextObject::HasPortionInfo() const +sal_Bool BinTextObject::HasPortionInfo() const { - return pPortionInfo ? TRUE : FALSE; + return pPortionInfo ? sal_True : sal_False; } void BinTextObject::ClearPortionInfo() { if ( pPortionInfo ) { - for ( USHORT n = pPortionInfo->Count(); n; ) + for ( sal_uInt16 n = pPortionInfo->Count(); n; ) delete pPortionInfo->GetObject( --n ); delete pPortionInfo; pPortionInfo = NULL; } } -BOOL BinTextObject::HasOnlineSpellErrors() const +sal_Bool BinTextObject::HasOnlineSpellErrors() const { #ifndef SVX_LIGHT - for ( USHORT n = 0; n < aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aContents.Count(); n++ ) { ContentInfo* p = aContents.GetObject( n ); if ( p->GetWrongList() && p->GetWrongList()->Count() ) - return TRUE; + return sal_True; } #endif // !SVX_LIGHT - return FALSE; + return sal_False; } -BOOL BinTextObject::HasCharAttribs( USHORT _nWhich ) const +sal_Bool BinTextObject::HasCharAttribs( sal_uInt16 _nWhich ) const { - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); - USHORT nAttribs = pC->GetAttribs().Count(); + sal_uInt16 nAttribs = pC->GetAttribs().Count(); if ( nAttribs && !_nWhich ) - return TRUE; + return sal_True; - for ( USHORT nAttr = nAttribs; nAttr; ) + for ( sal_uInt16 nAttr = nAttribs; nAttr; ) { XEditAttribute* pX = pC->GetAttribs().GetObject( --nAttr ); if ( pX->GetItem()->Which() == _nWhich ) - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } -void BinTextObject::GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) const +void BinTextObject::GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const { rLst.Remove( 0, rLst.Count() ); ContentInfo* pC = GetContents().GetObject( nPara ); if ( pC ) { - for ( USHORT nAttr = 0; nAttr < pC->GetAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pC->GetAttribs().Count(); nAttr++ ) { XEditAttribute* pAttr = pC->GetAttribs().GetObject( nAttr ); EECharAttrib aEEAttr; @@ -955,21 +955,21 @@ void BinTextObject::GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) cons } } -void BinTextObject::MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, USHORT nEnd ) +void BinTextObject::MergeParaAttribs( const SfxItemSet& rAttribs, sal_uInt16 nStart, sal_uInt16 nEnd ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); - for ( USHORT nW = nStart; nW <= nEnd; nW++ ) + for ( sal_uInt16 nW = nStart; nW <= nEnd; nW++ ) { - if ( ( pC->GetParaAttribs().GetItemState( nW, FALSE ) != SFX_ITEM_ON ) - && ( rAttribs.GetItemState( nW, FALSE ) == SFX_ITEM_ON ) ) + if ( ( pC->GetParaAttribs().GetItemState( nW, sal_False ) != SFX_ITEM_ON ) + && ( rAttribs.GetItemState( nW, sal_False ) == SFX_ITEM_ON ) ) { pC->GetParaAttribs().Put( rAttribs.Get( nW ) ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -978,9 +978,9 @@ void BinTextObject::MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, ClearPortionInfo(); } -BOOL BinTextObject::IsFieldObject() const +sal_Bool BinTextObject::IsFieldObject() const { - return BinTextObject::GetField() ? TRUE : FALSE; + return BinTextObject::GetField() ? sal_True : sal_False; } const SvxFieldItem* BinTextObject::GetField() const @@ -990,8 +990,8 @@ const SvxFieldItem* BinTextObject::GetField() const ContentInfo* pC = GetContents()[0]; if ( pC->GetText().Len() == 1 ) { - USHORT nAttribs = pC->GetAttribs().Count(); - for ( USHORT nAttr = nAttribs; nAttr; ) + sal_uInt16 nAttribs = pC->GetAttribs().Count(); + for ( sal_uInt16 nAttr = nAttribs; nAttr; ) { XEditAttribute* pX = pC->GetAttribs().GetObject( --nAttr ); if ( pX->GetItem()->Which() == EE_FEATURE_FIELD ) @@ -1002,59 +1002,59 @@ const SvxFieldItem* BinTextObject::GetField() const return 0; } -BOOL BinTextObject::HasField( TypeId aType ) const +sal_Bool BinTextObject::HasField( TypeId aType ) const { - USHORT nParagraphs = GetContents().Count(); - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + sal_uInt16 nParagraphs = GetContents().Count(); + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); - USHORT nAttrs = pC->GetAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttrs; nAttr++ ) + sal_uInt16 nAttrs = pC->GetAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttrs; nAttr++ ) { XEditAttribute* pAttr = pC->GetAttribs()[nAttr]; if ( pAttr->GetItem()->Which() == EE_FEATURE_FIELD ) { if ( !aType ) - return TRUE; + return sal_True; const SvxFieldData* pFldData = ((const SvxFieldItem*)pAttr->GetItem())->GetField(); if ( pFldData && pFldData->IsA( aType ) ) - return TRUE; + return sal_True; } } } - return FALSE; + return sal_False; } -SfxItemSet BinTextObject::GetParaAttribs( USHORT nPara ) const +SfxItemSet BinTextObject::GetParaAttribs( sal_uInt16 nPara ) const { ContentInfo* pC = GetContents().GetObject( nPara ); return pC->GetParaAttribs(); } -void BinTextObject::SetParaAttribs( USHORT nPara, const SfxItemSet& rAttribs ) +void BinTextObject::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rAttribs ) { ContentInfo* pC = GetContents().GetObject( nPara ); pC->GetParaAttribs().Set( rAttribs ); ClearPortionInfo(); } -BOOL BinTextObject::RemoveCharAttribs( USHORT _nWhich ) +sal_Bool BinTextObject::RemoveCharAttribs( sal_uInt16 _nWhich ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); - for ( USHORT nAttr = pC->GetAttribs().Count(); nAttr; ) + for ( sal_uInt16 nAttr = pC->GetAttribs().Count(); nAttr; ) { XEditAttribute* pAttr = pC->GetAttribs().GetObject( --nAttr ); if ( !_nWhich || ( pAttr->GetItem()->Which() == _nWhich ) ) { pC->GetAttribs().Remove( nAttr ); DestroyAttrib( pAttr ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -1065,18 +1065,18 @@ BOOL BinTextObject::RemoveCharAttribs( USHORT _nWhich ) return bChanged; } -BOOL BinTextObject::RemoveParaAttribs( USHORT _nWhich ) +sal_Bool BinTextObject::RemoveParaAttribs( sal_uInt16 _nWhich ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); if ( !_nWhich ) { if( pC->GetParaAttribs().Count() ) - bChanged = TRUE; + bChanged = sal_True; pC->GetParaAttribs().ClearItem(); } else @@ -1084,7 +1084,7 @@ BOOL BinTextObject::RemoveParaAttribs( USHORT _nWhich ) if ( pC->GetParaAttribs().GetItemState( _nWhich ) == SFX_ITEM_ON ) { pC->GetParaAttribs().ClearItem( _nWhich ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -1095,19 +1095,19 @@ BOOL BinTextObject::RemoveParaAttribs( USHORT _nWhich ) return bChanged; } -BOOL BinTextObject::HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const +sal_Bool BinTextObject::HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const { - USHORT nParagraphs = GetContents().Count(); - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + sal_uInt16 nParagraphs = GetContents().Count(); + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); if ( ( pC->GetFamily() == eFamily ) && ( pC->GetStyle() == rName ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -void BinTextObject::GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamily& rFamily ) const +void BinTextObject::GetStyleSheet( sal_uInt16 nPara, XubString& rName, SfxStyleFamily& rFamily ) const { if ( nPara < aContents.Count() ) { @@ -1117,7 +1117,7 @@ void BinTextObject::GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamil } } -void BinTextObject::SetStyleSheet( USHORT nPara, const XubString& rName, const SfxStyleFamily& rFamily ) +void BinTextObject::SetStyleSheet( sal_uInt16 nPara, const XubString& rName, const SfxStyleFamily& rFamily ) { if ( nPara < aContents.Count() ) { @@ -1127,14 +1127,14 @@ void BinTextObject::SetStyleSheet( USHORT nPara, const XubString& rName, const S } } -BOOL BinTextObject::ImpChangeStyleSheets( +sal_Bool BinTextObject::ImpChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily ) { - const USHORT nParagraphs = GetContents().Count(); - BOOL bChanges = FALSE; + const sal_uInt16 nParagraphs = GetContents().Count(); + sal_Bool bChanges = sal_False; - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); if ( pC->GetFamily() == eOldFamily ) @@ -1143,18 +1143,18 @@ BOOL BinTextObject::ImpChangeStyleSheets( { pC->GetStyle() = rNewName; pC->GetFamily() = eNewFamily; - bChanges = TRUE; + bChanges = sal_True; } } } return bChanges; } -BOOL __EXPORT BinTextObject::ChangeStyleSheets( +sal_Bool __EXPORT BinTextObject::ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily ) { - BOOL bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily ); + sal_Bool bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily ); if ( bChanges ) ClearPortionInfo(); @@ -1169,7 +1169,7 @@ void __EXPORT BinTextObject::ChangeStyleSheetName( SfxStyleFamily eFamily, void __EXPORT BinTextObject::StoreData( SvStream& rOStream ) const { - USHORT nVer = 602; + sal_uInt16 nVer = 602; rOStream << nVer; rOStream << bOwnerOfPool; @@ -1183,17 +1183,17 @@ void __EXPORT BinTextObject::StoreData( SvStream& rOStream ) const // Aktuelle Zeichensatz speichern... // #90477# GetSOStoreTextEncoding: Bug in 5.2, when default char set is multi byte text encoding - rtl_TextEncoding eEncoding = GetSOStoreTextEncoding( gsl_getSystemTextEncoding(), (USHORT) rOStream.GetVersion() ); - rOStream << (USHORT) eEncoding; + rtl_TextEncoding eEncoding = GetSOStoreTextEncoding( gsl_getSystemTextEncoding(), (sal_uInt16) rOStream.GetVersion() ); + rOStream << (sal_uInt16) eEncoding; // Die Anzahl der Absaetze... - USHORT nParagraphs = GetContents().Count(); + sal_uInt16 nParagraphs = GetContents().Count(); rOStream << nParagraphs; char cFeatureConverted = ByteString( CH_FEATURE, eEncoding ).GetChar(0); // Die einzelnen Absaetze... - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); @@ -1201,17 +1201,17 @@ void __EXPORT BinTextObject::StoreData( SvStream& rOStream ) const ByteString aText( pC->GetText(), eEncoding ); // Symbols? - BOOL bSymbolPara = FALSE; + sal_Bool bSymbolPara = sal_False; if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) { const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) { aText = ByteString( pC->GetText(), RTL_TEXTENCODING_SYMBOL ); - bSymbolPara = TRUE; + bSymbolPara = sal_True; } } - for ( USHORT nA = 0; nA < pC->GetAttribs().Count(); nA++ ) + for ( sal_uInt16 nA = 0; nA < pC->GetAttribs().Count(); nA++ ) { XEditAttribute* pAttr = pC->GetAttribs().GetObject( nA ); @@ -1234,7 +1234,7 @@ void __EXPORT BinTextObject::StoreData( SvStream& rOStream ) const { // Don't create a new Attrib with StarBats font, MBR changed the // SvxFontItem::Store() to store StarBats instead of StarSymbol! - for ( USHORT nChar = pAttr->GetStart(); nChar < pAttr->GetEnd(); nChar++ ) + for ( sal_uInt16 nChar = pAttr->GetStart(); nChar < pAttr->GetEnd(); nChar++ ) { sal_Unicode cOld = pC->GetText().GetChar( nChar ); char cConv = ByteString::ConvertFromUnicode( ConvertFontToSubsFontChar( hConv, cOld ), RTL_TEXTENCODING_SYMBOL ); @@ -1264,7 +1264,7 @@ void __EXPORT BinTextObject::StoreData( SvStream& rOStream ) const */ if ( hConv ) { - for ( USHORT nChar = 0; nChar < pC->GetText().Len(); nChar++ ) + for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ ) { if ( !pC->GetAttribs().FindAttrib( EE_CHAR_FONTINFO, nChar ) ) { @@ -1286,19 +1286,19 @@ void __EXPORT BinTextObject::StoreData( SvStream& rOStream ) const // StyleName und Family... rOStream.WriteByteString( ByteString( pC->GetStyle(), eEncoding ) ); - rOStream << (USHORT)pC->GetFamily(); + rOStream << (sal_uInt16)pC->GetFamily(); // Absatzattribute... pC->GetParaAttribs().Store( rOStream ); // Die Anzahl der Attribute... - USHORT nAttribs = pC->GetAttribs().Count(); + sal_uInt16 nAttribs = pC->GetAttribs().Count(); rOStream << nAttribs; // Und die einzelnen Attribute // Items als Surregate => immer 8 Byte pro Attrib // Which = 2; Surregat = 2; Start = 2; End = 2; - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { XEditAttribute* pX = pC->GetAttribs().GetObject( nAttr ); @@ -1325,16 +1325,16 @@ void __EXPORT BinTextObject::StoreData( SvStream& rOStream ) const rOStream << bStoreUnicodeStrings; if ( bStoreUnicodeStrings ) { - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); - USHORT nL = pC->GetText().Len(); + sal_uInt16 nL = pC->GetText().Len(); rOStream << nL; rOStream.Write( pC->GetText().GetBuffer(), nL*sizeof(sal_Unicode) ); // #91575# StyleSheetName must be Unicode too! // Copy/Paste from EA3 to BETA or from BETA to EA3 not possible, not needed... - // If needed, change nL back to ULONG and increase version... + // If needed, change nL back to sal_uInt32 and increase version... nL = pC->GetStyle().Len(); rOStream << nL; rOStream.Write( pC->GetStyle().GetBuffer(), nL*sizeof(sal_Unicode) ); @@ -1348,7 +1348,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) // Das Textobject wurde erstmal mit der aktuellen Einstellung // von pTextObjectPool erzeugt. - BOOL bOwnerOfCurrent = bOwnerOfPool; + sal_Bool bOwnerOfCurrent = bOwnerOfPool; rIStream >> bOwnerOfPool; if ( bOwnerOfCurrent && !bOwnerOfPool ) @@ -1369,17 +1369,17 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) GetPool()->Load( rIStream ); // CharSet, in dem gespeichert wurde: - USHORT nCharSet; + sal_uInt16 nCharSet; rIStream >> nCharSet; - rtl_TextEncoding eSrcEncoding = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, (USHORT)rIStream.GetVersion() ); + rtl_TextEncoding eSrcEncoding = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, (sal_uInt16)rIStream.GetVersion() ); // Die Anzahl der Absaetze... - USHORT nParagraphs; + sal_uInt16 nParagraphs; rIStream >> nParagraphs; // Die einzelnen Absaetze... - for ( ULONG nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt32 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = CreateAndInsertContent(); @@ -1390,7 +1390,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) // StyleName und Family... rIStream.ReadByteString( pC->GetStyle(), eSrcEncoding ); - USHORT nStyleFamily; + sal_uInt16 nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; @@ -1398,16 +1398,16 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) pC->GetParaAttribs().Load( rIStream ); // Die Anzahl der Attribute... - USHORT nAttribs; + sal_uInt16 nAttribs; rIStream >> nAttribs; // Und die einzelnen Attribute // Items als Surregate => immer 8 Byte pro Attrib // Which = 2; Surregat = 2; Start = 2; End = 2; - USHORT nAttr; + sal_uInt16 nAttr; for ( nAttr = 0; nAttr < nAttribs; nAttr++ ) { - USHORT _nWhich, nStart, nEnd; + sal_uInt16 _nWhich, nStart, nEnd; const SfxPoolItem* pItem; rIStream >> _nWhich; @@ -1429,8 +1429,8 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) if ( ( _nWhich >= EE_FEATURE_START ) && ( _nWhich <= EE_FEATURE_END ) ) { // Convert CH_FEATURE to CH_FEATURE_OLD - DBG_ASSERT( (BYTE) aByteString.GetChar( nStart ) == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" ); - if ( (BYTE) aByteString.GetChar( nStart ) == CH_FEATURE_OLD ) + DBG_ASSERT( (sal_uInt8) aByteString.GetChar( nStart ) == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" ); + if ( (sal_uInt8) aByteString.GetChar( nStart ) == CH_FEATURE_OLD ) pC->GetText().SetChar( nStart, CH_FEATURE ); } } @@ -1440,14 +1440,14 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) // But check for paragraph and character symbol attribs here, // FinishLoad will not be called in OpenOffice Calc, no StyleSheets... - BOOL bSymbolPara = FALSE; + sal_Bool bSymbolPara = sal_False; if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) { const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) { pC->GetText() = String( aByteString, RTL_TEXTENCODING_SYMBOL ); - bSymbolPara = TRUE; + bSymbolPara = sal_True; } } @@ -1479,7 +1479,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) pC->GetAttribs().Insert( pNewAttr, nAttr ); DestroyAttrib( pAttr ); - for ( USHORT nChar = pNewAttr->GetStart(); nChar < pNewAttr->GetEnd(); nChar++ ) + for ( sal_uInt16 nChar = pNewAttr->GetStart(); nChar < pNewAttr->GetEnd(); nChar++ ) { sal_Unicode cOld = pC->GetText().GetChar( nChar ); DBG_ASSERT( cOld >= 0xF000, "cOld not converted?!" ); @@ -1506,7 +1506,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv ); pC->GetParaAttribs().Put( aNewFontItem ); - for ( USHORT nChar = 0; nChar < pC->GetText().Len(); nChar++ ) + for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ ) { if ( !pC->GetAttribs().FindAttrib( EE_CHAR_FONTINFO, nChar ) ) { @@ -1526,7 +1526,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) // Ab 400 auch die DefMetric: if ( nVersion >= 400 ) { - USHORT nTmpMetric; + sal_uInt16 nTmpMetric; rIStream >> nTmpMetric; if ( nVersion >= 401 ) { @@ -1553,14 +1553,14 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) { rIStream >> nScriptType; - BOOL bUnicodeStrings; + sal_Bool bUnicodeStrings; rIStream >> bUnicodeStrings; if ( bUnicodeStrings ) { - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); - USHORT nL; + sal_uInt16 nL; // Text rIStream >> nL; @@ -1568,7 +1568,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) { pC->GetText().AllocBuffer( nL ); rIStream.Read( pC->GetText().GetBufferAccess(), nL*sizeof(sal_Unicode) ); - pC->GetText().ReleaseBufferAccess( (USHORT)nL ); + pC->GetText().ReleaseBufferAccess( (sal_uInt16)nL ); } // StyleSheetName @@ -1577,7 +1577,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) { pC->GetStyle().AllocBuffer( nL ); rIStream.Read( pC->GetStyle().GetBufferAccess(), nL*sizeof(sal_Unicode) ); - pC->GetStyle().ReleaseBufferAccess( (USHORT)nL ); + pC->GetStyle().ReleaseBufferAccess( (sal_uInt16)nL ); } } } @@ -1588,7 +1588,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) // Wirkt nur wenn auch Tab-Positionen eingestellt wurden, nicht beim DefTab. if ( nVersion < 500 ) { - for ( USHORT n = 0; n < aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aContents.Count(); n++ ) { ContentInfo* pC = aContents.GetObject( n ); const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&) pC->GetParaAttribs().Get( EE_PARA_LRSPACE ); @@ -1596,7 +1596,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) { const SvxTabStopItem& rTabs = (const SvxTabStopItem&) pC->GetParaAttribs().Get( EE_PARA_TABS ); SvxTabStopItem aNewTabs( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS ); - for ( USHORT t = 0; t < rTabs.Count(); t++ ) + for ( sal_uInt16 t = 0; t < rTabs.Count(); t++ ) { const SvxTabStop& rT = rTabs[ t ]; aNewTabs.Insert( SvxTabStop( rT.GetTabPos() - rLRSpace.GetTxtLeft(), @@ -1608,7 +1608,7 @@ void __EXPORT BinTextObject::CreateData( SvStream& rIStream ) } } -USHORT BinTextObject::GetVersion() const +sal_uInt16 BinTextObject::GetVersion() const { return nVersion; } @@ -1626,7 +1626,7 @@ bool BinTextObject::operator==( const BinTextObject& rCompare ) const ( bVertical != rCompare.bVertical ) ) return false; - USHORT n; + sal_uInt16 n; for( n = 0; n < aContents.Count(); n++ ) { if( !( *aContents.GetObject( n ) == *rCompare.aContents.GetObject( n ) ) ) @@ -1644,7 +1644,7 @@ bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const return false; } - for(USHORT a(0); a < GetContents().Count(); a++) + for(sal_uInt16 a(0); a < GetContents().Count(); a++) { const ContentInfo& rCandA(*GetContents().GetObject(a)); const ContentInfo& rCandB(*rCompare.GetContents().GetObject(a)); @@ -1673,7 +1673,7 @@ void __EXPORT BinTextObject::CreateData300( SvStream& rIStream ) rIStream >> nParagraphs; // Die einzelnen Absaetze... - for ( ULONG nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt32 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = CreateAndInsertContent(); @@ -1682,7 +1682,7 @@ void __EXPORT BinTextObject::CreateData300( SvStream& rIStream ) // StyleName und Family... rIStream.ReadByteString( pC->GetStyle() ); - USHORT nStyleFamily; + sal_uInt16 nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; @@ -1696,9 +1696,9 @@ void __EXPORT BinTextObject::CreateData300( SvStream& rIStream ) // Und die einzelnen Attribute // Items als Surregate => immer 8 Byte pro Attrib // Which = 2; Surregat = 2; Start = 2; End = 2; - for ( ULONG nAttr = 0; nAttr < nAttribs; nAttr++ ) + for ( sal_uInt32 nAttr = 0; nAttr < nAttribs; nAttr++ ) { - USHORT _nWhich, nStart, nEnd; + sal_uInt16 _nWhich, nStart, nEnd; const SfxPoolItem* pItem; rIStream >> _nWhich; @@ -1715,11 +1715,11 @@ void __EXPORT BinTextObject::CreateData300( SvStream& rIStream ) } // Prueffen, ob ein Zeichensatz gespeichert wurde - USHORT nCharSetMarker; + sal_uInt16 nCharSetMarker; rIStream >> nCharSetMarker; if ( nCharSetMarker == CHARSETMARKER ) { - USHORT nCharSet; + sal_uInt16 nCharSet; rIStream >> nCharSet; } } diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 6ef3ce359d49..ee0aace48029 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -43,8 +43,8 @@ class XEditAttribute private: const SfxPoolItem* pItem; - USHORT nStart; - USHORT nEnd; + sal_uInt16 nStart; + sal_uInt16 nEnd; XEditAttribute(); XEditAttribute( const XEditAttribute& rCopyFrom ); @@ -53,19 +53,19 @@ private: public: XEditAttribute( const SfxPoolItem& rAttr ); - XEditAttribute( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); + XEditAttribute( const SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); const SfxPoolItem* GetItem() const { return pItem; } - USHORT& GetStart() { return nStart; } - USHORT& GetEnd() { return nEnd; } + sal_uInt16& GetStart() { return nStart; } + sal_uInt16& GetEnd() { return nEnd; } - USHORT GetStart() const { return nStart; } - USHORT GetEnd() const { return nEnd; } + sal_uInt16 GetStart() const { return nStart; } + sal_uInt16 GetEnd() const { return nEnd; } - USHORT GetLen() const { return nEnd-nStart; } + sal_uInt16 GetLen() const { return nEnd-nStart; } - inline BOOL IsFeature(); + inline sal_Bool IsFeature(); inline bool operator==( const XEditAttribute& rCompare ); }; @@ -79,9 +79,9 @@ inline bool XEditAttribute::operator==( const XEditAttribute& rCompare ) (*pItem == *rCompare.pItem)); } -inline BOOL XEditAttribute::IsFeature() +inline sal_Bool XEditAttribute::IsFeature() { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); return ( ( nWhich >= EE_FEATURE_START ) && ( nWhich <= EE_FEATURE_END ) ); } @@ -92,13 +92,13 @@ SV_DECL_PTRARR( XEditAttributeListImpl, XEditAttributePtr, 0, 4 ) class XEditAttributeList : public XEditAttributeListImpl { public: - XEditAttribute* FindAttrib( USHORT nWhich, USHORT nChar ) const; + XEditAttribute* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nChar ) const; }; struct XParaPortion { long nHeight; - USHORT nFirstLineOffset; + sal_uInt16 nFirstLineOffset; EditLineList aLines; TextPortionList aTextPortions; @@ -109,22 +109,22 @@ SV_DECL_PTRARR( XBaseParaPortionList, XParaPortionPtr, 0, 4 ) class XParaPortionList : public XBaseParaPortionList { - ULONG nRefDevPtr; + sal_uInt32 nRefDevPtr; OutDevType eRefDevType; MapMode aRefMapMode; - ULONG nPaperWidth; + sal_uInt32 nPaperWidth; public: - XParaPortionList( OutputDevice* pRefDev, ULONG nPW ) : + XParaPortionList( OutputDevice* pRefDev, sal_uInt32 nPW ) : aRefMapMode( pRefDev->GetMapMode() ) { - nRefDevPtr = (ULONG)pRefDev; nPaperWidth = nPW; + nRefDevPtr = (sal_uInt32)pRefDev; nPaperWidth = nPW; eRefDevType = pRefDev->GetOutDevType(); } - ULONG GetRefDevPtr() const { return nRefDevPtr; } - ULONG GetPaperWidth() const { return nPaperWidth; } + sal_uInt32 GetRefDevPtr() const { return nRefDevPtr; } + sal_uInt32 GetPaperWidth() const { return nPaperWidth; } OutDevType GetRefDevType() const { return eRefDevType; } const MapMode& GetRefMapMode() const { return aRefMapMode; } }; @@ -135,7 +135,7 @@ struct LoadStoreTempInfos ByteString aOrgString_Load; FontToSubsFontConverter hOldSymbolConv_Store; - BOOL bSymbolParagraph_Store; + sal_Bool bSymbolParagraph_Store; LoadStoreTempInfos() { bSymbolParagraph_Store = FALSE; hOldSymbolConv_Store = NULL; } @@ -197,23 +197,23 @@ class BinTextObject : public EditTextObject, public SfxItemPoolUser private: ContentInfoList aContents; SfxItemPool* pPool; - BOOL bOwnerOfPool; + sal_Bool bOwnerOfPool; XParaPortionList* pPortionInfo; sal_uInt32 nObjSettings; - USHORT nMetric; - USHORT nVersion; - USHORT nUserType; - USHORT nScriptType; + sal_uInt16 nMetric; + sal_uInt16 nVersion; + sal_uInt16 nUserType; + sal_uInt16 nScriptType; - BOOL bVertical; - BOOL bStoreUnicodeStrings; + sal_Bool bVertical; + sal_Bool bStoreUnicodeStrings; protected: void DeleteContents(); virtual void StoreData( SvStream& rOStream ) const; virtual void CreateData( SvStream& rIStream ); - BOOL ImpChangeStyleSheets( const String& rOldName, SfxStyleFamily eOldFamily, + sal_Bool ImpChangeStyleSheets( const String& rOldName, SfxStyleFamily eOldFamily, const String& rNewName, SfxStyleFamily eNewFamily ); public: @@ -223,22 +223,22 @@ public: virtual EditTextObject* Clone() const; - USHORT GetUserType() const; - void SetUserType( USHORT n ); + sal_uInt16 GetUserType() const; + void SetUserType( sal_uInt16 n ); - ULONG GetObjectSettings() const; - void SetObjectSettings( ULONG n ); + sal_uInt32 GetObjectSettings() const; + void SetObjectSettings( sal_uInt32 n ); - BOOL IsVertical() const; - void SetVertical( BOOL b ); + sal_Bool IsVertical() const; + void SetVertical( sal_Bool b ); - USHORT GetScriptType() const; - void SetScriptType( USHORT nType ); + sal_uInt16 GetScriptType() const; + void SetScriptType( sal_uInt16 nType ); - USHORT GetVersion() const; // Solange der Outliner keine Recordlaenge speichert + sal_uInt16 GetVersion() const; // Solange der Outliner keine Recordlaenge speichert ContentInfo* CreateAndInsertContent(); - XEditAttribute* CreateAttrib( const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ); + XEditAttribute* CreateAttrib( const SfxPoolItem& rItem, sal_uInt16 nStart, sal_uInt16 nEnd ); void DestroyAttrib( XEditAttribute* pAttr ); ContentInfoList& GetContents() { return aContents; } @@ -248,47 +248,47 @@ public: void SetPortionInfo( XParaPortionList* pP ) { pPortionInfo = pP; } - virtual USHORT GetParagraphCount() const; - virtual String GetText( USHORT nParagraph ) const; - virtual void Insert( const EditTextObject& rObj, USHORT nPara ); - virtual EditTextObject* CreateTextObject( USHORT nPara, USHORT nParas = 1 ) const; - virtual void RemoveParagraph( USHORT nPara ); + virtual sal_uInt16 GetParagraphCount() const; + virtual String GetText( sal_uInt16 nParagraph ) const; + virtual void Insert( const EditTextObject& rObj, sal_uInt16 nPara ); + virtual EditTextObject* CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas = 1 ) const; + virtual void RemoveParagraph( sal_uInt16 nPara ); - virtual BOOL HasPortionInfo() const; + virtual sal_Bool HasPortionInfo() const; virtual void ClearPortionInfo(); - virtual BOOL HasOnlineSpellErrors() const; + virtual sal_Bool HasOnlineSpellErrors() const; - virtual BOOL HasCharAttribs( USHORT nWhich = 0 ) const; - virtual void GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) const; + virtual sal_Bool HasCharAttribs( sal_uInt16 nWhich = 0 ) const; + virtual void GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const; - virtual BOOL RemoveCharAttribs( USHORT nWhich = 0 ); - virtual BOOL RemoveParaAttribs( USHORT nWhich = 0 ); + virtual sal_Bool RemoveCharAttribs( sal_uInt16 nWhich = 0 ); + virtual sal_Bool RemoveParaAttribs( sal_uInt16 nWhich = 0 ); - virtual void MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, USHORT nEnd ); + virtual void MergeParaAttribs( const SfxItemSet& rAttribs, sal_uInt16 nStart, sal_uInt16 nEnd ); - virtual BOOL IsFieldObject() const; + virtual sal_Bool IsFieldObject() const; virtual const SvxFieldItem* GetField() const; - virtual BOOL HasField( TypeId Type = NULL ) const; + virtual sal_Bool HasField( TypeId Type = NULL ) const; - SfxItemSet GetParaAttribs( USHORT nPara ) const; - void SetParaAttribs( USHORT nPara, const SfxItemSet& rAttribs ); + SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; + void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rAttribs ); - virtual BOOL HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const; - virtual void GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamily& eFamily ) const; - virtual void SetStyleSheet( USHORT nPara, const XubString& rName, const SfxStyleFamily& eFamily ); - virtual BOOL ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, + virtual sal_Bool HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const; + virtual void GetStyleSheet( sal_uInt16 nPara, XubString& rName, SfxStyleFamily& eFamily ) const; + virtual void SetStyleSheet( sal_uInt16 nPara, const XubString& rName, const SfxStyleFamily& eFamily ); + virtual sal_Bool ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, const String& rNewName, SfxStyleFamily eNewFamily ); virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName ); void CreateData300( SvStream& rIStream ); - BOOL HasMetric() const { return nMetric != 0xFFFF; } - USHORT GetMetric() const { return nMetric; } - void SetMetric( USHORT n ) { nMetric = n; } + sal_Bool HasMetric() const { return nMetric != 0xFFFF; } + sal_uInt16 GetMetric() const { return nMetric; } + void SetMetric( sal_uInt16 n ) { nMetric = n; } - BOOL IsOwnerOfPool() const { return bOwnerOfPool; } - void StoreUnicodeStrings( BOOL b ) { bStoreUnicodeStrings = b; } + sal_Bool IsOwnerOfPool() const { return bOwnerOfPool; } + void StoreUnicodeStrings( sal_Bool b ) { bStoreUnicodeStrings = b; } /* cl removed because not needed anymore since binfilter void PrepareStore( SfxStyleSheetPool* pStyleSheetPool ); diff --git a/editeng/source/editeng/editsel.hxx b/editeng/source/editeng/editsel.hxx index e4d5b9d71b05..05f28be24006 100644 --- a/editeng/source/editeng/editsel.hxx +++ b/editeng/source/editeng/editsel.hxx @@ -48,9 +48,9 @@ public: virtual void CreateAnchor(); virtual void DestroyAnchor(); - virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE ); + virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False ); - virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ); + virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); virtual void DeselectAtPoint( const Point& rPointPixel ); virtual void DeselectAll(); diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index 40c53634b5ce..f6467c3954b7 100644 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -36,93 +36,93 @@ class InternalEditStatus : public EditStatus public: InternalEditStatus() { ; } - void TurnOnFlags( ULONG nFlags ) + void TurnOnFlags( sal_uInt32 nFlags ) { nControlBits |= nFlags; } - void TurnOffFlags( ULONG nFlags ) + void TurnOffFlags( sal_uInt32 nFlags ) { nControlBits &= ~nFlags; } - void TurnOnStatusBits( ULONG nBits ) + void TurnOnStatusBits( sal_uInt32 nBits ) { nStatusBits |= nBits; } - void TurnOffStatusBits( ULONG nBits ) + void TurnOffStatusBits( sal_uInt32 nBits ) { nStatusBits &= ~nBits; } - BOOL UseCharAttribs() const + sal_Bool UseCharAttribs() const { return ( ( nControlBits & EE_CNTRL_USECHARATTRIBS ) != 0 ); } - BOOL NotifyCursorMovements() const + sal_Bool NotifyCursorMovements() const { return ( ( nControlBits & EE_CNTRL_CRSRLEFTPARA ) != 0 ); } - BOOL UseIdleFormatter() const + sal_Bool UseIdleFormatter() const { return ( ( nControlBits & EE_CNTRL_DOIDLEFORMAT) != 0 ); } - BOOL AllowPasteSpecial() const + sal_Bool AllowPasteSpecial() const { return ( ( nControlBits & EE_CNTRL_PASTESPECIAL ) != 0 ); } - BOOL DoAutoIndenting() const + sal_Bool DoAutoIndenting() const { return ( ( nControlBits & EE_CNTRL_AUTOINDENTING ) != 0 ); } - BOOL DoUndoAttribs() const + sal_Bool DoUndoAttribs() const { return ( ( nControlBits & EE_CNTRL_UNDOATTRIBS ) != 0 ); } - BOOL OneCharPerLine() const + sal_Bool OneCharPerLine() const { return ( ( nControlBits & EE_CNTRL_ONECHARPERLINE ) != 0 ); } - BOOL IsOutliner() const + sal_Bool IsOutliner() const { return ( ( nControlBits & EE_CNTRL_OUTLINER ) != 0 ); } - BOOL IsOutliner2() const + sal_Bool IsOutliner2() const { return ( ( nControlBits & EE_CNTRL_OUTLINER2 ) != 0 ); } - BOOL IsAnyOutliner() const + sal_Bool IsAnyOutliner() const { return IsOutliner() || IsOutliner2(); } - BOOL DoNotUseColors() const + sal_Bool DoNotUseColors() const { return ( ( nControlBits & EE_CNTRL_NOCOLORS ) != 0 ); } - BOOL AllowBigObjects() const + sal_Bool AllowBigObjects() const { return ( ( nControlBits & EE_CNTRL_ALLOWBIGOBJS ) != 0 ); } - BOOL DoOnlineSpelling() const + sal_Bool DoOnlineSpelling() const { return ( ( nControlBits & EE_CNTRL_ONLINESPELLING ) != 0 ); } - BOOL DoStretch() const + sal_Bool DoStretch() const { return ( ( nControlBits & EE_CNTRL_STRETCHING ) != 0 ); } - BOOL AutoPageSize() const + sal_Bool AutoPageSize() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZE ) != 0 ); } - BOOL AutoPageWidth() const + sal_Bool AutoPageWidth() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEX ) != 0 ); } - BOOL AutoPageHeight() const + sal_Bool AutoPageHeight() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEY ) != 0 ); } - BOOL MarkFields() const + sal_Bool MarkFields() const { return ( ( nControlBits & EE_CNTRL_MARKFIELDS ) != 0 ); } - BOOL DoRestoreFont() const + sal_Bool DoRestoreFont() const { return ( ( nControlBits & EE_CNTRL_RESTOREFONT ) != 0 ); } - BOOL DoImportRTFStyleSheets() const + sal_Bool DoImportRTFStyleSheets() const { return ( ( nControlBits & EE_CNTRL_RTFSTYLESHEETS ) != 0 ); } - BOOL DoAutoCorrect() const + sal_Bool DoAutoCorrect() const { return ( ( nControlBits & EE_CNTRL_AUTOCORRECT ) != 0 ); } - BOOL DoAutoComplete() const + sal_Bool DoAutoComplete() const { return ( ( nControlBits & EE_CNTRL_AUTOCOMPLETE ) != 0 ); } - BOOL DoTabIndenting() const + sal_Bool DoTabIndenting() const { return ( ( nControlBits & EE_CNTRL_TABINDENTING ) != 0 ); } - BOOL DoFormat100() const + sal_Bool DoFormat100() const { return ( ( nControlBits & EE_CNTRL_FORMAT100 ) != 0 ); } - BOOL ULSpaceSummation() const + sal_Bool ULSpaceSummation() const { return ( ( nControlBits & EE_CNTRL_ULSPACESUMMATION ) != 0 ); } - BOOL ULSpaceFirstParagraph() const + sal_Bool ULSpaceFirstParagraph() const { return ( ( nControlBits & EE_CNTRL_ULSPACEFIRSTPARA ) != 0 ); } }; diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx index 4c54c553c353..210a18ca0ae4 100644 --- a/editeng/source/editeng/editundo.hxx +++ b/editeng/source/editeng/editundo.hxx @@ -47,14 +47,14 @@ class EditView; class EditUndoDelContent : public EditUndo { private: - BOOL bDelObject; - USHORT nNode; + sal_Bool bDelObject; + sal_uInt16 nNode; ContentNode* pContentNode; // Zeigt auf das gueltige, // nicht zerstoerte Objekt! public: TYPEINFO(); - EditUndoDelContent( ImpEditEngine* pImpEE, ContentNode* pNode, USHORT nPortio ); + EditUndoDelContent( ImpEditEngine* pImpEE, ContentNode* pNode, sal_uInt16 nPortio ); ~EditUndoDelContent(); virtual void Undo(); @@ -67,8 +67,8 @@ public: class EditUndoConnectParas : public EditUndo { private: - USHORT nNode; - USHORT nSepPos; + sal_uInt16 nNode; + sal_uInt16 nSepPos; SfxItemSet aLeftParaAttribs; SfxItemSet aRightParaAttribs; @@ -78,13 +78,13 @@ private: SfxStyleFamily eLeftStyleFamily; SfxStyleFamily eRightStyleFamily; - BOOL bBackward; + sal_Bool bBackward; public: TYPEINFO(); - EditUndoConnectParas( ImpEditEngine* pImpEE, USHORT nNode, USHORT nSepPos, + EditUndoConnectParas( ImpEditEngine* pImpEE, sal_uInt16 nNode, sal_uInt16 nSepPos, const SfxItemSet& rLeftParaAttribs, const SfxItemSet& rRightParaAttribs, - const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, BOOL bBackward ); + const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, sal_Bool bBackward ); ~EditUndoConnectParas(); virtual void Undo(); @@ -97,12 +97,12 @@ public: class EditUndoSplitPara : public EditUndo { private: - USHORT nNode; - USHORT nSepPos; + sal_uInt16 nNode; + sal_uInt16 nSepPos; public: TYPEINFO(); - EditUndoSplitPara( ImpEditEngine* pImpEE, USHORT nNode, USHORT nSepPos ); + EditUndoSplitPara( ImpEditEngine* pImpEE, sal_uInt16 nNode, sal_uInt16 nSepPos ); ~EditUndoSplitPara(); virtual void Undo(); @@ -128,7 +128,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); }; // ----------------------------------------------------------------------- @@ -177,11 +177,11 @@ class EditUndoMoveParagraphs: public EditUndo { private: Range nParagraphs; - USHORT nDest; + sal_uInt16 nDest; public: TYPEINFO(); - EditUndoMoveParagraphs( ImpEditEngine* pImpEE, const Range& rParas, USHORT nDest ); + EditUndoMoveParagraphs( ImpEditEngine* pImpEE, const Range& rParas, sal_uInt16 nDest ); ~EditUndoMoveParagraphs(); virtual void Undo(); @@ -194,7 +194,7 @@ public: class EditUndoSetStyleSheet: public EditUndo { private: - USHORT nPara; + sal_uInt16 nPara; XubString aPrevName; XubString aNewName; SfxStyleFamily ePrevFamily; @@ -204,7 +204,7 @@ private: public: TYPEINFO(); - EditUndoSetStyleSheet( ImpEditEngine* pImpEE, USHORT nPara, + EditUndoSetStyleSheet( ImpEditEngine* pImpEE, sal_uInt16 nPara, const XubString& rPrevName, SfxStyleFamily ePrevFamily, const XubString& rNewName, SfxStyleFamily eNewFamily, const SfxItemSet& rPrevParaAttribs ); @@ -220,13 +220,13 @@ public: class EditUndoSetParaAttribs: public EditUndo { private: - USHORT nPara; + sal_uInt16 nPara; SfxItemSet aPrevItems; SfxItemSet aNewItems; public: TYPEINFO(); - EditUndoSetParaAttribs( ImpEditEngine* pImpEE, USHORT nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ); + EditUndoSetParaAttribs( ImpEditEngine* pImpEE, sal_uInt16 nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ); ~EditUndoSetParaAttribs(); virtual void Undo(); @@ -243,10 +243,10 @@ private: SfxItemSet aNewAttribs; ContentInfoArray aPrevAttribs; - BYTE nSpecial; - BOOL bSetIsRemove; - BOOL bRemoveParaAttribs; - USHORT nRemoveWhich; + sal_uInt8 nSpecial; + sal_Bool bSetIsRemove; + sal_Bool bRemoveParaAttribs; + sal_uInt16 nRemoveWhich; void ImpSetSelection( EditView* pView ); @@ -259,10 +259,10 @@ public: ContentInfoArray& GetContentInfos() { return aPrevAttribs; } SfxItemSet& GetNewAttribs() { return aNewAttribs; } - void SetSpecial( BYTE n ) { nSpecial = n; } - void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; } - void SetRemoveParaAttribs( BOOL b ) { bRemoveParaAttribs = b; } - void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; } + void SetSpecial( sal_uInt8 n ) { nSpecial = n; } + void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; } + void SetRemoveParaAttribs( sal_Bool b ) { bRemoveParaAttribs = b; } + void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; } virtual void Undo(); virtual void Redo(); diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index 851848c5ede0..3ed82ac367f1 100644 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -52,13 +52,13 @@ private: protected: virtual void SpellStart( SvxSpellArea eArea ); - virtual BOOL SpellContinue(); // Bereich pruefen - virtual void ReplaceAll( const String &rNewText, INT16 nLanguage ); + virtual sal_Bool SpellContinue(); // Bereich pruefen + virtual void ReplaceAll( const String &rNewText, sal_Int16 nLanguage ); virtual void SpellEnd(); - virtual BOOL SpellMore(); - virtual BOOL HasOtherCnt(); + virtual sal_Bool SpellMore(); + virtual sal_Bool HasOtherCnt(); virtual void ScrollArea(); - virtual void ChangeWord( const String& rNewWord, const USHORT nLang ); + virtual void ChangeWord( const String& rNewWord, const sal_uInt16 nLang ); virtual void ChangeThesWord( const String& rNewWord ); virtual void AutoCorrect( const String& rOldWord, const String& rNewWord ); @@ -66,18 +66,18 @@ public: EditSpellWrapper( Window* pWin, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xChecker, - BOOL bIsStart, - BOOL bIsAllRight, EditView* pView ); + sal_Bool bIsStart, + sal_Bool bIsAllRight, EditView* pView ); }; struct WrongRange { - USHORT nStart; - USHORT nEnd; + sal_uInt16 nStart; + sal_uInt16 nEnd; - WrongRange( USHORT nS, USHORT nE ) { nStart = nS; nEnd = nE; } + WrongRange( sal_uInt16 nS, sal_uInt16 nE ) { nStart = nS; nEnd = nE; } }; SV_DECL_VARARR( WrongRanges, WrongRange, 4, 4 ) @@ -86,41 +86,41 @@ SV_DECL_VARARR( WrongRanges, WrongRange, 4, 4 ) class WrongList : private WrongRanges { private: - USHORT nInvalidStart; - USHORT nInvalidEnd; + sal_uInt16 nInvalidStart; + sal_uInt16 nInvalidEnd; - BOOL DbgIsBuggy() const; + sal_Bool DbgIsBuggy() const; public: WrongList(); ~WrongList(); - BOOL IsInvalid() const { return nInvalidStart != NOT_INVALID; } + sal_Bool IsInvalid() const { return nInvalidStart != NOT_INVALID; } void SetValid() { nInvalidStart = NOT_INVALID; nInvalidEnd = 0; } - void MarkInvalid( USHORT nS, USHORT nE ); + void MarkInvalid( sal_uInt16 nS, sal_uInt16 nE ); - USHORT Count() const { return WrongRanges::Count(); } + sal_uInt16 Count() const { return WrongRanges::Count(); } // Wenn man weiss was man tut: - WrongRange& GetObject( USHORT n ) const { return WrongRanges::GetObject( n ); } - void InsertWrong( const WrongRange& rWrong, USHORT nPos ); + WrongRange& GetObject( sal_uInt16 n ) const { return WrongRanges::GetObject( n ); } + void InsertWrong( const WrongRange& rWrong, sal_uInt16 nPos ); - USHORT GetInvalidStart() const { return nInvalidStart; } - USHORT& GetInvalidStart() { return nInvalidStart; } + sal_uInt16 GetInvalidStart() const { return nInvalidStart; } + sal_uInt16& GetInvalidStart() { return nInvalidStart; } - USHORT GetInvalidEnd() const { return nInvalidEnd; } - USHORT& GetInvalidEnd() { return nInvalidEnd; } + sal_uInt16 GetInvalidEnd() const { return nInvalidEnd; } + sal_uInt16& GetInvalidEnd() { return nInvalidEnd; } - void TextInserted( USHORT nPos, USHORT nChars, BOOL bPosIsSep ); - void TextDeleted( USHORT nPos, USHORT nChars ); + void TextInserted( sal_uInt16 nPos, sal_uInt16 nChars, sal_Bool bPosIsSep ); + void TextDeleted( sal_uInt16 nPos, sal_uInt16 nChars ); void ResetRanges() { Remove( 0, Count() ); } - BOOL HasWrongs() const { return Count() != 0; } - void InsertWrong( USHORT nStart, USHORT nEnd, BOOL bClearRange ); - BOOL NextWrong( USHORT& rnStart, USHORT& rnEnd ) const; - BOOL HasWrong( USHORT nStart, USHORT nEnd ) const; - BOOL HasAnyWrong( USHORT nStart, USHORT nEnd ) const; - void ClearWrongs( USHORT nStart, USHORT nEnd, const ContentNode* pNode ); + sal_Bool HasWrongs() const { return Count() != 0; } + void InsertWrong( sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bClearRange ); + sal_Bool NextWrong( sal_uInt16& rnStart, sal_uInt16& rnEnd ) const; + sal_Bool HasWrong( sal_uInt16 nStart, sal_uInt16 nEnd ) const; + sal_Bool HasAnyWrong( sal_uInt16 nStart, sal_uInt16 nEnd ) const; + void ClearWrongs( sal_uInt16 nStart, sal_uInt16 nEnd, const ContentNode* pNode ); void MarkWrongsInvalid(); WrongList* Clone() const; @@ -129,7 +129,7 @@ public: bool operator==(const WrongList& rCompare) const; }; -inline void WrongList::InsertWrong( const WrongRange& rWrong, USHORT nPos ) +inline void WrongList::InsertWrong( const WrongRange& rWrong, sal_uInt16 nPos ) { WrongRanges::Insert( rWrong, nPos ); #ifdef DBG_UTIL @@ -143,35 +143,35 @@ class EdtAutoCorrDoc : public SvxAutoCorrDoc { ImpEditEngine* pImpEE; ContentNode* pCurNode; - USHORT nCursor; + sal_uInt16 nCursor; - BOOL bAllowUndoAction; - BOOL bUndoAction; + sal_Bool bAllowUndoAction; + sal_Bool bUndoAction; protected: void ImplStartUndoAction(); public: - EdtAutoCorrDoc( ImpEditEngine* pImpEE, ContentNode* pCurNode, USHORT nCrsr, xub_Unicode cIns ); + EdtAutoCorrDoc( ImpEditEngine* pImpEE, ContentNode* pCurNode, sal_uInt16 nCrsr, xub_Unicode cIns ); ~EdtAutoCorrDoc(); - virtual BOOL Delete( USHORT nStt, USHORT nEnd ); - virtual BOOL Insert( USHORT nPos, const String& rTxt ); - virtual BOOL Replace( USHORT nPos, const String& rTxt ); + virtual sal_Bool Delete( sal_uInt16 nStt, sal_uInt16 nEnd ); + virtual sal_Bool Insert( sal_uInt16 nPos, const String& rTxt ); + virtual sal_Bool Replace( sal_uInt16 nPos, const String& rTxt ); - virtual BOOL SetAttr( USHORT nStt, USHORT nEnd, USHORT nSlotId, SfxPoolItem& ); - virtual BOOL SetINetAttr( USHORT nStt, USHORT nEnd, const String& rURL ); + virtual sal_Bool SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ); + virtual sal_Bool SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL ); - virtual BOOL HasSymbolChars( USHORT nStt, USHORT nEnd ); + virtual sal_Bool HasSymbolChars( sal_uInt16 nStt, sal_uInt16 nEnd ); - virtual const String* GetPrevPara( BOOL bAtNormalPos ); + virtual const String* GetPrevPara( sal_Bool bAtNormalPos ); - virtual BOOL ChgAutoCorrWord( USHORT& rSttPos, USHORT nEndPos, + virtual sal_Bool ChgAutoCorrWord( sal_uInt16& rSttPos, sal_uInt16 nEndPos, SvxAutoCorrect& rACorrect, const String** ppPara ); - virtual LanguageType GetLanguage( USHORT nPos, BOOL bPrevPara = FALSE ) const; + virtual LanguageType GetLanguage( sal_uInt16 nPos, sal_Bool bPrevPara = sal_False ) const; - USHORT GetCursor() const { return nCursor; } + sal_uInt16 GetCursor() const { return nCursor; } }; diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index c8f5e2948665..8cb411ad054d 100755 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -120,7 +120,7 @@ struct DragAndDropInfo sal_uInt16 nCursorWidth; ESelection aBeginDragSel; EditPaM aDropDest; - USHORT nOutlinerDropDest; + sal_uInt16 nOutlinerDropDest; ESelection aDropSel; VirtualDevice* pBackground; const SvxFieldItem* pField; @@ -236,7 +236,7 @@ private: long nInvMore; - ULONG nControl; + sal_uInt32 nControl; sal_uInt32 nTravelXPos; sal_uInt16 nExtraCursorFlags; sal_uInt16 nCursorBidiLevel; @@ -287,13 +287,13 @@ public: void ResetOutputArea( const Rectangle& rRec ); const Rectangle& GetOutputArea() const { return aOutArea; } - BOOL IsVertical() const; + sal_Bool IsVertical() const; - BOOL PostKeyEvent( const KeyEvent& rKeyEvent ); + sal_Bool PostKeyEvent( const KeyEvent& rKeyEvent ); - BOOL MouseButtonUp( const MouseEvent& rMouseEvent ); - BOOL MouseButtonDown( const MouseEvent& rMouseEvent ); - BOOL MouseMove( const MouseEvent& rMouseEvent ); + sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent ); + sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent ); + sal_Bool MouseMove( const MouseEvent& rMouseEvent ); void Command( const CommandEvent& rCEvt ); void CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bCut ); @@ -330,7 +330,7 @@ public: void AddDragAndDropListeners(); void RemoveDragAndDropListeners(); - BOOL IsBulletArea( const Point& rPos, sal_uInt16* pPara ); + sal_Bool IsBulletArea( const Point& rPos, sal_uInt16* pPara ); // Fuer die SelectionEngine... void CreateAnchor(); @@ -345,9 +345,9 @@ public: void CalcAnchorPoint(); void RecalcOutputArea(); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, BOOL test ); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, USHORT nShowCursorFlags = 0 ); - Pair Scroll( long ndX, long ndY, BYTE nRangeCheck = RGCHK_NEG ); + void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool test ); + void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_uInt16 nShowCursorFlags = 0 ); + Pair Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck = RGCHK_NEG ); void SetInsertMode( sal_Bool bInsert ); sal_Bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); } @@ -453,9 +453,9 @@ private: sal_uInt16 nStretchX; sal_uInt16 nStretchY; - USHORT nAsianCompressionMode; - BOOL bKernAsianPunctuation; - BOOL bAddExtLeading; + sal_uInt16 nAsianCompressionMode; + sal_Bool bKernAsianPunctuation; + sal_Bool bAddExtLeading; EEHorizontalTextDirection eDefaultHorizontalTextDirection; @@ -538,14 +538,14 @@ private: EditPaM GetPaM( Point aDocPos, sal_Bool bSmart = sal_True ); EditPaM GetPaM( ParaPortion* pPortion, Point aPos, sal_Bool bSmart = sal_True ); - long GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT nIndex, BOOL bPreferPortionStart = FALSE ); - long GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLine, USHORT nTextPortion ); - USHORT GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nX, BOOL bSmart = TRUE ); + long GetXPos( ParaPortion* pParaPortion, EditLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart = sal_False ); + long GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLine, sal_uInt16 nTextPortion ); + sal_uInt16 GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nX, sal_Bool bSmart = sal_True ); Range GetInvalidYOffsets( ParaPortion* pPortion ); Range GetLineXPosStartEnd( ParaPortion* pParaPortion, EditLine* pLine ); - void SetParaAttrib( BYTE nFunc, EditSelection aSel, sal_uInt16 nValue ); - sal_uInt16 GetParaAttrib( BYTE nFunc, EditSelection aSel ); + void SetParaAttrib( sal_uInt8 nFunc, EditSelection aSel, sal_uInt16 nValue ); + sal_uInt16 GetParaAttrib( sal_uInt8 nFunc, EditSelection aSel ); void SetCharAttrib( EditSelection aSel, const SfxPoolItem& rItem ); void ParaAttribsToCharAttribs( ContentNode* pNode ); void GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const; @@ -553,12 +553,12 @@ private: EditTextObject* CreateBinTextObject( EditSelection aSelection, SfxItemPool*, sal_Bool bAllowBigObjects = sal_False, sal_uInt16 nBigObjStart = 0 ) const; void StoreBinTextObject( SvStream& rOStream, BinTextObject& rTextObject ); EditSelection InsertBinTextObject( BinTextObject&, EditPaM aPaM ); - EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const String& rBaseURL, const EditPaM& rPaM, BOOL bUseSpecial ); + EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const String& rBaseURL, const EditPaM& rPaM, sal_Bool bUseSpecial ); EditPaM Clear(); EditPaM RemoveText(); EditPaM RemoveText( EditSelection aEditSelection ); - sal_Bool CreateLines( USHORT nPara, sal_uInt32 nStartPosY ); + sal_Bool CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ); void CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uInt32 nStartPosY ); sal_Bool FinishCreateLines( ParaPortion* pParaPortion ); void CalcCharPositions( ParaPortion* pParaPortion ); @@ -586,9 +586,9 @@ private: sal_Bool ImpCheckRefMapMode(); - BOOL ImplHasText() const; + sal_Bool ImplHasText() const; - void ImpFindKashidas( ContentNode* pNode, USHORT nStart, USHORT nEnd, SvUShorts& rArray ); + void ImpFindKashidas( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, SvUShorts& rArray ); void InsertContent( ContentNode* pNode, sal_uInt16 nPos ); EditPaM SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos ); @@ -601,8 +601,8 @@ private: EditPaM PageDown( const EditPaM& rPaM, EditView* pView); EditPaM CursorUp( const EditPaM& rPaM, EditView* pEditView ); EditPaM CursorDown( const EditPaM& rPaM, EditView* pEditView ); - EditPaM CursorLeft( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); - EditPaM CursorRight( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); + EditPaM CursorLeft( const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); + EditPaM CursorRight( const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); EditPaM CursorStartOfLine( const EditPaM& rPaM ); EditPaM CursorEndOfLine( const EditPaM& rPaM ); EditPaM CursorStartOfParagraph( const EditPaM& rPaM ); @@ -613,22 +613,22 @@ private: EditPaM WordRight( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); EditPaM StartOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); EditPaM EndOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, BOOL bAcceptStartOfWord = TRUE ); + EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_Bool bAcceptStartOfWord = sal_True ); EditSelection SelectSentence( const EditSelection& rCurSel ); - EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, USHORT nCharacterIteratorMode, BOOL bToLeft ); - EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, BOOL bStart ); + EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, sal_Bool bToLeft ); + EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, sal_Bool bStart ); - void InitScriptTypes( USHORT nPara ); - USHORT GetScriptType( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; - USHORT GetScriptType( const EditSelection& rSel ) const; - BOOL IsScriptChange( const EditPaM& rPaM ) const; - BOOL HasScriptType( USHORT nPara, USHORT nType ) const; + void InitScriptTypes( sal_uInt16 nPara ); + sal_uInt16 GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos = NULL ) const; + sal_uInt16 GetScriptType( const EditSelection& rSel ) const; + sal_Bool IsScriptChange( const EditPaM& rPaM ) const; + sal_Bool HasScriptType( sal_uInt16 nPara, sal_uInt16 nType ) const; - BOOL ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, USHORT nStartPos, sal_Int32* pDXArray, USHORT n100thPercentFromMax, BOOL bManipulateDXArray ); + sal_Bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_uInt16 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, sal_Bool bManipulateDXArray ); void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth ); - void ImplInitLayoutMode( OutputDevice* pOutDev, USHORT nPara, USHORT nIndex ); + void ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, sal_uInt16 nIndex ); void ImplInitDigitMode( OutputDevice* pOutDev, String* pString, xub_StrLen nStt, xub_StrLen nLen, LanguageType eLang ); EditPaM ReadText( SvStream& rInput, EditSelection aSel ); @@ -640,7 +640,7 @@ private: sal_uInt32 WriteRTF( SvStream& rOutput, EditSelection aSel ); sal_uInt32 WriteXML( SvStream& rOutput, EditSelection aSel ); sal_uInt32 WriteHTML( SvStream& rOutput, EditSelection aSel ); - sal_uInt32 WriteBin( SvStream& rOutput, EditSelection aSel, BOOL bStoreUnicode = FALSE ) const; + sal_uInt32 WriteBin( SvStream& rOutput, EditSelection aSel, sal_Bool bStoreUnicode = sal_False ) const; void WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos, SvxFontTable& rFontTable, SvxColorList& rColorList ); @@ -665,12 +665,12 @@ private: Color GetBackgroundColor() const { return maBackgroundColor; } Color GetAutoColor() const; - void EnableAutoColor( BOOL b ) { bUseAutoColor = b; } - BOOL IsAutoColorEnabled() const { return bUseAutoColor; } - void ForceAutoColor( BOOL b ) { bForceAutoColor = b; } - BOOL IsForceAutoColor() const { return bForceAutoColor; } + void EnableAutoColor( sal_Bool b ) { bUseAutoColor = b; } + sal_Bool IsAutoColorEnabled() const { return bUseAutoColor; } + void ForceAutoColor( sal_Bool b ) { bForceAutoColor = b; } + sal_Bool IsForceAutoColor() const { return bForceAutoColor; } - inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, ULONG nDrawMode ); + inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, sal_uInt32 nDrawMode ); inline void EraseVirtualDevice(); DECL_LINK( StatusTimerHdl, Timer * ); @@ -697,7 +697,7 @@ private: the output string at hand. This is necessary for slideshow text effects. */ - void ImplFillTextMarkingVector(const ::com::sun::star::lang::Locale& rLocale, EEngineData::TextMarkingVector& rTextMarkingVector, const String& rTxt, const USHORT nIdx, const USHORT nLen) const; + void ImplFillTextMarkingVector(const ::com::sun::star::lang::Locale& rLocale, EEngineData::TextMarkingVector& rTextMarkingVector, const String& rTxt, const sal_uInt16 nIdx, const sal_uInt16 nLen) const; SpellInfo * CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs ); @@ -708,7 +708,7 @@ public: ImpEditEngine( EditEngine* pEditEngine, SfxItemPool* pPool ); ~ImpEditEngine(); - void InitDoc( BOOL bKeepParaAttribs ); + void InitDoc( sal_Bool bKeepParaAttribs ); EditDoc& GetEditDoc() { return aEditDoc; } const EditDoc& GetEditDoc() const { return aEditDoc; } @@ -724,20 +724,20 @@ public: const Size& GetPaperSize() const { return aPaperSize; } void SetPaperSize( const Size& rSz ) { aPaperSize = rSz; } - void SetVertical( BOOL bVertical ); - BOOL IsVertical() const { return GetEditDoc().IsVertical(); } + void SetVertical( sal_Bool bVertical ); + sal_Bool IsVertical() const { return GetEditDoc().IsVertical(); } - void SetFixedCellHeight( BOOL bUseFixedCellHeight ); - BOOL IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } + void SetFixedCellHeight( sal_Bool bUseFixedCellHeight ); + sal_Bool IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ) { eDefaultHorizontalTextDirection = eHTextDir; } EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return eDefaultHorizontalTextDirection; } - void InitWritingDirections( USHORT nPara ); - BOOL IsRightToLeft( USHORT nPara ) const; - BYTE GetRightToLeft( USHORT nPara, USHORT nChar, USHORT* pStart = NULL, USHORT* pEnd = NULL ); - BOOL HasDifferentRTLLevels( const ContentNode* pNode ); + void InitWritingDirections( sal_uInt16 nPara ); + sal_Bool IsRightToLeft( sal_uInt16 nPara ) const; + sal_uInt8 GetRightToLeft( sal_uInt16 nPara, sal_uInt16 nChar, sal_uInt16* pStart = NULL, sal_uInt16* pEnd = NULL ); + sal_Bool HasDifferentRTLLevels( const ContentNode* pNode ); void SetTextRanger( TextRanger* pRanger ); TextRanger* GetTextRanger() const { return pTextRanger; } @@ -782,7 +782,7 @@ public: EditPaM InsertText( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite, sal_Bool bIsUserInput = sal_False ); EditPaM InsertText( EditSelection aCurEditSelection, const String& rStr ); EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite ); - EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, BYTE nMode, BYTE nDelMode = DELMODE_SIMPLE ); + EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, sal_uInt8 nMode, sal_uInt8 nDelMode = DELMODE_SIMPLE ); EditPaM InsertParaBreak( EditSelection aEditSelection ); EditPaM InsertLineBreak( EditSelection aEditSelection ); EditPaM InsertTab( EditSelection aEditSelection ); @@ -803,18 +803,18 @@ public: sal_uInt32 CalcTextHeight(); sal_uInt32 GetTextHeight() const; - sal_uInt32 CalcTextWidth( BOOL bIgnoreExtraSpace ); - sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace ); + sal_uInt32 CalcTextWidth( sal_Bool bIgnoreExtraSpace ); + sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_Bool bIgnoreExtraSpace ); sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const; sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const; - void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; - USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; + void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const; + sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const; sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ); sal_uInt32 GetParaHeight( sal_uInt16 nParagraph ); - SfxItemSet GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal_uInt8 nFlags = 0xFF ) const; - SfxItemSet GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib = FALSE ); - void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE nSpecial = 0 ); + SfxItemSet GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags = 0xFF ) const; + SfxItemSet GetAttribs( EditSelection aSel, sal_Bool bOnlyHardAttrib = sal_False ); + void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0 ); void RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich = 0 ); void RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0, sal_Bool bRemoveFeatures = sal_False ); void SetFlatMode( sal_Bool bFlat ); @@ -859,8 +859,8 @@ public: inline void IdleFormatAndUpdate( EditView* pCurView = 0 ); svtools::ColorConfig& GetColorConfig(); - BOOL IsVisualCursorTravelingEnabled(); - BOOL DoVisualCursorTraveling( const ContentNode* pNode ); + sal_Bool IsVisualCursorTravelingEnabled(); + sal_Bool DoVisualCursorTraveling( const ContentNode* pNode ); EditSelection ConvertSelection( sal_uInt16 nStartPara, sal_uInt16 nStartPos, sal_uInt16 nEndPara, sal_uInt16 nEndPos ) const; inline EPaM CreateEPaM( const EditPaM& rPaM ); @@ -922,7 +922,7 @@ public: LanguageType GetLanguage( const EditSelection rSelection ) const; - LanguageType GetLanguage( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; + LanguageType GetLanguage( const EditPaM& rPaM, sal_uInt16* pEndPos = NULL ) const; ::com::sun::star::lang::Locale GetLocale( const EditPaM& rPaM ) const; void DoOnlineSpelling( ContentNode* pThisNodeOnly = 0, sal_Bool bSpellAtCursorPos = sal_False, sal_Bool bInteruptable = sal_True ); @@ -934,14 +934,14 @@ public: ImpSpell( EditView* pEditView ); // text conversion functions - void Convert( EditView* pEditView, LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, INT32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ); + void Convert( EditView* pEditView, LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ); void ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtLang, EditView* pEditView, LanguageType nSrcLang, const ESelection &rConvRange, sal_Bool bAllowImplicitChangesForNotConvertibleText, LanguageType nTargetLang, const Font *pTargetFont ); ConvInfo * GetConvInfo() const { return pConvInfo; } sal_Bool HasConvertibleTextPortion( LanguageType nLang ); void SetLanguageAndFont( const ESelection &rESel, - LanguageType nLang, USHORT nLangWhichId, - const Font *pFont, USHORT nFontWhichId ); + LanguageType nLang, sal_uInt16 nLangWhichId, + const Font *pFont, sal_uInt16 nFontWhichId ); // returns true if input sequence checking should be applied sal_Bool IsInputSequenceCheckingRequired( sal_Unicode nChar, const EditSelection& rCurSel ) const; @@ -985,7 +985,7 @@ public: sal_Int32 GetSpaceBeforeAndMinLabelWidth( const ContentNode *pNode, sal_Int32 *pnSpaceBefore = 0, sal_Int32 *pnMinLabelWidth = 0 ) const; const SvxLRSpaceItem& GetLRSpaceItem( ContentNode* pNode ); - SvxAdjust GetJustification( USHORT nPara ) const; + SvxAdjust GetJustification( sal_uInt16 nPara ) const; void SetCharStretching( sal_uInt16 nX, sal_uInt16 nY ); inline void GetCharStretching( sal_uInt16& rX, sal_uInt16& rY ); @@ -1003,22 +1003,22 @@ public: void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow ); EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ); - short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets ); + short ReplaceTextOnly( ContentNode* pNode, sal_uInt16 nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets ); - void SetAsianCompressionMode( USHORT n ); - USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; } + void SetAsianCompressionMode( sal_uInt16 n ); + sal_uInt16 GetAsianCompressionMode() const { return nAsianCompressionMode; } - void SetKernAsianPunctuation( BOOL b ); - BOOL IsKernAsianPunctuation() const { return bKernAsianPunctuation; } + void SetKernAsianPunctuation( sal_Bool b ); + sal_Bool IsKernAsianPunctuation() const { return bKernAsianPunctuation; } - void SetAddExtLeading( BOOL b ); - BOOL IsAddExtLeading() const { return bAddExtLeading; } + void SetAddExtLeading( sal_Bool b ); + sal_Bool IsAddExtLeading() const { return bAddExtLeading; } - vos::ORef<SvxForbiddenCharactersTable> GetForbiddenCharsTable( BOOL bGetInternal = TRUE ) const; + vos::ORef<SvxForbiddenCharactersTable> GetForbiddenCharsTable( sal_Bool bGetInternal = sal_True ) const; void SetForbiddenCharsTable( vos::ORef<SvxForbiddenCharactersTable> xForbiddenChars ); - BOOL mbLastTryMerge; + sal_Bool mbLastTryMerge; /** sets a link that is called at the beginning of a drag operation at an edit view */ void SetBeginDropHdl( const Link& rLink ) { maBeginDropHdl = rLink; } @@ -1029,8 +1029,8 @@ public: Link GetEndDropHdl() const { return maEndDropHdl; } /// specifies if auto-correction should capitalize the first word or not (default is on) - void SetFirstWordCapitalization( BOOL bCapitalize ) { bFirstWordCapitalization = bCapitalize; } - BOOL IsFirstWordCapitalization() const { return bFirstWordCapitalization; } + void SetFirstWordCapitalization( sal_Bool bCapitalize ) { bFirstWordCapitalization = bCapitalize; } + sal_Bool IsFirstWordCapitalization() const { return bFirstWordCapitalization; } }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) @@ -1071,7 +1071,7 @@ inline EditSelection ImpEditEngine::CreateSel( const ESelection& rSel ) return aSel; } -inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode& rMapMode, ULONG nDrawMode ) +inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode& rMapMode, sal_uInt32 nDrawMode ) { if ( !pVirtDev ) pVirtDev = new VirtualDevice; @@ -1206,7 +1206,7 @@ inline Cursor* ImpEditView::GetCursor() void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit ); void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const MapUnit* pSourceUnit = NULL, const MapUnit* pDestUnit = NULL ); -BYTE GetCharTypeForCompression( xub_Unicode cChar ); +sal_uInt8 GetCharTypeForCompression( xub_Unicode cChar ); Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin ); #endif // _IMPEDIT_HXX diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index e46a40f09e02..b92284eb60bf 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -62,7 +62,7 @@ TextConvWrapper::TextConvWrapper( Window* pWindow, const Font* pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive, - BOOL bIsStart, + sal_Bool bIsStart, EditView* pView ) : HangulHanjaConversion( pWindow, rxMSF, rSourceLocale, rTargetLocale, pTargetFont, nOptions, bIsInteractive ) { @@ -286,8 +286,8 @@ sal_Bool TextConvWrapper::ConvContinue_impl() void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel, - LanguageType nLang, USHORT nLangWhichId, - const Font *pFont, USHORT nFontWhichId ) + LanguageType nLang, sal_uInt16 nLangWhichId, + const Font *pFont, sal_uInt16 nFontWhichId ) { ESelection aOldSel = pEditView->GetSelection(); pEditView->SetSelection( rESel ); @@ -321,7 +321,7 @@ void TextConvWrapper::SelectNewUnit_impl( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ) { - BOOL bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; + sal_Bool bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; DBG_ASSERT( bOK, "invalid arguments" ); if (!bOK) return; @@ -329,8 +329,8 @@ void TextConvWrapper::SelectNewUnit_impl( ESelection aSelection = pEditView->GetSelection(); DBG_ASSERT( aSelection.nStartPara == aSelection.nEndPara, "paragraph mismatch in selection" ); - aSelection.nStartPos = (USHORT) (nLastPos + nUnitOffset + nUnitStart); - aSelection.nEndPos = (USHORT) (nLastPos + nUnitOffset + nUnitEnd); + aSelection.nStartPos = (sal_uInt16) (nLastPos + nUnitOffset + nUnitStart); + aSelection.nEndPos = (sal_uInt16) (nLastPos + nUnitOffset + nUnitEnd); pEditView->SetSelection( aSelection ); } @@ -372,7 +372,7 @@ void TextConvWrapper::ReplaceUnit( ReplacementAction eAction, LanguageType *pNewUnitLanguage ) { - BOOL bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; + sal_Bool bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; DBG_ASSERT( bOK, "invalid arguments" ); if (!bOK) return; @@ -405,7 +405,7 @@ void TextConvWrapper::ReplaceUnit( default: DBG_ERROR( "unexpected case" ); } - nUnitOffset = sal::static_int_cast< USHORT >( + nUnitOffset = sal::static_int_cast< sal_uInt16 >( nUnitOffset + nUnitStart + aNewTxt.getLength()); // remember current original language for kater use @@ -459,13 +459,13 @@ void TextConvWrapper::ReplaceUnit( { // Note: replacement is always done in the current paragraph // which is the one ConvContinue points to - pConvInfo->aConvContinue.nIndex = sal::static_int_cast< USHORT >( + pConvInfo->aConvContinue.nIndex = sal::static_int_cast< sal_uInt16 >( pConvInfo->aConvContinue.nIndex + nDelta); // if that is the same as the one where the conversions ends // the end needs to be updated also if (pConvInfo->aConvTo.nPara == pConvInfo->aConvContinue.nPara) - pConvInfo->aConvTo.nIndex = sal::static_int_cast< USHORT >( + pConvInfo->aConvTo.nIndex = sal::static_int_cast< sal_uInt16 >( pConvInfo->aConvTo.nIndex + nDelta); } } diff --git a/editeng/source/editeng/textconv.hxx b/editeng/source/editeng/textconv.hxx index 8ffc00291fe9..89cc0484b73f 100644 --- a/editeng/source/editeng/textconv.hxx +++ b/editeng/source/editeng/textconv.hxx @@ -41,8 +41,8 @@ class TextConvWrapper : public editeng::HangulHanjaConversion { rtl::OUString aConvText; // convertible text part found last time LanguageType nConvTextLang; // language of aConvText - USHORT nLastPos; // starting position of the last found text portion (word) - USHORT nUnitOffset; // offset of current unit in the current text portion (word) + sal_uInt16 nLastPos; // starting position of the last found text portion (word) + sal_uInt16 nUnitOffset; // offset of current unit in the current text portion (word) ESelection aConvSel; // selection to be converted if // 'HasRange' is true, other conversion @@ -99,8 +99,8 @@ protected: virtual sal_Bool HasRubySupport() const; void SetLanguageAndFont( const ESelection &rESel, - LanguageType nLang, USHORT nLangWhichId, - const Font *pFont, USHORT nFontWhichId ); + LanguageType nLang, sal_uInt16 nLangWhichId, + const Font *pFont, sal_uInt16 nFontWhichId ); public: @@ -109,9 +109,9 @@ public: const ::com::sun::star::lang::Locale& rSourceLocale, const ::com::sun::star::lang::Locale& rTargetLocale, const Font* pTargetFont, - INT32 nOptions, + sal_Int32 nOptions, sal_Bool bIsInteractive, - BOOL bIsStart, EditView* pView ); + sal_Bool bIsStart, EditView* pView ); virtual ~TextConvWrapper(); |