diff options
Diffstat (limited to 'editeng/source/editeng/editattr.cxx')
-rw-r--r-- | editeng/source/editeng/editattr.cxx | 126 |
1 files changed, 58 insertions, 68 deletions
diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 8f50b34373..59647d6a90 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,10 +96,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTINFO || rAttr.Which() == EE_CHAR_FONTINFO_CJK || rAttr.Which() == EE_CHAR_FONTINFO_CTL, "Not a Font attribute!" ); } void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) @@ -115,10 +115,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_ITALIC || rAttr.Which() == EE_CHAR_ITALIC_CJK || rAttr.Which() == EE_CHAR_ITALIC_CTL, "Not a Italic attribute!" ); } void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* ) @@ -129,10 +129,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_WEIGHT || rAttr.Which() == EE_CHAR_WEIGHT_CJK || rAttr.Which() == EE_CHAR_WEIGHT_CTL, "Not a Weight attribute!" ); } void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* ) @@ -143,10 +143,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_UNDERLINE, "Not a Underline attribute!" ); } void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) @@ -159,10 +159,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_OVERLINE, "Not a overline attribute!" ); } void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) @@ -175,25 +175,25 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTHEIGHT || rAttr.Which() == EE_CHAR_FONTHEIGHT_CJK || rAttr.Which() == EE_CHAR_FONTHEIGHT_CTL, "Not a Height attribute!" ); } void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* ) { - // Prop wird ignoriert + // Property is ignored rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem*)GetItem())->GetHeight() ) ); } // ------------------------------------------------------------------------- // 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTWIDTH, "Not a Width attribute!" ); } void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* ) @@ -204,10 +204,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Not a Size attribute!" ); } void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* ) @@ -218,10 +218,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_COLOR, "Not a Color attribute!" ); } void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* ) @@ -232,10 +232,10 @@ 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!" ); + DBG_ASSERT( ( rAttr.Which() == EE_CHAR_LANGUAGE ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CJK ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CTL ), "Not a Language attribute!" ); } void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* ) @@ -246,34 +246,30 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_SHADOW, "Not a Shadow attribute!" ); } 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Not a escapement attribute!" ); } -#if defined( WIN ) && !defined( WNT ) -#pragma optimize ("", off) -#endif - 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 ) @@ -283,32 +279,27 @@ void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) rFont.SetEscapement( nEsc ); } -#if defined( WIN ) && !defined( WNT ) -#pragma optimize ("", on) -#endif - - // ------------------------------------------------------------------------- // 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_OUTLINE, "Not a Outline attribute!" ); } 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* ) @@ -318,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* ) @@ -331,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; } @@ -344,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 ); @@ -354,8 +345,7 @@ EditCharAttribField::EditCharAttribField( const EditCharAttribField& rAttr ) : EditCharAttrib( *rAttr.GetItem(), rAttr.GetStart(), rAttr.GetEnd() ), aFieldValue( rAttr.aFieldValue ) { - // Diesen CCTOR nur fuer temporaeres Object verwenden, - // Item wird nicht gepoolt. + // Use this constructor only for temporary Objects, Item is not pooled. pTxtColor = rAttr.pTxtColor ? new Color( *rAttr.pTxtColor ) : 0; pFldColor = rAttr.pFldColor ? new Color( *rAttr.pFldColor ) : 0; } @@ -365,31 +355,31 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_PAIRKERNING, "Not a Pair Kerning!" ); } void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) @@ -400,10 +390,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_KERNING, "Not a Kerning!" ); } void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* ) @@ -414,10 +404,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_WLM, "Not a Kerning!" ); } void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* ) @@ -428,10 +418,10 @@ 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!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_EMPHASISMARK, "Not a Emphasis attribute!" ); } void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* ) @@ -442,7 +432,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!" ); |