summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-26 10:27:15 +0200
committerNoel Grandin <noel@peralex.com>2014-11-26 11:46:38 +0200
commit5be1635d45e28e047af0cde4e387b07a3131cc9d (patch)
treed2bd0d9f133c10e563655081174d1481a68e09b3
parentb61ca31e53f0a56667a5e00e966681be29ea7bf7 (diff)
loplugin: cstylecast
Change-Id: Idce7220056f7bc339a5060fd0bd6fbbbdde4f6ff
-rw-r--r--sw/source/core/inc/frame.hxx4
-rw-r--r--sw/source/core/inc/layfrm.hxx6
-rw-r--r--sw/source/core/inc/txtfrm.hxx6
-rw-r--r--sw/source/core/text/frmform.cxx4
-rw-r--r--sw/source/filter/html/css1atr.cxx44
-rw-r--r--sw/source/filter/html/htmlctxt.cxx8
-rw-r--r--sw/source/filter/html/htmldrawwriter.cxx10
-rw-r--r--sw/source/filter/html/htmlfld.cxx2
-rw-r--r--sw/source/filter/html/htmlfldw.cxx14
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx8
-rw-r--r--sw/source/filter/html/htmlform.cxx4
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/htmlnumreader.cxx2
-rw-r--r--sw/source/filter/html/htmlsect.cxx6
-rw-r--r--sw/source/filter/html/htmltab.cxx10
-rw-r--r--sw/source/filter/html/htmltabw.cxx4
-rw-r--r--sw/source/filter/html/svxcss1.cxx14
-rw-r--r--sw/source/filter/html/swhtml.cxx8
-rw-r--r--sw/source/filter/html/wrthtml.cxx18
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/docxexport.cxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx10
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx10
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx2
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx2
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx4
-rw-r--r--sw/source/filter/xml/xmliteme.cxx2
-rw-r--r--sw/source/filter/xml/xmltbli.cxx4
-rw-r--r--sw/source/filter/xml/xmltexte.cxx2
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx4
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx8
-rw-r--r--sw/source/ui/config/optload.cxx6
-rw-r--r--sw/source/ui/config/optpage.cxx12
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx2
-rw-r--r--sw/source/ui/fldui/fldvar.cxx2
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx2
-rw-r--r--sw/source/ui/misc/num.cxx2
-rw-r--r--sw/source/ui/misc/titlepage.cxx2
-rw-r--r--sw/source/ui/table/tabledlg.cxx34
-rw-r--r--sw/source/uibase/app/apphdl.cxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx8
-rw-r--r--sw/source/uibase/app/docsh2.cxx2
-rw-r--r--sw/source/uibase/app/docst.cxx18
-rw-r--r--sw/source/uibase/app/docstyle.cxx4
-rw-r--r--sw/source/uibase/dialog/regionsw.cxx18
-rw-r--r--sw/source/uibase/docvw/edtwin2.cxx4
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx2
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx2
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx2
-rw-r--r--sw/source/uibase/shells/basesh.cxx10
-rw-r--r--sw/source/uibase/shells/drawsh.cxx2
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx8
-rw-r--r--sw/source/uibase/shells/textfld.cxx2
-rw-r--r--sw/source/uibase/shells/textsh.cxx6
-rw-r--r--sw/source/uibase/shells/textsh2.cxx10
-rw-r--r--sw/source/uibase/shells/txtcrsr.cxx4
-rw-r--r--sw/source/uibase/uiview/pview.cxx8
-rw-r--r--sw/source/uibase/uiview/view2.cxx38
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx4
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx2
-rw-r--r--sw/source/uibase/uno/unotxvw.cxx4
-rw-r--r--sw/source/uibase/utlui/content.cxx4
-rw-r--r--sw/source/uibase/utlui/numfmtlb.cxx2
-rw-r--r--sw/source/uibase/utlui/uitool.cxx12
-rw-r--r--sw/source/uibase/utlui/zoomctrl.cxx2
73 files changed, 244 insertions, 244 deletions
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index cd96b26dc02d..472568b4deb6 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -973,11 +973,11 @@ inline void SwFrm::ResetRetouche() const
inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf()
{
- return (SwLayoutFrm*)((const SwFrm*)this)->GetNextLayoutLeaf();
+ return (SwLayoutFrm*)static_cast<const SwFrm*>(this)->GetNextLayoutLeaf();
}
inline SwLayoutFrm *SwFrm::GetPrevLayoutLeaf()
{
- return (SwLayoutFrm*)((const SwFrm*)this)->GetPrevLayoutLeaf();
+ return (SwLayoutFrm*)static_cast<const SwFrm*>(this)->GetPrevLayoutLeaf();
}
inline const SwLayoutFrm *SwFrm::GetNextLayoutLeaf() const
{
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index d074034ba387..c4d3772b754f 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -195,17 +195,17 @@ public:
*/
inline SwCntntFrm* SwLayoutFrm::ContainsCntnt()
{
- return (SwCntntFrm*)(((const SwLayoutFrm*)this)->ContainsCntnt());
+ return (SwCntntFrm*)(static_cast<const SwLayoutFrm*>(this)->ContainsCntnt());
}
inline SwCellFrm* SwLayoutFrm::FirstCell()
{
- return (SwCellFrm*)(((const SwLayoutFrm*)this)->FirstCell());
+ return (SwCellFrm*)(static_cast<const SwLayoutFrm*>(this)->FirstCell());
}
inline SwFrm* SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections )
{
- return (SwFrm*)(((const SwLayoutFrm*)this)->ContainsAny( _bInvestigateFtnForSections ));
+ return (SwFrm*)(static_cast<const SwLayoutFrm*>(this)->ContainsAny( _bInvestigateFtnForSections ));
}
/**
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index d76fc92c0f13..3317c270c27d 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -670,9 +670,9 @@ inline bool SwTxtFrm::HasPara() const
/// 9104: Frm().Height() - Prt().Height(), see widorp.cxx and 7455, 6114, 7908
inline SwTwips SwTxtFrm::GetRstHeight() const
{
- return !GetUpper() ? 0 : ((const SwFrm*)GetUpper())->Frm().Top()
- + ((const SwFrm*)GetUpper())->Prt().Top()
- + ((const SwFrm*)GetUpper())->Prt().Height()
+ return !GetUpper() ? 0 : static_cast<const SwFrm*>(GetUpper())->Frm().Top()
+ + static_cast<const SwFrm*>(GetUpper())->Prt().Top()
+ + static_cast<const SwFrm*>(GetUpper())->Prt().Height()
- Frm().Top() - (Frm().Height() - Prt().Height());
}
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 71b353f8fa7e..2edea7c73200 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1574,7 +1574,7 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
return;
// If necessary the pPara
- sal_uInt16 nOld = ((const SwTxtMargin&)rLine).GetDropHeight();
+ sal_uInt16 nOld = static_cast<const SwTxtMargin&>(rLine).GetDropHeight();
bool bShrink = false;
bool bGrow = false;
bool bGoOn = rLine.IsOnceMore();
@@ -1593,7 +1593,7 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
bGoOn = rLine.IsOnceMore();
if( bGoOn )
{
- const sal_uInt16 nNew = ((const SwTxtMargin&)rLine).GetDropHeight();
+ const sal_uInt16 nNew = static_cast<const SwTxtMargin&>(rLine).GetDropHeight();
if( nOld == nNew )
bGoOn = false;
else
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 6e63fbd907c1..a2c4fac8e618 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -989,10 +989,10 @@ const SwFmt *SwHTMLWriter::GetParentFmt( const SwFmt& rFmt, sal_uInt16 nDeep )
bool swhtml_css1atr_equalFontItems( const SfxPoolItem& r1, const SfxPoolItem& r2 )
{
- return ((const SvxFontItem &)r1).GetFamilyName() ==
- ((const SvxFontItem &)r2).GetFamilyName() &&
- ((const SvxFontItem &)r1).GetFamily() ==
- ((const SvxFontItem &)r2).GetFamily();
+ return static_cast<const SvxFontItem &>(r1).GetFamilyName() ==
+ static_cast<const SvxFontItem &>(r2).GetFamilyName() &&
+ static_cast<const SvxFontItem &>(r1).GetFamily() ==
+ static_cast<const SvxFontItem &>(r2).GetFamily();
}
void SwHTMLWriter::SubtractItemSet( SfxItemSet& rItemSet,
@@ -2393,7 +2393,7 @@ static Writer& OutCSS1_SvxCaseMap( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt;
- switch( ((const SvxCaseMapItem&)rHt).GetCaseMap() )
+ switch( static_cast<const SvxCaseMapItem&>(rHt).GetCaseMap() )
{
case SVX_CASEMAP_NOT_MAPPED:
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, sCSS1_PV_normal );
@@ -2428,7 +2428,7 @@ static Writer& OutCSS1_SvxColor( Writer& rWrt, const SfxPoolItem& rHt )
OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
"write color as Hint?" );
- Color aColor( ((const SvxColorItem&)rHt).GetValue() );
+ Color aColor( static_cast<const SvxColorItem&>(rHt).GetValue() );
if( COL_AUTO == aColor.GetColor() )
aColor.SetColor( COL_BLACK );
@@ -2473,7 +2473,7 @@ static Writer& OutCSS1_SvxFont( Writer& rWrt, const SfxPoolItem& rHt )
// MS IE3b1 has problems with single quotes
sal_uInt16 nMode = rHTMLWrt.nCSS1OutMode & CSS1_OUTMODE_ANY_ON;
sal_Unicode cQuote = nMode == CSS1_OUTMODE_RULE_ON ? '\"' : '\'';
- SwHTMLWriter::PrepareFontList( ((const SvxFontItem&)rHt), sOut, cQuote,
+ SwHTMLWriter::PrepareFontList( static_cast<const SvxFontItem&>(rHt), sOut, cQuote,
true );
rHTMLWrt.OutCSS1_Property( sCSS1_P_font_family, sOut );
@@ -2500,7 +2500,7 @@ static Writer& OutCSS1_SvxFontHeight( Writer& rWrt, const SfxPoolItem& rHt )
if( !rHTMLWrt.IsCSS1Script( nScript ) )
return rWrt;
- sal_uInt32 nHeight = ((const SvxFontHeightItem&)rHt).GetHeight();
+ sal_uInt32 nHeight = static_cast<const SvxFontHeightItem&>(rHt).GetHeight();
OString sHeight(OString::number(nHeight/20) + OString(sCSS1_UNIT_pt));
rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_font_size, sHeight);
@@ -2521,7 +2521,7 @@ static Writer& OutCSS1_SvxPosture( Writer& rWrt, const SfxPoolItem& rHt )
return rWrt;
const sal_Char *pStr = 0;
- switch( ((const SvxPostureItem&)rHt).GetPosture() )
+ switch( static_cast<const SvxPostureItem&>(rHt).GetPosture() )
{
case ITALIC_NONE: pStr = sCSS1_PV_normal; break;
case ITALIC_OBLIQUE: pStr = sCSS1_PV_oblique; break;
@@ -2549,7 +2549,7 @@ static Writer& OutCSS1_SvxKerning( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt;
- sal_Int16 nValue = ((const SvxKerningItem&)rHt).GetValue();
+ sal_Int16 nValue = static_cast<const SvxKerningItem&>(rHt).GetValue();
if( nValue )
{
OStringBuffer sOut;
@@ -2596,7 +2596,7 @@ static Writer& OutCSS1_SvxLanguage( Writer& rWrt, const SfxPoolItem& rHt )
OSL_ENSURE( !rHTMLWrt.IsCSS1Source(CSS1_OUTMODE_HINT),
"write Language as Hint?" );
- LanguageType eLang = ((const SvxLanguageItem &)rHt).GetLanguage();
+ LanguageType eLang = static_cast<const SvxLanguageItem &>(rHt).GetLanguage();
if( LANGUAGE_DONTKNOW == eLang )
return rWrt;
@@ -2635,7 +2635,7 @@ static Writer& OutCSS1_SvxHidden( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt;
- if ( ((const SvxCharHiddenItem&)rHt).GetValue() )
+ if ( static_cast<const SvxCharHiddenItem&>(rHt).GetValue() )
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_display, sCSS1_PV_none );
return rWrt;
@@ -2655,7 +2655,7 @@ static Writer& OutCSS1_SvxFontWeight( Writer& rWrt, const SfxPoolItem& rHt )
return rWrt;
const sal_Char *pStr = 0;
- switch( ((const SvxWeightItem&)rHt).GetWeight() )
+ switch( static_cast<const SvxWeightItem&>(rHt).GetWeight() )
{
case WEIGHT_ULTRALIGHT: pStr = sCSS1_PV_extra_light; break;
case WEIGHT_LIGHT: pStr = sCSS1_PV_light; break;
@@ -2758,7 +2758,7 @@ static Writer& OutCSS1_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt )
return rWrt;
const sal_Char* pStr = 0;
- switch( ((const SvxAdjustItem&)rHt).GetAdjust() )
+ switch( static_cast<const SvxAdjustItem&>(rHt).GetAdjust() )
{
case SVX_ADJUST_LEFT: pStr = sCSS1_PV_left; break;
case SVX_ADJUST_RIGHT: pStr = sCSS1_PV_right; break;
@@ -2778,7 +2778,7 @@ static Writer& OutCSS1_SvxFmtSplit( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- const sal_Char *pStr = ((const SvxFmtSplitItem&)rHt).GetValue()
+ const sal_Char *pStr = static_cast<const SvxFmtSplitItem&>(rHt).GetValue()
? sCSS1_PV_auto
: sCSS1_PV_avoid;
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_page_break_inside, pStr );
@@ -2790,7 +2790,7 @@ static Writer& OutCSS1_SwFmtLayoutSplit( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- const sal_Char *pStr = ((const SwFmtLayoutSplit&)rHt).GetValue()
+ const sal_Char *pStr = static_cast<const SwFmtLayoutSplit&>(rHt).GetValue()
? sCSS1_PV_auto
: sCSS1_PV_avoid;
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_page_break_inside, pStr );
@@ -2802,7 +2802,7 @@ static Writer& OutCSS1_SvxWidows( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- OString aStr(OString::number(((const SvxWidowsItem&)rHt).GetValue()));
+ OString aStr(OString::number(static_cast<const SvxWidowsItem&>(rHt).GetValue()));
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_widows, aStr );
return rWrt;
@@ -2812,7 +2812,7 @@ static Writer& OutCSS1_SvxOrphans( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- OString aStr(OString::number(((const SvxOrphansItem&)rHt).GetValue()));
+ OString aStr(OString::number(static_cast<const SvxOrphansItem&>(rHt).GetValue()));
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_orphans, aStr );
return rWrt;
@@ -3157,9 +3157,9 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt,
return rWrt;
// start getting a few values
-// const Brush &rBrush = ((const SvxBrushItem &)rHt).GetBrush();
- const Color & rColor = ((const SvxBrushItem &)rHt).GetColor();
- SvxGraphicPosition ePos = ((const SvxBrushItem &)rHt).GetGraphicPos();
+// const Brush &rBrush = static_cast<const SvxBrushItem &>(rHt).GetBrush();
+ const Color & rColor = static_cast<const SvxBrushItem &>(rHt).GetColor();
+ SvxGraphicPosition ePos = static_cast<const SvxBrushItem &>(rHt).GetGraphicPos();
// get the color
bool bColor = false;
@@ -3176,7 +3176,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt,
OUString aGraphicInBase64;
// Embedded Grafic -> export WriteEmbedded
- const Graphic* pGrf = ((const SvxBrushItem &)rHt).GetGraphic();
+ const Graphic* pGrf = static_cast<const SvxBrushItem &>(rHt).GetGraphic();
if( pGrf )
{
sal_uLong nErr = XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64);
diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx
index aceeb3557161..48457030200e 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -601,7 +601,7 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet,
{
sal_uInt16 nUpper = 0, nLower = 0;
GetULSpaceFromContext( nUpper, nLower );
- SvxULSpaceItem aULSpace( *((const SvxULSpaceItem *)pItem) );
+ SvxULSpaceItem aULSpace( *static_cast<const SvxULSpaceItem *>(pItem) );
if( !rPropInfo.bTopMargin )
aULSpace.SetUpper( nUpper );
if( !rPropInfo.bBottomMargin )
@@ -622,17 +622,17 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet,
break;
case RES_CHRATR_FONTSIZE:
// es werden keine Attribute mit %-Angaben gesetzt
- if( ((const SvxFontHeightItem *)pItem)->GetProp() == 100 )
+ if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 )
ppAttr = &aAttrTab.pFontHeight;
break;
case RES_CHRATR_CJK_FONTSIZE:
// es werden keine Attribute mit %-Angaben gesetzt
- if( ((const SvxFontHeightItem *)pItem)->GetProp() == 100 )
+ if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 )
ppAttr = &aAttrTab.pFontHeightCJK;
break;
case RES_CHRATR_CTL_FONTSIZE:
// es werden keine Attribute mit %-Angaben gesetzt
- if( ((const SvxFontHeightItem *)pItem)->GetProp() == 100 )
+ if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 )
ppAttr = &aAttrTab.pFontHeightCTL;
break;
diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx
index db80f953c5f4..ccc67a777875 100644
--- a/sw/source/filter/html/htmldrawwriter.cxx
+++ b/sw/source/filter/html/htmldrawwriter.cxx
@@ -193,7 +193,7 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt,
// LOOP
sal_Int32 nCount =
- ((const SdrTextAniCountItem&)rItemSet.Get( SDRATTR_TEXT_ANICOUNT ))
+ static_cast<const SdrTextAniCountItem&>(rItemSet.Get( SDRATTR_TEXT_ANICOUNT ))
.GetValue();
if( 0==nCount )
nCount = SDRTEXTANI_SLIDE==eAniKind ? 1 : -1;
@@ -202,14 +202,14 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt,
// SCROLLDELAY
sal_uInt16 nDelay =
- ((const SdrTextAniDelayItem&)rItemSet.Get( SDRATTR_TEXT_ANIDELAY ))
+ static_cast<const SdrTextAniDelayItem&>(rItemSet.Get( SDRATTR_TEXT_ANIDELAY ))
.GetValue();
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_scrolldelay).
append("=\"").append(static_cast<sal_Int32>(nDelay)).append("\"");
// SCROLLAMOUNT
sal_Int16 nAmount =
- ((const SdrTextAniAmountItem&)rItemSet.Get( SDRATTR_TEXT_ANIAMOUNT ))
+ static_cast<const SdrTextAniAmountItem&>(rItemSet.Get( SDRATTR_TEXT_ANIAMOUNT ))
.GetValue();
if( nAmount < 0 )
{
@@ -268,11 +268,11 @@ Writer& OutHTML_DrawFrmFmtAsMarquee( Writer& rWrt,
// BGCOLOR
drawing::FillStyle eFillStyle =
- ((const XFillStyleItem&)rItemSet.Get(XATTR_FILLSTYLE)).GetValue();
+ static_cast<const XFillStyleItem&>(rItemSet.Get(XATTR_FILLSTYLE)).GetValue();
if( drawing::FillStyle_SOLID==eFillStyle )
{
const Color& rFillColor =
- ((const XFillColorItem&)rItemSet.Get(XATTR_FILLCOLOR)).GetColorValue();
+ static_cast<const XFillColorItem&>(rItemSet.Get(XATTR_FILLCOLOR)).GetColorValue();
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).append("=");
rWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index eb3a17eb3bb1..c2156b6a8dd3 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -629,7 +629,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, const sal_Char *pTag
break;
if( RES_TXTATR_FIELD == pAttr->pItem->Which() &&
- RES_SCRIPTFLD == ((const SwFmtFld *)pAttr->pItem)->GetField()->GetTyp()->Which() )
+ RES_SCRIPTFLD == static_cast<const SwFmtFld *>(pAttr->pItem)->GetField()->GetTyp()->Which() )
{
bMoveFwd = false;
break;
diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx
index 4266b85c83b1..69633d3a1d3e 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -104,7 +104,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
;
}
OSL_ENSURE( pSubStr, "ubekannter Subtyp fuer SwExtUserField" );
- bFixed = ((const SwExtUserField*)pFld)->IsFixed();
+ bFixed = static_cast<const SwExtUserField*>(pFld)->IsFixed();
break;
case RES_AUTHORFLD:
@@ -115,7 +115,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
case AF_SHORTCUT: pFmtStr = OOO_STRING_SW_HTML_FF_shortcut; break;
}
OSL_ENSURE( pFmtStr, "ubekanntes Format fuer SwAuthorField" );
- bFixed = ((const SwAuthorField*)pFld)->IsFixed();
+ bFixed = static_cast<const SwAuthorField*>(pFld)->IsFixed();
break;
case RES_DATETIMEFLD:
@@ -143,7 +143,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
if( (SvxExtNumType)nFmt==SVX_NUM_CHAR_SPECIAL )
{
- aValue = ((const SwPageNumberField *)pFld)->GetUserString();
+ aValue = static_cast<const SwPageNumberField *>(pFld)->GetUserString();
}
else
{
@@ -198,7 +198,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
break;
}
}
- bFixed = ((const SwDocInfoField*)pFld)->IsFixed();
+ bFixed = static_cast<const SwDocInfoField*>(pFld)->IsFixed();
if( bNumFmt )
{
if( bFixed )
@@ -206,7 +206,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
// Fuer ein fixes Feld och den Num-Value ausgeben.
// Fixe Felder ohne Zahlenformate sollte es
// eigentlich nicht geben. OSL_ENSURE(ist unten.
- dNumValue = ((const SwDocInfoField*)pFld)->GetValue();
+ dNumValue = static_cast<const SwDocInfoField*>(pFld)->GetValue();
bNumValue = true;
}
else if( !nFmt )
@@ -249,7 +249,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld,
default:
;
}
- bFixed = ((const SwFileNameField*)pFld)->IsFixed();
+ bFixed = static_cast<const SwFileNameField*>(pFld)->IsFixed();
OSL_ENSURE( pFmtStr, "unbekanntes Format fuer SwFileNameField" );
break;
}
@@ -512,7 +512,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt )
if( rHTMLWrt.bLFPossible )
rHTMLWrt.OutNewLine( true );
- bool bURL = ((const SwScriptField *)pFld)->IsCodeURL();
+ bool bURL = static_cast<const SwScriptField *>(pFld)->IsCodeURL();
const OUString& rType = pFld->GetPar1();
OUString aContents, aURL;
if(bURL)
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 90c6a04d6194..183787e02e09 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -214,7 +214,7 @@ sal_uInt16 SwHTMLWriter::GuessFrmType( const SwFrmFmt& rFrmFmt,
const SfxItemSet& rItemSet = rFrmFmt.GetAttrSet();
if( SfxItemState::SET == rItemSet.GetItemState( RES_COL,
true, &pItem ) &&
- ((const SwFmtCol *)pItem)->GetNumCols() > 1 )
+ static_cast<const SwFmtCol *>(pItem)->GetNumCols() > 1 )
{
// spaltiger Rahmen
eType = HTML_FRMTYPE_MULTICOL;
@@ -676,7 +676,7 @@ OString SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt,
if( (nFrmOpts & HTML_FRMOPT_SIZE) &&
SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ) &&
( (nFrmOpts & HTML_FRMOPT_ANYSIZE) ||
- ATT_FIX_SIZE == ((const SwFmtFrmSize *)pItem)->GetHeightSizeType()) )
+ ATT_FIX_SIZE == static_cast<const SwFmtFrmSize *>(pItem)->GetHeightSizeType()) )
{
const SwFmtFrmSize *pFSItem = (const SwFmtFrmSize *)pItem;
sal_uInt8 nPrcWidth = pFSItem->GetWidthPercent();
@@ -942,7 +942,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrmFmt& rF
if( (nFrameOptions & HTML_FRMOPT_SIZE) &&
SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ) &&
( (nFrameOptions & HTML_FRMOPT_ANYSIZE) ||
- ATT_FIX_SIZE == ((const SwFmtFrmSize *)pItem)->GetHeightSizeType()) )
+ ATT_FIX_SIZE == static_cast<const SwFmtFrmSize *>(pItem)->GetHeightSizeType()) )
{
const SwFmtFrmSize *pFSItem = (const SwFmtFrmSize *)pItem;
sal_uInt8 nPrcWidth = pFSItem->GetWidthPercent();
@@ -1372,7 +1372,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
// Events
if (SfxItemState::SET == rItemSet.GetItemState(RES_FRMMACRO, true, &pItem))
{
- const SvxMacroTableDtor& rMacTable = ((const SvxMacroItem *)pItem)->GetMacroTable();
+ const SvxMacroTableDtor& rMacTable = static_cast<const SvxMacroItem *>(pItem)->GetMacroTable();
if (!rMacTable.empty())
{
HtmlWriterHelper::applyEvents(aHtml, rMacTable, aImageEventTable, rHTMLWrt.bCfgStarBasic);
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index f0317e20d821..c6d07014e265 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -974,7 +974,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
&pItem ) &&
xPropSetInfo->hasPropertyByName( sPropName ) )
{
- const Color &rColor = ((const SvxBrushItem *)pItem)->GetColor();
+ const Color &rColor = static_cast<const SvxBrushItem *>(pItem)->GetColor();
/// copy color, if color is not "no fill"/"auto fill"
if( rColor.GetColor() != COL_TRANSPARENT )
{
@@ -990,7 +990,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
&pItem ) &&
xPropSetInfo->hasPropertyByName( sPropName ) )
{
- aTmp <<= (sal_Int32)((const SvxColorItem *)pItem)->GetValue()
+ aTmp <<= (sal_Int32)static_cast<const SvxColorItem *>(pItem)->GetValue()
.GetRGBColor();
rFCompPropSet->setPropertyValue( sPropName, aTmp );
}
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 5755bcd69e65..d33b337f7742 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -485,7 +485,7 @@ IMAGE_SETEVENT:
if( aAttrTab.pINetFmt )
{
const OUString& rURL =
- ((const SwFmtINetFmt&)aAttrTab.pINetFmt->GetItem()).GetValue();
+ static_cast<const SwFmtINetFmt&>(aAttrTab.pINetFmt->GetItem()).GetValue();
pCSS1Parser->SetATagStyles();
sal_uInt16 nPoolId = static_cast< sal_uInt16 >(pDoc->IsVisitedURL( rURL )
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx
index 492c1d21ecc8..8d774d4cc8f0 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -289,7 +289,7 @@ void SwHTMLParser::NewNumBulList( int nToken )
if( aPropInfo.bTextIndent )
{
short nTextIndent =
- ((const SvxLRSpaceItem &)aItemSet.Get( RES_LR_SPACE ))
+ static_cast<const SvxLRSpaceItem &>(aItemSet.Get( RES_LR_SPACE ))
.GetTxtFirstLineOfst();
aNumFmt.SetFirstLineOffset( nTextIndent );
bChangeNumFmt = true;
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index 4f9c9ef670b9..89ae5174eaf3 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -441,7 +441,7 @@ void SwHTMLParser::FixHeaderFooterDistance( bool bHeader,
if( pTxtNode )
{
const SvxULSpaceItem& rULSpace =
- ((const SvxULSpaceItem&)pTxtNode
+ static_cast<const SvxULSpaceItem&>(pTxtNode
->SwCntntNode::GetAttr( RES_UL_SPACE ));
// Der untere Absatz-Abstand wird zum Abstand zur
@@ -474,7 +474,7 @@ void SwHTMLParser::FixHeaderFooterDistance( bool bHeader,
if( pTxtNode )
{
const SvxULSpaceItem& rULSpace =
- ((const SvxULSpaceItem&)pTxtNode
+ static_cast<const SvxULSpaceItem&>(pTxtNode
->SwCntntNode::GetAttr( RES_UL_SPACE ));
// Der obere Absatz-Abstand wird zum Abstand zur
@@ -769,7 +769,7 @@ void SwHTMLParser::InsertFlyFrame( const SfxItemSet& rItemSet,
sal_uInt16 nFlags )
{
RndStdIds eAnchorId =
- ((const SwFmtAnchor&)rItemSet.Get( RES_ANCHOR )).GetAnchorId();
+ static_cast<const SwFmtAnchor&>(rItemSet.Get( RES_ANCHOR )).GetAnchorId();
// Den Rahmen anlegen
SwFlyFrmFmt* pFlyFmt = pDoc->MakeFlySection( eAnchorId, pPam->GetPoint(),
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index bd4153112771..093c70817156 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -1508,7 +1508,7 @@ void HTMLTable::FixFrameFmt( SwTableBox *pBox,
SfxItemState::SET==pCNd->GetpSwAttrSet()->GetItemState(
RES_PARATR_ADJUST, false, &pItem ) )
{
- eAdjust = ((const SvxAdjustItem *)pItem)
+ eAdjust = static_cast<const SvxAdjustItem *>(pItem)
->GetAdjust();
}
}
@@ -2961,7 +2961,7 @@ SvxBrushItem* SwHTMLParser::CreateBrushItem( const Color *pColor,
if( SfxItemState::SET == aItemSet.GetItemState( RES_BACKGROUND, false,
&pItem ) )
{
- pBrushItem = new SvxBrushItem( *((const SvxBrushItem *)pItem) );
+ pBrushItem = new SvxBrushItem( *static_cast<const SvxBrushItem *>(pItem) );
}
}
@@ -3504,7 +3504,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
RES_PARATR_SPLIT, false, &pItem ) )
{
aItemSet.Put(
- SwFmtLayoutSplit( ((const SvxFmtSplitItem *)pItem)
+ SwFmtLayoutSplit( static_cast<const SvxFmtSplitItem *>(pItem)
->GetValue() ) );
aItemSet.ClearItem( RES_PARATR_SPLIT );
}
@@ -3703,7 +3703,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
if( nSpace )
aFrmSet.Put( SvxULSpaceItem(nSpace,nSpace, RES_UL_SPACE) );
- RndStdIds eAnchorId = ((const SwFmtAnchor&)aFrmSet.
+ RndStdIds eAnchorId = static_cast<const SwFmtAnchor&>(aFrmSet.
Get( RES_ANCHOR )).
GetAnchorId();
SwFrmFmt *pFrmFmt = pDoc->MakeFlySection(
@@ -3924,7 +3924,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
// in der Zelle kann sich ein Bereich befinden!
eTabAdjust = aAttrTab.pAdjust
- ? ((const SvxAdjustItem&)aAttrTab.pAdjust->GetItem()).
+ ? static_cast<const SvxAdjustItem&>(aAttrTab.pAdjust->GetItem()).
GetAdjust()
: SVX_ADJUST_END;
}
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index e3adc949ba17..4db0fc747ef0 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -438,12 +438,12 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
bool bNumFmt = false, bValue = false;
if( SfxItemState::SET==rItemSet.GetItemState( RES_BOXATR_FORMAT, false, &pItem ) )
{
- nNumFmt = ((const SwTblBoxNumFormat *)pItem)->GetValue();
+ nNumFmt = static_cast<const SwTblBoxNumFormat *>(pItem)->GetValue();
bNumFmt = true;
}
if( SfxItemState::SET==rItemSet.GetItemState( RES_BOXATR_VALUE, false, &pItem ) )
{
- nValue = ((const SwTblBoxValue *)pItem)->GetValue();
+ nValue = static_cast<const SwTblBoxValue *>(pItem)->GetValue();
bValue = true;
if( !bNumFmt )
nNumFmt = pBox->GetFrmFmt()->GetTblBoxNumFmt().GetValue();
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index b660bea40d5e..f97b9625e051 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -2003,7 +2003,7 @@ static void ParseCSS1_text_indent( const CSS1Expression *pExpr,
if( SfxItemState::SET == rItemSet.GetItemState( aItemIds.nLRSpace, false,
&pItem ) )
{
- SvxLRSpaceItem aLRItem( *((const SvxLRSpaceItem*)pItem) );
+ SvxLRSpaceItem aLRItem( *static_cast<const SvxLRSpaceItem*>(pItem) );
aLRItem.SetTxtFirstLineOfst( nIndent );
rItemSet.Put( aLRItem );
}
@@ -2058,7 +2058,7 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr,
if( SfxItemState::SET == rItemSet.GetItemState( aItemIds.nLRSpace, false,
&pItem ) )
{
- SvxLRSpaceItem aLRItem( *((const SvxLRSpaceItem*)pItem) );
+ SvxLRSpaceItem aLRItem( *static_cast<const SvxLRSpaceItem*>(pItem) );
aLRItem.SetTxtLeft( (sal_uInt16)nLeft );
rItemSet.Put( aLRItem );
}
@@ -2113,7 +2113,7 @@ static void ParseCSS1_margin_right( const CSS1Expression *pExpr,
if( SfxItemState::SET == rItemSet.GetItemState( aItemIds.nLRSpace, false,
&pItem ) )
{
- SvxLRSpaceItem aLRItem( *((const SvxLRSpaceItem*)pItem) );
+ SvxLRSpaceItem aLRItem( *static_cast<const SvxLRSpaceItem*>(pItem) );
aLRItem.SetRight( (sal_uInt16)nRight );
rItemSet.Put( aLRItem );
}
@@ -2171,7 +2171,7 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr,
if( SfxItemState::SET == rItemSet.GetItemState( aItemIds.nULSpace, false,
&pItem ) )
{
- SvxULSpaceItem aULItem( *((const SvxULSpaceItem*)pItem) );
+ SvxULSpaceItem aULItem( *static_cast<const SvxULSpaceItem*>(pItem) );
aULItem.SetUpper( nUpper );
rItemSet.Put( aULItem );
}
@@ -2229,7 +2229,7 @@ static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr,
if( SfxItemState::SET == rItemSet.GetItemState( aItemIds.nULSpace, false,
&pItem ) )
{
- SvxULSpaceItem aULItem( *((const SvxULSpaceItem*)pItem) );
+ SvxULSpaceItem aULItem( *static_cast<const SvxULSpaceItem*>(pItem) );
aULItem.SetLower( nLower );
rItemSet.Put( aULItem );
}
@@ -2332,7 +2332,7 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr,
if( SfxItemState::SET == rItemSet.GetItemState( aItemIds.nLRSpace, false,
&pItem ) )
{
- SvxLRSpaceItem aLRItem( *((const SvxLRSpaceItem*)pItem) );
+ SvxLRSpaceItem aLRItem( *static_cast<const SvxLRSpaceItem*>(pItem) );
if( bSetMargins[3] )
aLRItem.SetLeft( (sal_uInt16)nMargins[3] );
if( bSetMargins[1] )
@@ -2361,7 +2361,7 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr,
if( SfxItemState::SET == rItemSet.GetItemState( aItemIds.nULSpace, false,
&pItem ) )
{
- SvxULSpaceItem aULItem( *((const SvxULSpaceItem*)pItem) );
+ SvxULSpaceItem aULItem( *static_cast<const SvxULSpaceItem*>(pItem) );
if( bSetMargins[0] )
aULItem.SetUpper( (sal_uInt16)nMargins[0] );
if( bSetMargins[2] )
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 37ad01950afe..2edd0df59b2a 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -1688,7 +1688,7 @@ void SwHTMLParser::NextToken( int nToken )
Show(); // show what we have up to here
SvxAdjust eAdjust = aAttrTab.pAdjust
- ? ((const SvxAdjustItem&)aAttrTab.pAdjust->GetItem()).
+ ? static_cast<const SvxAdjustItem&>(aAttrTab.pAdjust->GetItem()).
GetAdjust()
: SVX_ADJUST_END;
BuildTable( eAdjust );
@@ -2348,7 +2348,7 @@ bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, bool bUpdateNum )
{
bool bFont = (nIdx % 5) == 0;
const SfxPoolItem& rItem =
- ((const SwCntntNode *)pTxtNd)->GetAttr( nWhich );
+ static_cast<const SwCntntNode *>(pTxtNd)->GetAttr( nWhich );
if( bFont ? swhtml_css1atr_equalFontItems(rItem,pHt->GetAttr())
: rItem == pHt->GetAttr() )
{
@@ -2852,7 +2852,7 @@ void SwHTMLParser::_SetAttr( bool bChkEnd, bool bBeforeTable,
{
sal_uInt16 nFldWhich =
pPostIts
- ? ((const SwFmtFld *)pAttr->pItem)->GetField()->GetTyp()->Which()
+ ? static_cast<const SwFmtFld *>(pAttr->pItem)->GetField()->GetTyp()->Which()
: 0;
if( pPostIts && (RES_POSTITFLD == nFldWhich ||
RES_SCRIPTFLD == nFldWhich) )
@@ -4910,7 +4910,7 @@ void SwHTMLParser::InsertSpacer()
// der Rahmen anlegen
RndStdIds eAnchorId =
- ((const SwFmtAnchor &)aFrmSet.Get(RES_ANCHOR)).GetAnchorId();
+ static_cast<const SwFmtAnchor &>(aFrmSet.Get(RES_ANCHOR)).GetAnchorId();
SwFrmFmt *pFlyFmt = pDoc->MakeFlySection( eAnchorId,
pPam->GetPoint(), &aFrmSet );
// Ggf Frames anlegen und auto-geb. Rahmen registrieren
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index caf05841d7ce..c62e000371f3 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -173,7 +173,7 @@ void SwHTMLWriter::SetupFilterOptions(SfxMedium& rMedium)
return;
- OUString sFilterOptions = ((const SfxStringItem*)pItem)->GetValue();
+ OUString sFilterOptions = static_cast<const SfxStringItem*>(pItem)->GetValue();
if (sFilterOptions == "SkipImages")
{
mbSkipImages = true;
@@ -313,7 +313,7 @@ sal_uLong SwHTMLWriter::WriteStream()
nCSS1Script = CSS1_OUTMODE_WESTERN;
break;
}
- eLang = ((const SvxLanguageItem&)pDoc
+ eLang = static_cast<const SvxLanguageItem&>(pDoc
->GetDefault(GetLangWhichIdFromScript(nCSS1Script))).GetLanguage();
nFootNote = nEndNote = 0;
@@ -396,7 +396,7 @@ sal_uLong SwHTMLWriter::WriteStream()
SfxItemState::SET == rPageItemSet.GetItemState( RES_HEADER, true, &pItem) )
{
const SwFrmFmt *pHeaderFmt =
- ((const SwFmtHeader *)pItem)->GetHeaderFmt();
+ static_cast<const SwFmtHeader *>(pItem)->GetHeaderFmt();
if( pHeaderFmt )
OutHTML_HeaderFooter( *this, *pHeaderFmt, true );
}
@@ -416,7 +416,7 @@ sal_uLong SwHTMLWriter::WriteStream()
SfxItemState::SET == rPageItemSet.GetItemState( RES_FOOTER, true, &pItem) )
{
const SwFrmFmt *pFooterFmt =
- ((const SwFmtFooter *)pItem)->GetFooterFmt();
+ static_cast<const SwFmtFooter *>(pItem)->GetFooterFmt();
if( pFooterFmt )
OutHTML_HeaderFooter( *this, *pFooterFmt, false );
}
@@ -522,7 +522,7 @@ static const SwFmtCol *lcl_html_GetFmtCol( const SwSection& rSection,
const SfxPoolItem* pItem;
if( FILE_LINK_SECTION != rSection.GetType() &&
SfxItemState::SET == rFmt.GetAttrSet().GetItemState(RES_COL,false,&pItem) &&
- ((const SwFmtCol *)pItem)->GetNumCols() > 1 )
+ static_cast<const SwFmtCol *>(pItem)->GetNumCols() > 1 )
{
pCol = (const SwFmtCol *)pItem;
}
@@ -860,7 +860,7 @@ static void OutBodyColor( const sal_Char* pTag, const SwFmt *pFmt,
if( COL_AUTO == aColor.GetColor() )
aColor.SetColor( COL_BLACK );
- Color aRefColor( ((const SvxColorItem*)pRefItem)->GetValue() );
+ Color aRefColor( static_cast<const SvxColorItem*>(pRefItem)->GetValue() );
if( COL_AUTO == aRefColor.GetColor() )
aRefColor.SetColor( COL_BLACK );
@@ -919,7 +919,7 @@ sal_uInt16 SwHTMLWriter::OutHeaderAttrs()
break;
const sal_uInt16 nFldWhich =
- ((const SwFmtFld&)pHt->GetAttr()).GetField()->GetTyp()->Which();
+ static_cast<const SwFmtFld&>(pHt->GetAttr()).GetField()->GetTyp()->Which();
if( RES_POSTITFLD!=nFldWhich &&
RES_SCRIPTFLD!=nFldWhich )
break;
@@ -986,7 +986,7 @@ const SwPageDesc *SwHTMLWriter::MakeHeader( sal_uInt16 &rHeaderAttrs )
SwNode *pNd = pDoc->GetNodes()[ nNodeIdx ];
if( pNd->IsCntntNode() )
{
- pPageDesc = ((const SwFmtPageDesc &)pNd->GetCntntNode()
+ pPageDesc = static_cast<const SwFmtPageDesc &>(pNd->GetCntntNode()
->GetAttr(RES_PAGEDESC)).GetPageDesc();
break;
}
@@ -1236,7 +1236,7 @@ void SwHTMLWriter::OutBackground( const SfxItemSet& rItemSet, bool bGraphic )
if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false,
&pItem ))
{
- OutBackground( ((const SvxBrushItem*)pItem), bGraphic );
+ OutBackground( static_cast<const SvxBrushItem*>(pItem), bGraphic );
}
}
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index 7cd25b955257..fb5d2aff68c0 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -42,7 +42,7 @@ sal_Int16 SwWriteTableCell::GetVertOri() const
if( SfxItemState::SET == rItemSet.GetItemState( RES_VERT_ORIENT, false, &pItem ) )
{
sal_Int16 eBoxVertOri =
- ((const SwFmtVertOrient *)pItem)->GetVertOrient();
+ static_cast<const SwFmtVertOrient *>(pItem)->GetVertOrient();
if( text::VertOrientation::CENTER==eBoxVertOri || text::VertOrientation::BOTTOM==eBoxVertOri)
eCellVertOri = eBoxVertOri;
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8926a7a0040b..81db98a05043 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6974,7 +6974,7 @@ static void impl_WriteTabElement( FSHelperPtr pSerializer,
void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop )
{
const SfxPoolItem* pLR = m_rExport.HasItem( RES_LR_SPACE );
- long nCurrentLeft = pLR ? ((const SvxLRSpaceItem*)pLR)->GetTxtLeft() : 0;
+ long nCurrentLeft = pLR ? static_cast<const SvxLRSpaceItem*>(pLR)->GetTxtLeft() : 0;
sal_uInt16 nCount = rTabStop.Count();
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 5b4c38193e3d..5d3be74efc3e 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -218,7 +218,7 @@ bool DocxExport::DisallowInheritingOutlineNumbering( const SwFmt& rFmt )
{
if (const SwFmt *pParent = rFmt.DerivedFrom())
{
- if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle())
+ if (static_cast<const SwTxtFmtColl*>(pParent)->IsAssignedToListLevelOfOutlineStyle())
{
::sax_fastparser::FSHelperPtr pSerializer = m_pAttrOutput->GetSerializer( );
// Level 9 disables the outline
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 84b031a60859..51a4c62fa713 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2222,7 +2222,7 @@ void RtfAttributeOutput::CharUnderline(const SvxUnderlineItem& rUnderline)
const SfxPoolItem* pItem = m_rExport.HasItem(RES_CHRATR_WORDLINEMODE);
bool bWord = false;
if (pItem)
- bWord = ((const SvxWordLineModeItem*)pItem)->GetValue() ? true : false;
+ bWord = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue() ? true : false;
switch (rUnderline.GetLineStyle())
{
case UNDERLINE_SINGLE:
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index b0261afef8ba..5949a28bdac5 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -754,7 +754,7 @@ bool RtfExport::DisallowInheritingOutlineNumbering(const SwFmt& rFmt)
{
if (const SwFmt* pParent = rFmt.DerivedFrom())
{
- if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle())
+ if (static_cast<const SwTxtFmtColl*>(pParent)->IsAssignedToListLevelOfOutlineStyle())
{
// Level 9 disables the outline
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LEVEL).WriteInt32(9);
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index a5f6c0b04d24..3dac90607203 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1577,7 +1577,7 @@ OUString SwWW8AttrIter::GetSnippet(const OUString &rStr, sal_Int32 nAktPos,
m_rExport.m_aCurrentCharPropStarts.push( nAktPos );
const SfxPoolItem &rItem = GetItem(RES_CHRATR_CASEMAP);
- if (SVX_CASEMAP_TITEL == ((const SvxCaseMapItem&)rItem).GetValue())
+ if (SVX_CASEMAP_TITEL == static_cast<const SvxCaseMapItem&>(rItem).GetValue())
{
sal_uInt16 nScriptType = i18n::ScriptType::LATIN;
if (g_pBreakIt->GetBreakIter().is())
@@ -1587,14 +1587,14 @@ OUString SwWW8AttrIter::GetSnippet(const OUString &rStr, sal_Int32 nAktPos,
switch (nScriptType)
{
case i18n::ScriptType::ASIAN:
- nLanguage = ((const SvxLanguageItem&)GetItem(RES_CHRATR_CJK_LANGUAGE)).GetLanguage();
+ nLanguage = static_cast<const SvxLanguageItem&>(GetItem(RES_CHRATR_CJK_LANGUAGE)).GetLanguage();
break;
case i18n::ScriptType::COMPLEX:
- nLanguage = ((const SvxLanguageItem&)GetItem(RES_CHRATR_CTL_LANGUAGE)).GetLanguage();
+ nLanguage = static_cast<const SvxLanguageItem&>(GetItem(RES_CHRATR_CTL_LANGUAGE)).GetLanguage();
break;
case i18n::ScriptType::LATIN:
default:
- nLanguage = ((const SvxLanguageItem&)GetItem(RES_CHRATR_LANGUAGE)).GetLanguage();
+ nLanguage = static_cast<const SvxLanguageItem&>(GetItem(RES_CHRATR_LANGUAGE)).GetLanguage();
break;
}
@@ -2806,7 +2806,7 @@ bool MSWordExportBase::NoPageBreakSection( const SfxItemSet* pSet )
bNoPageBreak = true;
else
{
- SvxBreak eBreak = ((const SvxFmtBreakItem*)pI)->GetBreak();
+ SvxBreak eBreak = static_cast<const SvxFmtBreakItem*>(pI)->GetBreak();
switch (eBreak)
{
case SVX_BREAK_PAGE_BEFORE:
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 16083afa4dbe..59aaf3e6171f 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3227,7 +3227,7 @@ void WW8Export::ExportDocument_Impl()
if (pStdTxtFmtColl && SfxItemState::SET == pStdTxtFmtColl->GetItemState(
RES_PARATR_HYPHENZONE, false, &pItem))
{
- pDop->fAutoHyphen = ((const SvxHyphenZoneItem*)pItem)->IsHyphen();
+ pDop->fAutoHyphen = static_cast<const SvxHyphenZoneItem*>(pItem)->IsHyphen();
}
StoreDoc1();
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index c0f07175d7f2..9bff1195802c 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -445,7 +445,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
SwTwips nHeight = rFlyFmt.GetFrmSize().GetHeight();
nHeight/=20; //nHeight was in twips, want it in half points, but
//then half of total height.
- long nFontHeight = ((const SvxFontHeightItem&)
+ long nFontHeight = static_cast<const SvxFontHeightItem&>(
GetItem(RES_CHRATR_FONTSIZE)).GetHeight();
nHeight-=nFontHeight/20;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index a56517a96e2f..7d7bfc98be73 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -736,7 +736,7 @@ bool WW8Export::DisallowInheritingOutlineNumbering(const SwFmt &rFmt)
{
if (const SwFmt *pParent = rFmt.DerivedFrom())
{
- if (((const SwTxtFmtColl*)pParent)->IsAssignedToListLevelOfOutlineStyle())
+ if (static_cast<const SwTxtFmtColl*>(pParent)->IsAssignedToListLevelOfOutlineStyle())
{
if (bWrtWW8)
{
@@ -769,8 +769,8 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
{
int nLvl = MAXLEVEL;
- if (((const SwTxtFmtColl&)rFmt).IsAssignedToListLevelOfOutlineStyle())
- nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel();
+ if (static_cast<const SwTxtFmtColl&>(rFmt).IsAssignedToListLevelOfOutlineStyle())
+ nLvl = static_cast<const SwTxtFmtColl&>(rFmt).GetAssignedOutlineStyleLevel();
if (nLvl >= 0 && nLvl < MAXLEVEL)
{
@@ -1284,7 +1284,7 @@ void WW8AttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline )
const SfxPoolItem* pItem = m_rWW8Export.HasItem( RES_CHRATR_WORDLINEMODE );
bool bWord = false;
if (pItem)
- bWord = ((const SvxWordLineModeItem*)pItem)->GetValue() ? true : false;
+ bWord = static_cast<const SvxWordLineModeItem*>(pItem)->GetValue() ? true : false;
// WW95 - parameters: 0 = none, 1 = single, 2 = by Word,
// 3 = double, 4 = dotted, 5 = hidden
@@ -3340,7 +3340,7 @@ static bool lcl_IsAtTxtEnd(const SwFmtFtn& rFtn)
const SwSectionNode* pSectNd = rFtn.GetTxtFtn()->GetTxtNode().
FindSectionNode();
while( pSectNd && FTNEND_ATPGORDOCEND ==
- ((const SwFmtFtnEndAtTxtEnd&)pSectNd->GetSection().GetFmt()->
+ static_cast<const SwFmtFtnEndAtTxtEnd&>(pSectNd->GetSection().GetFmt()->
GetFmtAttr( nWh, true)).GetValue() )
pSectNd = pSectNd->StartOfSectionNode()->FindSectionNode();
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 53f383997e13..82ed68cd3132 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1547,7 +1547,7 @@ sal_Int32 SwWW8ImplReader::MatchSdrBoxIntoFlyBoxItem(const Color& rLineColor,
return nOutsideThick;
}
-#define WW8ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue()
+#define WW8ITEMVALUE(ItemSet,Id,Cast) static_cast<const Cast&>((ItemSet).Get(Id)).GetValue()
void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
SfxItemSet& rFlySet, MSO_LineStyle eLineStyle, MSO_LineDashing eDashing, MSO_SPT eShapeType,
@@ -1749,7 +1749,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
eState = rOldSet.GetItemState(XATTR_FILLSTYLE, true, &pItem);
if (eState == SfxItemState::SET)
{
- const drawing::FillStyle eFill = ((const XFillStyleItem*)pItem)->GetValue();
+ const drawing::FillStyle eFill = static_cast<const XFillStyleItem*>(pItem)->GetValue();
switch (eFill)
{
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d2d30bebbef6..d069e20224d5 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1737,7 +1737,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
bFound = pSty->GetAttrSet().GetItemState(RES_PARATR_TABSTOP, false,
&pTabs) == SfxItemState::SET;
if( bFound )
- aAttr = *((const SvxTabStopItem*)pTabs);
+ aAttr = *static_cast<const SvxTabStopItem*>(pTabs);
else
{
sal_uInt16 nOldTabBase = nTabBase;
@@ -5522,7 +5522,7 @@ namespace
const SfxPoolItem *pPasswordItem;
if(pSet && SfxItemState::SET == pSet->GetItemState(SID_PASSWORD, true, &pPasswordItem))
- aPassw = ((const SfxStringItem *)pPasswordItem)->GetValue();
+ aPassw = static_cast<const SfxStringItem *>(pPasswordItem)->GetValue();
else
{
try
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index c3a468b57d26..cad7b49767f2 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -4384,7 +4384,7 @@ void SwWW8ImplReader::Read_Emphasis( sal_uInt16, const sal_uInt8* pData, short n
nLang = SVBT16ToShort( pLang );
else
{
- nLang = ((const SvxLanguageItem *)
+ nLang = static_cast<const SvxLanguageItem *>(
GetFmtAttr(RES_CHRATR_CJK_LANGUAGE))->GetLanguage();
}
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 6276c772b416..9a638be8d110 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -1011,7 +1011,7 @@ void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc )
if( pColl && RES_CONDTXTFMTCOLL == pColl->Which() )
{
const SwFmtCollConditions& rConditions =
- ((const SwConditionTxtFmtColl *)pColl)->GetCondColls();
+ static_cast<const SwConditionTxtFmtColl *>(pColl)->GetCondColls();
bool bSendModify = false;
for( size_t j=0; j < rConditions.size() && !bSendModify; ++j )
{
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 48196c2cf6c1..d34ca353b6b7 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -87,7 +87,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
{
OUString sName;
const SwPageDesc *pPageDesc =
- ((const SwFmtPageDesc *)pItem)->GetPageDesc();
+ static_cast<const SwFmtPageDesc *>(pItem)->GetPageDesc();
if( pPageDesc )
SwStyleNameMapper::FillProgName(
pPageDesc->GetName(),
@@ -109,7 +109,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
false, &pItem ) )
{
sal_Int32 nFormat = (sal_Int32)
- ((const SwTblBoxNumFormat *)pItem)->GetValue();
+ static_cast<const SwTblBoxNumFormat *>(pItem)->GetValue();
if ( (nFormat != -1) && (nFormat != NUMBERFORMAT_TEXT) )
{
diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx
index 254129b4a8d5..b13d83ecb163 100644
--- a/sw/source/filter/xml/xmliteme.cxx
+++ b/sw/source/filter/xml/xmliteme.cxx
@@ -130,7 +130,7 @@ void SwXMLTableItemMapper_Impl::handleSpecialItem(
&pItem ) )
{
sal_Int16 eHoriOrient =
- ((const SwFmtHoriOrient *)pItem)->GetHoriOrient();
+ static_cast<const SwFmtHoriOrient *>(pItem)->GetHoriOrient();
bool bExport = false;
sal_uInt16 nMemberId =
static_cast<sal_uInt16>( rEntry.nMemberId & MID_SW_FLAG_MASK );
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index a9a9a50aa73b..673027b58e04 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -797,7 +797,7 @@ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl(
SfxItemState::SET == pAutoItemSet->GetItemState( RES_FRM_SIZE, false,
&pItem ) )
{
- const SwFmtFrmSize *pSize = ((const SwFmtFrmSize *)pItem);
+ const SwFmtFrmSize *pSize = static_cast<const SwFmtFrmSize *>(pItem);
nWidth = pSize->GetWidth();
bRelWidth = ATT_VAR_SIZE == pSize->GetHeightSizeType();
}
@@ -2676,7 +2676,7 @@ void SwXMLTableContext::MakeTable()
if( SfxItemState::SET == pAutoItemSet->GetItemState( RES_HORI_ORIENT, false,
&pItem ) )
{
- eHoriOrient = ((const SwFmtHoriOrient *)pItem)->GetHoriOrient();
+ eHoriOrient = static_cast<const SwFmtHoriOrient *>(pItem)->GetHoriOrient();
switch( eHoriOrient )
{
case text::HoriOrientation::FULL:
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 79ea895a69d3..3d9dab5c5385 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -99,7 +99,7 @@ void SwXMLTextParagraphExport::exportStyleContent(
if( pColl && RES_CONDTXTFMTCOLL == pColl->Which() )
{
const SwFmtCollConditions& rConditions =
- ((const SwConditionTxtFmtColl *)pColl)->GetCondColls();
+ static_cast<const SwConditionTxtFmtColl *>(pColl)->GetCondColls();
for( size_t i=0; i < rConditions.size(); ++i )
{
const SwCollCondition& rCond = rConditions[i];
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 4e68e202bff2..63d82606d06d 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -156,7 +156,7 @@ SwCharURLPage::SwCharURLPage(vcl::Window* pParent, const SfxItemSet& rCoreSet)
( 0 != ( pShell = SfxObjectShell::Current()) &&
0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
{
- sal_uInt16 nHtmlMode = ((const SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if(HTMLMODE_ON & nHtmlMode)
m_pCharStyleContainer->Hide();
}
@@ -227,7 +227,7 @@ void SwCharURLPage::Reset(const SfxItemSet* rSet)
}
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_SELECTION, false, &pItem))
{
- m_pTextED->SetText(((const SfxStringItem*)pItem)->GetValue());
+ m_pTextED->SetText(static_cast<const SfxStringItem*>(pItem)->GetValue());
m_pTextFT->Enable( false );
m_pTextED->Enable( false );
}
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index b9ee893ab9e9..5fbe842596d0 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -73,7 +73,7 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(vcl::Window* pParent, const SfxItem
( 0 != ( pObjSh = SfxObjectShell::Current()) &&
0 != (pItem = pObjSh->GetItem(SID_HTML_MODE))))
{
- const sal_uInt16 nHtmlMode = ((const SfxUInt16Item*)pItem)->GetValue();
+ const sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if (HTMLMODE_ON & nHtmlMode)
m_pCountParaFram->Hide();
@@ -167,7 +167,7 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet* rSet )
sal_Int16 nOutlineLv;
if( eItemState >= SfxItemState::DEFAULT )
{
- nOutlineLv = ((const SfxUInt16Item &)rSet->Get( GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL) )).GetValue();
+ nOutlineLv = static_cast<const SfxUInt16Item &>(rSet->Get( GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL) )).GetValue();
m_pOutlineLvLB->SelectEntryPos( nOutlineLv ) ;
}
else
@@ -180,7 +180,7 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet* rSet )
if( eItemState >= SfxItemState::DEFAULT )
{
- OUString aStyle = ((const SfxStringItem &)rSet->Get( GetWhich(SID_ATTR_PARA_NUMRULE) )).GetValue();
+ OUString aStyle = static_cast<const SfxStringItem &>(rSet->Get( GetWhich(SID_ATTR_PARA_NUMRULE) )).GetValue();
if(aStyle.isEmpty())
aStyle = m_pNumberStyleLB->GetEntry(0);
@@ -221,7 +221,7 @@ void SwParagraphNumTabPage::Reset( const SfxItemSet* rSet )
eItemState = rSet->GetItemState( FN_NUMBER_NEWSTART_AT);
if( eItemState > SfxItemState::DEFAULT )
{
- const sal_uInt16 nNewStart = ((const SfxUInt16Item&)rSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue();
+ const sal_uInt16 nNewStart = static_cast<const SfxUInt16Item&>(rSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue();
const bool bNotMax = USHRT_MAX != nNewStart;
m_pNewStartNumberCB->Check(bNotMax);
m_pNewStartNF->SetValue(bNotMax ? nNewStart : 1);
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 934988141b87..57871047c656 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -252,7 +252,7 @@ void SwLoadOptPage::Reset( const SfxItemSet* rSet)
const SfxPoolItem* pItem;
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_WRTSHELL, false, &pItem))
- m_pWrtShell = (SwWrtShell*)((const SwPtrItem*)pItem)->GetValue();
+ m_pWrtShell = (SwWrtShell*)static_cast<const SwPtrItem*>(pItem)->GetValue();
SwFldUpdateFlags eFldFlags = AUTOUPD_GLOBALSETTING;
m_nOldLinkMode = GLOBALSETTING;
@@ -312,7 +312,7 @@ void SwLoadOptPage::Reset( const SfxItemSet* rSet)
if(SfxItemState::SET == rSet->GetItemState(SID_ATTR_APPLYCHARUNIT, false, &pItem))
{
- bool bUseCharUnit = ((const SfxBoolItem*)pItem)->GetValue();
+ bool bUseCharUnit = static_cast<const SfxBoolItem*>(pItem)->GetValue();
m_pUseCharUnit->Check(bUseCharUnit);
}
else
@@ -558,7 +558,7 @@ void SwCaptionOptPage::Reset( const SfxItemSet* rSet)
const SfxPoolItem* pItem;
if(SfxItemState::SET == rSet->GetItemState(SID_HTML_MODE, false, &pItem))
{
- bHTMLMode = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
+ bHTMLMode = 0 != (static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON);
}
DelUserData();
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index c2b594be1144..3e6529482b54 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -752,7 +752,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
FONT_GROUP_CJK == nFontGroup ? SID_ATTR_CHAR_CJK_LANGUAGE : SID_ATTR_CHAR_CTL_LANGUAGE;
if( SfxItemState::SET == rSet->GetItemState(nLangSlot, false, &pLang))
- eLanguage = ((const SvxLanguageItem*)pLang)->GetValue();
+ eLanguage = static_cast<const SvxLanguageItem*>(pLang)->GetValue();
OUString sToReplace = sScriptWestern;
if(FONT_GROUP_CJK == nFontGroup )
@@ -770,7 +770,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_PRINTER, false, &pItem))
{
- pPrt = (SfxPrinter*)((const SwPtrItem*)pItem)->GetValue();
+ pPrt = (SfxPrinter*)static_cast<const SwPtrItem*>(pItem)->GetValue();
}
else
{
@@ -807,12 +807,12 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
}
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_STDFONTS, false, &pItem))
{
- pFontConfig = (SwStdFontConfig*)((const SwPtrItem*)pItem)->GetValue();
+ pFontConfig = (SwStdFontConfig*)static_cast<const SwPtrItem*>(pItem)->GetValue();
}
if(SfxItemState::SET == rSet->GetItemState(FN_PARAM_WRTSHELL, false, &pItem))
{
- pWrtShell = (SwWrtShell*)((const SwPtrItem*)pItem)->GetValue();
+ pWrtShell = (SwWrtShell*)static_cast<const SwPtrItem*>(pItem)->GetValue();
}
OUString sStdBackup;
OUString sOutBackup;
@@ -1211,7 +1211,7 @@ void SwTableOptionsTabPage::Reset( const SfxItemSet* rSet)
const SfxPoolItem* pItem;
if(SfxItemState::SET == rSet->GetItemState(SID_HTML_MODE, false, &pItem))
{
- bHTMLMode = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
+ bHTMLMode = 0 != (static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON);
}
// hide certain controls for html
@@ -1421,7 +1421,7 @@ void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet* rSet )
}
if( SfxItemState::SET == rSet->GetItemState( FN_PARAM_CRSR_IN_PROTECTED, false, &pItem ))
- m_pCrsrInProtCB->Check(((const SfxBoolItem*)pItem)->GetValue());
+ m_pCrsrInProtCB->Check(static_cast<const SfxBoolItem*>(pItem)->GetValue());
m_pCrsrInProtCB->SaveValue();
const SwDocDisplayItem* pDocDisplayAttr = 0;
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index a2eb4d63339a..04cc19061458 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1438,7 +1438,7 @@ void SwInsertDBColAutoPilot::SetTabSet()
}
if( SfxItemState::SET == pTblSet->GetItemState( FN_PARAM_TABLE_NAME, false,
- &pItem ) && ((const SfxStringItem*)pItem)->GetValue() ==
+ &pItem ) && static_cast<const SfxStringItem*>(pItem)->GetValue() ==
rSh.GetTableFmt()->GetName() )
pTblSet->ClearItem( FN_PARAM_TABLE_NAME );
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index b0c0903db8ee..8c6c7d1e1853 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1464,7 +1464,7 @@ short SwInsertSectionTabDialog::Ok()
if(SfxItemState::SET == pOutputItemSet->GetItemState(RES_COL, false, &pCol))
{
aRequest.AppendItem(SfxUInt16Item(SID_ATTR_COLUMNS,
- ((const SwFmtCol*)pCol)->GetColumns().size()));
+ static_cast<const SwFmtCol*>(pCol)->GetColumns().size()));
}
aRequest.AppendItem(SfxStringItem( FN_PARAM_REGION_NAME,
m_pSectionData->GetSectionName()));
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 7f935c00ddd8..7df0addd74f5 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -610,7 +610,7 @@ void SwFldVarPage::UpdateSubType()
break;
case TYP_GETFLD:
- if (GetCurField() && aList[i] == ((const SwFormulaField*)GetCurField())->GetFormula())
+ if (GetCurField() && aList[i] == static_cast<const SwFormulaField*>(GetCurField())->GetFormula())
bInsert = true;
break;
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 5cf90a486e9b..26a43894a9e9 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -328,7 +328,7 @@ void SwIndexMarkPane::UpdateLanguageDependenciesForPhoneticReading()
}
SfxItemSet aLangSet(pSh->GetAttrPool(), nWhich, nWhich);
pSh->GetCurAttr(aLangSet);
- nLangForPhoneticReading = ((const SvxLanguageItem&)aLangSet.Get(nWhich)).GetLanguage();
+ nLangForPhoneticReading = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
}
}
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index cd2ed1473548..459c038c6da3 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -368,7 +368,7 @@ void SwNumPositionTabPage::ActivatePage(const SfxItemSet& )
const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
if(pExampleSet && pExampleSet->GetItemState(FN_PARAM_NUM_PRESET, false, &pItem) != SfxItemState::UNKNOWN)
{
- bPreset = ((const SfxBoolItem*)pItem)->GetValue();
+ bPreset = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
bModified = (!pActNum->GetNumFmt( 0 ) || bPreset);
if(*pActNum != *pSaveNum ||
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index 1ddc306861d2..d29f24c446a3 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -38,7 +38,7 @@ namespace
const SfxPoolItem* pItem(0);
if (SfxItemState::SET == aSet.GetItemState( RES_PAGEDESC, true, &pItem ) && pItem)
{
- ::boost::optional<sal_uInt16> oNumOffset = ((const SwFmtPageDesc *)pItem)->GetNumOffset();
+ ::boost::optional<sal_uInt16> oNumOffset = static_cast<const SwFmtPageDesc *>(pItem)->GetNumOffset();
if (oNumOffset)
rPageNo = oNumOffset.get();
if (ppPageFmtDesc)
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index d70b4fdbff50..2d0ff785646c 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -97,7 +97,7 @@ SwFormatTablePage::SwFormatTablePage(vcl::Window* pParent, const SfxItemSet& rSe
const SfxPoolItem* pItem;
if(SfxItemState::SET == rSet.GetItemState(SID_HTML_MODE, false, &pItem))
- bHtmlMode = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
+ bHtmlMode = 0 != (static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON);
bool bCTL = SW_MOD()->GetCTLOptions().IsCTLFontEnabled();
get<VclContainer>("properties")->Show(!bHtmlMode && bCTL);
@@ -447,13 +447,13 @@ void SwFormatTablePage::Reset( const SfxItemSet* )
//Name
if(SfxItemState::SET == rSet.GetItemState( FN_PARAM_TABLE_NAME, false, &pItem ))
{
- m_pNameED->SetText(((const SfxStringItem*)pItem)->GetValue());
+ m_pNameED->SetText(static_cast<const SfxStringItem*>(pItem)->GetValue());
m_pNameED->SaveValue();
}
if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem ))
{
- pTblData = (SwTableRep*)((const SwPtrItem*) pItem)->GetValue();
+ pTblData = (SwTableRep*)static_cast<const SwPtrItem*>( pItem)->GetValue();
nMinTableWidth = pTblData->GetColCount() * MINLAY;
if(pTblData->GetWidthPercent())
@@ -545,9 +545,9 @@ void SwFormatTablePage::Reset( const SfxItemSet* )
if(SfxItemState::SET == rSet.GetItemState( RES_UL_SPACE, false,&pItem ))
{
m_pTopMF->SetValue(m_pTopMF->Normalize(
- ((const SvxULSpaceItem*)pItem)->GetUpper()), FUNIT_TWIP);
+ static_cast<const SvxULSpaceItem*>(pItem)->GetUpper()), FUNIT_TWIP);
m_pBottomMF->SetValue(m_pBottomMF->Normalize(
- ((const SvxULSpaceItem*)pItem)->GetLower()), FUNIT_TWIP);
+ static_cast<const SvxULSpaceItem*>(pItem)->GetLower()), FUNIT_TWIP);
m_pTopMF->SaveValue();
m_pBottomMF->SaveValue();
}
@@ -746,7 +746,7 @@ SwTableColumnPage::SwTableColumnPage(vcl::Window* pParent, const SfxItemSet& rSe
const SfxPoolItem* pItem;
Init((SfxItemState::SET == rSet.GetItemState( SID_HTML_MODE, false,&pItem )
- && ((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON));
+ && static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON));
}
//Description: Page column configuration
@@ -767,7 +767,7 @@ void SwTableColumnPage::Reset( const SfxItemSet* )
const SfxPoolItem* pItem;
if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem ))
{
- pTblData = (SwTableRep*)((const SwPtrItem*) pItem)->GetValue();
+ pTblData = (SwTableRep*)static_cast<const SwPtrItem*>( pItem)->GetValue();
nNoOfVisibleCols = pTblData->GetColCount();
nNoOfCols = pTblData->GetAllColCount();
nTableWidth = pTblData->GetAlign() != text::HoriOrientation::FULL &&
@@ -1300,7 +1300,7 @@ SwTextFlowPage::SwTextFlowPage(vcl::Window* pParent, const SfxItemSet& rSet)
#ifndef SW_FILEFORMAT_40
const SfxPoolItem *pItem;
if(SfxItemState::SET == rSet.GetItemState( SID_HTML_MODE, false,&pItem )
- && ((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON)
+ && static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON)
#endif
{
m_pKeepCB->Hide();
@@ -1459,12 +1459,12 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet )
if(SfxItemState::SET == rSet->GetItemState( RES_KEEP, false, &pItem ))
{
- m_pKeepCB->Check( ((const SvxFmtKeepItem*)pItem)->GetValue() );
+ m_pKeepCB->Check( static_cast<const SvxFmtKeepItem*>(pItem)->GetValue() );
m_pKeepCB->SaveValue();
}
if(SfxItemState::SET == rSet->GetItemState( RES_LAYOUT_SPLIT, false, &pItem ))
{
- m_pSplitCB->Check( ((const SwFmtLayoutSplit*)pItem)->GetValue() );
+ m_pSplitCB->Check( static_cast<const SwFmtLayoutSplit*>(pItem)->GetValue() );
}
else
m_pSplitCB->Check();
@@ -1474,7 +1474,7 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet )
if(SfxItemState::SET == rSet->GetItemState( RES_ROW_SPLIT, false, &pItem ))
{
- m_pSplitRowCB->Check( ((const SwFmtRowSplit*)pItem)->GetValue() );
+ m_pSplitRowCB->Check( static_cast<const SwFmtRowSplit*>(pItem)->GetValue() );
}
else
m_pSplitRowCB->SetState(TRISTATE_INDET);
@@ -1485,10 +1485,10 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet )
if(SfxItemState::SET == rSet->GetItemState( RES_PAGEDESC, false, &pItem ))
{
OUString sPageDesc;
- const SwPageDesc* pDesc = ((const SwFmtPageDesc*)pItem)->GetPageDesc();
+ const SwPageDesc* pDesc = static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc();
- //m_pPageNoNF->SetValue(((const SwFmtPageDesc*)pItem)->GetNumOffset());
- ::boost::optional<sal_uInt16> oNumOffset = ((const SwFmtPageDesc*)pItem)->GetNumOffset();
+ //m_pPageNoNF->SetValue(static_cast<const SwFmtPageDesc*>(pItem)->GetNumOffset());
+ ::boost::optional<sal_uInt16> oNumOffset = static_cast<const SwFmtPageDesc*>(pItem)->GetNumOffset();
if (oNumOffset)
m_pPageNoNF->SetValue(oNumOffset.get());
else
@@ -1587,7 +1587,7 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet )
if(SfxItemState::SET == rSet->GetItemState( FN_PARAM_TABLE_HEADLINE, false, &pItem ))
{
- sal_uInt16 nRep = ((const SfxUInt16Item*)pItem)->GetValue();
+ sal_uInt16 nRep = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
m_pHeadLineCB->Check( nRep > 0 );
m_pHeadLineCB->SaveValue();
m_pRepeatHeaderNF->SetValue( nRep );
@@ -1596,13 +1596,13 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet )
}
if ( rSet->GetItemState(FN_TABLE_BOX_TEXTORIENTATION) > SfxItemState::DEFAULT )
{
- sal_uLong nDirection = ((const SvxFrameDirectionItem&)rSet->Get(FN_TABLE_BOX_TEXTORIENTATION)).GetValue();
+ sal_uLong nDirection = static_cast<const SvxFrameDirectionItem&>(rSet->Get(FN_TABLE_BOX_TEXTORIENTATION)).GetValue();
m_pTextDirectionLB->SelectEntryPos(m_pTextDirectionLB->GetEntryPos( (const void*)nDirection ));
}
if ( rSet->GetItemState(FN_TABLE_SET_VERT_ALIGN) > SfxItemState::DEFAULT )
{
- sal_uInt16 nVert = ((const SfxUInt16Item&)rSet->Get(FN_TABLE_SET_VERT_ALIGN)).GetValue();
+ sal_uInt16 nVert = static_cast<const SfxUInt16Item&>(rSet->Get(FN_TABLE_SET_VERT_ALIGN)).GetValue();
sal_uInt16 nPos = 0;
switch(nVert)
{
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 3f9d862da737..ea6574b765c4 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -605,7 +605,7 @@ void SwModule::ExecOther(SfxRequest& rReq)
case SID_ATTR_METRIC:
if(pArgs && SfxItemState::SET == pArgs->GetItemState(nWhich, false, &pItem))
{
- FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)pItem)->GetValue();
+ FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem)->GetValue();
switch( eUnit )
{
case FUNIT_MM:
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 29670f3d091a..bd6b96c86c5c 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -162,7 +162,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
const SfxItemSet* pMedSet;
if( 0 != ( pMedSet = rMedium.GetItemSet() ) && SfxItemState::SET ==
pMedSet->GetItemState( FN_API_CALL, true, &pApiItem ) )
- bAPICall = ((const SfxBoolItem*)pApiItem)->GetValue();
+ bAPICall = static_cast<const SfxBoolItem*>(pApiItem)->GetValue();
const SfxFilter* pFlt = rMedium.GetFilter();
if( !pFlt )
@@ -206,7 +206,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
const SfxItemSet* pSet = rMedium.GetItemSet();
const SfxPoolItem *pPassItem;
if(pSet && SfxItemState::SET == pSet->GetItemState(SID_PASSWORD, true, &pPassItem))
- aPasswd = ((const SfxStringItem *)pPassItem)->GetValue();
+ aPasswd = static_cast<const SfxStringItem *>(pPassItem)->GetValue();
}
if (!(*ppRdr)->CheckPasswd( aPasswd, *pRead ))
@@ -232,7 +232,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,
const SfxPoolItem* pItem;
if( 0 != ( pSet = rMedium.GetItemSet() ) && SfxItemState::SET ==
pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
- aOpt.ReadUserData( ((const SfxStringItem*)pItem)->GetValue() );
+ aOpt.ReadUserData( static_cast<const SfxStringItem*>(pItem)->GetValue() );
if( pRead )
pRead->GetReaderOpt().SetASCIIOpts( aOpt );
@@ -703,7 +703,7 @@ bool SwDocShell::ConvertTo( SfxMedium& rMedium )
{
if( SfxItemState::SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS,
true, &pItem ) )
- sItemOpt = ((const SfxStringItem*)pItem)->GetValue();
+ sItemOpt = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
if(!sItemOpt.isEmpty())
aOpt.ReadUserData( sItemOpt );
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index bab7224ae7e8..0481707ca3ad 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -862,7 +862,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
OUString aFileName, aTemplateName;
if( pArgs && SfxItemState::SET == pArgs->GetItemState( nWhich, false, &pItem ) )
{
- aFileName = ((const SfxStringItem*)pItem)->GetValue();
+ aFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
SFX_ITEMSET_ARG( pArgs, pTemplItem, SfxStringItem, SID_TEMPLATE_NAME, false );
if ( pTemplItem )
aTemplateName = pTemplItem->GetValue();
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index aebf6ede5e90..93c717cce510 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -279,20 +279,20 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY,
false, &pItem ))
{
- const sal_uInt16 nFamily = ((const SfxUInt16Item*)pItem)->GetValue();
+ const sal_uInt16 nFamily = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
OUString sName;
sal_uInt16 nMask = 0;
if( SfxItemState::SET == pArgs->GetItemState( SID_STYLE_NEW,
false, &pItem ))
- sName = ((const SfxStringItem*)pItem)->GetValue();
+ sName = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( SfxItemState::SET == pArgs->GetItemState( SID_STYLE_MASK,
false, &pItem ))
- nMask = ((const SfxUInt16Item*)pItem)->GetValue();
+ nMask = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
OUString sParent;
if( SfxItemState::SET == pArgs->GetItemState( SID_STYLE_REFERENCE,
false, &pItem ))
- sParent = ((const SfxStringItem*)pItem)->GetValue();
+ sParent = static_cast<const SfxStringItem*>(pItem)->GetValue();
if (sName.isEmpty() && mxBasePool.get())
sName = SfxStyleDialog::GenerateUnusedName(*mxBasePool);
@@ -385,15 +385,15 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
SwWrtShell* pShell = GetWrtShell();
if( SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem ))
- aParam = ((const SfxStringItem*)pItem)->GetValue();
+ aParam = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_FAMILY,
false, &pItem ))
- nFamily = ((const SfxUInt16Item*)pItem)->GetValue();
+ nFamily = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_FAMILYNAME, false, &pItem ))
{
- OUString aFamily = ((const SfxStringItem*)pItem)->GetValue();
+ OUString aFamily = static_cast<const SfxStringItem*>(pItem)->GetValue();
if(aFamily.equalsAscii("CharacterStyles"))
nFamily = SFX_STYLE_FAMILY_CHAR;
else
@@ -412,7 +412,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_MASK,
false, &pItem ))
- nMask = ((const SfxUInt16Item*)pItem)->GetValue();
+ nMask = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
if( SfxItemState::SET == pArgs->GetItemState(FN_PARAM_WRTSHELL,
false, &pItem ))
pActShell = pShell = (SwWrtShell*)static_cast<const SwPtrItem*>(pItem)->GetValue();
@@ -445,7 +445,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
case SFX_STYLE_FAMILY_PSEUDO:
if(SfxItemState::SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, false, &pItem))
{
- aParam = ((const SfxStringItem*)pItem)->GetValue();
+ aParam = static_cast<const SfxStringItem*>(pItem)->GetValue();
}
break;
}
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 64602029cb70..3c53dcb2bdf0 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1330,7 +1330,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
const SfxPoolItem* pAutoUpdate;
if(SfxItemState::SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,false, &pAutoUpdate ))
{
- pColl->SetAutoUpdateFmt(((const SfxBoolItem*)pAutoUpdate)->GetValue());
+ pColl->SetAutoUpdateFmt(static_cast<const SfxBoolItem*>(pAutoUpdate)->GetValue());
}
const SwCondCollItem* pCondItem;
@@ -1455,7 +1455,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
const SfxPoolItem* pAutoUpdate;
if(SfxItemState::SET == rSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE,false, &pAutoUpdate ))
{
- pFrmFmt->SetAutoUpdateFmt(((const SfxBoolItem*)pAutoUpdate)->GetValue());
+ pFrmFmt->SetAutoUpdateFmt(static_cast<const SfxBoolItem*>(pAutoUpdate)->GetValue());
}
pFmt = pFrmFmt;
}
diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx
index db1d54f84217..43c72f627a0e 100644
--- a/sw/source/uibase/dialog/regionsw.cxx
+++ b/sw/source/uibase/dialog/regionsw.cxx
@@ -96,7 +96,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
if ( SfxItemState::SET ==
pSet->GetItemState(FN_PARAM_REGION_NAME, true, &pItem) )
{
- const OUString sRemoveWhenUniStringIsGone = ((const SfxStringItem *)pItem)->GetValue();
+ const OUString sRemoveWhenUniStringIsGone = static_cast<const SfxStringItem *>(pItem)->GetValue();
aTmpStr = rSh.GetUniqueSectionName(&sRemoveWhenUniStringIsGone);
}
else
@@ -127,12 +127,12 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
}
const bool bHidden = SfxItemState::SET == pSet->GetItemState(FN_PARAM_REGION_HIDDEN, true, &pItem) &&
- ((const SfxBoolItem *)pItem)->GetValue();
+ static_cast<const SfxBoolItem *>(pItem)->GetValue();
const bool bProtect = SfxItemState::SET == pSet->GetItemState(FN_PARAM_REGION_PROTECT, true, &pItem) &&
- ((const SfxBoolItem *)pItem)->GetValue();
+ static_cast<const SfxBoolItem *>(pItem)->GetValue();
// #114856# edit in readonly sections
const bool bEditInReadonly = SfxItemState::SET == pSet->GetItemState(FN_PARAM_REGION_EDIT_IN_READONLY, true, &pItem) &&
- ((const SfxBoolItem *)pItem)->GetValue();
+ static_cast<const SfxBoolItem *>(pItem)->GetValue();
aSection.SetProtectFlag(bProtect);
aSection.SetHidden(bHidden);
@@ -141,16 +141,16 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
if(SfxItemState::SET ==
pSet->GetItemState(FN_PARAM_REGION_CONDITION, true, &pItem))
- aSection.SetCondition(((const SfxStringItem *)pItem)->GetValue());
+ aSection.SetCondition(static_cast<const SfxStringItem *>(pItem)->GetValue());
OUString aFile, aSub;
if(SfxItemState::SET ==
pSet->GetItemState(FN_PARAM_1, true, &pItem))
- aFile = ((const SfxStringItem *)pItem)->GetValue();
+ aFile = static_cast<const SfxStringItem *>(pItem)->GetValue();
if(SfxItemState::SET ==
pSet->GetItemState(FN_PARAM_3, true, &pItem))
- aSub = ((const SfxStringItem *)pItem)->GetValue();
+ aSub = static_cast<const SfxStringItem *>(pItem)->GetValue();
if(!aFile.isEmpty() || !aSub.isEmpty())
{
@@ -162,7 +162,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
pSet->GetItemState(FN_PARAM_2, true, &pItem))
{
sLinkFileName = comphelper::string::setToken(sLinkFileName, 1, sfx2::cTokenSeparator,
- ((const SfxStringItem *)pItem)->GetValue());
+ static_cast<const SfxStringItem *>(pItem)->GetValue());
}
sLinkFileName += aSub;
@@ -223,7 +223,7 @@ void SwBaseShell::EditRegionDialog(SfxRequest& rReq)
OSL_ENSURE(pEditRegionDlg, "Dialog creation failed!");
if(pItem && pItem->ISA(SfxStringItem))
{
- pEditRegionDlg->SelectSection(((const SfxStringItem*)pItem)->GetValue());
+ pEditRegionDlg->SelectSection(static_cast<const SfxStringItem*>(pItem)->GetValue());
}
pEditRegionDlg->Execute();
}
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index 7cdc9d6e4f5a..c99197eb074f 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -281,7 +281,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
{
sTxt = SW_RESSTR(STR_CONTENT_TYPE_SINGLE_REFERENCE);
sTxt += ": ";
- sTxt += ((const SwFmtRefMark*)aCntntAtPos.aFnd.pAttr)->GetRefName();
+ sTxt += static_cast<const SwFmtRefMark*>(aCntntAtPos.aFnd.pAttr)->GetRefName();
}
break;
@@ -328,7 +328,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
break;
case RES_MACROFLD:
- sTxt = ((const SwMacroField*)pFld)->GetMacro();
+ sTxt = static_cast<const SwMacroField*>(pFld)->GetMacro();
break;
case RES_GETREFFLD:
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 59bc6f9fb77b..8068fa1f46f5 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -597,7 +597,7 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
DELETEZ(pGridItem);
//get the grid information
if(SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID, true))
- pGridItem = (SwTextGridItem*)((const SwTextGridItem&)rSet.Get(RES_TEXTGRID)).Clone();
+ pGridItem = (SwTextGridItem*)static_cast<const SwTextGridItem&>(rSet.Get(RES_TEXTGRID)).Clone();
if( SfxItemState::DEFAULT <= rSet.GetItemState( RES_FRAMEDIR, true ))
{
const SvxFrameDirectionItem& rDirItem =
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index f4f754d71ccd..4610db7bc42e 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -1108,7 +1108,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl)
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
- OUString sMsg(((const SvxPostItTextItem&)pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
+ OUString sMsg(static_cast<const SvxPostItTextItem&>(pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
// insert / change comment
pSh->SetRedlineComment(sMsg);
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 5cf01617207f..1a2862ddfe65 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -682,7 +682,7 @@ void SwPreviewZoomControl::StateChanged( sal_uInt16 /*nSID*/,
SwZoomBox_Impl* pBox = (SwZoomBox_Impl*)GetToolBox().GetItemWindow( GetId() );
if(SfxItemState::DEFAULT <= eState)
{
- OUString sZoom(unicode::formatPercent(((const SfxUInt16Item*)pState)->GetValue(),
+ OUString sZoom(unicode::formatPercent(static_cast<const SfxUInt16Item*>(pState)->GetValue(),
Application::GetSettings().GetUILanguageTag()));
pBox->SetText(sZoom);
pBox->SaveValue();
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index c2cfbea258cf..4bbccb4b2eaa 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2101,11 +2101,11 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet )
vcl::Font aFont;
if(pI && pI->ISA(SvxFontItem))
{
- aFont.SetName( ((const SvxFontItem*)pI)->GetFamilyName());
- aFont.SetStyleName(((const SvxFontItem*)pI)->GetStyleName());
- aFont.SetFamily(((const SvxFontItem*)pI)->GetFamily());
- aFont.SetPitch(((const SvxFontItem*)pI)->GetPitch());
- aFont.SetCharSet(((const SvxFontItem*)pI)->GetCharSet());
+ aFont.SetName( static_cast<const SvxFontItem*>(pI)->GetFamilyName());
+ aFont.SetStyleName(static_cast<const SvxFontItem*>(pI)->GetStyleName());
+ aFont.SetFamily(static_cast<const SvxFontItem*>(pI)->GetFamily());
+ aFont.SetPitch(static_cast<const SvxFontItem*>(pI)->GetPitch());
+ aFont.SetCharSet(static_cast<const SvxFontItem*>(pI)->GetCharSet());
}
bool bVertical = rSh.IsInVerticalText();
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index 2b0aab006f03..7102206994ba 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -293,7 +293,7 @@ void SwDrawShell::Execute(SfxRequest &rReq)
if (pArgs)
{
pVFrame->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
- ((const SfxBoolItem&)(pArgs->Get(SID_FONTWORK))).GetValue());
+ static_cast<const SfxBoolItem&>((pArgs->Get(SID_FONTWORK))).GetValue());
}
else
pVFrame->ToggleChildWindow( SvxFontWorkChildWindow::GetChildWindowId() );
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 92a20bc8b45c..ebcb72d99b03 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -188,7 +188,7 @@ void SwDrawTextShell::ExecFontWork(SfxRequest& rReq)
if ( rReq.GetArgs() )
{
pVFrame->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(),
- ((const SfxBoolItem&) (rReq.GetArgs()->
+ static_cast<const SfxBoolItem&>( (rReq.GetArgs()->
Get(SID_FONTWORK))).GetValue());
}
else
@@ -417,7 +417,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
if(pNewAttrs)
{
pNewAttrs->GetItemState(nSlot, false, &pItem );
- pOLV->InsertText(((const SfxStringItem *)pItem)->GetValue());
+ pOLV->InsertText(static_cast<const SfxStringItem *>(pItem)->GetValue());
}
break;
}
@@ -700,7 +700,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
OUString sFontName;
if ( pItem )
{
- sSym = ((const SfxStringItem*)pItem)->GetValue();
+ sSym = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
@@ -860,7 +860,7 @@ void SwDrawTextShell::GetStatePropPanelAttr(SfxItemSet &rSet)
//if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
if(SfxItemState::DONTCARE != eVState)
{
- SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
+ SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) ||
(nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) ||
(nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM);
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index c38a45ec7eb8..8aa84b57dfeb 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -518,7 +518,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
- OUString sMsg(((const SvxPostItTextItem&)pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
+ OUString sMsg(static_cast<const SvxPostItTextItem&>(pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
// Insert or change a comment
rSh.SetRedlineComment(sMsg);
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index ffe5dd381c77..e7d655cfa73c 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -151,7 +151,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
{
case FN_INSERT_STRING:
if( pItem )
- rSh.InsertByWord(((const SfxStringItem *)pItem)->GetValue());
+ rSh.InsertByWord(static_cast<const SfxStringItem *>(pItem)->GetValue());
break;
case FN_INSERT_SOFT_HYPHEN:
@@ -228,7 +228,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
case SID_HYPERLINK_SETLINK:
if (pItem)
- InsertHyperlink(*((const SvxHyperlinkItem *)pItem));
+ InsertHyperlink(*static_cast<const SvxHyperlinkItem *>(pItem));
rReq.Done();
break;
@@ -973,7 +973,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
OUString aChars, aFontName;
if ( pItem )
{
- aChars = ((const SfxStringItem*)pItem)->GetValue();
+ aChars = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = NULL;
pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
diff --git a/sw/source/uibase/shells/textsh2.cxx b/sw/source/uibase/shells/textsh2.cxx
index 8e1f349e6320..eb45bc4ceea9 100644
--- a/sw/source/uibase/shells/textsh2.cxx
+++ b/sw/source/uibase/shells/textsh2.cxx
@@ -107,22 +107,22 @@ void SwTextShell::ExecDB(SfxRequest &rReq)
// get the data source name
pArgs->GetItemState(FN_DB_DATA_SOURCE_ANY, false, &pSourceItem);
if(pSourceItem)
- ((const SfxUsrAnyItem*)pSourceItem)->GetValue() >>= sSourceArg;
+ static_cast<const SfxUsrAnyItem*>(pSourceItem)->GetValue() >>= sSourceArg;
// get the command
pArgs->GetItemState(FN_DB_DATA_COMMAND_ANY, false, &pCommandItem);
if(pCommandItem)
- ((const SfxUsrAnyItem*)pCommandItem)->GetValue() >>= sCommandArg;
+ static_cast<const SfxUsrAnyItem*>(pCommandItem)->GetValue() >>= sCommandArg;
// get the command type
pArgs->GetItemState(FN_DB_DATA_COMMAND_TYPE_ANY, false, &pCommandTypeItem);
if(pCommandTypeItem)
- ((const SfxUsrAnyItem*)pCommandTypeItem)->GetValue() >>= nCommandTypeArg;
+ static_cast<const SfxUsrAnyItem*>(pCommandTypeItem)->GetValue() >>= nCommandTypeArg;
Reference<XConnection> xConnection;
pArgs->GetItemState(FN_DB_CONNECTION_ANY, false, &pConnectionItem);
if ( pConnectionItem )
- ((const SfxUsrAnyItem*)pConnectionItem)->GetValue() >>= xConnection;
+ static_cast<const SfxUsrAnyItem*>(pConnectionItem)->GetValue() >>= xConnection;
// may be we even get no connection
if ( !xConnection.is() )
{
@@ -136,7 +136,7 @@ void SwTextShell::ExecDB(SfxRequest &rReq)
Reference<XResultSet> xCursor;
pArgs->GetItemState(FN_DB_DATA_CURSOR_ANY, false, &pCursorItem);
if ( pCursorItem )
- ((const SfxUsrAnyItem*)pCursorItem)->GetValue() >>= xCursor;
+ static_cast<const SfxUsrAnyItem*>(pCursorItem)->GetValue() >>= xCursor;
switch (rReq.GetSlot())
{
diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx
index 151212e4198d..871eb5acc900 100644
--- a/sw/source/uibase/shells/txtcrsr.cxx
+++ b/sw/source/uibase/shells/txtcrsr.cxx
@@ -57,9 +57,9 @@ void SwTextShell::ExecBasicMove(SfxRequest &rReq)
{
const SfxPoolItem *pItem;
if(SfxItemState::SET == pArgs->GetItemState(FN_PARAM_MOVE_COUNT, true, &pItem))
- nCount = ((const SfxInt32Item *)pItem)->GetValue();
+ nCount = static_cast<const SfxInt32Item *>(pItem)->GetValue();
if(SfxItemState::SET == pArgs->GetItemState(FN_PARAM_MOVE_SELECTION, true, &pItem))
- bSelect = ((const SfxBoolItem *)pItem)->GetValue();
+ bSelect = static_cast<const SfxBoolItem *>(pItem)->GetValue();
}
switch(rReq.GetSlot())
{
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index a397bb9dadc8..c15d1670f3bc 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -775,11 +775,11 @@ void SwPagePreview::Execute( SfxRequest &rReq )
sal_uInt16 nZoomFactor = USHRT_MAX;
if(SfxItemState::SET == pArgs->GetItemState(SID_ATTR_ZOOM, true, &pItem))
{
- eType = ((const SvxZoomItem *)pItem)->GetType();
- nZoomFactor = ((const SvxZoomItem *)pItem)->GetValue();
+ eType = static_cast<const SvxZoomItem *>(pItem)->GetType();
+ nZoomFactor = static_cast<const SvxZoomItem *>(pItem)->GetValue();
}
else if(SfxItemState::SET == pArgs->GetItemState(FN_PREVIEW_ZOOM, true, &pItem))
- nZoomFactor = ((const SfxUInt16Item *)pItem)->GetValue();
+ nZoomFactor = static_cast<const SfxUInt16Item *>(pItem)->GetValue();
if(USHRT_MAX != nZoomFactor)
SetZoom(eType, nZoomFactor);
}
@@ -792,7 +792,7 @@ void SwPagePreview::Execute( SfxRequest &rReq )
if ( pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, true, &pItem ) )
{
- const sal_uInt16 nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue();
+ const sal_uInt16 nCurrentZoom = static_cast<const SvxZoomSliderItem *>(pItem)->GetValue();
SetZoom( SVX_ZOOM_PERCENT, nCurrentZoom );
}
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 83470b960b3e..1cffd55052b9 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -579,7 +579,7 @@ void SwView::Execute(SfxRequest &rReq)
Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword();
if( aPasswd.getLength() )
{
- OSL_ENSURE( !((const SfxBoolItem*)pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" );
+ OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" );
// xmlsec05: new password dialog
vcl::Window* pParent;
const SfxPoolItem* pParentItem;
@@ -602,7 +602,7 @@ void SwView::Execute(SfxRequest &rReq)
}
}
- const sal_uInt16 nOn = ((const SfxBoolItem*)pItem)->GetValue()
+ const sal_uInt16 nOn = static_cast<const SfxBoolItem*>(pItem)->GetValue()
? nsRedlineMode_t::REDLINE_ON : 0;
const sal_uInt16 nMode = m_pWrtShell->GetRedlineMode();
m_pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn);
@@ -660,7 +660,7 @@ void SwView::Execute(SfxRequest &rReq)
{
sal_uInt16 nMode = ( ~(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE)
& m_pWrtShell->GetRedlineMode() ) | nsRedlineMode_t::REDLINE_SHOW_INSERT;
- if( ((const SfxBoolItem*)pItem)->GetValue() )
+ if( static_cast<const SfxBoolItem*>(pItem)->GetValue() )
nMode |= nsRedlineMode_t::REDLINE_SHOW_DELETE;
m_pWrtShell->SetRedlineModeAndCheckInsMode( nMode );
@@ -759,20 +759,20 @@ void SwView::Execute(SfxRequest &rReq)
if( pArgs )
{
if( SfxItemState::SET == pArgs->GetItemState( SID_FILE_NAME, false, &pItem ))
- sFileName = ((const SfxStringItem*)pItem)->GetValue();
+ sFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
bHasFileName = !sFileName.isEmpty();
if( SfxItemState::SET == pArgs->GetItemState( SID_FILTER_NAME, false, &pItem ))
- sFilterName = ((const SfxStringItem*)pItem)->GetValue();
+ sFilterName = static_cast<const SfxStringItem*>(pItem)->GetValue();
if( SfxItemState::SET == pArgs->GetItemState( SID_VERSION, false, &pItem ))
{
- nVersion = ((const SfxInt16Item *)pItem)->GetValue();
+ nVersion = static_cast<const SfxInt16Item *>(pItem)->GetValue();
m_pViewImpl->SetParam( nVersion );
}
if( SfxItemState::SET == pArgs->GetItemState( SID_NO_ACCEPT_DIALOG, false, &pItem ))
{
- bNoAcceptDialog = ((const SfxBoolItem *)pItem)->GetValue();
+ bNoAcceptDialog = static_cast<const SfxBoolItem *>(pItem)->GetValue();
}
}
@@ -1026,7 +1026,7 @@ void SwView::Execute(SfxRequest &rReq)
if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem))
{
SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
- const sal_uInt16 nTab = ((const SfxUInt16Item*)pItem)->GetValue();
+ const sal_uInt16 nTab = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
MakeDefTabs( nTab, aDefTabs );
m_pWrtShell->SetDefault( aDefTabs );
}
@@ -1109,7 +1109,7 @@ void SwView::Execute(SfxRequest &rReq)
bool bShow = false;
if( pArgs &&
SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem ))
- bShow = ((const SfxBoolItem*)pItem)->GetValue();
+ bShow = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if((bShow && m_bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot))
GetViewFrame()->ToggleChildWindow(nSlot);
//if fields have been successfully inserted call the "real"
@@ -1185,7 +1185,7 @@ void SwView::Execute(SfxRequest &rReq)
SfxViewFrame* pViewFrame = GetViewFrame();
if (rReq.GetArgs() != NULL)
pViewFrame->SetChildWindow (FN_SPELL_GRAMMAR_DIALOG,
- ((const SfxBoolItem&) (rReq.GetArgs()->
+ static_cast<const SfxBoolItem&>( (rReq.GetArgs()->
Get(FN_SPELL_GRAMMAR_DIALOG))).GetValue());
else
pViewFrame->ToggleChildWindow(FN_SPELL_GRAMMAR_DIALOG);
@@ -1549,7 +1549,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
aSet.GetItemState(RES_PARATR_NUMRULE, true))
{
const OUString& rNumStyle =
- ((const SfxStringItem &)
+ static_cast<const SfxStringItem &>(
aSet.Get(RES_PARATR_NUMRULE)).GetValue();
if(!rNumStyle.isEmpty())
{
@@ -1719,15 +1719,15 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
const SfxPoolItem* pViewLayoutItem = 0;
if ( pSet && SfxItemState::SET == pSet->GetItemState(SID_ATTR_VIEWLAYOUT, true, &pViewLayoutItem))
{
- const sal_uInt16 nColumns = ((const SvxViewLayoutItem *)pViewLayoutItem)->GetValue();
- const bool bBookMode = ((const SvxViewLayoutItem *)pViewLayoutItem)->IsBookMode();
+ const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem *>(pViewLayoutItem)->GetValue();
+ const bool bBookMode = static_cast<const SvxViewLayoutItem *>(pViewLayoutItem)->IsBookMode();
SetViewLayout( nColumns, bBookMode );
}
if ( pSet && SfxItemState::SET == pSet->GetItemState(SID_ATTR_ZOOM, true, &pItem))
{
- enum SvxZoomType eType = ((const SvxZoomItem *)pItem)->GetType();
- SetZoom( eType, ((const SvxZoomItem *)pItem)->GetValue() );
+ enum SvxZoomType eType = static_cast<const SvxZoomItem *>(pItem)->GetType();
+ SetZoom( eType, static_cast<const SvxZoomItem *>(pItem)->GetValue() );
}
bUp = true;
if ( pItem )
@@ -1744,10 +1744,10 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
{
if ( SfxItemState::SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, true, &pItem ))
{
- const sal_uInt16 nColumns = ((const SvxViewLayoutItem *)pItem)->GetValue();
+ const sal_uInt16 nColumns = static_cast<const SvxViewLayoutItem *>(pItem)->GetValue();
const bool bBookMode = (0 == nColumns || 0 != (nColumns % 2)) ?
false :
- ((const SvxViewLayoutItem *)pItem)->IsBookMode();
+ static_cast<const SvxViewLayoutItem *>(pItem)->IsBookMode();
SetViewLayout( nColumns, bBookMode );
}
@@ -1766,7 +1766,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
{
if ( SfxItemState::SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, true, &pItem ))
{
- const sal_uInt16 nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue();
+ const sal_uInt16 nCurrentZoom = static_cast<const SvxZoomSliderItem *>(pItem)->GetValue();
SetZoom( SVX_ZOOM_PERCENT, nCurrentZoom );
}
@@ -1782,7 +1782,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
{
if (SfxItemState::SET == pArgs->GetItemState( nWhich, true, &pItem))
{
- switch ( ((const SfxUInt16Item *)pItem)->GetValue() )
+ switch ( static_cast<const SfxUInt16Item *>(pItem)->GetValue() )
{
case 0: rSh.EnterStdMode(); break;
case 1: rSh.EnterExtMode(); break;
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 0d3661e80ed2..1decd9275a92 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -538,7 +538,7 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin,
pOutliner->SetControlWord(nCntrl);
const SfxPoolItem& rItem = pSh->GetDoc()->GetDefault(RES_CHRATR_LANGUAGE);
- pOutliner->SetDefaultLanguage(((const SvxLanguageItem&)rItem).GetLanguage());
+ pOutliner->SetDefaultLanguage(static_cast<const SvxLanguageItem&>(rItem).GetLanguage());
if( bIsNewObj )
pOutliner->SetVertical( SID_DRAW_TEXT_VERTICAL == m_nDrawSfxId ||
@@ -751,7 +751,7 @@ bool SwView::IsDrawTextHyphenate()
EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
if( pSdrView->GetAttributes( aNewAttr ) &&
aNewAttr.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT )
- bHyphenate = ((const SfxBoolItem&)aNewAttr.Get( EE_PARA_HYPHENATE )).
+ bHyphenate = static_cast<const SfxBoolItem&>(aNewAttr.Get( EE_PARA_HYPHENATE )).
GetValue();
return bHyphenate;
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 1a96ef53906b..ae721da903e2 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -89,7 +89,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
const SfxPoolItem* pItem = 0;
bool bQuiet = false;
if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_SEARCH_QUIET, false, &pItem))
- bQuiet = ((const SfxBoolItem*) pItem)->GetValue();
+ bQuiet = static_cast<const SfxBoolItem*>( pItem)->GetValue();
bool bApi = bQuiet || bNoMessage;
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index e4fe0327d031..2379cb273602 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -1335,7 +1335,7 @@ sal_Bool SwXTextViewCursor::screenDown()
SfxRequest aReq(FN_PAGEDOWN, SfxCallMode::SLOT, m_pView->GetPool());
m_pView->Execute(aReq);
const SfxPoolItem* pRet = aReq.GetReturnValue();
- bRet = pRet && ((const SfxBoolItem*)pRet)->GetValue();
+ bRet = pRet && static_cast<const SfxBoolItem*>(pRet)->GetValue();
}
else
throw uno::RuntimeException();
@@ -1352,7 +1352,7 @@ sal_Bool SwXTextViewCursor::screenUp()
SfxRequest aReq(FN_PAGEUP, SfxCallMode::SLOT, m_pView->GetPool());
m_pView->Execute(aReq);
const SfxPoolItem* pRet = aReq.GetReturnValue();
- bRet = pRet && ((const SfxBoolItem*)pRet)->GetValue();
+ bRet = pRet && static_cast<const SfxBoolItem*>(pRet)->GetValue();
}
else
throw uno::RuntimeException();
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index ef1fd2e90735..7567a201ef48 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -116,12 +116,12 @@ namespace
{
static bool lcl_IsContent(const SvTreeListEntry* pEntry)
{
- return ((const SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CNT;
+ return static_cast<const SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() == CTYPE_CNT;
}
static bool lcl_IsContentType(const SvTreeListEntry* pEntry)
{
- return ((const SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CTT;
+ return static_cast<const SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() == CTYPE_CTT;
}
static bool lcl_FindShell(SwWrtShell* pShell)
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index 89630e93894c..d7eb8d662716 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -429,7 +429,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
if( bShowLanguageControl && SfxItemState::SET == pOutSet->GetItemState(
SID_ATTR_NUMBERFORMAT_ADD_AUTO, false, &pItem ))
{
- bUseAutomaticLanguage = ((const SfxBoolItem*)pItem)->GetValue();
+ bUseAutomaticLanguage = static_cast<const SfxBoolItem*>(pItem)->GetValue();
}
}
else
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index b354bb2af5d2..6eedf32f2c7c 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -297,11 +297,11 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
::FillHdFt(pHeaderFmt, rHeaderSet);
- rPageDesc.ChgHeaderShare(((const SfxBoolItem&)
+ rPageDesc.ChgHeaderShare(static_cast<const SfxBoolItem&>(
rHeaderSet.Get(SID_ATTR_PAGE_SHARED)).GetValue());
if (nFirstShare < 0)
{
- rPageDesc.ChgFirstShare(((const SfxBoolItem&)
+ rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>(
rHeaderSet.Get(SID_ATTR_PAGE_SHARED_FIRST)).GetValue());
nFirstShare = rPageDesc.IsFirstShared() ? 1 : 0;
}
@@ -337,11 +337,11 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
::FillHdFt(pFooterFmt, rFooterSet);
- rPageDesc.ChgFooterShare(((const SfxBoolItem&)
+ rPageDesc.ChgFooterShare(static_cast<const SfxBoolItem&>(
rFooterSet.Get(SID_ATTR_PAGE_SHARED)).GetValue());
if (nFirstShare < 0)
{
- rPageDesc.ChgFirstShare(((const SfxBoolItem&)
+ rPageDesc.ChgFirstShare(static_cast<const SfxBoolItem&>(
rFooterSet.Get(SID_ATTR_PAGE_SHARED_FIRST)).GetValue());
nFirstShare = rPageDesc.IsFirstShared() ? 1 : 0;
}
@@ -370,13 +370,13 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
if(SfxItemState::SET == rSet.GetItemState(
SID_SWREGISTER_MODE, false, &pItem))
{
- bool bSet = ((const SfxBoolItem*)pItem)->GetValue();
+ bool bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
if(!bSet)
rPageDesc.SetRegisterFmtColl(0);
else if(SfxItemState::SET == rSet.GetItemState(
SID_SWREGISTER_COLLECTION, false, &pItem))
{
- const OUString& rColl = ((const SfxStringItem*)pItem)->GetValue();
+ const OUString& rColl = static_cast<const SfxStringItem*>(pItem)->GetValue();
SwDoc& rDoc = *rMaster.GetDoc();
SwTxtFmtColl* pColl = rDoc.FindTxtFmtCollByName( rColl );
if( !pColl )
diff --git a/sw/source/uibase/utlui/zoomctrl.cxx b/sw/source/uibase/utlui/zoomctrl.cxx
index 3faa4a64f29e..e4990cc9fcd7 100644
--- a/sw/source/uibase/utlui/zoomctrl.cxx
+++ b/sw/source/uibase/utlui/zoomctrl.cxx
@@ -45,7 +45,7 @@ void SwZoomControl::StateChanged( sal_uInt16 nSID, SfxItemState eState,
{
if(SfxItemState::DEFAULT == eState && pState->ISA( SfxStringItem ))
{
- sPreviewZoom = ((const SfxStringItem*)pState)->GetValue();
+ sPreviewZoom = static_cast<const SfxStringItem*>(pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sPreviewZoom );
}
else