diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-30 09:02:35 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-01 13:08:42 +0200 |
commit | 4923ac72aaca2f0671aed98de33902eac0810131 (patch) | |
tree | 999d46bfb45786d472e580ac0b24b667d9d56246 /editeng | |
parent | 787ca46d94cfcd6349f42954d6abbeed030a5398 (diff) |
loplugin: cstylecast
Change-Id: I58582059495f7c50880038e2174ea2de026aa1c9
Diffstat (limited to 'editeng')
38 files changed, 375 insertions, 366 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index b02d4b6068bb..5a37e12ddfa4 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1588,7 +1588,7 @@ namespace accessibility // NumberingLevel if (rRes.Name == "NumberingLevel") { - const SvxNumBulletItem& rNumBullet = ( SvxNumBulletItem& )rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET); + const SvxNumBulletItem& rNumBullet = static_cast<const SvxNumBulletItem&>(rCacheTF.GetParaAttribs(GetParagraphIndex()).Get(EE_PARA_NUMBULLET)); if(rNumBullet.GetNumRule()->GetLevelCount()==0) { rRes.Value <<= (sal_Int16)-1; @@ -1613,7 +1613,7 @@ namespace accessibility if (rRes.Name == "NumberingRules") { SfxItemSet aAttribs = rCacheTF.GetParaAttribs(GetParagraphIndex()); - bool bVis = ((const SfxUInt16Item&)aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() ? sal_True : sal_False; + bool bVis = static_cast<const SfxUInt16Item&>(aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() ? true : false; if(bVis) { rRes.Value <<= (sal_Int16)-1; diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 0f25267273a8..ac55335f0d17 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -81,7 +81,7 @@ EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 _nS void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) { - const SvxFontItem& rAttr = (const SvxFontItem&)(*GetItem()); + const SvxFontItem& rAttr = static_cast<const SvxFontItem&>(*GetItem()); rFont.SetName( rAttr.GetFamilyName() ); rFont.SetFamily( rAttr.GetFamily() ); @@ -100,7 +100,7 @@ EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uIn void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetItalic( ((const SvxPostureItem*)GetItem())->GetPosture() ); + rFont.SetItalic( static_cast<const SvxPostureItem*>(GetItem())->GetPosture() ); } @@ -114,7 +114,7 @@ EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetWeight( (FontWeight)((const SvxWeightItem*)GetItem())->GetValue() ); + rFont.SetWeight( (FontWeight)static_cast<const SvxWeightItem*>(GetItem())->GetValue() ); } @@ -128,10 +128,10 @@ EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) { - rFont.SetUnderline( (FontUnderline)((const SvxUnderlineItem*)GetItem())->GetValue() ); + rFont.SetUnderline( (FontUnderline)static_cast<const SvxUnderlineItem*>(GetItem())->GetValue() ); if ( pOutDev ) - pOutDev->SetTextLineColor( ((const SvxUnderlineItem*)GetItem())->GetColor() ); + pOutDev->SetTextLineColor( static_cast<const SvxUnderlineItem*>(GetItem())->GetColor() ); } @@ -146,9 +146,9 @@ EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, sa void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) { - rFont.SetOverline( (FontUnderline)((const SvxOverlineItem*)GetItem())->GetValue() ); + rFont.SetOverline( (FontUnderline)static_cast<const SvxOverlineItem*>(GetItem())->GetValue() ); if ( pOutDev ) - pOutDev->SetOverlineColor( ((const SvxOverlineItem*)GetItem())->GetColor() ); + pOutDev->SetOverlineColor( static_cast<const SvxOverlineItem*>(GetItem())->GetColor() ); } @@ -163,7 +163,7 @@ EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAt void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* ) { // Property is ignored - rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem*)GetItem())->GetHeight() ) ); + rFont.SetSize( Size( rFont.GetSize().Width(), static_cast<const SvxFontHeightItem*>(GetItem())->GetHeight() ) ); } @@ -191,7 +191,7 @@ EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetStrikeout( (FontStrikeout)((const SvxCrossedOutItem*)GetItem())->GetValue() ); + rFont.SetStrikeout( (FontStrikeout)static_cast<const SvxCrossedOutItem*>(GetItem())->GetValue() ); } @@ -205,7 +205,7 @@ EditCharAttribCaseMap::EditCharAttribCaseMap( const SvxCaseMapItem& rAttr, sal_u void EditCharAttribCaseMap::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetCaseMap( ((const SvxCaseMapItem*)GetItem())->GetCaseMap() ); + rFont.SetCaseMap( static_cast<const SvxCaseMapItem*>(GetItem())->GetCaseMap() ); } @@ -219,7 +219,7 @@ EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16 void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* ) { - Color aColor = ((const SvxColorItem*)GetItem())->GetValue(); + Color aColor = static_cast<const SvxColorItem*>(GetItem())->GetValue(); rFont.SetColor( aColor); //fprintf(stderr, "Called SetFont with Color %d\n", aColor.GetColor()); } @@ -237,7 +237,7 @@ EditCharAttribBackgroundColor::EditCharAttribBackgroundColor( void EditCharAttribBackgroundColor::SetFont( SvxFont& rFont, OutputDevice* ) { - Color aColor = ((const SvxBackgroundColorItem*)GetItem())->GetValue(); + Color aColor = static_cast<const SvxBackgroundColorItem*>(GetItem())->GetValue(); rFont.SetFillColor( aColor); rFont.SetTransparent(false); @@ -254,7 +254,7 @@ EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, sa void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetLanguage( ((const SvxLanguageItem*)GetItem())->GetLanguage() ); + rFont.SetLanguage( static_cast<const SvxLanguageItem*>(GetItem())->GetLanguage() ); } @@ -268,7 +268,7 @@ EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, sal_uI void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetShadow( ((const SvxShadowedItem*)GetItem())->GetValue() ); + rFont.SetShadow( static_cast<const SvxShadowedItem*>(GetItem())->GetValue() ); } @@ -282,10 +282,10 @@ EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAt void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) { - sal_uInt16 nProp = ((const SvxEscapementItem*)GetItem())->GetProp(); + sal_uInt16 nProp = static_cast<const SvxEscapementItem*>(GetItem())->GetProp(); rFont.SetPropr( (sal_uInt8)nProp ); - short nEsc = ((const SvxEscapementItem*)GetItem())->GetEsc(); + short nEsc = static_cast<const SvxEscapementItem*>(GetItem())->GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) nEsc = 100 - nProp; else if ( nEsc == DFLT_ESC_AUTO_SUB ) @@ -304,7 +304,7 @@ EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, sal_u void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetOutline( ((const SvxContourItem*)GetItem())->GetValue() ); + rFont.SetOutline( static_cast<const SvxContourItem*>(GetItem())->GetValue() ); } @@ -411,7 +411,7 @@ EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAt void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetKerning( ((const SvxAutoKernItem*)GetItem())->GetValue() ); + rFont.SetKerning( static_cast<const SvxAutoKernItem*>(GetItem())->GetValue() ); } @@ -425,7 +425,7 @@ EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, sal_u void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetFixKerning( ((const SvxKerningItem*)GetItem())->GetValue() ); + rFont.SetFixKerning( static_cast<const SvxKerningItem*>(GetItem())->GetValue() ); } @@ -439,7 +439,7 @@ EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeIte void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetWordLineMode( ((const SvxWordLineModeItem*)GetItem())->GetValue() ); + rFont.SetWordLineMode( static_cast<const SvxWordLineModeItem*>(GetItem())->GetValue() ); } @@ -453,7 +453,7 @@ EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkIte void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetEmphasisMark( ((const SvxEmphasisMarkItem*)GetItem())->GetEmphasisMark() ); + rFont.SetEmphasisMark( static_cast<const SvxEmphasisMarkItem*>(GetItem())->GetEmphasisMark() ); } @@ -467,7 +467,7 @@ EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_ void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetRelief( (FontRelief)((const SvxCharReliefItem*)GetItem())->GetValue() ); + rFont.SetRelief( (FontRelief)static_cast<const SvxCharReliefItem*>(GetItem())->GetValue() ); } // class EditCharAttribGrabBag diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index ba3d852dcf00..3db1715e7f5a 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -65,16 +65,16 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) { case EE_PARA_WRITINGDIR: aDebStr.append("WritingDir="); - aDebStr.append(static_cast<sal_Int32>(((SvxFrameDirectionItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxFrameDirectionItem&>(rItem).GetValue())); break; case EE_PARA_OUTLLRSPACE: case EE_PARA_LRSPACE: aDebStr.append("FI="); - aDebStr.append(static_cast<sal_Int32>(((SvxLRSpaceItem&)rItem).GetTxtFirstLineOfst())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLRSpaceItem&>(rItem).GetTxtFirstLineOfst())); aDebStr.append(", LI="); - aDebStr.append(static_cast<sal_Int32>(((SvxLRSpaceItem&)rItem).GetTxtLeft())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLRSpaceItem&>(rItem).GetTxtLeft())); aDebStr.append(", RI="); - aDebStr.append(static_cast<sal_Int32>(((SvxLRSpaceItem&)rItem).GetRight())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLRSpaceItem&>(rItem).GetRight())); break; case EE_PARA_NUMBULLET: aDebStr.append("NumItem "); @@ -83,7 +83,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) aDebStr.append("Level"); aDebStr.append(static_cast<sal_Int32>(nLevel)); aDebStr.append('='); - const SvxNumberFormat* pFmt = ((const SvxNumBulletItem&)rItem).GetNumRule()->Get( nLevel ); + const SvxNumberFormat* pFmt = static_cast<const SvxNumBulletItem&>(rItem).GetNumRule()->Get( nLevel ); if ( pFmt ) { aDebStr.append('('); @@ -107,45 +107,45 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) break; case EE_PARA_BULLETSTATE: aDebStr.append("ShowBullet="); - aDebStr.append(static_cast<sal_Int32>(((SfxBoolItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SfxBoolItem&>(rItem).GetValue())); break; case EE_PARA_HYPHENATE: aDebStr.append("Hyphenate="); - aDebStr.append(static_cast<sal_Int32>(((SfxBoolItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SfxBoolItem&>(rItem).GetValue())); break; case EE_PARA_OUTLLEVEL: aDebStr.append("Level="); - aDebStr.append(static_cast<sal_Int32>(((SfxInt16Item&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SfxInt16Item&>(rItem).GetValue())); break; case EE_PARA_ULSPACE: aDebStr.append("SB="); - aDebStr.append(static_cast<sal_Int32>(((SvxULSpaceItem&)rItem).GetUpper())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxULSpaceItem&>(rItem).GetUpper())); aDebStr.append(", SA="); - aDebStr.append(static_cast<sal_Int32>(((SvxULSpaceItem&)rItem).GetLower())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxULSpaceItem&>(rItem).GetLower())); break; case EE_PARA_SBL: aDebStr.append("SBL="); - if ( ((SvxLineSpacingItem&)rItem).GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) + if ( static_cast<const SvxLineSpacingItem&>(rItem).GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) { aDebStr.append("Min: "); - aDebStr.append(static_cast<sal_Int32>(((SvxLineSpacingItem&)rItem).GetInterLineSpace())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpace())); } - else if ( ((SvxLineSpacingItem&)rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) + else if ( static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) { aDebStr.append("Prop: "); - aDebStr.append(static_cast<sal_Int32>(((SvxLineSpacingItem&)rItem).GetPropLineSpace())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLineSpacingItem&>(rItem).GetPropLineSpace())); } else aDebStr.append("Unsupported Type!"); break; case EE_PARA_JUST: aDebStr.append("SvxAdust="); - aDebStr.append(static_cast<sal_Int32>(((SvxAdjustItem&)rItem).GetAdjust())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxAdjustItem&>(rItem).GetAdjust())); break; case EE_PARA_TABS: { aDebStr.append("Tabs: "); - const SvxTabStopItem& rTabs = (const SvxTabStopItem&) rItem; + const SvxTabStopItem& rTabs = static_cast<const SvxTabStopItem&>(rItem); aDebStr.append(static_cast<sal_Int32>(rTabs.Count())); if ( rTabs.Count() ) { @@ -164,12 +164,12 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) case EE_CHAR_LANGUAGE_CJK: case EE_CHAR_LANGUAGE_CTL: aDebStr.append("Language="); - aDebStr.append(static_cast<sal_Int32>(((SvxLanguageItem&)rItem).GetLanguage())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxLanguageItem&>(rItem).GetLanguage())); break; case EE_CHAR_COLOR: { aDebStr.append("Color= "); - Color aColor( ((SvxColorItem&)rItem).GetValue() ); + Color aColor( static_cast<const SvxColorItem&>(rItem).GetValue() ); aDebStr.append(static_cast<sal_Int32>(aColor.GetRed())); aDebStr.append(", "); aDebStr.append(static_cast<sal_Int32>(aColor.GetGreen())); @@ -180,7 +180,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) case EE_CHAR_BKGCOLOR: { aDebStr.append("FillColor= "); - Color aColor( ((SvxBackgroundColorItem&)rItem).GetValue() ); + Color aColor( static_cast<const SvxBackgroundColorItem&>(rItem).GetValue() ); aDebStr.append(static_cast<sal_Int32>(aColor.GetRed())); aDebStr.append(", "); aDebStr.append(static_cast<sal_Int32>(aColor.GetGreen())); @@ -193,9 +193,9 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) case EE_CHAR_FONTINFO_CTL: { aDebStr.append("Font="); - aDebStr.append(OUStringToOString(((SvxFontItem&)rItem).GetFamilyName(), RTL_TEXTENCODING_ASCII_US)); + aDebStr.append(OUStringToOString(static_cast<const SvxFontItem&>(rItem).GetFamilyName(), RTL_TEXTENCODING_ASCII_US)); aDebStr.append(" (CharSet: "); - aDebStr.append(static_cast<sal_Int32>(((SvxFontItem&)rItem).GetCharSet())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxFontItem&>(rItem).GetCharSet())); aDebStr.append(')'); } break; @@ -204,8 +204,8 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) case EE_CHAR_FONTHEIGHT_CTL: { aDebStr.append("Groesse="); - aDebStr.append(static_cast<sal_Int32>(((SvxFontHeightItem&)rItem).GetHeight())); - Size aSz( 0, ((SvxFontHeightItem&)rItem).GetHeight() ); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxFontHeightItem&>(rItem).GetHeight())); + Size aSz( 0, static_cast<const SvxFontHeightItem&>(rItem).GetHeight() ); SfxMapUnit eUnit = rPool.GetMetric( rItem.Which() ); MapMode aItemMapMode( (MapUnit) eUnit ); MapMode aPntMap( MAP_POINT ); @@ -217,7 +217,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) case EE_CHAR_FONTWIDTH: { aDebStr.append("Breite="); - aDebStr.append(static_cast<sal_Int32>(((SvxCharScaleWidthItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxCharScaleWidthItem&>(rItem).GetValue())); aDebStr.append('%'); } break; @@ -225,57 +225,57 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) case EE_CHAR_WEIGHT_CJK: case EE_CHAR_WEIGHT_CTL: aDebStr.append("FontWeight="); - aDebStr.append(static_cast<sal_Int32>(((SvxWeightItem&)rItem).GetWeight())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxWeightItem&>(rItem).GetWeight())); break; case EE_CHAR_UNDERLINE: aDebStr.append("FontUnderline="); - aDebStr.append(static_cast<sal_Int32>(((SvxUnderlineItem&)rItem).GetLineStyle())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxUnderlineItem&>(rItem).GetLineStyle())); break; case EE_CHAR_OVERLINE: aDebStr.append("FontOverline="); - aDebStr.append(static_cast<sal_Int32>(((SvxOverlineItem&)rItem).GetLineStyle())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxOverlineItem&>(rItem).GetLineStyle())); break; case EE_CHAR_EMPHASISMARK: aDebStr.append("FontUnderline="); - aDebStr.append(static_cast<sal_Int32>(((SvxEmphasisMarkItem&)rItem).GetEmphasisMark())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxEmphasisMarkItem&>(rItem).GetEmphasisMark())); break; case EE_CHAR_RELIEF: aDebStr.append("FontRelief="); - aDebStr.append(static_cast<sal_Int32>(((SvxCharReliefItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxCharReliefItem&>(rItem).GetValue())); break; case EE_CHAR_STRIKEOUT: aDebStr.append("FontStrikeout="); - aDebStr.append(static_cast<sal_Int32>(((SvxCrossedOutItem&)rItem).GetStrikeout())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxCrossedOutItem&>(rItem).GetStrikeout())); break; case EE_CHAR_ITALIC: case EE_CHAR_ITALIC_CJK: case EE_CHAR_ITALIC_CTL: aDebStr.append("FontPosture="); - aDebStr.append(static_cast<sal_Int32>(((SvxPostureItem&)rItem).GetPosture())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxPostureItem&>(rItem).GetPosture())); break; case EE_CHAR_OUTLINE: aDebStr.append("FontOutline="); - aDebStr.append(static_cast<sal_Int32>(((SvxContourItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxContourItem&>(rItem).GetValue())); break; case EE_CHAR_SHADOW: aDebStr.append("FontShadowed="); - aDebStr.append(static_cast<sal_Int32>(((SvxShadowedItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxShadowedItem&>(rItem).GetValue())); break; case EE_CHAR_ESCAPEMENT: aDebStr.append("Escape="); - aDebStr.append(static_cast<sal_Int32>(((SvxEscapementItem&)rItem).GetEsc())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxEscapementItem&>(rItem).GetEsc())); aDebStr.append(", "); - aDebStr.append(static_cast<sal_Int32>(((SvxEscapementItem&)rItem).GetProp())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxEscapementItem&>(rItem).GetProp())); break; case EE_CHAR_PAIRKERNING: aDebStr.append("PairKerning="); - aDebStr.append(static_cast<sal_Int32>(((SvxAutoKernItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxAutoKernItem&>(rItem).GetValue())); break; case EE_CHAR_KERNING: { aDebStr.append("Kerning="); - aDebStr.append(static_cast<sal_Int32>(((SvxKerningItem&)rItem).GetValue())); - Size aSz( 0, (short)((SvxKerningItem&)rItem).GetValue() ); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxKerningItem&>(rItem).GetValue())); + Size aSz( 0, (short)static_cast<const SvxKerningItem&>(rItem).GetValue() ); SfxMapUnit eUnit = rPool.GetMetric( rItem.Which() ); MapMode aItemMapMode( (MapUnit) eUnit ); MapMode aPntMap( MAP_POINT ); @@ -286,7 +286,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) break; case EE_CHAR_WLM: aDebStr.append("WordLineMode="); - aDebStr.append(static_cast<sal_Int32>(((SvxWordLineModeItem&)rItem).GetValue())); + aDebStr.append(static_cast<sal_Int32>(static_cast<const SvxWordLineModeItem&>(rItem).GetValue())); break; case EE_CHAR_XMLATTRIBS: aDebStr.append("XMLAttribs=..."); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 93dc00424cbe..53662aef04b5 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -28,6 +28,7 @@ #include <editeng/fontitem.hxx> #include <editeng/crossedoutitem.hxx> #include <editeng/fhgtitem.hxx> +#include <editeng/flditem.hxx> #include <editeng/postitem.hxx> #include <editeng/kernitem.hxx> #include <editeng/wrlmitem.hxx> @@ -58,6 +59,7 @@ #include <rtl/ustrbuf.hxx> +#include <svl/grabbagitem.hxx> #include <tools/stream.hxx> #include <tools/debug.hxx> #include <com/sun/star/i18n/ScriptType.hpp> @@ -277,100 +279,100 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sa case EE_CHAR_LANGUAGE_CJK: case EE_CHAR_LANGUAGE_CTL: { - pNew = new EditCharAttribLanguage( (const SvxLanguageItem&)rNew, nS, nE ); + pNew = new EditCharAttribLanguage( static_cast<const SvxLanguageItem&>(rNew), nS, nE ); } break; case EE_CHAR_COLOR: { - pNew = new EditCharAttribColor( (const SvxColorItem&)rNew, nS, nE ); + pNew = new EditCharAttribColor( static_cast<const SvxColorItem&>(rNew), nS, nE ); } break; case EE_CHAR_FONTINFO: case EE_CHAR_FONTINFO_CJK: case EE_CHAR_FONTINFO_CTL: { - pNew = new EditCharAttribFont( (const SvxFontItem&)rNew, nS, nE ); + pNew = new EditCharAttribFont( static_cast<const SvxFontItem&>(rNew), nS, nE ); } break; case EE_CHAR_FONTHEIGHT: case EE_CHAR_FONTHEIGHT_CJK: case EE_CHAR_FONTHEIGHT_CTL: { - pNew = new EditCharAttribFontHeight( (const SvxFontHeightItem&)rNew, nS, nE ); + pNew = new EditCharAttribFontHeight( static_cast<const SvxFontHeightItem&>(rNew), nS, nE ); } break; case EE_CHAR_FONTWIDTH: { - pNew = new EditCharAttribFontWidth( (const SvxCharScaleWidthItem&)rNew, nS, nE ); + pNew = new EditCharAttribFontWidth( static_cast<const SvxCharScaleWidthItem&>(rNew), nS, nE ); } break; case EE_CHAR_WEIGHT: case EE_CHAR_WEIGHT_CJK: case EE_CHAR_WEIGHT_CTL: { - pNew = new EditCharAttribWeight( (const SvxWeightItem&)rNew, nS, nE ); + pNew = new EditCharAttribWeight( static_cast<const SvxWeightItem&>(rNew), nS, nE ); } break; case EE_CHAR_UNDERLINE: { - pNew = new EditCharAttribUnderline( (const SvxUnderlineItem&)rNew, nS, nE ); + pNew = new EditCharAttribUnderline( static_cast<const SvxUnderlineItem&>(rNew), nS, nE ); } break; case EE_CHAR_OVERLINE: { - pNew = new EditCharAttribOverline( (const SvxOverlineItem&)rNew, nS, nE ); + pNew = new EditCharAttribOverline( static_cast<const SvxOverlineItem&>(rNew), nS, nE ); } break; case EE_CHAR_EMPHASISMARK: { - pNew = new EditCharAttribEmphasisMark( (const SvxEmphasisMarkItem&)rNew, nS, nE ); + pNew = new EditCharAttribEmphasisMark( static_cast<const SvxEmphasisMarkItem&>(rNew), nS, nE ); } break; case EE_CHAR_RELIEF: { - pNew = new EditCharAttribRelief( (const SvxCharReliefItem&)rNew, nS, nE ); + pNew = new EditCharAttribRelief( static_cast<const SvxCharReliefItem&>(rNew), nS, nE ); } break; case EE_CHAR_STRIKEOUT: { - pNew = new EditCharAttribStrikeout( (const SvxCrossedOutItem&)rNew, nS, nE ); + pNew = new EditCharAttribStrikeout( static_cast<const SvxCrossedOutItem&>(rNew), nS, nE ); } break; case EE_CHAR_ITALIC: case EE_CHAR_ITALIC_CJK: case EE_CHAR_ITALIC_CTL: { - pNew = new EditCharAttribItalic( (const SvxPostureItem&)rNew, nS, nE ); + pNew = new EditCharAttribItalic( static_cast<const SvxPostureItem&>(rNew), nS, nE ); } break; case EE_CHAR_OUTLINE: { - pNew = new EditCharAttribOutline( (const SvxContourItem&)rNew, nS, nE ); + pNew = new EditCharAttribOutline( static_cast<const SvxContourItem&>(rNew), nS, nE ); } break; case EE_CHAR_SHADOW: { - pNew = new EditCharAttribShadow( (const SvxShadowedItem&)rNew, nS, nE ); + pNew = new EditCharAttribShadow( static_cast<const SvxShadowedItem&>(rNew), nS, nE ); } break; case EE_CHAR_ESCAPEMENT: { - pNew = new EditCharAttribEscapement( (const SvxEscapementItem&)rNew, nS, nE ); + pNew = new EditCharAttribEscapement( static_cast<const SvxEscapementItem&>(rNew), nS, nE ); } break; case EE_CHAR_PAIRKERNING: { - pNew = new EditCharAttribPairKerning( (const SvxAutoKernItem&)rNew, nS, nE ); + pNew = new EditCharAttribPairKerning( static_cast<const SvxAutoKernItem&>(rNew), nS, nE ); } break; case EE_CHAR_KERNING: { - pNew = new EditCharAttribKerning( (const SvxKerningItem&)rNew, nS, nE ); + pNew = new EditCharAttribKerning( static_cast<const SvxKerningItem&>(rNew), nS, nE ); } break; case EE_CHAR_WLM: { - pNew = new EditCharAttribWordLineMode( (const SvxWordLineModeItem&)rNew, nS, nE ); + pNew = new EditCharAttribWordLineMode( static_cast<const SvxWordLineModeItem&>(rNew), nS, nE ); } break; case EE_CHAR_XMLATTRIBS: @@ -380,32 +382,32 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sa break; case EE_CHAR_CASEMAP: { - pNew = new EditCharAttribCaseMap( (const SvxCaseMapItem&)rNew, nS, nE ); + pNew = new EditCharAttribCaseMap( static_cast<const SvxCaseMapItem&>(rNew), nS, nE ); } break; case EE_CHAR_GRABBAG: { - pNew = new EditCharAttribGrabBag( (const SfxGrabBagItem&)rNew, nS, nE ); + pNew = new EditCharAttribGrabBag( static_cast<const SfxGrabBagItem&>(rNew), nS, nE ); } break; case EE_FEATURE_TAB: { - pNew = new EditCharAttribTab( (const SfxVoidItem&)rNew, nS ); + pNew = new EditCharAttribTab( static_cast<const SfxVoidItem&>(rNew), nS ); } break; case EE_FEATURE_LINEBR: { - pNew = new EditCharAttribLineBreak( (const SfxVoidItem&)rNew, nS ); + pNew = new EditCharAttribLineBreak( static_cast<const SfxVoidItem&>(rNew), nS ); } break; case EE_FEATURE_FIELD: { - pNew = new EditCharAttribField( (const SvxFieldItem&)rNew, nS ); + pNew = new EditCharAttribField( static_cast<const SvxFieldItem&>(rNew), nS ); } break; case EE_CHAR_BKGCOLOR: { - pNew = new EditCharAttribBackgroundColor( (const SvxBackgroundColorItem&)rNew, nS, nE ); + pNew = new EditCharAttribBackgroundColor( static_cast<const SvxBackgroundColorItem&>(rNew), nS, nE ); } break; default: @@ -880,7 +882,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit case EE_PARA_LRSPACE: { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLRSpaceItem ) ), "ConvertItem: invalid Item!" ); - SvxLRSpaceItem& rItem = (SvxLRSpaceItem&)rPoolItem; + SvxLRSpaceItem& rItem = static_cast<SvxLRSpaceItem&>(rPoolItem); rItem.SetTxtFirstLineOfst( sal::static_int_cast< short >( OutputDevice::LogicToLogic( rItem.GetTxtFirstLineOfst(), eSourceUnit, eDestUnit ) ) ); rItem.SetTxtLeft( OutputDevice::LogicToLogic( rItem.GetTxtLeft(), eSourceUnit, eDestUnit ) ); rItem.SetRight( OutputDevice::LogicToLogic( rItem.GetRight(), eSourceUnit, eDestUnit ) ); @@ -889,7 +891,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit case EE_PARA_ULSPACE: { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxULSpaceItem ) ), "ConvertItem: Invalid Item!" ); - SvxULSpaceItem& rItem = (SvxULSpaceItem&)rPoolItem; + SvxULSpaceItem& rItem = static_cast<SvxULSpaceItem&>(rPoolItem); 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 ) ) ); } @@ -897,7 +899,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit case EE_PARA_SBL: { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLineSpacingItem ) ), "ConvertItem: Invalid Item!" ); - SvxLineSpacingItem& rItem = (SvxLineSpacingItem&)rPoolItem; + SvxLineSpacingItem& rItem = static_cast<SvxLineSpacingItem&>(rPoolItem); // SetLineHeight changes also eLineSpace! if ( rItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) rItem.SetLineHeight( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); @@ -906,7 +908,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit case EE_PARA_TABS: { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxTabStopItem ) ), "ConvertItem: Invalid Item!" ); - SvxTabStopItem& rItem = (SvxTabStopItem&)rPoolItem; + SvxTabStopItem& rItem = static_cast<SvxTabStopItem&>(rPoolItem); SvxTabStopItem aNewItem( EE_PARA_TABS ); for ( sal_uInt16 i = 0; i < rItem.Count(); i++ ) { @@ -922,7 +924,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit case EE_CHAR_FONTHEIGHT_CTL: { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxFontHeightItem ) ), "ConvertItem: Invalid Item!" ); - SvxFontHeightItem& rItem = (SvxFontHeightItem&)rPoolItem; + SvxFontHeightItem& rItem = static_cast<SvxFontHeightItem&>(rPoolItem); rItem.SetHeight( OutputDevice::LogicToLogic( rItem.GetHeight(), eSourceUnit, eDestUnit ) ); } break; @@ -1853,7 +1855,7 @@ ContentAttribs::~ContentAttribs() SvxTabStop ContentAttribs::FindTabStop( sal_Int32 nCurPos, sal_uInt16 nDefTab ) { - const SvxTabStopItem& rTabs = (const SvxTabStopItem&) GetItem( EE_PARA_TABS ); + const SvxTabStopItem& rTabs = static_cast<const SvxTabStopItem&>( GetItem( EE_PARA_TABS ) ); for ( sal_uInt16 i = 0; i < rTabs.Count(); i++ ) { const SvxTabStop& rTab = rTabs[i]; @@ -2008,39 +2010,39 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontInfo ) == SfxItemState::SET ) ) { - const SvxFontItem& rFontItem = (const SvxFontItem&)rSet.Get( nWhich_FontInfo ); + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(rSet.Get( nWhich_FontInfo )); rFont.SetName( rFontItem.GetFamilyName() ); rFont.SetFamily( rFontItem.GetFamily() ); rFont.SetPitch( rFontItem.GetPitch() ); rFont.SetCharSet( rFontItem.GetCharSet() ); } if ( bSearchInParent || ( rSet.GetItemState( nWhich_Language ) == SfxItemState::SET ) ) - rFont.SetLanguage( ((const SvxLanguageItem&)rSet.Get( nWhich_Language )).GetLanguage() ); + rFont.SetLanguage( static_cast<const SvxLanguageItem&>(rSet.Get( nWhich_Language )).GetLanguage() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_COLOR ) == SfxItemState::SET ) ) - rFont.SetColor( ((const SvxColorItem&)rSet.Get( EE_CHAR_COLOR )).GetValue() ); + rFont.SetColor( static_cast<const SvxColorItem&>(rSet.Get( EE_CHAR_COLOR )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_BKGCOLOR ) == SfxItemState::SET ) ) - rFont.SetFillColor( ((const SvxBackgroundColorItem&)rSet.Get( EE_CHAR_BKGCOLOR )).GetValue() ); + rFont.SetFillColor( static_cast<const SvxBackgroundColorItem&>(rSet.Get( EE_CHAR_BKGCOLOR )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontHeight ) == SfxItemState::SET ) ) - rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem&)rSet.Get( nWhich_FontHeight ) ).GetHeight() ) ); + rFont.SetSize( Size( rFont.GetSize().Width(), static_cast<const SvxFontHeightItem&>(rSet.Get( nWhich_FontHeight ) ).GetHeight() ) ); if ( bSearchInParent || ( rSet.GetItemState( nWhich_Weight ) == SfxItemState::SET ) ) - rFont.SetWeight( ((const SvxWeightItem&)rSet.Get( nWhich_Weight )).GetWeight() ); + rFont.SetWeight( static_cast<const SvxWeightItem&>(rSet.Get( nWhich_Weight )).GetWeight() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_UNDERLINE ) == SfxItemState::SET ) ) - rFont.SetUnderline( ((const SvxUnderlineItem&)rSet.Get( EE_CHAR_UNDERLINE )).GetLineStyle() ); + rFont.SetUnderline( static_cast<const SvxUnderlineItem&>(rSet.Get( EE_CHAR_UNDERLINE )).GetLineStyle() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_OVERLINE ) == SfxItemState::SET ) ) - rFont.SetOverline( ((const SvxOverlineItem&)rSet.Get( EE_CHAR_OVERLINE )).GetLineStyle() ); + rFont.SetOverline( static_cast<const SvxOverlineItem&>(rSet.Get( EE_CHAR_OVERLINE )).GetLineStyle() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_STRIKEOUT ) == SfxItemState::SET ) ) - rFont.SetStrikeout( ((const SvxCrossedOutItem&)rSet.Get( EE_CHAR_STRIKEOUT )).GetStrikeout() ); + rFont.SetStrikeout( static_cast<const SvxCrossedOutItem&>(rSet.Get( EE_CHAR_STRIKEOUT )).GetStrikeout() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_CASEMAP ) == SfxItemState::SET ) ) - rFont.SetCaseMap( ((const SvxCaseMapItem&)rSet.Get( EE_CHAR_CASEMAP )).GetCaseMap() ); + rFont.SetCaseMap( static_cast<const SvxCaseMapItem&>(rSet.Get( EE_CHAR_CASEMAP )).GetCaseMap() ); if ( bSearchInParent || ( rSet.GetItemState( nWhich_Italic ) == SfxItemState::SET ) ) - rFont.SetItalic( ((const SvxPostureItem&)rSet.Get( nWhich_Italic )).GetPosture() ); + rFont.SetItalic( static_cast<const SvxPostureItem&>(rSet.Get( nWhich_Italic )).GetPosture() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_OUTLINE ) == SfxItemState::SET ) ) - rFont.SetOutline( ((const SvxContourItem&)rSet.Get( EE_CHAR_OUTLINE )).GetValue() ); + rFont.SetOutline( static_cast<const SvxContourItem&>(rSet.Get( EE_CHAR_OUTLINE )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_SHADOW ) == SfxItemState::SET ) ) - rFont.SetShadow( ((const SvxShadowedItem&)rSet.Get( EE_CHAR_SHADOW )).GetValue() ); + rFont.SetShadow( static_cast<const SvxShadowedItem&>(rSet.Get( EE_CHAR_SHADOW )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_ESCAPEMENT ) == SfxItemState::SET ) ) { - const SvxEscapementItem& rEsc = (const SvxEscapementItem&) rSet.Get( EE_CHAR_ESCAPEMENT ); + const SvxEscapementItem& rEsc = static_cast<const SvxEscapementItem&>( rSet.Get( EE_CHAR_ESCAPEMENT ) ); sal_uInt16 nProp = rEsc.GetProp(); rFont.SetPropr( (sal_uInt8)nProp ); @@ -2053,15 +2055,15 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s rFont.SetEscapement( nEsc ); } if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_PAIRKERNING ) == SfxItemState::SET ) ) - rFont.SetKerning( ((const SvxAutoKernItem&)rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() ); + rFont.SetKerning( static_cast<const SvxAutoKernItem&>(rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_KERNING ) == SfxItemState::SET ) ) - rFont.SetFixKerning( ((const SvxKerningItem&)rSet.Get( EE_CHAR_KERNING )).GetValue() ); + rFont.SetFixKerning( static_cast<const SvxKerningItem&>(rSet.Get( EE_CHAR_KERNING )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_WLM ) == SfxItemState::SET ) ) - rFont.SetWordLineMode( ((const SvxWordLineModeItem&)rSet.Get( EE_CHAR_WLM )).GetValue() ); + rFont.SetWordLineMode( static_cast<const SvxWordLineModeItem&>(rSet.Get( EE_CHAR_WLM )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_EMPHASISMARK ) == SfxItemState::SET ) ) - rFont.SetEmphasisMark( ((const SvxEmphasisMarkItem&)rSet.Get( EE_CHAR_EMPHASISMARK )).GetValue() ); + rFont.SetEmphasisMark( static_cast<const SvxEmphasisMarkItem&>(rSet.Get( EE_CHAR_EMPHASISMARK )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_RELIEF ) == SfxItemState::SET ) ) - rFont.SetRelief( (FontRelief)((const SvxCharReliefItem&)rSet.Get( EE_CHAR_RELIEF )).GetValue() ); + rFont.SetRelief( (FontRelief)static_cast<const SvxCharReliefItem&>(rSet.Get( EE_CHAR_RELIEF )).GetValue() ); // If comparing the entire font, or if checking before each alteration // whether the value changes, remains relatively the same thing. @@ -2313,7 +2315,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, bool bKeepEndingAttribs ) if ( !aFollow.isEmpty() && ( aFollow != pStyle->GetName() ) ) { SfxStyleSheetBase* pNext = pStyle->GetPool().Find( aFollow, pStyle->GetFamily() ); - pNode->SetStyleSheet( (SfxStyleSheet*)pNext ); + pNode->SetStyleSheet( static_cast<SfxStyleSheet*>(pNext) ); } } diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 133d2e9d3cdf..56c487cd978e 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1127,7 +1127,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v sal_Int32 nPara = pImpEditEngine->GetEditDoc().GetPos( pNode ); - SfxBoolItem aBulletState( (const SfxBoolItem&) pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ); + SfxBoolItem aBulletState( static_cast<const SfxBoolItem&>( pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ) ); bool bBulletIsVisible = aBulletState.GetValue() ? true : false; // just toggling EE_PARA_BULLETSTATE should be fine for both cases... diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 5f315dceb1f5..33ecb675a2df 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -95,7 +95,8 @@ XParaPortionList::XParaPortionList( OutputDevice* pRefDev, sal_uLong nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY) : aRefMapMode(pRefDev->GetMapMode()), nStretchX(_nStretchX), nStretchY(_nStretchY) { - nRefDevPtr = (sal_uIntPtr)pRefDev; nPaperWidth = nPW; + nRefDevPtr = reinterpret_cast<sal_uIntPtr>(pRefDev); + nPaperWidth = nPW; eRefDevType = pRefDev->GetOutDevType(); } @@ -1101,7 +1102,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const bool bSymbolPara = false; if (rC.GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SfxItemState::SET) { - const SvxFontItem& rFontItem = (const SvxFontItem&)rC.GetParaAttribs().Get(EE_CHAR_FONTINFO); + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(rC.GetParaAttribs().Get(EE_CHAR_FONTINFO)); if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) { aBuffer = OStringBuffer(OUStringToOString(rC.GetText(), RTL_TEXTENCODING_SYMBOL)); @@ -1114,7 +1115,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const if (rAttr.GetItem()->Which() == EE_CHAR_FONTINFO) { - const SvxFontItem& rFontItem = (const SvxFontItem&)*rAttr.GetItem(); + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(*rAttr.GetItem()); if ( ( !bSymbolPara && ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) ) || ( bSymbolPara && ( rFontItem.GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) ) { @@ -1150,7 +1151,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const FontToSubsFontConverter hConv = NULL; if (rC.GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SfxItemState::SET) { - hConv = CreateFontToSubsFontConverter( ((const SvxFontItem&)rC.GetParaAttribs().Get( EE_CHAR_FONTINFO )).GetFamilyName(), FONTTOSUBSFONT_EXPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); + hConv = CreateFontToSubsFontConverter( static_cast<const SvxFontItem&>(rC.GetParaAttribs().Get( EE_CHAR_FONTINFO )).GetFamilyName(), FONTTOSUBSFONT_EXPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); } if ( hConv ) { @@ -1311,7 +1312,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) { sal_Char cEncodedChar = aByteString[nStart]; sal_Unicode cChar = OUString(&cEncodedChar, 1, - ((SvxCharSetColorItem*)pItem)->GetCharSet()).toChar(); + static_cast<const SvxCharSetColorItem*>(pItem)->GetCharSet()).toChar(); pC->SetText(pC->GetText().replaceAt(nStart, 1, OUString(cChar))); } else @@ -1336,7 +1337,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) bool bSymbolPara = false; if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SfxItemState::SET ) { - const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pC->GetParaAttribs().Get( EE_CHAR_FONTINFO )); if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) { pC->SetText(OStringToOUString(aByteString, RTL_TEXTENCODING_SYMBOL)); @@ -1349,7 +1350,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) const XEditAttribute& rAttr = pC->aAttribs[--nAttr]; if ( rAttr.GetItem()->Which() == EE_CHAR_FONTINFO ) { - const SvxFontItem& rFontItem = (const SvxFontItem&)*rAttr.GetItem(); + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(*rAttr.GetItem()); if ( ( !bSymbolPara && ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) ) || ( bSymbolPara && ( rFontItem.GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) ) { @@ -1392,7 +1393,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) // Maybe old symbol font as paragraph attribute? if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SfxItemState::SET ) { - const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pC->GetParaAttribs().Get( EE_CHAR_FONTINFO )); FontToSubsFontConverter hConv = CreateFontToSubsFontConverter( rFontItem.GetFamilyName(), FONTTOSUBSFONT_IMPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); if ( hConv ) { diff --git a/editeng/source/editeng/editsel.cxx b/editeng/source/editeng/editsel.cxx index 1cbc655bb3b1..7c3f919faa2a 100644 --- a/editeng/source/editeng/editsel.cxx +++ b/editeng/source/editeng/editsel.cxx @@ -91,7 +91,7 @@ EditSelectionEngine::EditSelectionEngine() : SelectionEngine( (vcl::Window*)0 ) void EditSelectionEngine::SetCurView( EditView* pNewView ) { if ( GetFunctionSet() ) - ((EditSelFunctionSet*)GetFunctionSet())->SetCurView( pNewView ); + const_cast<EditSelFunctionSet*>(static_cast<const EditSelFunctionSet*>(GetFunctionSet()))->SetCurView( pNewView ); if ( pNewView ) SetWindow( pNewView->GetWindow() ); diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index f3e5355b814b..97ab743a0b52 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -187,7 +187,7 @@ void EditUndoDelContent::Redo() if (pEE->IsCallParaInsertedOrDeleted()) pEE->ParagraphDeleted( nNode ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uLong)pContentNode, nNode ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( reinterpret_cast<sal_uLong>(pContentNode), nNode ); pEE->AppendDeletedNodeInfo(pInf); pEE->UpdateSelections(); @@ -253,9 +253,9 @@ void EditUndoConnectParas::Undo() if (GetEditEngine()->GetStyleSheetPool()) { if ( !aLeftStyleName.isEmpty() ) - GetEditEngine()->SetStyleSheet( nNode, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) ); + GetEditEngine()->SetStyleSheet( nNode, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily )) ); if ( !aRightStyleName.isEmpty() ) - GetEditEngine()->SetStyleSheet( nNode+1, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aRightStyleName, eRightStyleFamily ) ); + GetEditEngine()->SetStyleSheet( nNode+1, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aRightStyleName, eRightStyleFamily )) ); } GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); @@ -451,7 +451,7 @@ EditUndoSetStyleSheet::~EditUndoSetStyleSheet() void EditUndoSetStyleSheet::Undo() { DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); - GetEditEngine()->SetStyleSheet( nPara, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aPrevName, ePrevFamily ) ); + GetEditEngine()->SetStyleSheet( nPara, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aPrevName, ePrevFamily )) ); GetEditEngine()->SetParaAttribsOnly( nPara, aPrevParaAttribs ); lcl_DoSetSelection( GetEditEngine()->GetActiveView(), nPara ); } @@ -459,7 +459,7 @@ void EditUndoSetStyleSheet::Undo() void EditUndoSetStyleSheet::Redo() { DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); - GetEditEngine()->SetStyleSheet( nPara, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aNewName, eNewFamily ) ); + GetEditEngine()->SetStyleSheet( nPara, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aNewName, eNewFamily )) ); lcl_DoSetSelection( GetEditEngine()->GetActiveView(), nPara ); } diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 41f754996a61..e4b4ea98ea6a 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -699,14 +699,14 @@ OUString const* EdtAutoCorrDoc::GetPrevPara(bool const) sal_Int32 nPos = rNodes.GetPos( pCurNode ); // Special case: Bullet => Paragraph start => simply return NULL... - const SfxBoolItem& rBulletState = (const SfxBoolItem&) - mpEditEngine->GetParaAttrib( nPos, EE_PARA_BULLETSTATE ); + const SfxBoolItem& rBulletState = static_cast<const SfxBoolItem&>( + mpEditEngine->GetParaAttrib( nPos, EE_PARA_BULLETSTATE )); bool bBullet = rBulletState.GetValue() ? true : false; if ( !bBullet && (mpEditEngine->GetControlWord() & EE_CNTRL_OUTLINER) ) { // The Outliner has still a Bullet at Level 0. - const SfxInt16Item& rLevel = (const SfxInt16Item&) - mpEditEngine->GetParaAttrib( nPos, EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( + mpEditEngine->GetParaAttrib( nPos, EE_PARA_OUTLLEVEL )); if ( rLevel.GetValue() == 0 ) bBullet = true; } diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx index e56eb1c5ac8d..401fb553dc26 100644 --- a/editeng/source/editeng/eeobj.cxx +++ b/editeng/source/editeng/eeobj.cxx @@ -54,7 +54,7 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo sal_uLong nT = SotExchange::GetFormat( rFlavor ); if ( nT == SOT_FORMAT_STRING ) { - aAny <<= (OUString)GetString(); + aAny <<= GetString(); } else if ( ( nT == SOT_FORMATSTR_ID_EDITENGINE ) || ( nT == SOT_FORMAT_RTF ) ) { diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 781e6c8a34ef..b8dd439112d5 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -166,9 +166,9 @@ SfxPoolItem** GlobalEditData::GetDefItems() assert(EDITITEMCOUNT == 55 && "ITEMCOUNT changed, adjust DefItems!"); // Init DefFonts: - GetDefaultFonts( *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START], - *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO_CJK - EE_ITEMS_START], - *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO_CTL - EE_ITEMS_START] ); + GetDefaultFonts( *static_cast<SvxFontItem*>(ppDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START]), + *static_cast<SvxFontItem*>(ppDefItems[EE_CHAR_FONTINFO_CJK - EE_ITEMS_START]), + *static_cast<SvxFontItem*>(ppDefItems[EE_CHAR_FONTINFO_CTL - EE_ITEMS_START]) ); } return ppDefItems; diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index fc9779775cc9..5b1d5169182d 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -287,13 +287,13 @@ void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos, bool EditRTFParser::IsEndPara( SvxNodeIdx* pNd, sal_Int32 nCnt ) const { - return ( nCnt == ( ((EditNodeIdx*)pNd)->GetNode()->Len()) ); + return nCnt == ( static_cast<EditNodeIdx*>(pNd)->GetNode()->Len()); } void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) { - ContentNode* pSttNode = ((EditNodeIdx&)rSet.GetSttNode()).GetNode(); - ContentNode* pEndNode = ((EditNodeIdx&)rSet.GetEndNode()).GetNode(); + ContentNode* pSttNode = const_cast<EditNodeIdx&>(static_cast<const EditNodeIdx&>(rSet.GetSttNode())).GetNode(); + ContentNode* pEndNode = const_cast<EditNodeIdx&>(static_cast<const EditNodeIdx&>(rSet.GetEndNode())).GetNode(); EditPaM aStartPaM( pSttNode, rSet.GetSttCnt() ); EditPaM aEndPaM( pEndNode, rSet.GetEndCnt() ); @@ -311,11 +311,11 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) { if (SfxItemState::SET == rSet.GetAttrSet().GetItemState( aFntHeightIems[i], false, &pItem )) { - sal_uInt32 nHeight = ((SvxFontHeightItem*)pItem)->GetHeight(); + sal_uInt32 nHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight(); long nNewHeight; nNewHeight = OutputDevice::LogicToLogic( (long)nHeight, eSrcUnit, eDestUnit ); - SvxFontHeightItem aFntHeightItem( nNewHeight, ((SvxFontHeightItem*)pItem)->GetProp(), aFntHeightIems[i] ); + SvxFontHeightItem aFntHeightItem( nNewHeight, static_cast<const SvxFontHeightItem*>(pItem)->GetProp(), aFntHeightIems[i] ); rSet.GetAttrSet().Put( aFntHeightItem ); } } @@ -324,7 +324,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) if( SfxItemState::SET == rSet.GetAttrSet().GetItemState( EE_CHAR_ESCAPEMENT, false, &pItem )) { // die richtige - long nEsc = ((SvxEscapementItem*)pItem)->GetEsc(); + long nEsc = static_cast<const SvxEscapementItem*>(pItem)->GetEsc(); if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) ) { @@ -333,7 +333,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) mpEditEngine->SeekCursor(aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont); nEsc = nEsc * 100 / aFont.GetSize().Height(); - SvxEscapementItem aEscItem( (short) nEsc, ((SvxEscapementItem*)pItem)->GetProp(), EE_CHAR_ESCAPEMENT ); + SvxEscapementItem aEscItem( (short) nEsc, static_cast<const SvxEscapementItem*>(pItem)->GetProp(), EE_CHAR_ESCAPEMENT ); rSet.GetAttrSet().Put( aEscItem ); } } @@ -361,7 +361,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) SvxRTFStyleType* pS = it->second; mpEditEngine->SetStyleSheet( EditSelection(aStartPaM, aEndPaM), - (SfxStyleSheet*)mpEditEngine->GetStyleSheetPool()->Find(pS->sName, SFX_STYLE_FAMILY_ALL)); + static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find(pS->sName, SFX_STYLE_FAMILY_ALL))); nOutlLevel = pS->nOutlineNo; } } @@ -435,7 +435,7 @@ SvxRTFStyleType* EditRTFParser::FindStyleSheet( const OUString& rName ) SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) { // Check if a template exists, then it will not be changed! - SfxStyleSheet* pStyle = (SfxStyleSheet*)mpEditEngine->GetStyleSheetPool()->Find( pRTFStyle->sName, SFX_STYLE_FAMILY_ALL ); + SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( pRTFStyle->sName, SFX_STYLE_FAMILY_ALL )); if ( pStyle ) return pStyle; @@ -452,7 +452,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) } } - pStyle = (SfxStyleSheet*) &mpEditEngine->GetStyleSheetPool()->Make( aName, SFX_STYLE_FAMILY_PARA ); + pStyle = static_cast<SfxStyleSheet*>( &mpEditEngine->GetStyleSheetPool()->Make( aName, SFX_STYLE_FAMILY_PARA ) ); // 1) convert and take over Items ... ConvertAndPutItems( pStyle->GetItemSet(), pRTFStyle->aAttrSet ); @@ -460,7 +460,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) // 2) As long as Parent is not in the pool, also create this ... if ( !aParent.isEmpty() && ( aParent != aName ) ) { - SfxStyleSheet* pS = (SfxStyleSheet*)mpEditEngine->GetStyleSheetPool()->Find( aParent, SFX_STYLE_FAMILY_ALL ); + SfxStyleSheet* pS = static_cast<SfxStyleSheet*>(mpEditEngine->GetStyleSheetPool()->Find( aParent, SFX_STYLE_FAMILY_ALL )); if ( !pS ) { // If not found anywhere, create from RTF ... diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index d636c5d2338e..1c7ee7c50bfb 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -1571,10 +1571,10 @@ void ImpEditView::dragGestureRecognized(const ::com::sun::star::datatransfer::dn pDragAndDropInfo->bOutlinerMode = true; EditPaM aStartPaM( pEditEngine->GetEditDoc().GetObject( nPara ), 0 ); EditPaM aEndPaM( aStartPaM ); - const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>(pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL )); for ( sal_Int32 n = nPara +1; n < pEditEngine->GetEditDoc().Count(); n++ ) { - const SfxInt16Item& rL = (const SfxInt16Item&) pEditEngine->GetParaAttrib( n, EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rL = static_cast<const SfxInt16Item&>( pEditEngine->GetParaAttrib( n, EE_PARA_OUTLLEVEL ) ); if ( rL.GetValue() > rLevel.GetValue() ) { aEndPaM.SetNode( pEditEngine->GetEditDoc().GetObject( n ) ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 6dd731e2f2f1..fd3f7a001142 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1924,7 +1924,7 @@ bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const if ( !IsVertical() ) { bR2L = GetDefaultHorizontalTextDirection() == EE_HTEXTDIR_R2L; - pFrameDirItem = &(const SvxFrameDirectionItem&)GetParaAttrib( nPara, EE_PARA_WRITINGDIR ); + pFrameDirItem = &static_cast<const SvxFrameDirectionItem&>(GetParaAttrib( nPara, EE_PARA_WRITINGDIR )); if ( pFrameDirItem->GetValue() == FRMDIR_ENVIRONMENT ) { // #103045# if DefaultHorizontalTextDirection is set, use that value, otherwise pool default. @@ -1935,7 +1935,7 @@ bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const else { // Use pool default - pFrameDirItem = &(const SvxFrameDirectionItem&)((ImpEditEngine*)this)->GetEmptyItemSet().Get( EE_PARA_WRITINGDIR ); + pFrameDirItem = &static_cast<const SvxFrameDirectionItem&>(((ImpEditEngine*)this)->GetEmptyItemSet().Get( EE_PARA_WRITINGDIR )); } } } @@ -2001,7 +2001,7 @@ SvxAdjust ImpEditEngine::GetJustification( sal_Int32 nPara ) const if ( !aStatus.IsOutliner() ) { - eJustification = ((const SvxAdjustItem&) GetParaAttrib( nPara, EE_PARA_JUST )).GetAdjust(); + eJustification = static_cast<const SvxAdjustItem&>(GetParaAttrib( nPara, EE_PARA_JUST )).GetAdjust(); if ( IsRightToLeft( nPara ) ) { @@ -2195,7 +2195,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR } sal_Int32 nParagraphTobeDeleted = aEditDoc.GetPos( pRight ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uIntPtr)pRight, nParagraphTobeDeleted ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( reinterpret_cast<sal_uIntPtr>(pRight), nParagraphTobeDeleted ); aDeletedNodes.push_back(pInf); GetEditEnginePtr()->ParagraphConnected( aEditDoc.GetPos( pLeft ), aEditDoc.GetPos( pRight ) ); @@ -2435,7 +2435,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) OSL_ENSURE( pNode, "Blind Node in ImpRemoveParagraph" ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uIntPtr)pNode, nPara ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( reinterpret_cast<sal_uIntPtr>(pNode), nPara ); aDeletedNodes.push_back(pInf); // The node is managed by the undo and possibly destroyed! @@ -3296,8 +3296,8 @@ void ImpEditEngine::UpdateSelections() for (size_t i = 0, n = aDeletedNodes.size(); i < n; ++i) { const DeletedNodeInfo& rInf = aDeletedNodes[i]; - if ( ( ( sal_uLong )(aCurSel.Min().GetNode()) == rInf.GetInvalidAdress() ) || - ( ( sal_uLong )(aCurSel.Max().GetNode()) == rInf.GetInvalidAdress() ) ) + if ( ( reinterpret_cast<sal_uLong>(aCurSel.Min().GetNode()) == rInf.GetInvalidAdress() ) || + ( reinterpret_cast<sal_uLong>(aCurSel.Max().GetNode()) == rInf.GetInvalidAdress() ) ) { // Use ParaPortions, as now also hidden paragraphs have to be // taken into account! @@ -3442,12 +3442,12 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( ( pAttr->GetStart() == aSelection.Min().GetIndex() ) && ( pAttr->Which() == EE_FEATURE_FIELD ) ) { - const SvxFieldItem* pField = (const SvxFieldItem*)pAttr->GetItem(); + const SvxFieldItem* pField = static_cast<const SvxFieldItem*>(pAttr->GetItem()); const SvxFieldData* pFld = pField->GetField(); if ( pFld && pFld->ISA( SvxURLField ) ) { // Office-Bookmark - OUString aURL( ((const SvxURLField*)pFld)->GetURL() ); + OUString aURL( static_cast<const SvxURLField*>(pFld)->GetURL() ); pDataObj->GetURL() = aURL; } } @@ -3545,8 +3545,8 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) if ( pPortion->IsVisible() ) { - const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); - const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); + const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE )); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; @@ -3616,7 +3616,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, bool bSmart EditPaM aPaM; aPaM.SetNode( pPortion->GetNode() ); - const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; @@ -3643,7 +3643,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, bool bSmart if ( !pLine ) // may happen only in the range of SA! { #if OSL_DEBUG_LEVEL > 0 - const SvxULSpaceItem& rULSpace =(const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); + const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE )); OSL_ENSURE( nY+GetYValue( rULSpace.GetLower() ) >= aDocPos.Y() , "Index in no line, GetPaM ?" ); #endif aPaM.SetIndex( pPortion->GetNode()->Len() ); @@ -4030,8 +4030,8 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) if ( !aStatus.IsOutliner() ) { - const SvxULSpaceItem& rULItem = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); - const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); + const SvxULSpaceItem& rULItem = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE )); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); sal_Int32 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; if ( nSBL ) @@ -4059,8 +4059,8 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) if ( nPortion && !aStatus.ULSpaceSummation() ) { ParaPortion* pPrev = GetParaPortions().SafeGetObject( nPortion-1 ); - const SvxULSpaceItem& rPrevULItem = (const SvxULSpaceItem&)pPrev->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); - const SvxLineSpacingItem& rPrevLSItem = (const SvxLineSpacingItem&)pPrev->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); + const SvxULSpaceItem& rPrevULItem = static_cast<const SvxULSpaceItem&>(pPrev->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE )); + const SvxLineSpacingItem& rPrevLSItem = static_cast<const SvxLineSpacingItem&>(pPrev->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); // In realation between WinWord6/Writer3: // With a proportional line spacing the paragraph spacing is @@ -4129,7 +4129,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, long nY = pPortion->GetFirstLineOffset(); - const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index f807a4af35f1..06180a1b8d62 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -619,13 +619,13 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) bool bRightToLeftPara = IsRightToLeft( nPara ); SvxAdjust eJustification = GetJustification( nPara ); - bool bHyphenatePara = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HYPHENATE )).GetValue(); + bool bHyphenatePara = static_cast<const SfxBoolItem&>(pNode->GetContentAttribs().GetItem( EE_PARA_HYPHENATE )).GetValue(); sal_Int32 nSpaceBefore = 0; sal_Int32 nMinLabelWidth = 0; sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pNode, &nSpaceBefore, &nMinLabelWidth ); const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pNode ); - const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&) pNode->GetContentAttribs().GetItem( EE_PARA_SBL ); - const bool bScriptSpace = ((const SvxScriptSpaceItem&) pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>( pNode->GetContentAttribs().GetItem( EE_PARA_SBL ) ); + const bool bScriptSpace = static_cast<const SvxScriptSpaceItem&>(pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); const short nInvalidDiff = pParaPortion->GetInvalidDiff(); const sal_Int32 nInvalidStart = pParaPortion->GetInvalidPosStart(); @@ -992,7 +992,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) aTmpFont.SetPhysFont( GetRefDevice() ); ImplInitDigitMode(GetRefDevice(), aTmpFont.GetLanguage()); - OUString aFieldValue = cChar ? OUString(cChar) : ((EditCharAttribField*)pNextFeature)->GetFieldValue(); + OUString aFieldValue = cChar ? OUString(cChar) : static_cast<const EditCharAttribField*>(pNextFeature)->GetFieldValue(); if ( bCalcCharPositions || !pPortion->HasValidSize() ) { pPortion->GetSize() = aTmpFont.QuickGetTextSize( GetRefDevice(), aFieldValue, 0, aFieldValue.getLength(), 0 ); @@ -1587,7 +1587,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn sal_Int32 nSpaceBefore = 0; sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pParaPortion->GetNode(), &nSpaceBefore ); const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pParaPortion->GetNode() ); - const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pParaPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pParaPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); short nStartX = GetXValue( (short)(rLRItem.GetTxtLeft() + rLRItem.GetTxtFirstLineOfst() + nSpaceBefore)); Rectangle aBulletArea = Rectangle( Point(), Point() ); @@ -1782,8 +1782,8 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te const i18n::ForbiddenCharacters* pForbidden = GetForbiddenCharsTable()->GetForbiddenCharacters( LanguageTag::convertToLanguageType( aLocale ), true ); aUserOptions.forbiddenBeginCharacters = pForbidden->beginLine; aUserOptions.forbiddenEndCharacters = pForbidden->endLine; - aUserOptions.applyForbiddenRules = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_FORBIDDENRULES )).GetValue(); - aUserOptions.allowPunctuationOutsideMargin = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HANGINGPUNCTUATION )).GetValue(); + aUserOptions.applyForbiddenRules = static_cast<const SfxBoolItem&>(pNode->GetContentAttribs().GetItem( EE_PARA_FORBIDDENRULES )).GetValue(); + aUserOptions.allowPunctuationOutsideMargin = static_cast<const SfxBoolItem&>(pNode->GetContentAttribs().GetItem( EE_PARA_HANGINGPUNCTUATION )).GetValue(); aUserOptions.allowHyphenateEnglish = sal_False; i18n::LineBreakResults aLBR = _xBI->getLineBreak( @@ -2563,27 +2563,27 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo short nScriptType = GetI18NScriptType( EditPaM( pNode, nPos ) ); if ( ( nScriptType == i18n::ScriptType::ASIAN ) || ( nScriptType == i18n::ScriptType::COMPLEX ) ) { - const SvxFontItem& rFontItem = (const SvxFontItem&)pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ) ); + const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ) )); rFont.SetName( rFontItem.GetFamilyName() ); rFont.SetFamily( rFontItem.GetFamily() ); rFont.SetPitch( rFontItem.GetPitch() ); rFont.SetCharSet( rFontItem.GetCharSet() ); Size aSz( rFont.GetSize() ); - aSz.Height() = ((const SvxFontHeightItem&)pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ) ) ).GetHeight(); + aSz.Height() = static_cast<const SvxFontHeightItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ) ) ).GetHeight(); rFont.SetSize( aSz ); - rFont.SetWeight( ((const SvxWeightItem&)pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ))).GetWeight() ); - rFont.SetItalic( ((const SvxPostureItem&)pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_ITALIC, nScriptType ))).GetPosture() ); - rFont.SetLanguage( ((const SvxLanguageItem&)pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ))).GetLanguage() ); + rFont.SetWeight( static_cast<const SvxWeightItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ))).GetWeight() ); + rFont.SetItalic( static_cast<const SvxPostureItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_ITALIC, nScriptType ))).GetPosture() ); + rFont.SetLanguage( static_cast<const SvxLanguageItem&>(pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ))).GetLanguage() ); } - sal_uInt16 nRelWidth = ((const SvxCharScaleWidthItem&)pNode->GetContentAttribs().GetItem( EE_CHAR_FONTWIDTH)).GetValue(); + sal_uInt16 nRelWidth = static_cast<const SvxCharScaleWidthItem&>(pNode->GetContentAttribs().GetItem( EE_CHAR_FONTWIDTH)).GetValue(); /* * Set output device's line and overline colors */ if ( pOut ) { - const SvxUnderlineItem& rTextLineColor = (const SvxUnderlineItem&)pNode->GetContentAttribs().GetItem( EE_CHAR_UNDERLINE ); + const SvxUnderlineItem& rTextLineColor = static_cast<const SvxUnderlineItem&>(pNode->GetContentAttribs().GetItem( EE_CHAR_UNDERLINE )); if ( rTextLineColor.GetColor() != COL_TRANSPARENT ) pOut->SetTextLineColor( rTextLineColor.GetColor() ); else @@ -2592,7 +2592,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo if ( pOut ) { - const SvxOverlineItem& rOverlineColor = (const SvxOverlineItem&)pNode->GetContentAttribs().GetItem( EE_CHAR_OVERLINE ); + const SvxOverlineItem& rOverlineColor = static_cast<const SvxOverlineItem&>(pNode->GetContentAttribs().GetItem( EE_CHAR_OVERLINE )); if ( rOverlineColor.GetColor() != COL_TRANSPARENT ) pOut->SetOverlineColor( rOverlineColor.GetColor() ); else @@ -2632,16 +2632,16 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo } } if ( pAttrib->Which() == EE_CHAR_FONTWIDTH ) - nRelWidth = ((const SvxCharScaleWidthItem*)pAttrib->GetItem())->GetValue(); + nRelWidth = static_cast<const SvxCharScaleWidthItem*>(pAttrib->GetItem())->GetValue(); if ( pAttrib->Which() == EE_CHAR_LANGUAGE_CJK ) - pCJKLanguageItem = (const SvxLanguageItem*) pAttrib->GetItem(); + pCJKLanguageItem = static_cast<const SvxLanguageItem*>( pAttrib->GetItem() ); } pAttrib = GetAttrib( rAttribs, ++nAttr ); } } if ( !pCJKLanguageItem ) - pCJKLanguageItem = (const SvxLanguageItem*) &pNode->GetContentAttribs().GetItem( EE_CHAR_LANGUAGE_CJK ); + pCJKLanguageItem = static_cast<const SvxLanguageItem*>( &pNode->GetContentAttribs().GetItem( EE_CHAR_LANGUAGE_CJK ) ); rFont.SetCJKContextLanguage( pCJKLanguageItem->GetLanguage() ); @@ -2918,7 +2918,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt Point aParaStart( aStartPos ); - const SvxLineSpacingItem& rLSItem = ((const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL )); sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; bool bPaintBullet (false); @@ -3144,7 +3144,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt const EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature(nIndex); DBG_ASSERT( pAttr, "Field not found"); DBG_ASSERT( pAttr && pAttr->GetItem()->ISA( SvxFieldItem ), "Field of the wrong type! "); - aText = ((EditCharAttribField*)pAttr)->GetFieldValue(); + aText = static_cast<const EditCharAttribField*>(pAttr)->GetFieldValue(); nTextStart = 0; nTextLen = aText.getLength(); ExtraPortionInfo *pExtraInfo = pTextPortion->GetExtraInfos(); @@ -3453,7 +3453,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt Rectangle aRect( aTopLeft, pTextPortion->GetSize() ); vcl::PDFExtOutDevBookmarkEntry aBookmark; aBookmark.nLinkId = pPDFExtOutDevData->CreateLink( aRect ); - aBookmark.aBookmark = ((SvxURLField*)pFieldData)->GetURL(); + aBookmark.aBookmark = static_cast<const SvxURLField*>(pFieldData)->GetURL(); std::vector< vcl::PDFExtOutDevBookmarkEntry >& rBookmarks = pPDFExtOutDevData->GetBookmarks(); rBookmarks.push_back( aBookmark ); } @@ -3600,7 +3600,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt if ( !aStatus.IsOutliner() ) { - const SvxULSpaceItem& rULItem = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); + const SvxULSpaceItem& rULItem = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE )); long nUL = GetYValue( rULItem.GetLower() ); if ( !IsVertical() ) aStartPos.Y() += nUL; @@ -3912,7 +3912,7 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) { // Mark as deleted, so that no selection will end or begin at // this paragraph... - DeletedNodeInfo* pDelInfo = new DeletedNodeInfo( (sal_uIntPtr)pPPortion->GetNode(), nParagraph ); + DeletedNodeInfo* pDelInfo = new DeletedNodeInfo( reinterpret_cast<sal_uIntPtr>(pPPortion->GetNode()), nParagraph ); aDeletedNodes.push_back(pDelInfo); UpdateSelections(); // The region below will not be invalidated if UpdateMode = sal_False! @@ -4090,11 +4090,11 @@ long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const const ParaPortion* pPortion = rParaPortions[i]; nTotalOccupiedHeight += pPortion->GetFirstLineOffset(); - const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_SBL); + const SvxLineSpacingItem& rLSItem = static_cast<const SvxLineSpacingItem&>(pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_SBL)); sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; - const SvxULSpaceItem& rULItem = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE); + const SvxULSpaceItem& rULItem = static_cast<const SvxULSpaceItem&>(pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE)); long nUL = GetYValue( rULItem.GetLower() ); const EditLineList& rLines = pPortion->GetLines(); @@ -4262,7 +4262,7 @@ sal_Int32 ImpEditEngine::GetSpaceBeforeAndMinLabelWidth( const SvxLRSpaceItem& ImpEditEngine::GetLRSpaceItem( ContentNode* pNode ) { - return (const SvxLRSpaceItem&)pNode->GetContentAttribs().GetItem( aStatus.IsOutliner() ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE ); + return static_cast<const SvxLRSpaceItem&>(pNode->GetContentAttribs().GetItem( aStatus.IsOutliner() ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE )); } // select a representative text language for the digit type according to the diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 38c04623f9a9..6af9a8f64399 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -332,9 +332,9 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // Generate and write out Font table ... std::vector<SvxFontItem*> aFontTable; // default font must be up front, so DEF font in RTF - aFontTable.push_back( new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO ) ) ); - aFontTable.push_back( new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CJK ) ) ); - aFontTable.push_back( new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CTL ) ) ); + aFontTable.push_back( new SvxFontItem( static_cast<const SvxFontItem&>(aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO ) ) ) ); + aFontTable.push_back( new SvxFontItem( static_cast<const SvxFontItem&>(aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CJK ) ) ) ); + aFontTable.push_back( new SvxFontItem( static_cast<const SvxFontItem&>(aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CTL ) ) ) ); for ( sal_uInt16 nScriptType = 0; nScriptType < 3; nScriptType++ ) { sal_uInt16 nWhich = EE_CHAR_FONTINFO; @@ -344,7 +344,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) nWhich = EE_CHAR_FONTINFO_CTL; sal_uInt32 i = 0; - SvxFontItem* pFontItem = (SvxFontItem*)aEditDoc.GetItemPool().GetItem2( nWhich, i ); + const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(aEditDoc.GetItemPool().GetItem2( nWhich, i )); while ( pFontItem ) { bool bAlreadyExist = false; @@ -357,7 +357,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) if ( !bAlreadyExist ) aFontTable.push_back( new SvxFontItem( *pFontItem ) ); - pFontItem = (SvxFontItem*)aEditDoc.GetItemPool().GetItem2( nWhich, ++i ); + pFontItem = static_cast<const SvxFontItem*>(aEditDoc.GetItemPool().GetItem2( nWhich, ++i )); } } @@ -497,7 +497,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // Parent ... (only if necessary) if ( !pStyle->GetParent().isEmpty() && ( pStyle->GetParent() != pStyle->GetName() ) ) { - SfxStyleSheet* pParent = (SfxStyleSheet*)GetStyleSheetPool()->Find( pStyle->GetParent(), pStyle->GetFamily() ); + SfxStyleSheet* pParent = static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find( pStyle->GetParent(), pStyle->GetFamily() )); DBG_ASSERT( pParent, "Parent not found!" ); rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SBASEDON ); nNumber = aStyleSheetToIdMap.find(pParent)->second; @@ -508,7 +508,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // we assume that we have only SfxStyleSheet in the pool SfxStyleSheet* pNext = static_cast<SfxStyleSheet*>(pStyle); if ( !pStyle->GetFollow().isEmpty() && ( pStyle->GetFollow() != pStyle->GetName() ) ) - pNext = (SfxStyleSheet*)GetStyleSheetPool()->Find( pStyle->GetFollow(), pStyle->GetFamily() ); + pNext = static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find( pStyle->GetFollow(), pStyle->GetFamily() )); DBG_ASSERT( pNext, "Next ot found!" ); rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SNEXT ); @@ -702,7 +702,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, { case EE_PARA_WRITINGDIR: { - const SvxFrameDirectionItem& rWritingMode = (const SvxFrameDirectionItem&)rItem; + const SvxFrameDirectionItem& rWritingMode = static_cast<const SvxFrameDirectionItem&>(rItem); if ( rWritingMode.GetValue() == FRMDIR_HORI_RIGHT_TOP ) rOutput.WriteCharPtr( "\\rtlpar" ); else @@ -711,7 +711,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_PARA_OUTLLEVEL: { - sal_Int32 nLevel = ((const SfxInt16Item&)rItem).GetValue(); + sal_Int32 nLevel = static_cast<const SfxInt16Item&>(rItem).GetValue(); if( nLevel >= 0 ) { rOutput.WriteCharPtr( "\\level" ); @@ -723,15 +723,15 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_PARA_LRSPACE: { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FI ); - sal_Int32 nTxtFirst = ((const SvxLRSpaceItem&)rItem).GetTxtFirstLineOfst(); + sal_Int32 nTxtFirst = static_cast<const SvxLRSpaceItem&>(rItem).GetTxtFirstLineOfst(); nTxtFirst = LogicToTwips( nTxtFirst ); rOutput.WriteInt32AsString( nTxtFirst ); rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_LI ); - sal_uInt32 nTxtLeft = static_cast< sal_uInt32 >(((const SvxLRSpaceItem&)rItem).GetTxtLeft()); + sal_uInt32 nTxtLeft = static_cast< sal_uInt32 >(static_cast<const SvxLRSpaceItem&>(rItem).GetTxtLeft()); nTxtLeft = (sal_uInt32)LogicToTwips( nTxtLeft ); rOutput.WriteInt32AsString( nTxtLeft ); rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RI ); - sal_uInt32 nTxtRight = ((const SvxLRSpaceItem&)rItem).GetRight(); + sal_uInt32 nTxtRight = static_cast<const SvxLRSpaceItem&>(rItem).GetRight(); nTxtRight = LogicToTwips( nTxtRight); rOutput.WriteUInt32AsString( nTxtRight ); } @@ -739,11 +739,11 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_PARA_ULSPACE: { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SB ); - sal_uInt32 nUpper = ((const SvxULSpaceItem&)rItem).GetUpper(); + sal_uInt32 nUpper = static_cast<const SvxULSpaceItem&>(rItem).GetUpper(); nUpper = (sal_uInt32)LogicToTwips( nUpper ); rOutput.WriteUInt32AsString( nUpper ); rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SA ); - sal_uInt32 nLower = ((const SvxULSpaceItem&)rItem).GetLower(); + sal_uInt32 nLower = static_cast<const SvxULSpaceItem&>(rItem).GetLower(); nLower = LogicToTwips( nLower ); rOutput.WriteUInt32AsString( nLower ); } @@ -751,13 +751,13 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_PARA_SBL: { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SL ); - sal_Int32 nVal = ((const SvxLineSpacingItem&)rItem).GetLineHeight(); + sal_Int32 nVal = static_cast<const SvxLineSpacingItem&>(rItem).GetLineHeight(); char cMult = '0'; - if ( ((const SvxLineSpacingItem&)rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) + if ( static_cast<const SvxLineSpacingItem&>(rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) { // From where do I get the value now? // The SwRTF parser is based on a 240 Font! - nVal = ((const SvxLineSpacingItem&)rItem).GetPropLineSpace(); + nVal = static_cast<const SvxLineSpacingItem&>(rItem).GetPropLineSpace(); nVal *= 240; nVal /= 100; cMult = '1'; @@ -768,7 +768,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_PARA_JUST: { - SvxAdjust eJustification = ((const SvxAdjustItem&)rItem).GetAdjust(); + SvxAdjust eJustification = static_cast<const SvxAdjustItem&>(rItem).GetAdjust(); switch ( eJustification ) { case SVX_ADJUST_CENTER: rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_QC ); @@ -782,7 +782,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_PARA_TABS: { - const SvxTabStopItem& rTabs = (const SvxTabStopItem&) rItem; + const SvxTabStopItem& rTabs = static_cast<const SvxTabStopItem&>(rItem); for ( sal_uInt16 i = 0; i < rTabs.Count(); i++ ) { const SvxTabStop& rTab = rTabs[i]; @@ -825,7 +825,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_CHAR_FONTHEIGHT_CTL: { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_FS ); - sal_Int32 nHeight = ((const SvxFontHeightItem&)rItem).GetHeight(); + sal_Int32 nHeight = static_cast<const SvxFontHeightItem&>(rItem).GetHeight(); nHeight = LogicToTwips( nHeight ); // Twips => HalfPoints nHeight /= 10; @@ -836,7 +836,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_CHAR_WEIGHT_CJK: case EE_CHAR_WEIGHT_CTL: { - FontWeight e = ((const SvxWeightItem&)rItem).GetWeight(); + FontWeight e = static_cast<const SvxWeightItem&>(rItem).GetWeight(); switch ( e ) { case WEIGHT_BOLD: rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_B ); break; @@ -848,7 +848,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, { // Must underlined if in WordLineMode, but the information is // missing here - FontUnderline e = ((const SvxUnderlineItem&)rItem).GetLineStyle(); + FontUnderline e = static_cast<const SvxUnderlineItem&>(rItem).GetLineStyle(); switch ( e ) { case UNDERLINE_NONE: rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ULNONE ); break; @@ -862,7 +862,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_CHAR_OVERLINE: { - FontUnderline e = ((const SvxOverlineItem&)rItem).GetLineStyle(); + FontUnderline e = static_cast<const SvxOverlineItem&>(rItem).GetLineStyle(); switch ( e ) { case UNDERLINE_NONE: rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_OLNONE ); break; @@ -876,7 +876,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_CHAR_STRIKEOUT: { - FontStrikeout e = ((const SvxCrossedOutItem&)rItem).GetStrikeout(); + FontStrikeout e = static_cast<const SvxCrossedOutItem&>(rItem).GetStrikeout(); switch ( e ) { case STRIKEOUT_SINGLE: @@ -891,7 +891,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_CHAR_ITALIC_CJK: case EE_CHAR_ITALIC_CTL: { - FontItalic e = ((const SvxPostureItem&)rItem).GetPosture(); + FontItalic e = static_cast<const SvxPostureItem&>(rItem).GetPosture(); switch ( e ) { case ITALIC_OBLIQUE: @@ -905,13 +905,13 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_CHAR_OUTLINE: { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_OUTL ); - if ( !((const SvxContourItem&)rItem).GetValue() ) + if ( !static_cast<const SvxContourItem&>(rItem).GetValue() ) rOutput.WriteChar( '0' ); } break; case EE_CHAR_RELIEF: { - sal_uInt16 nRelief = ((const SvxCharReliefItem&)rItem).GetValue(); + sal_uInt16 nRelief = static_cast<const SvxCharReliefItem&>(rItem).GetValue(); if ( nRelief == RELIEF_EMBOSSED ) rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_EMBO ); if ( nRelief == RELIEF_ENGRAVED ) @@ -920,7 +920,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_CHAR_EMPHASISMARK: { - sal_uInt16 nMark = ((const SvxEmphasisMarkItem&)rItem).GetValue(); + sal_uInt16 nMark = static_cast<const SvxEmphasisMarkItem&>(rItem).GetValue(); if ( nMark == EMPHASISMARK_NONE ) rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ACCNONE ); else if ( nMark == EMPHASISMARK_SIDE_DOTS ) @@ -932,7 +932,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_CHAR_SHADOW: { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_SHAD ); - if ( !((const SvxShadowedItem&)rItem).GetValue() ) + if ( !static_cast<const SvxShadowedItem&>(rItem).GetValue() ) rOutput.WriteChar( '0' ); } break; @@ -950,13 +950,13 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_EXPNDTW ); rOutput.WriteInt32AsString( LogicToTwips( - ((const SvxKerningItem&)rItem).GetValue() ) ); + static_cast<const SvxKerningItem&>(rItem).GetValue() ) ); } break; case EE_CHAR_PAIRKERNING: { rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_KERNING ); - rOutput.WriteUInt32AsString( ((const SvxAutoKernItem&)rItem).GetValue() ? 1 : 0 ); + rOutput.WriteUInt32AsString( static_cast<const SvxAutoKernItem&>(rItem).GetValue() ? 1 : 0 ); } break; case EE_CHAR_ESCAPEMENT: @@ -968,9 +968,9 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, long nFontHeight = GetRefDevice()->LogicToLogic( aFont.GetSize(), &GetRefMapMode(), &aPntMode ).Height(); nFontHeight *=2; // HalfP oints - sal_uInt16 nProp = ((const SvxEscapementItem&)rItem).GetProp(); + sal_uInt16 nProp = static_cast<const SvxEscapementItem&>(rItem).GetProp(); sal_uInt16 nProp100 = nProp*100; // For SWG-Token Prop in 100th percent. - short nEsc = ((const SvxEscapementItem&)rItem).GetEsc(); + short nEsc = static_cast<const SvxEscapementItem&>(rItem).GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) { nEsc = 100 - nProp; @@ -1213,7 +1213,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject && ( pPortionInfo->GetStretchX() == nStretchX ) && ( pPortionInfo->GetStretchY() == nStretchY ) ) { - if ( ( pPortionInfo->GetRefDevPtr() == (sal_uIntPtr)GetRefDevice() ) || + if ( ( pPortionInfo->GetRefDevPtr() == reinterpret_cast<sal_uIntPtr>(GetRefDevice()) ) || ( ( pPortionInfo->GetRefDevType() == OUTDEV_VIRDEV ) && ( GetRefDevice()->GetOutDevType() == OUTDEV_VIRDEV ) ) ) bUsePortionInfo = true; @@ -1309,7 +1309,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject bParaAttribs = pC->GetParaAttribs().Count() ? sal_True : sal_False; if ( GetStyleSheetPool() && pC->GetStyle().getLength() ) { - SfxStyleSheet* pStyle = (SfxStyleSheet*)GetStyleSheetPool()->Find( pC->GetStyle(), pC->GetFamily() ); + SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find( pC->GetStyle(), pC->GetFamily() )); DBG_ASSERT( pStyle, "InsertBinTextObject - Style not found!" ); SetStyleSheet( nPara, pStyle ); } @@ -1428,10 +1428,10 @@ LanguageType ImpEditEngine::GetLanguage( const EditPaM& rPaM, sal_Int32* pEndPos { short nScriptType = GetI18NScriptType( rPaM, pEndPos ); // pEndPos will be valid now, pointing to ScriptChange or NodeLen sal_uInt16 nLangId = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); - const SvxLanguageItem* pLangItem = &(const SvxLanguageItem&)rPaM.GetNode()->GetContentAttribs().GetItem( nLangId ); + const SvxLanguageItem* pLangItem = &static_cast<const SvxLanguageItem&>(rPaM.GetNode()->GetContentAttribs().GetItem( nLangId )); const EditCharAttrib* pAttr = rPaM.GetNode()->GetCharAttribs().FindAttrib( nLangId, rPaM.GetIndex() ); if ( pAttr ) - pLangItem = (const SvxLanguageItem*)pAttr->GetItem(); + pLangItem = static_cast<const SvxLanguageItem*>(pAttr->GetItem()); if ( pEndPos && pAttr && ( pAttr->GetEnd() < *pEndPos ) ) *pEndPos = pAttr->GetEnd(); @@ -1655,7 +1655,7 @@ void ImpEditEngine::SetLanguageAndFont( if (pFont) { // set new font attribute - SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId ); + SvxFontItem aFontItem = static_cast<const SvxFontItem&>( aNewSet.Get( nFontWhichId ) ); aFontItem.SetFamilyName( pFont->GetName()); aFontItem.SetFamily( pFont->GetFamily()); aFontItem.SetStyleName( pFont->GetStyleName()); diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index ec24083d0204..62ded41ffd69 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -150,12 +150,12 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if ( pStyleSheetHint ) { DBG_ASSERT( pStyleSheetHint->GetStyleSheet()->ISA( SfxStyleSheet ), "No SfxStyleSheet!" ); - pStyle = (SfxStyleSheet*) pStyleSheetHint->GetStyleSheet(); + pStyle = static_cast<SfxStyleSheet*>( pStyleSheetHint->GetStyleSheet() ); nId = pStyleSheetHint->GetHint(); } else if ( dynamic_cast<const SfxSimpleHint*>(&rHint) && rBC.ISA( SfxStyleSheet ) ) { - pStyle = (SfxStyleSheet*)&rBC; + pStyle = static_cast<SfxStyleSheet*>(&rBC); nId = dynamic_cast<const SfxSimpleHint*>(&rHint)->GetId(); } diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index e5230587185e..dbf19b950cd2 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -259,7 +259,7 @@ void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel, if (pFont) { // set new font attribute - SvxFontItem aFontItem = (SvxFontItem&) aNewSet.Get( nFontWhichId ); + SvxFontItem aFontItem = static_cast<const SvxFontItem&>( aNewSet.Get( nFontWhichId ) ); aFontItem.SetFamilyName( pFont->GetName()); aFontItem.SetFamily( pFont->GetFamily()); aFontItem.SetStyleName( pFont->GetStyleName()); diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index f04f35a70f0d..a0dd0eca3956 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -269,7 +269,7 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom ) bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT(rItem.ISA(SvxBulletItem),"operator==Types not matching"); - const SvxBulletItem& rBullet = (const SvxBulletItem&)rItem; + const SvxBulletItem& rBullet = static_cast<const SvxBulletItem&>(rItem); // Compare with ValidMask, otherwise no put possible in a AttrSet if the // item differs only in terms of the ValidMask from an existing one. if( nValidMask != rBullet.nValidMask || diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 91da32dea2ae..57f1e2af0427 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -358,7 +358,7 @@ bool SvxFieldItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal which or type" ); - const SvxFieldData* pOtherFld = ((const SvxFieldItem&)rItem).GetField(); + const SvxFieldData* pOtherFld = static_cast<const SvxFieldItem&>(rItem).GetField(); if ( !pField && !pOtherFld ) return true; @@ -407,7 +407,7 @@ bool SvxDateField::operator==( const SvxFieldData& rOther ) const if ( rOther.Type() != Type() ) return false; - const SvxDateField& rOtherFld = (const SvxDateField&) rOther; + const SvxDateField& rOtherFld = static_cast<const SvxDateField&>(rOther); return ( ( nFixDate == rOtherFld.nFixDate ) && ( eType == rOtherFld.eType ) && ( eFormat == rOtherFld.eFormat ) ); @@ -545,7 +545,7 @@ bool SvxURLField::operator==( const SvxFieldData& rOther ) const if ( rOther.Type() != Type() ) return false; - const SvxURLField& rOtherFld = (const SvxURLField&) rOther; + const SvxURLField& rOtherFld = static_cast<const SvxURLField&>(rOther); return ( ( eFormat == rOtherFld.eFormat ) && ( aURL == rOtherFld.aURL ) && ( aRepresentation == rOtherFld.aRepresentation ) && @@ -816,7 +816,7 @@ bool SvxExtTimeField::operator==( const SvxFieldData& rOther ) const if ( rOther.Type() != Type() ) return false; - const SvxExtTimeField& rOtherFld = (const SvxExtTimeField&) rOther; + const SvxExtTimeField& rOtherFld = static_cast<const SvxExtTimeField&>(rOther); return ((m_nFixTime == rOtherFld.m_nFixTime) && ( eType == rOtherFld.eType ) && ( eFormat == rOtherFld.eFormat ) ); @@ -960,7 +960,7 @@ bool SvxExtFileField::operator==( const SvxFieldData& rOther ) const if ( rOther.Type() != Type() ) return false; - const SvxExtFileField& rOtherFld = (const SvxExtFileField&) rOther; + const SvxExtFileField& rOtherFld = static_cast<const SvxExtFileField&>(rOther); return ( ( aFile == rOtherFld.aFile ) && ( eType == rOtherFld.eType ) && ( eFormat == rOtherFld.eFormat ) ); @@ -1112,7 +1112,7 @@ bool SvxAuthorField::operator==( const SvxFieldData& rOther ) const if ( rOther.Type() != Type() ) return false; - const SvxAuthorField& rOtherFld = (const SvxAuthorField&) rOther; + const SvxAuthorField& rOtherFld = static_cast<const SvxAuthorField&>(rOther); return ( ( aName == rOtherFld.aName ) && ( aFirstName == rOtherFld.aFirstName ) && ( aShortName == rOtherFld.aShortName ) && diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index f184a2869f44..9eb3a253a6b5 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -309,7 +309,7 @@ bool SvxSizeItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return ( aSize == ( (SvxSizeItem&)rAttr ).GetSize() ); + return ( aSize == static_cast<const SvxSizeItem&>( rAttr ).GetSize() ); } @@ -553,7 +553,7 @@ bool SvxLRSpaceItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - const SvxLRSpaceItem& rOther = (const SvxLRSpaceItem&)rAttr; + const SvxLRSpaceItem& rOther = static_cast<const SvxLRSpaceItem&>(rAttr); return ( nFirstLineOfst == rOther.GetTxtFirstLineOfst() && @@ -928,11 +928,12 @@ bool SvxULSpaceItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return ( nUpper == ( (SvxULSpaceItem&)rAttr ).nUpper && - nLower == ( (SvxULSpaceItem&)rAttr ).nLower && - bContext == ( (SvxULSpaceItem&)rAttr ).bContext && - nPropUpper == ( (SvxULSpaceItem&)rAttr ).nPropUpper && - nPropLower == ( (SvxULSpaceItem&)rAttr ).nPropLower ); + const SvxULSpaceItem& rSpaceItem = static_cast<const SvxULSpaceItem&>( rAttr ); + return ( nUpper == rSpaceItem.nUpper && + nLower == rSpaceItem.nLower && + bContext == rSpaceItem.bContext && + nPropUpper == rSpaceItem.nPropUpper && + nPropLower == rSpaceItem.nPropLower ); } @@ -949,7 +950,8 @@ bool SvxULSpaceItem::GetPresentation SfxItemPresentation ePres, SfxMapUnit eCoreUnit, SfxMapUnit ePresUnit, - OUString& rText, const IntlWrapper *pIntl + OUString& rText, + const IntlWrapper *pIntl ) const { switch ( ePres ) @@ -1154,9 +1156,10 @@ bool SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return ( bCntnt == ( (SvxProtectItem&)rAttr ).bCntnt && - bSize == ( (SvxProtectItem&)rAttr ).bSize && - bPos == ( (SvxProtectItem&)rAttr ).bPos ); + const SvxProtectItem& rItem = static_cast<const SvxProtectItem&>(rAttr); + return ( bCntnt == rItem.bCntnt && + bSize == rItem.bSize && + bPos == rItem.bPos ); } bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1371,9 +1374,10 @@ bool SvxShadowItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return ( ( aShadowColor == ( (SvxShadowItem&)rAttr ).aShadowColor ) && - ( nWidth == ( (SvxShadowItem&)rAttr ).GetWidth() ) && - ( eLocation == ( (SvxShadowItem&)rAttr ).GetLocation() ) ); + const SvxShadowItem& rItem = static_cast<const SvxShadowItem&>(rAttr); + return ( ( aShadowColor == rItem.aShadowColor ) && + ( nWidth == rItem.GetWidth() ) && + ( eLocation == rItem.GetLocation() ) ); } @@ -1626,15 +1630,16 @@ bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(rAttr); return ( - ( nTopDist == ( (SvxBoxItem&)rAttr ).nTopDist ) && - ( nBottomDist == ( (SvxBoxItem&)rAttr ).nBottomDist ) && - ( nLeftDist == ( (SvxBoxItem&)rAttr ).nLeftDist ) && - ( nRightDist == ( (SvxBoxItem&)rAttr ).nRightDist ) && - CmpBrdLn( pTop, ( (SvxBoxItem&)rAttr ).GetTop() ) && - CmpBrdLn( pBottom, ( (SvxBoxItem&)rAttr ).GetBottom() ) && - CmpBrdLn( pLeft, ( (SvxBoxItem&)rAttr ).GetLeft() ) && - CmpBrdLn( pRight, ( (SvxBoxItem&)rAttr ).GetRight() ) ); + ( nTopDist == rBoxItem.nTopDist ) && + ( nBottomDist == rBoxItem.nBottomDist ) && + ( nLeftDist == rBoxItem.nLeftDist ) && + ( nRightDist == rBoxItem.nRightDist ) && + CmpBrdLn( pTop, rBoxItem.GetTop() ) && + CmpBrdLn( pBottom, rBoxItem.GetBottom() ) && + CmpBrdLn( pLeft, rBoxItem.GetLeft() ) && + CmpBrdLn( pRight, rBoxItem.GetRight() ) ); } @@ -2502,7 +2507,7 @@ SvxBoxInfoItem &SvxBoxInfoItem::operator=( const SvxBoxInfoItem& rCpy ) bool SvxBoxInfoItem::operator==( const SfxPoolItem& rAttr ) const { - SvxBoxInfoItem& rBoxInfo = (SvxBoxInfoItem&)rAttr; + const SvxBoxInfoItem& rBoxInfo = static_cast<const SvxBoxInfoItem&>(rAttr); DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); @@ -2890,7 +2895,7 @@ bool SvxFmtBreakItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==( rAttr ), "unequal types" ); - return GetValue() == ( (SvxFmtBreakItem&)rAttr ).GetValue(); + return GetValue() == static_cast<const SvxFmtBreakItem&>( rAttr ).GetValue(); } @@ -3092,7 +3097,7 @@ bool SvxLineItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return CmpBrdLn( pLine, ((SvxLineItem&)rAttr).GetLine() ); + return CmpBrdLn( pLine, static_cast<const SvxLineItem&>(rAttr).GetLine() ); } @@ -3769,7 +3774,7 @@ bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - SvxBrushItem& rCmp = (SvxBrushItem&)rAttr; + const SvxBrushItem& rCmp = static_cast<const SvxBrushItem&>(rAttr); bool bEqual = ( aColor == rCmp.aColor && eGraphicPos == rCmp.eGraphicPos && pImpl->nGraphicTransparency == rCmp.pImpl->nGraphicTransparency); @@ -4113,7 +4118,7 @@ bool SvxFrameDirectionItem::operator==( const SfxPoolItem& rCmp ) const { DBG_ASSERT( SfxPoolItem::operator==(rCmp), "unequal types" ); - return GetValue() == ((SvxFrameDirectionItem&)rCmp).GetValue(); + return GetValue() == static_cast<const SvxFrameDirectionItem&>(rCmp).GetValue(); } SfxPoolItem* SvxFrameDirectionItem::Clone( SfxItemPool * ) const diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 800a1308416d..5a6a21fac06c 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -210,7 +210,7 @@ SvxNumberFormat::SvxNumberFormat( SvStream &rStream ) if ( hasGraphicBrush ) { pGraphicBrush = new SvxBrushItem( SID_ATTR_BRUSH ); - pGraphicBrush = (SvxBrushItem*)(pGraphicBrush->Create( rStream, BRUSH_GRAPHIC_VERSION )); + pGraphicBrush = static_cast<SvxBrushItem*>(pGraphicBrush->Create( rStream, BRUSH_GRAPHIC_VERSION )); } else pGraphicBrush = 0; rStream.ReadUInt16( nTmp16 ); eVertOrient = nTmp16; @@ -405,7 +405,7 @@ void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem, else if ( !pGraphicBrush || (pGraphicBrush && !(*pBrushItem == *pGraphicBrush)) ) { delete pGraphicBrush; - pGraphicBrush = (SvxBrushItem*)pBrushItem->Clone(); + pGraphicBrush = static_cast<SvxBrushItem*>(pBrushItem->Clone()); pGraphicBrush->SetDoneLink( STATIC_LINK( this, SvxNumberFormat, GraphicArrived) ); } @@ -950,7 +950,7 @@ SvxNumBulletItem::~SvxNumBulletItem() bool SvxNumBulletItem::operator==( const SfxPoolItem& rCopy) const { - return *pNumRule == *((SvxNumBulletItem&)rCopy).pNumRule; + return *pNumRule == *static_cast<const SvxNumBulletItem&>(rCopy).pNumRule; } SfxPoolItem* SvxNumBulletItem::Clone( SfxItemPool * ) const diff --git a/editeng/source/items/optitems.cxx b/editeng/source/items/optitems.cxx index 8dce77f48885..a11c7984e5c5 100644 --- a/editeng/source/items/optitems.cxx +++ b/editeng/source/items/optitems.cxx @@ -81,7 +81,7 @@ SfxPoolItem* SfxSpellCheckItem::Clone( SfxItemPool* ) const bool SfxSpellCheckItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( SfxPoolItem::operator==(rItem), "unequal types" ); - return ( xSpellCheck == ( (const SfxSpellCheckItem& )rItem ).GetXSpellChecker() ); + return ( xSpellCheck == static_cast<const SfxSpellCheckItem&>( rItem ).GetXSpellChecker() ); } // class SfxHyphenRegionItem ----------------------------------------------- @@ -110,8 +110,8 @@ bool SfxHyphenRegionItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return ( ( ( (SfxHyphenRegionItem&)rAttr ).nMinLead == nMinLead ) && - ( ( (SfxHyphenRegionItem&)rAttr ).nMinTrail == nMinTrail ) ); + return ( ( static_cast<const SfxHyphenRegionItem&>( rAttr ).nMinLead == nMinLead ) && + ( static_cast<const SfxHyphenRegionItem&>( rAttr ).nMinTrail == nMinTrail ) ); } diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 88af51f10a4f..9efee0dd6d6a 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -86,7 +86,7 @@ bool SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - const SvxLineSpacingItem& rLineSpace = (const SvxLineSpacingItem&)rAttr; + const SvxLineSpacingItem& rLineSpace = static_cast<const SvxLineSpacingItem&>(rAttr); return ( // Same Linespacing Rule? (eLineSpace == rLineSpace.eLineSpace) @@ -347,11 +347,11 @@ bool SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return( ( GetAdjust() == ((SvxAdjustItem&)rAttr).GetAdjust() && - bOneBlock == ((SvxAdjustItem&)rAttr).bOneBlock && - bLastCenter == ((SvxAdjustItem&)rAttr).bLastCenter && - bLastBlock == ((SvxAdjustItem&)rAttr).bLastBlock ) - ? 1 : 0 ); + const SvxAdjustItem& rItem = static_cast<const SvxAdjustItem&>(rAttr); + return GetAdjust() == rItem.GetAdjust() && + bOneBlock == rItem.bOneBlock && + bLastCenter == rItem.bLastCenter && + bLastBlock == rItem.bLastBlock; } bool SvxAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -705,11 +705,12 @@ bool SvxHyphenZoneItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return ( (((SvxHyphenZoneItem&)rAttr).bHyphen == bHyphen) - && (((SvxHyphenZoneItem&)rAttr).bPageEnd == bPageEnd) - && (((SvxHyphenZoneItem&)rAttr).nMinLead == nMinLead) - && (((SvxHyphenZoneItem&)rAttr).nMinTrail == nMinTrail) - && (((SvxHyphenZoneItem&)rAttr).nMaxHyphens == nMaxHyphens) ); + const SvxHyphenZoneItem& rItem = static_cast<const SvxHyphenZoneItem&>(rAttr); + return ( rItem.bHyphen == bHyphen + && rItem.bPageEnd == bPageEnd + && rItem.nMinLead == nMinLead + && rItem.nMinTrail == nMinTrail + && rItem.nMaxHyphens == nMaxHyphens ); } @@ -1053,7 +1054,7 @@ bool SvxTabStopItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - const SvxTabStopItem& rTSI = (SvxTabStopItem&)rAttr; + const SvxTabStopItem& rTSI = static_cast<const SvxTabStopItem&>(rAttr); if ( Count() != rTSI.Count() ) return false; @@ -1144,8 +1145,8 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) if( bStoreDefTabs ) { - const SvxTabStopItem& rDefTab = (const SvxTabStopItem &) - pPool->GetDefaultItem( pPool->GetWhich( SID_ATTR_TABSTOP, false ) ); + const SvxTabStopItem& rDefTab = static_cast<const SvxTabStopItem &>( + pPool->GetDefaultItem( pPool->GetWhich( SID_ATTR_TABSTOP, false ) ) ); nDefDist = sal_uInt16( rDefTab.maTabStops.front().GetTabPos() ); const sal_Int32 nPos = nTabs > 0 ? (*this)[nTabs-1].GetTabPos() : 0; nCount = (sal_uInt16)(nPos / nDefDist); diff --git a/editeng/source/items/svdfield.cxx b/editeng/source/items/svdfield.cxx index 58d4f3f2a367..c0f91f1e2780 100644 --- a/editeng/source/items/svdfield.cxx +++ b/editeng/source/items/svdfield.cxx @@ -33,7 +33,7 @@ SvxFieldData* SdrMeasureField::Clone() const bool SdrMeasureField::operator==(const SvxFieldData& rSrc) const { - return eMeasureFieldKind==((SdrMeasureField&)rSrc).GetMeasureFieldKind(); + return eMeasureFieldKind == static_cast<const SdrMeasureField&>(rSrc).GetMeasureFieldKind(); } void SdrMeasureField::Load(SvPersistStream& rIn) diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 6e6745805d3f..0307a329ab12 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -184,7 +184,7 @@ bool SvxFontListItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return( pFontList == ((SvxFontListItem&)rAttr).pFontList ); + return( pFontList == static_cast<const SvxFontListItem&>(rAttr).pFontList ); } bool SvxFontListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const @@ -342,7 +342,7 @@ bool SvxFontItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - const SvxFontItem& rItem = (const SvxFontItem&)rAttr; + const SvxFontItem& rItem = static_cast<const SvxFontItem&>(rAttr); bool bRet = ( eFamily == rItem.eFamily && aFamilyName == rItem.aFamilyName && @@ -782,9 +782,9 @@ SfxPoolItem* SvxFontHeightItem::Create( SvStream& rStrm, bool SvxFontHeightItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); - return GetHeight() == ((SvxFontHeightItem&)rItem).GetHeight() && - GetProp() == ((SvxFontHeightItem&)rItem).GetProp() && - GetPropUnit() == ((SvxFontHeightItem&)rItem).GetPropUnit(); + return GetHeight() == static_cast<const SvxFontHeightItem&>(rItem).GetHeight() && + GetProp() == static_cast<const SvxFontHeightItem&>(rItem).GetProp() && + GetPropUnit() == static_cast<const SvxFontHeightItem&>(rItem).GetPropUnit(); } bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1149,8 +1149,8 @@ SfxPoolItem* SvxFontWidthItem::Create( SvStream& rStrm, bool SvxFontWidthItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); - return GetWidth() == ((SvxFontWidthItem&)rItem).GetWidth() && - GetProp() == ((SvxFontWidthItem&)rItem).GetProp(); + return GetWidth() == static_cast<const SvxFontWidthItem&>(rItem).GetWidth() && + GetProp() == static_cast<const SvxFontWidthItem&>(rItem).GetProp(); } bool SvxFontWidthItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -1361,7 +1361,7 @@ bool SvxTextLineItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); return SfxEnumItem::operator==( rItem ) && - GetColor() == ((SvxTextLineItem&)rItem).GetColor(); + GetColor() == static_cast<const SvxTextLineItem&>(rItem).GetColor(); } // class SvxUnderlineItem ------------------------------------------------ @@ -1880,7 +1880,7 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return mColor == ( (const SvxColorItem&)rAttr ).mColor; + return mColor == static_cast<const SvxColorItem&>( rAttr ).mColor; } @@ -2247,8 +2247,8 @@ bool SvxEscapementItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); - return( nEsc == ((SvxEscapementItem&)rAttr).nEsc && - nProp == ((SvxEscapementItem&)rAttr).nProp ); + return( nEsc == static_cast<const SvxEscapementItem&>(rAttr).nEsc && + nProp == static_cast<const SvxEscapementItem&>(rAttr).nProp ); } @@ -2835,9 +2835,9 @@ SvxTwoLinesItem::~SvxTwoLinesItem() bool SvxTwoLinesItem::operator==( const SfxPoolItem& rAttr ) const { DBG_ASSERT( SfxPoolItem::operator==( rAttr ), "not equal attribute types" ); - return bOn == ((SvxTwoLinesItem&)rAttr).bOn && - cStartBracket == ((SvxTwoLinesItem&)rAttr).cStartBracket && - cEndBracket == ((SvxTwoLinesItem&)rAttr).cEndBracket; + return bOn == static_cast<const SvxTwoLinesItem&>(rAttr).bOn && + cStartBracket == static_cast<const SvxTwoLinesItem&>(rAttr).cStartBracket && + cEndBracket == static_cast<const SvxTwoLinesItem&>(rAttr).cEndBracket; } SfxPoolItem* SvxTwoLinesItem::Clone( SfxItemPool* ) const @@ -3055,7 +3055,7 @@ bool SvxCharRotateItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); return SfxUInt16Item::operator==( rItem ) && - IsFitToLine() == ((const SvxCharRotateItem&)rItem).IsFitToLine(); + IsFitToLine() == static_cast<const SvxCharRotateItem&>(rItem).IsFitToLine(); } diff --git a/editeng/source/items/writingmodeitem.cxx b/editeng/source/items/writingmodeitem.cxx index bebc0e6881b4..7ce8509a41c8 100644 --- a/editeng/source/items/writingmodeitem.cxx +++ b/editeng/source/items/writingmodeitem.cxx @@ -40,7 +40,7 @@ bool SvxWritingModeItem::operator==( const SfxPoolItem& rCmp ) const { DBG_ASSERT( SfxPoolItem::operator==(rCmp), "unequal types" ); - return GetValue() == ((SvxWritingModeItem&)rCmp).GetValue(); + return GetValue() == static_cast<const SvxWritingModeItem&>(rCmp).GetValue(); } SfxPoolItem* SvxWritingModeItem::Clone( SfxItemPool * ) const diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index 136230495a95..4a9833016ddc 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -53,7 +53,7 @@ bool SvXMLAttrContainerItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT( rItem.ISA(SvXMLAttrContainerItem), "SvXMLAttrContainerItem::operator ==(): Bad type"); - return *pImpl == *((const SvXMLAttrContainerItem&)rItem).pImpl; + return *pImpl == *static_cast<const SvXMLAttrContainerItem&>(rItem).pImpl; } int SvXMLAttrContainerItem::Compare( const SfxPoolItem &/*rWith*/ ) const @@ -98,7 +98,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal xRef = *(Reference<XInterface>*)rVal.getValue(); Reference<XUnoTunnel> xTunnel(xRef, UNO_QUERY); if( xTunnel.is() ) - pContainer = (SvUnoAttributeContainer*)(sal_uLong)xTunnel->getSomething(SvUnoAttributeContainer::getUnoTunnelId()); + pContainer = reinterpret_cast<SvUnoAttributeContainer*>((sal_uLong)xTunnel->getSomething(SvUnoAttributeContainer::getUnoTunnelId())); } if( pContainer ) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 967ae2338931..b4ca12912c77 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -814,7 +814,7 @@ bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, if( lcl_IsInAsciiArr( sImplWordChars, *pStr ) && pWordStt - 1 == pStr && // Installation at beginning of paragraph. Replaced < by <= (#i38971#) - (sal_IntPtr)(pStart + 1) <= (sal_IntPtr)pStr && + (pStart + 1) <= pStr && rCC.isLetter(aText, pStr-1 - pStart)) pWordStt = --pStr; else diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index b4b44aa42cf6..154be10fa663 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -132,7 +132,7 @@ void Outliner::ParagraphInserted( sal_Int32 nPara ) { pPara->nFlags = PARAFLAG_SETBULLETTEXT; pPara->bVisible = true; - const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ) ); pPara->SetDepth( rLevel.GetValue() ); } } @@ -566,7 +566,7 @@ bool Outliner::ImpConvertEdtToOut( sal_Int32 nPara,EditView* pView) pEditEngine->QuickDelete( aDelSel ); } - const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ) ); sal_Int16 nOutlLevel = rLevel.GetValue(); ImplCheckDepth( nOutlLevel ); @@ -731,7 +731,7 @@ void Outliner::ImplSetLevelDependendStyleSheet( sal_Int32 nPara, SfxStyleSheet* OUString aNewStyleSheetName( pStyle->GetName() ); aNewStyleSheetName = aNewStyleSheetName.copy( 0, aNewStyleSheetName.getLength()-1 ); aNewStyleSheetName += OUString::number( nDepth+1 ); - SfxStyleSheet* pNewStyle = (SfxStyleSheet*)GetStyleSheetPool()->Find( aNewStyleSheetName, pStyle->GetFamily() ); + SfxStyleSheet* pNewStyle = static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find( aNewStyleSheetName, pStyle->GetFamily() )); DBG_ASSERT( pNewStyle, "AutoStyleSheetName - Style not found!" ); if ( pNewStyle && ( pNewStyle != GetStyleSheet( nPara ) ) ) { @@ -925,7 +925,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos, bool bDrawBullet = false; if (pEditEngine) { - const SfxBoolItem& rBulletState = (const SfxBoolItem&) pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ); + const SfxBoolItem& rBulletState = static_cast<const SfxBoolItem&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ); bDrawBullet = rBulletState.GetValue() ? true : false; } @@ -1145,7 +1145,7 @@ sal_uLong Outliner::Read( SvStream& rInput, const OUString& rBaseURL, sal_uInt16 if ( eFormat == EE_FORMAT_BIN ) { const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( n ); - const SfxInt16Item& rLevel = (const SfxInt16Item&) rAttrs.Get( EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( rAttrs.Get( EE_PARA_OUTLLEVEL )); sal_Int16 nDepth = rLevel.GetValue(); ImplInitDepth( n, nDepth, false ); } @@ -1237,7 +1237,7 @@ void Outliner::ImpTextPasted( sal_Int32 nStartPara, sal_Int32 nCount ) const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( nStartPara ); if ( rAttrs.GetItemState( EE_PARA_OUTLLEVEL ) == SfxItemState::SET ) { - const SfxInt16Item& rLevel = (const SfxInt16Item&) rAttrs.Get( EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( rAttrs.Get( EE_PARA_OUTLLEVEL ) ); nDepth = rLevel.GetValue(); } if ( nDepth != GetDepth( nStartPara ) ) @@ -1452,7 +1452,7 @@ const SvxNumberFormat* Outliner::GetNumberFormat( sal_Int32 nPara ) const if( nDepth >= 0 ) { - const SvxNumBulletItem& rNumBullet = (const SvxNumBulletItem&) pEditEngine->GetParaAttrib( nPara, EE_PARA_NUMBULLET ); + const SvxNumBulletItem& rNumBullet = static_cast<const SvxNumBulletItem&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_NUMBULLET ) ); if ( rNumBullet.GetNumRule()->GetLevelCount() > nDepth ) pFmt = rNumBullet.GetNumRule()->Get( nDepth ); } @@ -1531,7 +1531,7 @@ void Outliner::ParaAttribsChanged( sal_Int32 nPara ) if ( pParaList->GetParagraphCount() == pEditEngine->GetParagraphCount() ) { Paragraph* pPara = pParaList->GetParagraph( nPara ); - const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ) ); if ( pPara && pPara->GetDepth() != rLevel.GetValue() ) { pPara->SetDepth( rLevel.GetValue() ); @@ -1578,7 +1578,7 @@ Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, bool bRetu // the ODF attribute text:space-before which holds the spacing to add to the left of the label const short nSpaceBefore = pFmt->GetAbsLSpace() + pFmt->GetFirstLineOffset(); - const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&) pEditEngine->GetParaAttrib( nPara, bOutlineMode ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE ); + const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( pEditEngine->GetParaAttrib( nPara, bOutlineMode ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE ) ); aTopLeft.X() = rLR.GetTxtLeft() + rLR.GetTxtFirstLineOfst() + nSpaceBefore; long nBulletWidth = std::max( (long) -rLR.GetTxtFirstLineOfst(), (long) ((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) ); @@ -1588,7 +1588,7 @@ Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, bool bRetu if ( bAdjust && !bOutlineMode ) { // Adjust when centered or align right - const SvxAdjustItem& rItem = (const SvxAdjustItem&)pEditEngine->GetParaAttrib( nPara, EE_PARA_JUST ); + const SvxAdjustItem& rItem = static_cast<const SvxAdjustItem&>(pEditEngine->GetParaAttrib( nPara, EE_PARA_JUST )); if ( ( !pEditEngine->IsRightToLeft( nPara ) && ( rItem.GetAdjust() != SVX_ADJUST_LEFT ) ) || ( pEditEngine->IsRightToLeft( nPara ) && ( rItem.GetAdjust() != SVX_ADJUST_RIGHT ) ) ) { @@ -1890,7 +1890,7 @@ sal_uInt16 Outliner::ImplGetNumbering( sal_Int32 nPara, const SvxNumberFormat* p pParaFmt = pFmt; } - const SfxBoolItem& rBulletState = (const SfxBoolItem&) pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ); + const SfxBoolItem& rBulletState = static_cast<const SfxBoolItem&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ); if( rBulletState.GetValue() ) nNumber += 1; diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index bbd89edf3538..c0d2d98fe083 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1394,7 +1394,7 @@ sal_uLong OutlinerView::Read( SvStream& rInput, const OUString& rBaseURL, EEText if ( eFormat == EE_FORMAT_BIN ) { const SfxItemSet& rAttrs = pOwner->GetParaAttribs( n ); - const SfxInt16Item& rLevel = (const SfxInt16Item&) rAttrs.Get( EE_PARA_OUTLLEVEL ); + const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( rAttrs.Get( EE_PARA_OUTLLEVEL ) ); sal_uInt16 nDepth = rLevel.GetValue(); pOwner->ImplInitDepth( n, nDepth, false ); } diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 8958a24941f8..6d3c9ebba772 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -90,14 +90,14 @@ using namespace editeng; // Some helper functions // char inline const SvxEscapementItem& GetEscapement(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) - { return (const SvxEscapementItem&)rSet.Get( nId,bInP); } + { return static_cast<const SvxEscapementItem&>(rSet.Get( nId,bInP)); } inline const SvxLineSpacingItem& GetLineSpacing(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) - { return (const SvxLineSpacingItem&)rSet.Get( nId,bInP); } + { return static_cast<const SvxLineSpacingItem&>(rSet.Get( nId,bInP)); } // frm inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) - { return (const SvxLRSpaceItem&)rSet.Get( nId,bInP); } + { return static_cast<const SvxLRSpaceItem&>(rSet.Get( nId,bInP)); } inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) - { return (const SvxULSpaceItem&)rSet.Get( nId,bInP); } + { return static_cast<const SvxULSpaceItem&>(rSet.Get( nId,bInP)); } void SvxRTFParser::SetScriptAttr( RTF_CharTypeDef eType, SfxItemSet& rSet, SfxPoolItem& rItem ) @@ -805,12 +805,12 @@ ATTR_SETUNDERLINE: { // is switched off ? if( UNDERLINE_NONE == - ((SvxUnderlineItem*)pItem)->GetLineStyle() ) + static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle() ) break; - aUL = *(SvxUnderlineItem*)pItem; + aUL = *static_cast<const SvxUnderlineItem*>(pItem); } else - aUL = (const SvxUnderlineItem&)pSet->Get( aPlainMap.nUnderline, false ); + aUL = static_cast<const SvxUnderlineItem&>(pSet->Get( aPlainMap.nUnderline, false )); if( UNDERLINE_NONE == aUL.GetLineStyle() ) aUL.SetLineStyle( UNDERLINE_SINGLE ); @@ -900,12 +900,12 @@ ATTR_SETOVERLINE: { // is switched off ? if( UNDERLINE_NONE == - ((SvxOverlineItem*)pItem)->GetLineStyle() ) + static_cast<const SvxOverlineItem*>(pItem)->GetLineStyle() ) break; - aOL = *(SvxOverlineItem*)pItem; + aOL = *static_cast<const SvxOverlineItem*>(pItem); } else - aOL = (const SvxOverlineItem&)pSet->Get( aPlainMap.nOverline, false ); + aOL = static_cast<const SvxOverlineItem&>(pSet->Get( aPlainMap.nOverline, false )); if( UNDERLINE_NONE == aOL.GetLineStyle() ) aOL.SetLineStyle( UNDERLINE_SINGLE ); @@ -1395,7 +1395,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, SvxBoxItem aAttr( aPardMap.nBox ); const SfxPoolItem* pItem; if( SfxItemState::SET == rSet.GetItemState( aPardMap.nBox, false, &pItem ) ) - aAttr = *(SvxBoxItem*)pItem; + aAttr = *static_cast<const SvxBoxItem*>(pItem); SvxBorderLine aBrd( 0, DEF_LINE_WIDTH_0 ); // Simple plain line bool bContinue = true; diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 740d5949c508..4489731d5d05 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -811,8 +811,8 @@ const vcl::Font& SvxRTFParser::GetFont( sal_uInt16 nId ) const vcl::Font* pFont; if( it == aFontTbl.end() ) { - const SvxFontItem& rDfltFont = (const SvxFontItem&) - pAttrPool->GetDefaultItem( aPlainMap.nFont ); + const SvxFontItem& rDfltFont = static_cast<const SvxFontItem&>( + pAttrPool->GetDefaultItem( aPlainMap.nFont )); pDfltFont->SetName( rDfltFont.GetStyleName() ); pDfltFont->SetFamily( rDfltFont.GetFamily() ); pFont = pDfltFont; diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx index f375fcaa668f..4505bf94c070 100644 --- a/editeng/source/uno/unofdesc.cxx +++ b/editeng/source/uno/unofdesc.cxx @@ -133,7 +133,7 @@ void SvxUnoFontDescriptor::FillFromItemSet( const SfxItemSet& rSet, awt::FontDes { const SfxPoolItem* pItem = NULL; { - SvxFontItem* pFontItem = (SvxFontItem*)&rSet.Get( EE_CHAR_FONTINFO, true ); + const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(&rSet.Get( EE_CHAR_FONTINFO, true )); rDesc.Name = pFontItem->GetFamilyName(); rDesc.StyleName = pFontItem->GetStyleName(); rDesc.Family = sal::static_int_cast< sal_Int16 >( @@ -173,7 +173,7 @@ void SvxUnoFontDescriptor::FillFromItemSet( const SfxItemSet& rSet, awt::FontDes aStrikeOut >>= rDesc.Strikeout; } { - SvxWordLineModeItem* pWLMItem = (SvxWordLineModeItem*)&rSet.Get( EE_CHAR_WLM, true ); + const SvxWordLineModeItem* pWLMItem = static_cast<const SvxWordLineModeItem*>(&rSet.Get( EE_CHAR_WLM, true )); rDesc.WordLineMode = pWLMItem->GetValue(); } } diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 8d46c15f8729..ca91283f380b 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -317,11 +317,11 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > xAnchor, co mpImpl->mbBoolean2 = true; // #i35416# for variable date field, don't use invalid "0000-00-00" date, // use current date instead - bool bFixed = ((SvxDateField*)pData)->GetType() == SVXDATETYPE_FIX; + bool bFixed = static_cast<const SvxDateField*>(pData)->GetType() == SVXDATETYPE_FIX; mpImpl->maDateTime = getDate( bFixed ? - ((SvxDateField*)pData)->GetFixDate() : + static_cast<const SvxDateField*>(pData)->GetFixDate() : Date( Date::SYSTEM ).GetDate() ); - mpImpl->mnInt32 = ((SvxDateField*)pData)->GetFormat(); + mpImpl->mnInt32 = static_cast<const SvxDateField*>(pData)->GetFormat(); mpImpl->mbBoolean1 = bFixed; } break; @@ -334,36 +334,36 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > xAnchor, co case text::textfield::Type::EXTENDED_TIME: mpImpl->mbBoolean2 = false; - mpImpl->maDateTime = getTime( ((SvxExtTimeField*)pData)->GetFixTime() ); - mpImpl->mbBoolean1 = ((SvxExtTimeField*)pData)->GetType() == SVXTIMETYPE_FIX; - mpImpl->mnInt32 = ((SvxExtTimeField*)pData)->GetFormat(); + mpImpl->maDateTime = getTime( static_cast<const SvxExtTimeField*>(pData)->GetFixTime() ); + mpImpl->mbBoolean1 = static_cast<const SvxExtTimeField*>(pData)->GetType() == SVXTIMETYPE_FIX; + mpImpl->mnInt32 = static_cast<const SvxExtTimeField*>(pData)->GetFormat(); break; case text::textfield::Type::URL: - mpImpl->msString1 = ((SvxURLField*)pData)->GetRepresentation(); - mpImpl->msString2 = ((SvxURLField*)pData)->GetTargetFrame(); - mpImpl->msString3 = ((SvxURLField*)pData)->GetURL(); + mpImpl->msString1 = static_cast<const SvxURLField*>(pData)->GetRepresentation(); + mpImpl->msString2 = static_cast<const SvxURLField*>(pData)->GetTargetFrame(); + mpImpl->msString3 = static_cast<const SvxURLField*>(pData)->GetURL(); mpImpl->mnInt16 = sal::static_int_cast< sal_Int16 >( - ((SvxURLField*)pData)->GetFormat()); + static_cast<const SvxURLField*>(pData)->GetFormat()); break; case text::textfield::Type::EXTENDED_FILE: - mpImpl->msString1 = ((SvxExtFileField*)pData)->GetFile(); - mpImpl->mbBoolean1 = ((SvxExtFileField*)pData)->GetType() == SVXFILETYPE_FIX; - mpImpl->mnInt16 = getFileNameDisplayFormat(((SvxExtFileField*)pData)->GetFormat()); + mpImpl->msString1 = static_cast<const SvxExtFileField*>(pData)->GetFile(); + mpImpl->mbBoolean1 = static_cast<const SvxExtFileField*>(pData)->GetType() == SVXFILETYPE_FIX; + mpImpl->mnInt16 = getFileNameDisplayFormat(static_cast<const SvxExtFileField*>(pData)->GetFormat()); break; case text::textfield::Type::AUTHOR: - mpImpl->msString1 = ((SvxAuthorField*)pData)->GetFormatted(); - mpImpl->msString2 = ((SvxAuthorField*)pData)->GetFormatted(); + mpImpl->msString1 = static_cast<const SvxAuthorField*>(pData)->GetFormatted(); + mpImpl->msString2 = static_cast<const SvxAuthorField*>(pData)->GetFormatted(); mpImpl->mnInt16 = sal::static_int_cast< sal_Int16 >( - ((SvxAuthorField*)pData)->GetFormat()); - mpImpl->mbBoolean1 = ((SvxAuthorField*)pData)->GetType() == SVXAUTHORTYPE_FIX; - mpImpl->mbBoolean2 = ((SvxAuthorField*)pData)->GetFormat() != SVXAUTHORFORMAT_SHORTNAME; + static_cast<const SvxAuthorField*>(pData)->GetFormat()); + mpImpl->mbBoolean1 = static_cast<const SvxAuthorField*>(pData)->GetType() == SVXAUTHORTYPE_FIX; + mpImpl->mbBoolean2 = static_cast<const SvxAuthorField*>(pData)->GetFormat() != SVXAUTHORFORMAT_SHORTNAME; break; case text::textfield::Type::MEASURE: - mpImpl->mnInt16 = sal::static_int_cast< sal_Int16 >(((SdrMeasureField*)pData)->GetMeasureFieldKind()); + mpImpl->mnInt16 = sal::static_int_cast< sal_Int16 >(static_cast<const SdrMeasureField*>(pData)->GetMeasureFieldKind()); break; } } @@ -392,7 +392,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() Date aDate( setDate( mpImpl->maDateTime ) ); pData = new SvxDateField( aDate, mpImpl->mbBoolean1?SVXDATETYPE_FIX:SVXDATETYPE_VAR ); if( mpImpl->mnInt32 >= SVXDATEFORMAT_APPDEFAULT && mpImpl->mnInt32 <= SVXDATEFORMAT_F ) - ((SvxDateField*)pData)->SetFormat( (SvxDateFormat)mpImpl->mnInt32 ); + static_cast<SvxDateField*>(pData)->SetFormat( (SvxDateFormat)mpImpl->mnInt32 ); } else { @@ -402,7 +402,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() pData = new SvxExtTimeField( aTime, mpImpl->mbBoolean1?SVXTIMETYPE_FIX:SVXTIMETYPE_VAR ); if( mpImpl->mnInt32 >= SVXTIMEFORMAT_APPDEFAULT && mpImpl->mnInt32 <= SVXTIMEFORMAT_AM_HMSH ) - ((SvxExtTimeField*)pData)->SetFormat( (SvxTimeFormat)mpImpl->mnInt32 ); + static_cast<SvxExtTimeField*>(pData)->SetFormat( (SvxTimeFormat)mpImpl->mnInt32 ); } else { @@ -415,9 +415,9 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() case text::textfield::Type::URL: pData = new SvxURLField( mpImpl->msString3, mpImpl->msString1, !mpImpl->msString1.isEmpty() ? SVXURLFORMAT_REPR : SVXURLFORMAT_URL ); - ((SvxURLField*)pData)->SetTargetFrame( mpImpl->msString2 ); + static_cast<SvxURLField*>(pData)->SetTargetFrame( mpImpl->msString2 ); if( mpImpl->mnInt16 >= SVXURLFORMAT_APPDEFAULT && mpImpl->mnInt16 <= SVXURLFORMAT_REPR ) - ((SvxURLField*)pData)->SetFormat( (SvxURLFormat)mpImpl->mnInt16 ); + static_cast<SvxURLField*>(pData)->SetFormat( (SvxURLFormat)mpImpl->mnInt16 ); break; case text::textfield::Type::PAGE: @@ -478,11 +478,11 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() if( !mpImpl->mbBoolean2 ) { - ((SvxAuthorField*)pData)->SetFormat( SVXAUTHORFORMAT_SHORTNAME ); + static_cast<SvxAuthorField*>(pData)->SetFormat( SVXAUTHORFORMAT_SHORTNAME ); } else if( mpImpl->mnInt16 >= SVXAUTHORFORMAT_FULLNAME || mpImpl->mnInt16 <= SVXAUTHORFORMAT_SHORTNAME ) { - ((SvxAuthorField*)pData)->SetFormat( (SvxAuthorFormat) mpImpl->mnInt16 ); + static_cast<SvxAuthorField*>(pData)->SetFormat( (SvxAuthorFormat) mpImpl->mnInt16 ); } break; diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index 2b0ce3824fd4..78c4d17b5391 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -429,7 +429,7 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex( const Sequence< beans::Prope sal_Int32 nColor = 0; if( aVal >>= nColor ) { - aFmt.SetBulletColor( (Color) nColor ); + aFmt.SetBulletColor( static_cast<Color>(nColor) ); continue; } } diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 77b9267a7180..9fd17d2d83b6 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -646,7 +646,7 @@ void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertySimpleEntry* pM case EE_FEATURE_FIELD: if ( rSet.GetItemState( EE_FEATURE_FIELD, false ) == SfxItemState::SET ) { - SvxFieldItem* pItem = (SvxFieldItem*)rSet.GetItem( EE_FEATURE_FIELD ); + const SvxFieldItem* pItem = static_cast<const SvxFieldItem*>(rSet.GetItem( EE_FEATURE_FIELD )); const SvxFieldData* pData = pItem->GetField(); uno::Reference< text::XTextRange > xAnchor( this ); @@ -703,7 +703,7 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const SfxIt if( eState != SfxItemState::SET && eState != SfxItemState::DEFAULT) throw uno::RuntimeException(); - SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)rSet.GetItem( EE_PARA_NUMBULLET, true ); + const SvxNumBulletItem* pBulletItem = static_cast<const SvxNumBulletItem*>(rSet.GetItem( EE_PARA_NUMBULLET, true )); if( pBulletItem == NULL ) throw uno::RuntimeException(); @@ -744,8 +744,8 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const SfxIt SfxItemState eState = rSet.GetItemState( EE_PARA_BULLETSTATE, true ); if( eState == SfxItemState::SET || eState == SfxItemState::DEFAULT ) { - SfxBoolItem* pItem = (SfxBoolItem*)rSet.GetItem( EE_PARA_BULLETSTATE, true ); - bState = pItem->GetValue() ? sal_True : sal_False; + const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(rSet.GetItem( EE_PARA_BULLETSTATE, true )); + bState = pItem->GetValue(); } aAny <<= bState; diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index a72f577b2a3e..d15a53fd51d8 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -90,7 +90,7 @@ SvXMLImportContext *SvxXMLTextImportContext::CreateChildContext( sal_uInt16 nPre else if( XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, XML_AUTOMATIC_STYLES ) ) { pContext = new SvXMLStylesContext( GetImport(), nPrefix, rLocalName, xAttrList ); - GetImport().GetTextImport()->SetAutoStyles( (SvXMLStylesContext*)pContext ); + GetImport().GetTextImport()->SetAutoStyles( static_cast<SvXMLStylesContext*>(pContext) ); } else |