[Libreoffice-commits] core.git: 10 commits - sw/source
Noel Grandin
noel at peralex.com
Mon Dec 1 23:33:18 PST 2014
sw/source/core/unocore/unotbl.cxx | 14 +-
sw/source/core/unocore/unotextmarkup.cxx | 6 -
sw/source/core/view/viewimp.cxx | 26 ++--
sw/source/core/view/viewsh.cxx | 42 +++----
sw/source/core/view/vnew.cxx | 2
sw/source/core/view/vprint.cxx | 6 -
sw/source/filter/ascii/ascatr.cxx | 4
sw/source/filter/basflt/fltini.cxx | 14 +-
sw/source/filter/basflt/fltshell.cxx | 24 ++--
sw/source/filter/basflt/shellio.cxx | 8 -
sw/source/filter/html/css1atr.cxx | 122 +++++++++++------------
sw/source/filter/html/htmlatr.cxx | 132 ++++++++++++-------------
sw/source/filter/html/htmlbas.cxx | 2
sw/source/filter/html/htmlcss1.cxx | 44 ++++----
sw/source/filter/html/htmlctxt.cxx | 6 -
sw/source/filter/html/htmldrawreader.cxx | 6 -
sw/source/filter/html/htmldrawwriter.cxx | 4
sw/source/filter/html/htmlfld.cxx | 24 ++--
sw/source/filter/html/htmlfldw.cxx | 6 -
sw/source/filter/html/htmlflywriter.cxx | 56 +++++-----
sw/source/filter/html/htmlform.cxx | 16 +--
sw/source/filter/html/htmlforw.cxx | 4
sw/source/filter/html/htmlftn.cxx | 6 -
sw/source/filter/html/htmlgrin.cxx | 6 -
sw/source/filter/html/htmlplug.cxx | 10 -
sw/source/filter/html/htmlsect.cxx | 6 -
sw/source/filter/html/htmltab.cxx | 32 +++---
sw/source/filter/html/htmltabw.cxx | 6 -
sw/source/filter/html/svxcss1.cxx | 10 -
sw/source/filter/html/swhtml.cxx | 24 ++--
sw/source/filter/html/wrthtml.cxx | 10 -
sw/source/filter/html/wrthtml.hxx | 4
sw/source/filter/writer/writer.cxx | 10 -
sw/source/filter/writer/wrtswtbl.cxx | 10 -
sw/source/filter/ww8/docxattributeoutput.cxx | 14 +-
sw/source/filter/ww8/docxexport.cxx | 2
sw/source/filter/ww8/rtfattributeoutput.cxx | 20 +--
sw/source/filter/ww8/rtfexport.cxx | 45 ++++----
sw/source/filter/ww8/rtfsdrexport.cxx | 2
sw/source/filter/ww8/wrtw8esh.cxx | 10 -
sw/source/filter/ww8/wrtw8nds.cxx | 22 ++--
sw/source/filter/ww8/wrtw8num.cxx | 2
sw/source/filter/ww8/wrtw8sty.cxx | 40 +++----
sw/source/filter/ww8/wrtww8.cxx | 24 ++--
sw/source/filter/ww8/wrtww8gr.cxx | 6 -
sw/source/filter/ww8/ww8atr.cxx | 46 ++++----
sw/source/filter/ww8/ww8graf.cxx | 10 -
sw/source/filter/ww8/ww8par.cxx | 46 ++++----
sw/source/filter/ww8/ww8par2.cxx | 20 +--
sw/source/filter/ww8/ww8par3.cxx | 30 ++---
sw/source/filter/ww8/ww8par4.cxx | 2
sw/source/filter/ww8/ww8par5.cxx | 82 +++++++--------
sw/source/filter/ww8/ww8par6.cxx | 44 ++++----
sw/source/filter/ww8/ww8scan.cxx | 12 +-
sw/source/filter/ww8/ww8scan.hxx | 14 +-
sw/source/filter/xml/xmlfmt.cxx | 14 +-
sw/source/filter/xml/xmlfonte.cxx | 4
sw/source/filter/xml/xmlimp.cxx | 4
sw/source/filter/xml/xmliteme.cxx | 6 -
sw/source/filter/xml/xmlitemi.cxx | 2
sw/source/filter/xml/xmltble.cxx | 32 +++---
sw/source/filter/xml/xmltbli.cxx | 42 +++----
sw/source/filter/xml/xmltbli.hxx | 4
sw/source/filter/xml/xmltext.cxx | 2
sw/source/filter/xml/xmltexti.cxx | 2
sw/source/ui/chrdlg/chardlg.cxx | 4
sw/source/ui/chrdlg/drpcps.cxx | 6 -
sw/source/ui/chrdlg/numpara.cxx | 12 +-
sw/source/ui/chrdlg/tblnumfm.cxx | 2
sw/source/ui/config/optcomp.cxx | 6 -
sw/source/ui/config/optload.cxx | 28 ++---
sw/source/ui/config/optpage.cxx | 42 +++----
sw/source/ui/dialog/docstdlg.cxx | 4
sw/source/ui/dialog/macassgn.cxx | 2
sw/source/ui/dialog/uiregionsw.cxx | 26 ++--
sw/source/ui/envelp/envfmt.cxx | 6 -
sw/source/ui/envelp/envfmt.hxx | 2
sw/source/ui/envelp/envlop1.cxx | 4
sw/source/ui/envelp/envprt.cxx | 4
sw/source/ui/envelp/envprt.hxx | 3
sw/source/ui/envelp/label1.cxx | 22 ++--
sw/source/ui/envelp/labfmt.cxx | 2
sw/source/ui/envelp/labfmt.hxx | 2
sw/source/ui/envelp/labprt.hxx | 2
sw/source/ui/envelp/swuilabimp.hxx | 2
sw/source/ui/fldui/DropDownFieldDialog.cxx | 2
sw/source/ui/fldui/changedb.cxx | 6 -
sw/source/ui/fldui/flddb.cxx | 22 ++--
sw/source/ui/fldui/flddinf.cxx | 18 +--
sw/source/ui/fldui/flddok.cxx | 34 +++---
sw/source/ui/fldui/fldedt.cxx | 10 -
sw/source/ui/fldui/fldfunc.cxx | 16 +--
sw/source/ui/fldui/fldpage.cxx | 20 +--
sw/source/ui/fldui/fldref.cxx | 46 ++++----
sw/source/ui/fldui/fldtdlg.cxx | 12 +-
sw/source/ui/fldui/fldvar.cxx | 62 +++++------
sw/source/ui/fldui/inpdlg.cxx | 8 -
sw/source/ui/fldui/javaedit.cxx | 6 -
sw/source/ui/fmtui/tmpdlg.cxx | 2
sw/source/uibase/app/appenv.cxx | 8 -
sw/source/uibase/app/apphdl.cxx | 24 ++--
sw/source/uibase/app/applab.cxx | 10 -
sw/source/uibase/app/appopt.cxx | 40 +++----
sw/source/uibase/app/docsh.cxx | 2
sw/source/uibase/app/docsh2.cxx | 22 ++--
sw/source/uibase/app/docshini.cxx | 8 -
sw/source/uibase/app/docst.cxx | 20 +--
sw/source/uibase/app/docstyle.cxx | 2
sw/source/uibase/app/swmodul1.cxx | 8 -
sw/source/uibase/config/cfgitems.cxx | 8 -
sw/source/uibase/dbui/dbmgr.cxx | 4
sw/source/uibase/dbui/dbtree.cxx | 2
sw/source/uibase/dbui/mailmergechildwindow.cxx | 2
sw/source/uibase/dialog/regionsw.cxx | 2
sw/source/uibase/dochdl/swdtflvr.cxx | 30 ++---
sw/source/uibase/docvw/HeaderFooterWin.cxx | 2
sw/source/uibase/docvw/edtwin.cxx | 26 ++--
sw/source/uibase/docvw/edtwin2.cxx | 2
sw/source/uibase/docvw/edtwin3.cxx | 16 +--
sw/source/uibase/docvw/romenu.cxx | 4
sw/source/uibase/docvw/srcedtw.cxx | 6 -
sw/source/uibase/envelp/envimg.cxx | 2
sw/source/uibase/envelp/labimg.cxx | 2
sw/source/uibase/envelp/syncbtn.cxx | 2
sw/source/uibase/fldui/fldmgr.cxx | 102 +++++++++----------
sw/source/uibase/frmdlg/colex.cxx | 40 +++----
sw/source/uibase/frmdlg/colmgr.cxx | 6 -
sw/source/uibase/frmdlg/frmmgr.cxx | 10 -
sw/source/uibase/inc/content.hxx | 12 +-
sw/source/uibase/inc/envlop.hxx | 2
sw/source/uibase/inc/frmmgr.hxx | 2
sw/source/uibase/inc/swuicnttab.hxx | 2
sw/source/uibase/index/toxmgr.cxx | 4
sw/source/uibase/lingu/hhcwrp.cxx | 2
sw/source/uibase/misc/glshell.cxx | 4
sw/source/uibase/misc/numberingtypelistbox.cxx | 10 -
sw/source/uibase/misc/redlndlg.cxx | 2
sw/source/uibase/ribbar/concustomshape.cxx | 2
sw/source/uibase/ribbar/conrect.cxx | 2
sw/source/uibase/ribbar/drawbase.cxx | 2
sw/source/uibase/ribbar/tbxanchr.cxx | 4
sw/source/uibase/ribbar/workctrl.cxx | 2
sw/source/uibase/shells/annotsh.cxx | 64 ++++++------
sw/source/uibase/shells/basesh.cxx | 42 +++----
sw/source/uibase/shells/beziersh.cxx | 2
sw/source/uibase/shells/drawsh.cxx | 6 -
sw/source/uibase/shells/drformsh.cxx | 2
sw/source/uibase/shells/drwbassh.cxx | 14 +-
sw/source/uibase/shells/drwtxtex.cxx | 54 +++++-----
sw/source/uibase/shells/drwtxtsh.cxx | 10 -
sw/source/uibase/shells/frmsh.cxx | 44 ++++----
sw/source/uibase/shells/grfsh.cxx | 24 ++--
sw/source/uibase/shells/listsh.cxx | 2
sw/source/uibase/shells/tabsh.cxx | 54 +++++-----
sw/source/uibase/shells/textfld.cxx | 30 ++---
sw/source/uibase/shells/textglos.cxx | 12 +-
sw/source/uibase/shells/textidx.cxx | 4
sw/source/uibase/shells/textsh.cxx | 34 +++---
sw/source/uibase/shells/textsh1.cxx | 36 +++---
sw/source/uibase/shells/txtattr.cxx | 36 +++---
sw/source/uibase/shells/txtnum.cxx | 4
sw/source/uibase/sidebar/PagePropertyPanel.cxx | 4
sw/source/uibase/uiview/formatclipboard.cxx | 6 -
sw/source/uibase/uiview/pview.cxx | 8 -
sw/source/uibase/uiview/srcview.cxx | 8 -
sw/source/uibase/uiview/view.cxx | 2
sw/source/uibase/uiview/view1.cxx | 12 +-
sw/source/uibase/uiview/view2.cxx | 18 +--
sw/source/uibase/uiview/viewdlg.cxx | 2
sw/source/uibase/uiview/viewdlg2.cxx | 4
sw/source/uibase/uiview/viewdraw.cxx | 4
sw/source/uibase/uiview/viewling.cxx | 2
sw/source/uibase/uiview/viewsrch.cxx | 24 ++--
sw/source/uibase/uiview/viewstat.cxx | 21 ++-
sw/source/uibase/uiview/viewtab.cxx | 62 +++++------
sw/source/uibase/uno/unomailmerge.cxx | 2
sw/source/uibase/uno/unotxdoc.cxx | 6 -
sw/source/uibase/uno/unotxvw.cxx | 2
sw/source/uibase/utlui/content.cxx | 40 +++----
sw/source/uibase/utlui/glbltree.cxx | 10 -
sw/source/uibase/utlui/navipi.cxx | 2
sw/source/uibase/utlui/numfmtlb.cxx | 18 +--
sw/source/uibase/utlui/uiitems.cxx | 4
sw/source/uibase/utlui/uitool.cxx | 52 ++++-----
sw/source/uibase/wrtsh/delete.cxx | 2
sw/source/uibase/wrtsh/select.cxx | 4
sw/source/uibase/wrtsh/wrtsh1.cxx | 6 -
sw/source/uibase/wrtsh/wrtsh2.cxx | 4
188 files changed, 1513 insertions(+), 1506 deletions(-)
New commits:
commit 83c97b2a1c1a8d0531b6048fb27cf117b0da24e0
Author: Noel Grandin <noel at peralex.com>
Date: Mon Dec 1 10:18:30 2014 +0200
loplugin: cstylecast
Change-Id: Ic12c8b5ad5256b729b7cab8f78758b57f5316d3c
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index 9760f89..0f4788f 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -352,15 +352,15 @@ void Writer::PutEditEngFontsInAttrPool( bool bIncl_CJK_CTL )
void Writer::_AddFontItems( SfxItemPool& rPool, sal_uInt16 nW )
{
- const SvxFontItem* pFont = (const SvxFontItem*)&rPool.GetDefaultItem( nW );
+ const SvxFontItem* pFont = static_cast<const SvxFontItem*>(&rPool.GetDefaultItem( nW ));
_AddFontItem( rPool, *pFont );
- if( 0 != ( pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem( nW )) )
+ if( 0 != ( pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem( nW ))) )
_AddFontItem( rPool, *pFont );
sal_uInt32 nMaxItem = rPool.GetItemCount2( nW );
for( sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet )
- if( 0 != (pFont = (const SvxFontItem*)rPool.GetItem2( nW, nGet )) )
+ if( 0 != (pFont = static_cast<const SvxFontItem*>(rPool.GetItem2( nW, nGet ))) )
_AddFontItem( rPool, *pFont );
}
@@ -371,10 +371,10 @@ void Writer::_AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont )
{
SvxFontItem aFont( rFont );
aFont.SetWhich( RES_CHRATR_FONT );
- pItem = (SvxFontItem*)&rPool.Put( aFont );
+ pItem = static_cast<const SvxFontItem*>(&rPool.Put( aFont ));
}
else
- pItem = (SvxFontItem*)&rPool.Put( rFont );
+ pItem = static_cast<const SvxFontItem*>(&rPool.Put( rFont ));
if( 1 < pItem->GetRefCount() )
rPool.Remove( *pItem );
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index fb5d2af..968a3dd 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -82,7 +82,7 @@ sal_uInt32 SwWriteTable::GetBoxWidth( const SwTableBox *pBox )
{
const SwFrmFmt *pFmt = pBox->GetFrmFmt();
const SwFmtFrmSize& aFrmSize=
- (const SwFmtFrmSize&)pFmt->GetFmtAttr( RES_FRM_SIZE );
+ static_cast<const SwFmtFrmSize&>(pFmt->GetFmtAttr( RES_FRM_SIZE ));
return sal::static_int_cast<sal_uInt32>(aFrmSize.GetSize().Width());
}
@@ -176,11 +176,11 @@ const SvxBrushItem *SwWriteTable::GetLineBrush( const SwTableBox *pBox,
if( !pLine->GetUpper() )
{
if( !pRow->GetBackground() )
- pRow->SetBackground( (const SvxBrushItem *)pItem );
+ pRow->SetBackground( static_cast<const SvxBrushItem *>(pItem) );
pItem = 0;
}
- return (const SvxBrushItem *)pItem;
+ return static_cast<const SvxBrushItem *>(pItem);
}
pBox = pLine->GetUpper();
@@ -230,7 +230,7 @@ sal_uInt16 SwWriteTable::MergeBoxBorders( const SwTableBox *pBox,
sal_uInt16 nBorderMask = 0;
const SwFrmFmt *pFrmFmt = pBox->GetFrmFmt();
- const SvxBoxItem& rBoxItem = (const SvxBoxItem&)pFrmFmt->GetFmtAttr( RES_BOX );
+ const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(pFrmFmt->GetFmtAttr( RES_BOX ));
if( rBoxItem.GetTop() )
{
@@ -596,7 +596,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
if( SfxItemState::SET == rItemSet.GetItemState( RES_BACKGROUND, false,
&pItem ) )
{
- pLineBrush = (const SvxBrushItem *)pItem;
+ pLineBrush = static_cast<const SvxBrushItem *>(pItem);
// If the row spans the entire table, we can
// print out the background to the row. Otherwise
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 81db98a..862d754 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1424,7 +1424,7 @@ void DocxAttributeOutput::StartField_Impl( FieldInfos& rInfos, bool bWriteRun )
WriteFFData( rInfos );
if ( rInfos.pField )
{
- const SwDropDownField& rFld2 = *(SwDropDownField*)rInfos.pField;
+ const SwDropDownField& rFld2 = *static_cast<const SwDropDownField*>(rInfos.pField);
uno::Sequence<OUString> aItems =
rFld2.GetItemSequence();
GetExport().DoComboBox(rFld2.GetName(),
@@ -3590,7 +3590,7 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer
aPam.GetPoint()->nNode++;
if (aPam.GetPoint()->nNode.GetNode().IsTxtNode())
{
- const SwTxtNode& rTxtNode = (const SwTxtNode&)aPam.GetPoint()->nNode.GetNode();
+ const SwTxtNode& rTxtNode = static_cast<const SwTxtNode&>(aPam.GetPoint()->nNode.GetNode());
if( const SwAttrSet* pAttrSet = rTxtNode.GetpSwAttrSet())
{
const SvxCharRotateItem& rCharRotate = pAttrSet->GetCharRotate();
@@ -5494,7 +5494,7 @@ void DocxAttributeOutput::SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmF
const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
if ( pItem )
{
- const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem;
+ const SvxShadowItem* pShadowItem = static_cast<const SvxShadowItem*>(pItem);
aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
}
@@ -5570,7 +5570,7 @@ static OString impl_LevelNFC( sal_uInt16 nNumberingType , const SfxItemSet *pOut
case style::NumberingType::NUMBER_LOWER_ZH:
aType="taiwaneseCountingThousand";
if (pOutSet) {
- const SvxLanguageItem rLang = (const SvxLanguageItem&) pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true);
+ const SvxLanguageItem rLang = static_cast<const SvxLanguageItem&>( pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true) );
const LanguageType eLang = rLang.GetLanguage();
if (LANGUAGE_CHINESE_SIMPLIFIED == eLang) {
@@ -6596,12 +6596,12 @@ void DocxAttributeOutput::WriteField_Impl( const SwField* pFld, ww::eField eType
// TODO Any other field types here ?
if ( ( nType == RES_SETEXPFLD ) && ( nSubType & nsSwGetSetExpType::GSE_STRING ) )
{
- const SwSetExpField *pSet = ( const SwSetExpField* )( pFld );
+ const SwSetExpField *pSet = static_cast<const SwSetExpField*>( pFld );
m_sFieldBkm = pSet->GetPar1( );
}
else if ( nType == RES_DROPDOWN )
{
- const SwDropDownField* pDropDown = ( const SwDropDownField* )( pFld );
+ const SwDropDownField* pDropDown = static_cast<const SwDropDownField*>( pFld );
m_sFieldBkm = pDropDown->GetName( );
}
}
@@ -7762,7 +7762,7 @@ void DocxAttributeOutput::FormatBox( const SvxBoxItem& rBox )
const SfxPoolItem* pItem = GetExport().HasItem( RES_SHADOW );
if ( pItem )
{
- const SvxShadowItem* pShadowItem = (const SvxShadowItem*)pItem;
+ const SvxShadowItem* pShadowItem = static_cast<const SvxShadowItem*>(pItem);
aOutputBorderOptions.aShadowLocation = pShadowItem->GetLocation();
}
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 5d3be74..197eac9 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -489,7 +489,7 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
{
const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent();
if( !pParentFmt )
- pParentFmt = (SwSectionFmt*)0xFFFFFFFF;
+ pParentFmt = reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) ;
sal_uLong nRstLnNum;
if( rNd.IsCntntNode() )
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 51a4c62..816a7e5 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -651,7 +651,7 @@ void RtfAttributeOutput::TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer
const SfxPoolItem* pItem;
if (pCellFmt->GetAttrSet().HasItem(RES_BOX, &pItem))
{
- const SvxBoxItem& rBox = (SvxBoxItem&)*pItem;
+ const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(*pItem);
static const sal_uInt16 aBorders[] =
{
BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
@@ -695,7 +695,7 @@ void RtfAttributeOutput::TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t
const SfxPoolItem* pItem;
if (pCellFmt->GetAttrSet().HasItem(RES_BACKGROUND, &pItem))
{
- const SvxBrushItem& rBack = (SvxBrushItem&)*pItem;
+ const SvxBrushItem& rBack = static_cast<const SvxBrushItem&>(*pItem);
if (!rBack.GetColor().GetTransparency())
{
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT);
@@ -782,7 +782,7 @@ void RtfAttributeOutput::TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t
// vertical alignment
if (pCellFmt->GetAttrSet().HasItem(RES_VERT_ORIENT, &pItem))
- switch (((SwFmtVertOrient*)pItem)->GetVertOrient())
+ switch (static_cast<const SwFmtVertOrient*>(pItem)->GetVertOrient())
{
case text::VertOrientation::CENTER:
m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLVERTALC);
@@ -1311,7 +1311,7 @@ void RtfAttributeOutput::NumberingLevel(sal_uInt8 nLevel,
nVal=35;
if (pOutSet)
{
- const SvxLanguageItem rlang = (const SvxLanguageItem&) pOutSet->Get(RES_CHRATR_CJK_LANGUAGE,true);
+ const SvxLanguageItem rlang = static_cast<const SvxLanguageItem&>( pOutSet->Get(RES_CHRATR_CJK_LANGUAGE,true) );
if (LANGUAGE_CHINESE_SIMPLIFIED == rlang.GetLanguage())
{
nVal=39;
@@ -2098,7 +2098,7 @@ void RtfAttributeOutput::CharEscapement(const SvxEscapementItem& rEsc)
const char* pUpDn;
- SwTwips nH = ((SvxFontHeightItem&)m_rExport.GetItem(RES_CHRATR_FONTSIZE)).GetHeight();
+ SwTwips nH = static_cast<const SvxFontHeightItem&>(m_rExport.GetItem(RES_CHRATR_FONTSIZE)).GetHeight();
if (0 < rEsc.GetEsc())
pUpDn = OOO_STRING_SVTOOLS_RTF_UP;
@@ -2600,7 +2600,7 @@ void RtfAttributeOutput::ParaWidows(const SvxWidowsItem& rWidows)
void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop)
{
- long nOffset = ((SvxLRSpaceItem&)m_rExport.GetItem(RES_LR_SPACE)).GetTxtLeft();
+ long nOffset = static_cast<const SvxLRSpaceItem&>(m_rExport.GetItem(RES_LR_SPACE)).GetTxtLeft();
for (sal_uInt16 n = 0; n < rTabStop.Count(); n++)
{
const SvxTabStop& rTS = rTabStop[ n ];
@@ -2699,7 +2699,7 @@ void RtfAttributeOutput::ParaNumRule_Impl(const SwTxtNode* pTxtNd, sal_Int32 nLv
m_aStyles.append(OOO_STRING_SVTOOLS_RTF_PLAIN);
m_aStyles.append(' ');
- SvxLRSpaceItem aLR((SvxLRSpaceItem&)rNdSet.Get(RES_LR_SPACE));
+ SvxLRSpaceItem aLR(static_cast<const SvxLRSpaceItem&>(rNdSet.Get(RES_LR_SPACE)));
aLR.SetTxtLeft(aLR.GetTxtLeft() + pFmt->GetIndentAt());
aLR.SetTxtFirstLineOfst(pFmt->GetFirstLineOffset());
@@ -3297,7 +3297,7 @@ void RtfAttributeOutput::SetField(const SwField& /*rFld*/, ww::eField /*eType*/,
void RtfAttributeOutput::PostitField(const SwField* pFld)
{
- const SwPostItField& rPFld = *(SwPostItField*)pFld;
+ const SwPostItField& rPFld = *static_cast<const SwPostItField*>(pFld);
OString aName = OUStringToOString(rPFld.GetName(), RTL_TEXTENCODING_UTF8);
std::map<OString, sal_uInt16>::iterator it = m_rOpenedAnnotationMarksIds.find(aName);
@@ -3628,7 +3628,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const SwFlyFrmFmt* pFlyFrmFmt, S
aRendered.Height() = rSize.Height();
const Graphic* pGraphic = rOLENode.GetGraphic();
Size aMapped(pGraphic->GetPrefSize());
- const SwCropGrf& rCr = (const SwCropGrf&)rOLENode.GetAttr(RES_GRFATR_CROPGRF);
+ const SwCropGrf& rCr = static_cast<const SwCropGrf&>(rOLENode.GetAttr(RES_GRFATR_CROPGRF));
const sal_Char* pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP;
const sal_uInt8* pGraphicAry = 0;
SvMemoryStream aStream;
@@ -3756,7 +3756,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw
Size aMapped(eGraphicType == GRAPHIC_BITMAP ? rGraphic.GetSizePixel() : rGraphic.GetPrefSize());
- const SwCropGrf& rCr = (const SwCropGrf&)pGrfNode->GetAttr(RES_GRFATR_CROPGRF);
+ const SwCropGrf& rCr = static_cast<const SwCropGrf&>(pGrfNode->GetAttr(RES_GRFATR_CROPGRF));
//Get original size in twips
Size aSize(pGrfNode->GetTwipSize());
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 5949a28..fc7acc1 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -35,6 +35,7 @@
#include <editeng/udlnitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
+#include <editeng/fontitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/paperinf.hxx>
@@ -491,7 +492,7 @@ void RtfExport::ExportDocument_Impl()
Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_RTF).WriteChar('1')
.WriteCharPtr(OOO_STRING_SVTOOLS_RTF_ANSI);
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_DEFF);
- OutULong(maFontHelper.GetId((SvxFontItem&)pDoc->GetAttrPool().GetDefaultItem(RES_CHRATR_FONT)));
+ OutULong(maFontHelper.GetId(static_cast<const SvxFontItem&>(pDoc->GetAttrPool().GetDefaultItem(RES_CHRATR_FONT))));
// If this not exist, MS don't understand our ansi characters (0x80-0xff).
Strm().WriteCharPtr("\\adeflang1025");
@@ -536,7 +537,7 @@ void RtfExport::ExportDocument_Impl()
sal_uInt32 const nMaxItem = rPool.GetItemCount2(RES_PROTECT);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- const SvxProtectItem* pProtect = (const SvxProtectItem*)rPool.GetItem2(RES_PROTECT, n);
+ const SvxProtectItem* pProtect = static_cast<const SvxProtectItem*>(rPool.GetItem2(RES_PROTECT, n));
if (pProtect && pProtect->IsCntntProtected())
{
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FORMPROT);
@@ -570,7 +571,7 @@ void RtfExport::ExportDocument_Impl()
if (pSet)
{
sal_uInt16 nPosInDoc;
- pSttPgDsc = (SwFmtPageDesc*)&pSet->Get(RES_PAGEDESC);
+ pSttPgDsc = static_cast<const SwFmtPageDesc*>(&pSet->Get(RES_PAGEDESC));
if (!pSttPgDsc->GetPageDesc())
pSttPgDsc = 0;
else if (pDoc->FindPageDesc(pSttPgDsc->GetPageDesc()->GetName(), &nPosInDoc))
@@ -946,33 +947,33 @@ void RtfExport::OutColorTable()
// char color
{
- const SvxColorItem* pCol = (const SvxColorItem*)GetDfltAttr(RES_CHRATR_COLOR);
+ const SvxColorItem* pCol = static_cast<const SvxColorItem*>(GetDfltAttr(RES_CHRATR_COLOR));
InsColor(pCol->GetValue());
- if (0 != (pCol = (const SvxColorItem*)rPool.GetPoolDefaultItem(RES_CHRATR_COLOR)))
+ if (0 != (pCol = static_cast<const SvxColorItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_COLOR))))
InsColor(pCol->GetValue());
nMaxItem = rPool.GetItemCount2(RES_CHRATR_COLOR);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- if (0 != (pCol = (const SvxColorItem*)rPool.GetItem2(RES_CHRATR_COLOR, n)))
+ if (0 != (pCol = static_cast<const SvxColorItem*>(rPool.GetItem2(RES_CHRATR_COLOR, n))))
InsColor(pCol->GetValue());
}
- const SvxUnderlineItem* pUnder = (const SvxUnderlineItem*)GetDfltAttr(RES_CHRATR_UNDERLINE);
+ const SvxUnderlineItem* pUnder = static_cast<const SvxUnderlineItem*>(GetDfltAttr(RES_CHRATR_UNDERLINE));
InsColor(pUnder->GetColor());
nMaxItem = rPool.GetItemCount2(RES_CHRATR_UNDERLINE);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- if (0 != (pUnder = (const SvxUnderlineItem*)rPool.GetItem2(RES_CHRATR_UNDERLINE, n)))
+ if (0 != (pUnder = static_cast<const SvxUnderlineItem*>(rPool.GetItem2(RES_CHRATR_UNDERLINE, n))))
InsColor(pUnder->GetColor());
}
- const SvxOverlineItem* pOver = (const SvxOverlineItem*)GetDfltAttr(RES_CHRATR_OVERLINE);
+ const SvxOverlineItem* pOver = static_cast<const SvxOverlineItem*>(GetDfltAttr(RES_CHRATR_OVERLINE));
InsColor(pOver->GetColor());
nMaxItem = rPool.GetItemCount2(RES_CHRATR_OVERLINE);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- if (0 != (pOver = (const SvxOverlineItem*)rPool.GetItem2(RES_CHRATR_OVERLINE, n)))
+ if (0 != (pOver = static_cast<const SvxOverlineItem*>(rPool.GetItem2(RES_CHRATR_OVERLINE, n))))
InsColor(pOver->GetColor());
}
@@ -987,16 +988,16 @@ void RtfExport::OutColorTable()
for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds)
{
- const SvxBrushItem* pBkgrd = (const SvxBrushItem*)GetDfltAttr(*pIds);
+ const SvxBrushItem* pBkgrd = static_cast<const SvxBrushItem*>(GetDfltAttr(*pIds));
InsColor(pBkgrd->GetColor());
- if (0 != (pBkgrd = (const SvxBrushItem*)rPool.GetPoolDefaultItem(*pIds)))
+ if (0 != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetPoolDefaultItem(*pIds))))
{
InsColor(pBkgrd->GetColor());
}
nMaxItem = rPool.GetItemCount2(*pIds);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- if (0 != (pBkgrd = (const SvxBrushItem*)rPool.GetItem2(*pIds , n)))
+ if (0 != (pBkgrd = static_cast<const SvxBrushItem*>(rPool.GetItem2(*pIds , n))))
{
InsColor(pBkgrd->GetColor());
}
@@ -1005,16 +1006,16 @@ void RtfExport::OutColorTable()
// shadow color
{
- const SvxShadowItem* pShadow = (const SvxShadowItem*)GetDfltAttr(RES_SHADOW);
+ const SvxShadowItem* pShadow = static_cast<const SvxShadowItem*>(GetDfltAttr(RES_SHADOW));
InsColor(pShadow->GetColor());
- if (0 != (pShadow = (const SvxShadowItem*)rPool.GetPoolDefaultItem(RES_SHADOW)))
+ if (0 != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetPoolDefaultItem(RES_SHADOW))))
{
InsColor(pShadow->GetColor());
}
nMaxItem = rPool.GetItemCount2(RES_SHADOW);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- if (0 != (pShadow = (const SvxShadowItem*)rPool.GetItem2(RES_SHADOW, n)))
+ if (0 != (pShadow = static_cast<const SvxShadowItem*>(rPool.GetItem2(RES_SHADOW, n))))
{
InsColor(pShadow->GetColor());
}
@@ -1024,24 +1025,24 @@ void RtfExport::OutColorTable()
// frame border color
{
const SvxBoxItem* pBox;
- if (0 != (pBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem(RES_BOX)))
+ if (0 != (pBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_BOX))))
InsColorLine(*pBox);
nMaxItem = rPool.GetItemCount2(RES_BOX);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- if (0 != (pBox = (const SvxBoxItem*)rPool.GetItem2(RES_BOX, n)))
+ if (0 != (pBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_BOX, n))))
InsColorLine(*pBox);
}
}
{
const SvxBoxItem* pCharBox;
- if (0 != (pCharBox = (const SvxBoxItem*)rPool.GetPoolDefaultItem(RES_CHRATR_BOX)))
+ if (0 != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_BOX))))
InsColorLine(*pCharBox);
nMaxItem = rPool.GetItemCount2(RES_CHRATR_BOX);
for (sal_uInt32 n = 0; n < nMaxItem; ++n)
{
- if (0 != (pCharBox = (const SvxBoxItem*)rPool.GetItem2(RES_CHRATR_BOX, n)))
+ if (0 != (pCharBox = static_cast<const SvxBoxItem*>(rPool.GetItem2(RES_CHRATR_BOX, n))))
InsColorLine(*pCharBox);
}
}
@@ -1153,13 +1154,13 @@ void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader)
{
if (bHeader)
{
- const SwFmtHeader& rHeader = (const SwFmtHeader&)rItem;
+ const SwFmtHeader& rHeader = static_cast<const SwFmtHeader&>(rItem);
if (!rHeader.IsActive())
return;
}
else
{
- const SwFmtFooter& rFooter = (const SwFmtFooter&)rItem;
+ const SwFmtFooter& rFooter = static_cast<const SwFmtFooter&>(rItem);
if (!rFooter.IsActive())
return;
}
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index ecf12ee..24acdcb 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -35,7 +35,7 @@ using namespace css;
RtfSdrExport::RtfSdrExport(RtfExport& rExport)
: EscherEx(EscherExGlobalRef(new EscherExGlobal), 0),
m_rExport(rExport),
- m_rAttrOutput((RtfAttributeOutput&)m_rExport.AttrOutput()),
+ m_rAttrOutput(static_cast<RtfAttributeOutput&>(m_rExport.AttrOutput())),
m_pSdrObject(NULL),
m_nShapeType(ESCHER_ShpInst_Nil),
m_nShapeFlags(0) ,
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 2b534ff..3f2707f 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1143,13 +1143,13 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart)
void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt)
{
- const SvxFieldItem &rField = (const SvxFieldItem &)rHt;
+ const SvxFieldItem &rField = static_cast<const SvxFieldItem &>(rHt);
const SvxFieldData *pFld = rField.GetField();
if (pFld && pFld->ISA(SvxURLField))
{
sal_uInt8 nOldTxtTyp = m_rExport.nTxtTyp;
m_rExport.nTxtTyp = mnTyp;
- const SvxURLField *pURL = (const SvxURLField *)pFld;
+ const SvxURLField *pURL = static_cast<const SvxURLField *>(pFld);
m_rExport.AttrOutput().StartURL( pURL->GetURL(), pURL->GetTargetFrame() );
const OUString &rStr = pURL->GetRepresentation();
@@ -1988,14 +1988,14 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt,
const SwAttrSet& rAttrSet = rFmt.GetAttrSet();
if (SfxItemState::SET == rAttrSet.GetItemState(RES_BOX, false, &pItem))
{
- const SvxBoxItem* pBox = (const SvxBoxItem*)pItem;
+ const SvxBoxItem* pBox = static_cast<const SvxBoxItem*>(pItem);
if( pBox )
{
const SfxPoolItem* pShadItem;
if (SfxItemState::SET
== rAttrSet.GetItemState(RES_SHADOW, true, &pShadItem))
{
- const SvxShadowItem* pSI = (const SvxShadowItem*)pShadItem;
+ const SvxShadowItem* pSI = static_cast<const SvxShadowItem*>(pShadItem);
const sal_uInt16 nCstScale = 635; // unit scale between AOO and MS Word
const sal_uInt32 nShadowType = 131074; // shadow type of ms word. need to set the default value.
@@ -2325,7 +2325,7 @@ SwEscherEx::SwEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt)
&pItem);
if (SfxItemState::SET == eState && pItem)
{
- const SvxBrushItem* pBrush = (const SvxBrushItem*)pItem;
+ const SvxBrushItem* pBrush = static_cast<const SvxBrushItem*>(pItem);
WriteBrushAttr(*pBrush, aPropOpt);
SvxGraphicPosition ePos = pBrush->GetGraphicPos();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 3dac906..1233990 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -393,7 +393,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
sal_uInt16 nFontId = GetWhichOfScript( RES_CHRATR_FONT, GetScript() );
const SvxFontItem &rParentFont = ItemGet<SvxFontItem>(
- (const SwTxtFmtColl&)rNd.GetAnyFmtColl(), nFontId);
+ static_cast<const SwTxtFmtColl&>(rNd.GetAnyFmtColl()), nFontId);
const SvxFontItem *pFont = &rParentFont;
const SfxPoolItem *pGrabBag = 0;
@@ -811,8 +811,8 @@ void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, sal_Int32 /*nPos*/,
const SwAttrSet& rSet = rNode.GetSwAttrSet();
const SvxFontHeightItem &rHeightItem =
- ( const SvxFontHeightItem& )rSet.Get(
- GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) );
+ static_cast< const SvxFontHeightItem& >(rSet.Get(
+ GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) ));
nHeight = (rHeightItem.GetHeight() + 10)/20-1;
aStr += OUString::number(nHeight);
aStr += "(";
@@ -1433,11 +1433,11 @@ short MSWordExportBase::GetDefaultFrameDirection( ) const
{
if ( bOutFlyFrmAttrs ) //frame
{
- nDir = TrueFrameDirection( *( const SwFrmFmt * ) pOutFmtNode );
+ nDir = TrueFrameDirection( *static_cast< const SwFrmFmt * >(pOutFmtNode) );
}
else if ( pOutFmtNode->ISA( SwCntntNode ) ) //pagagraph
{
- const SwCntntNode *pNd = ( const SwCntntNode * ) pOutFmtNode;
+ const SwCntntNode *pNd = static_cast<const SwCntntNode *>(pOutFmtNode);
SwPosition aPos( *pNd );
nDir = pDoc->GetTextDirection( aPos );
}
@@ -1505,7 +1505,7 @@ const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() const
//If not set, or "no fill", get real bg
SfxItemState eState = rFmt.GetItemState(RES_BACKGROUND, true, &pItem);
- const SvxBrushItem* pRet = (const SvxBrushItem*)pItem;
+ const SvxBrushItem* pRet = static_cast<const SvxBrushItem*>(pItem);
if (SfxItemState::SET != eState || (!pRet->GetGraphic() &&
pRet->GetColor() == COL_TRANSPARENT))
{
@@ -1525,7 +1525,7 @@ SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrmFmt &rFlyFmt) const
const SfxPoolItem* pItem = 0;
SfxItemState eState =
pFlyFmt->GetItemState(RES_BACKGROUND, true, &pItem);
- pRet = (const SvxBrushItem*)pItem;
+ pRet = static_cast<const SvxBrushItem*>(pItem);
if (SfxItemState::SET != eState || (!pRet->GetGraphic() &&
pRet->GetColor() == COL_TRANSPARENT))
{
@@ -2433,7 +2433,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
static_cast<const SvxULSpaceItem*>(pItem)->GetLower()) ))
{
pTmpSet = new SfxItemSet( rNode.GetSwAttrSet() );
- SvxULSpaceItem aUL( *(SvxULSpaceItem*)pItem );
+ SvxULSpaceItem aUL( *static_cast<const SvxULSpaceItem*>(pItem) );
// #i25901#- consider compatibility option
if (!pDoc->getIDocumentSettingAccess().get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES))
{
@@ -2531,8 +2531,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
cannot export that, its its ltr then that's ok as thats word's
default. Otherwise we must add a RTL attribute to our export list
*/
- const SvxFrameDirectionItem* pItem = (const SvxFrameDirectionItem*)
- rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR);
+ const SvxFrameDirectionItem* pItem = static_cast<const SvxFrameDirectionItem*>(
+ rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR));
if (
(!pItem || pItem->GetValue() == FRMDIR_ENVIRONMENT) &&
aAttrIter.IsParaRTL()
@@ -2894,7 +2894,7 @@ void WW8Export::OutWW6FlyFrmsInCntnt( const SwTxtNode& rNd )
{
// attribute bound to a character
const SwFmtFlyCnt& rFlyCntnt = pAttr->GetFlyCnt();
- const SwFlyFrmFmt& rFlyFrmFmt = *(SwFlyFrmFmt*)rFlyCntnt.GetFrmFmt();
+ const SwFlyFrmFmt& rFlyFrmFmt = *static_cast<SwFlyFrmFmt*>(rFlyCntnt.GetFrmFmt());
const SwNodeIndex* pNodeIndex = rFlyFrmFmt.GetCntnt().GetCntntIdx();
if( pNodeIndex )
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index 359bdbd..79abf1d 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -204,7 +204,7 @@ static sal_uInt8 GetLevelNFC( sal_uInt16 eNumType, const SfxItemSet *pOutSet)
case SVX_NUM_NUMBER_LOWER_ZH:
nRet = 35;
if ( pOutSet ) {
- const SvxLanguageItem rLang = (const SvxLanguageItem&) pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true);
+ const SvxLanguageItem rLang = static_cast<const SvxLanguageItem&>( pOutSet->Get( RES_CHRATR_CJK_LANGUAGE,true) );
const LanguageType eLang = rLang.GetLanguage();
if (LANGUAGE_CHINESE_SIMPLIFIED ==eLang) {
nRet = 39;
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index cd6b3e9..ae6fafe 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -548,7 +548,7 @@ void MSWordStyles::GetStyleData( SwFmt* pFmt, bool& bFmtColl, sal_uInt16& nBase,
SwFmt* pNext;
if ( bFmtColl )
- pNext = &((SwTxtFmtColl*)pFmt)->GetNextTxtFmtColl();
+ pNext = &static_cast<SwTxtFmtColl*>(pFmt)->GetNextTxtFmtColl();
else
pNext = pFmt; // CharFmt: next CharFmt == self
@@ -902,13 +902,13 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc)
GetId(wwFont(OUString("Arial"), PITCH_VARIABLE, FAMILY_SWISS,
RTL_TEXTENCODING_MS_1252,bWrtWW8));
- const SvxFontItem* pFont = (const SvxFontItem*)GetDfltAttr(RES_CHRATR_FONT);
+ const SvxFontItem* pFont = static_cast<const SvxFontItem*>(GetDfltAttr(RES_CHRATR_FONT));
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
const SfxItemPool& rPool = rDoc.GetAttrPool();
- if (0 != (pFont = (const SvxFontItem*)rPool.GetPoolDefaultItem(RES_CHRATR_FONT)))
+ if (0 != (pFont = static_cast<const SvxFontItem*>(rPool.GetPoolDefaultItem(RES_CHRATR_FONT))))
{
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
pFont->GetFamily(), pFont->GetCharSet(),bWrtWW8));
@@ -923,7 +923,7 @@ void wwFontHelper::InitFontTable(bool bWrtWW8,const SwDoc& rDoc)
sal_uInt32 const nMaxItem = rPool.GetItemCount2( *pId );
for (sal_uInt32 nGet = 0; nGet < nMaxItem; ++nGet)
{
- pFont = (const SvxFontItem*)rPool.GetItem2( *pId, nGet );
+ pFont = static_cast<const SvxFontItem*>(rPool.GetItem2( *pId, nGet ));
if (0 != pFont)
{
GetId(wwFont(pFont->GetFamilyName(), pFont->GetPitch(),
@@ -1043,9 +1043,9 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
const SfxPoolItem* pI;
const SwNode* pNd = rExport.pCurPam->GetCntntNode();
- const SfxItemSet* pSet = pNd ? &((SwCntntNode*)pNd)->GetSwAttrSet() : 0;
+ const SfxItemSet* pSet = pNd ? &static_cast<const SwCntntNode*>(pNd)->GetSwAttrSet() : 0;
- sal_uLong nRstLnNum = pSet ? ((SwFmtLineNumber&)pSet->Get( RES_LINENUMBER )).GetStartValue() : 0;
+ sal_uLong nRstLnNum = pSet ? static_cast<const SwFmtLineNumber&>(pSet->Get( RES_LINENUMBER )).GetStartValue() : 0;
const SwTableNode* pTblNd = rExport.pCurPam->GetNode().FindTableNode();
const SwSectionNode* pSectNd;
@@ -1075,9 +1075,9 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
// Hole evtl. Pagedesc des 1. Nodes
if ( pSet &&
SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, true, &pI ) &&
- ( (SwFmtPageDesc*)pI )->GetPageDesc() )
+ static_cast<const SwFmtPageDesc*>(pI)->GetPageDesc() )
{
- AppendSection( *(SwFmtPageDesc*)pI, *pNd, pFmt, nRstLnNum );
+ AppendSection( *static_cast<const SwFmtPageDesc*>(pI), *pNd, pFmt, nRstLnNum );
}
else
AppendSection( rExport.pAktPageDesc, pFmt, nRstLnNum );
@@ -1138,10 +1138,10 @@ sal_uInt16 MSWordSections::NumberOfColumns( const SwDoc &rDoc, const WW8_SepInfo
aSet.SetParent( &rSet );
//0xffffffff, what the hell is going on with that!, fixme most terribly
- if ( rInfo.pSectionFmt && (SwSectionFmt*)0xFFFFFFFF != rInfo.pSectionFmt )
+ if ( rInfo.pSectionFmt && reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) != rInfo.pSectionFmt )
aSet.Put( rInfo.pSectionFmt->GetFmtAttr( RES_COL ) );
- const SwFmtCol& rCol = (const SwFmtCol&)aSet.Get( RES_COL );
+ const SwFmtCol& rCol = static_cast<const SwFmtCol&>(aSet.Get( RES_COL ));
const SwColumns& rColumns = rCol.GetColumns();
return rColumns.size();
}
@@ -1276,8 +1276,8 @@ void MSWordSections::SetHeaderFlag( sal_uInt8& rHeadFootFlags, const SwFmt& rFmt
{
const SfxPoolItem* pItem;
if( SfxItemState::SET == rFmt.GetItemState(RES_HEADER, true, &pItem)
- && ((SwFmtHeader*)pItem)->IsActive() &&
- ((SwFmtHeader*)pItem)->GetHeaderFmt() )
+ && static_cast<const SwFmtHeader*>(pItem)->IsActive() &&
+ static_cast<const SwFmtHeader*>(pItem)->GetHeaderFmt() )
rHeadFootFlags |= nFlag;
}
@@ -1286,8 +1286,8 @@ void MSWordSections::SetFooterFlag( sal_uInt8& rHeadFootFlags, const SwFmt& rFmt
{
const SfxPoolItem* pItem;
if( SfxItemState::SET == rFmt.GetItemState(RES_FOOTER, true, &pItem)
- && ((SwFmtFooter*)pItem)->IsActive() &&
- ((SwFmtFooter*)pItem)->GetFooterFmt() )
+ && static_cast<const SwFmtFooter*>(pItem)->IsActive() &&
+ static_cast<const SwFmtFooter*>(pItem)->GetFooterFmt() )
rHeadFootFlags |= nFlag;
}
@@ -1325,7 +1325,7 @@ bool WW8_SepInfo::IsProtected() const
bool bRet = false;
if (
pSectionFmt &&
- ((SwSectionFmt*)0xFFFFFFFF != pSectionFmt)
+ (reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) != pSectionFmt)
)
{
const SwSection *pSection = pSectionFmt->GetSection();
@@ -1394,10 +1394,10 @@ bool MSWordSections::HasBorderItem( const SwFmt& rFmt )
{
const SfxPoolItem* pItem;
return SfxItemState::SET == rFmt.GetItemState(RES_BOX, true, &pItem) &&
- ( ((SvxBoxItem*)pItem)->GetTop() ||
- ((SvxBoxItem*)pItem)->GetBottom() ||
- ((SvxBoxItem*)pItem)->GetLeft() ||
- ((SvxBoxItem*)pItem)->GetRight() );
+ ( static_cast<const SvxBoxItem*>(pItem)->GetTop() ||
+ static_cast<const SvxBoxItem*>(pItem)->GetBottom() ||
+ static_cast<const SvxBoxItem*>(pItem)->GetLeft() ||
+ static_cast<const SvxBoxItem*>(pItem)->GetRight() );
}
void WW8AttributeOutput::StartSection()
@@ -1661,7 +1661,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
}
}
- if ( (SwSectionFmt*)0xFFFFFFFF != rSepInfo.pSectionFmt )
+ if ( reinterpret_cast<SwSectionFmt*>(0xFFFFFFFF) != rSepInfo.pSectionFmt )
{
if ( nBreakCode == 0 )
bOutPgDscSet = false;
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index ae07f4b..68f2eab 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -52,7 +52,7 @@ bool SwWrtShell::TryRemoveIndent()
SfxItemSet aAttrSet(GetAttrPool(), RES_LR_SPACE, RES_LR_SPACE);
GetCurAttr(aAttrSet);
- SvxLRSpaceItem aItem = (const SvxLRSpaceItem &)aAttrSet.Get(RES_LR_SPACE);
+ SvxLRSpaceItem aItem = static_cast<const SvxLRSpaceItem &>(aAttrSet.Get(RES_LR_SPACE));
short aOldFirstLineOfst = aItem.GetTxtFirstLineOfst();
if (aOldFirstLineOfst > 0)
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 8e05860..a2a2f03 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -55,7 +55,7 @@ void SwWrtShell::Invalidate()
// to avoid making the slot volatile, invalidate it every time if something could have been changed
// this is still much cheaper than asking for the state every 200 ms (and avoid background processing)
GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE );
- SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId());
+ SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()));
if (pWrdCnt)
pWrdCnt->UpdateCounts();
}
@@ -396,7 +396,7 @@ void SwWrtShell::EndSelect()
fnKillSel = &SwWrtShell::ResetSelect;
}
}
- SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId());
+ SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()));
if (pWrdCnt)
pWrdCnt->UpdateCounts();
}
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 8841f0c..e697217 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -311,13 +311,13 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter,
if( aGrfSize.Width() > aBound.Width() )
{
aGrfSize.Width() = aBound.Width();
- aGrfSize.Height() = ((BigInt)aBound.Width()) * aTempHeight / aTempWidth;
+ aGrfSize.Height() = BigInt(aBound.Width()) * aTempHeight / aTempWidth;
}
// Fit hight if necessary, scale down the width proportional thereafter.
if( aGrfSize.Height() > aBound.Height() )
{
aGrfSize.Height() = aBound.Height();
- aGrfSize.Width() = ((BigInt)aBound.Height()) * aTempWidth / aTempHeight;
+ aGrfSize.Width() = BigInt(aBound.Height()) * aTempWidth / aTempHeight;
}
pFrmMgr->SetSize( aGrfSize );
pFrmMgr->UpdateFlyFrm();
@@ -1462,7 +1462,7 @@ SwCharFmt *SwWrtShell::GetCharStyle(const OUString &rFmtName, GetStyle eCreate )
{
sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( rFmtName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT );
if( USHRT_MAX != nId || GETSTYLE_CREATEANY == eCreate )
- pFmt = (SwCharFmt*)GetFmtFromPool( nId );
+ pFmt = static_cast<SwCharFmt*>(GetFmtFromPool( nId ));
}
return pFmt;
}
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx
index 98f6830..1f78a7b 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -348,7 +348,7 @@ void SwWrtShell::ClickToField( const SwField& rFld )
case RES_MACROFLD:
{
- const SwMacroField *pFld = (const SwMacroField*)&rFld;
+ const SwMacroField *pFld = static_cast<const SwMacroField*>(&rFld);
const OUString sText( rFld.GetPar2() );
OUString sRet( sText );
ExecMacro( pFld->GetSvxMacro(), &sRet );
@@ -459,7 +459,7 @@ void LoadURL( SwViewShell& rVSh, const OUString& rURL, sal_uInt16 nFilter,
return;
//A CrsrShell is always a WrtShell
- SwWrtShell &rSh = (SwWrtShell&)rVSh;
+ SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh);
SwDocShell* pDShell = rSh.GetView().GetDocShell();
OSL_ENSURE( pDShell, "No DocShell?!");
commit cf16234a23a716fe98adf32dd5b56d48be242c99
Author: Noel Grandin <noel at peralex.com>
Date: Mon Dec 1 10:18:03 2014 +0200
loplugin: cstylecast
Change-Id: If31b41296a91c6a6ac990494e88ab7b47240a823
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
index ebe50a6..ed4a66a 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
@@ -535,7 +535,7 @@ void PagePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pSt
meFUnit = FUNIT_NONE;
if ( pState && eState >= SfxItemState::DEFAULT )
{
- meFUnit = (FieldUnit)( (const SfxUInt16Item*)pState )->GetValue();
+ meFUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pState )->GetValue();
}
else
{
@@ -550,7 +550,7 @@ void PagePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pSt
{
const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
if ( pItem )
- meFUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+ meFUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem )->GetValue();
}
else
{
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx
index 5540680..ffaa515 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -141,16 +141,16 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh )
if(bBackground)
{
if(pItem)
- rSh.SetBoxBackground( *(const SvxBrushItem*)pItem );
+ rSh.SetBoxBackground( *static_cast<const SvxBrushItem*>(pItem) );
if(pRowItem)
{
- SvxBrushItem aBrush(*(const SvxBrushItem*)pRowItem);
+ SvxBrushItem aBrush(*static_cast<const SvxBrushItem*>(pRowItem));
aBrush.SetWhich(RES_BACKGROUND);
rSh.SetRowBackground(aBrush);
}
if(pTableItem)
{
- SvxBrushItem aBrush(*(const SvxBrushItem*)pTableItem);
+ SvxBrushItem aBrush(*static_cast<const SvxBrushItem*>(pTableItem));
aBrush.SetWhich(RES_BACKGROUND);
rSh.SetTabBackground( aBrush );
}
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index c15d167..612b4aa 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -688,9 +688,9 @@ void SwPagePreview::Execute( SfxRequest &rReq )
const SfxItemSet *pArgs = rReq.GetArgs();
if( pArgs && pArgs->Count() >= 2 )
{
- sal_uInt8 nCols = (sal_uInt8)((SfxUInt16Item &)pArgs->Get(
+ sal_uInt8 nCols = (sal_uInt8)static_cast<const SfxUInt16Item &>(pArgs->Get(
SID_ATTR_TABLE_COLUMN)).GetValue();
- sal_uInt8 nRows = (sal_uInt8)((SfxUInt16Item &)pArgs->Get(
+ sal_uInt8 nRows = (sal_uInt8)static_cast<const SfxUInt16Item &>(pArgs->Get(
SID_ATTR_TABLE_ROW)).GetValue();
pViewWin->CalcWish( nRows, nCols );
@@ -1103,7 +1103,7 @@ void SwPagePreview::Init(const SwViewOption * pPrefs)
// Update the fields
// ATTENTION: Do cast the EditShell up, to use the SS.
// At the methodes the current shell will be queried!
- SwEditShell* pESh = (SwEditShell*)GetViewShell();
+ SwEditShell* pESh = static_cast<SwEditShell*>(GetViewShell());
bool bIsModified = pESh->IsModified();
SwViewOption aOpt( *pPrefs );
@@ -1643,7 +1643,7 @@ sal_uInt16 SwPagePreview::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
if ( pOld && pOld->IsPrinting() )
return SFX_PRINTERROR_BUSY;
- SwEditShell &rESh = (SwEditShell&)rSh; //Buh...
+ SwEditShell &rESh = static_cast<SwEditShell&>(rSh); //Buh...
if( ( SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ) & nDiffFlags )
{
rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true );
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index b54333d..2760949 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -342,7 +342,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
pMed = pDocShell->GetMedium();
else
{
- SfxBoolItem* pItem = (SfxBoolItem*)pDocShell->ExecuteSlot(rReq, pDocShell->GetInterface());
+ const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pDocShell->ExecuteSlot(rReq, pDocShell->GetInterface()));
if(pItem && pItem->GetValue())
pMed = pDocShell->GetMedium();
}
@@ -368,8 +368,8 @@ void SwSrcView::Execute(SfxRequest& rReq)
const sal_uInt16 nWhich = pTmpArgs->GetWhichByPos( 0 );
OSL_ENSURE( nWhich, "Which for SearchItem ?" );
const SfxPoolItem& rItem = pTmpArgs->Get( nWhich );
- SetSearchItem( (const SvxSearchItem&)rItem);
- StartSearchAndReplace( (const SvxSearchItem&)rItem, false, rReq.IsAPI() );
+ SetSearchItem( static_cast<const SvxSearchItem&>(rItem));
+ StartSearchAndReplace( static_cast<const SvxSearchItem&>(rItem), false, rReq.IsAPI() );
if(aEditWin.IsModified())
GetDocShell()->GetDoc()->getIDocumentState().SetModified();
}
@@ -563,7 +563,7 @@ SvxSearchItem* SwSrcView::GetSearchItem()
void SwSrcView::SetSearchItem( const SvxSearchItem& rItem )
{
delete pSearchItem;
- pSearchItem = (SvxSearchItem*)rItem.Clone();
+ pSearchItem = static_cast<SvxSearchItem*>(rItem.Clone());
}
sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 346c9e1..f0841cc 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -801,7 +801,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
}
else if( dynamic_cast<SwWrtShell*>( pDocSh->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() ) )
{
- m_pWrtShell = new SwWrtShell( *(SwWrtShell*)pDocSh->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(),
+ m_pWrtShell = new SwWrtShell( *static_cast<SwWrtShell*>(pDocSh->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()),
m_pEditWin, *this);
}
else
diff --git a/sw/source/uibase/uiview/view1.cxx b/sw/source/uibase/uiview/view1.cxx
index 0a56ee6..b357674 100644
--- a/sw/source/uibase/uiview/view1.cxx
+++ b/sw/source/uibase/uiview/view1.cxx
@@ -83,26 +83,26 @@ void SwView::Activate(bool bMDIActivate)
// Initialize Flddlg newly if necessary (e.g. for TYP_SETVAR)
sal_uInt16 nId = SwFldDlgWrapper::GetChildWindowId();
SfxViewFrame* pVFrame = GetViewFrame();
- SwFldDlgWrapper *pWrp = (SwFldDlgWrapper*)pVFrame->GetChildWindow(nId);
+ SwFldDlgWrapper *pWrp = static_cast<SwFldDlgWrapper*>(pVFrame->GetChildWindow(nId));
if (pWrp)
pWrp->ReInitDlg(GetDocShell());
// Initialize RedlineDlg newly if necessary
nId = SwRedlineAcceptChild::GetChildWindowId();
- SwRedlineAcceptChild *pRed = (SwRedlineAcceptChild*)pVFrame->GetChildWindow(nId);
+ SwRedlineAcceptChild *pRed = static_cast<SwRedlineAcceptChild*>(pVFrame->GetChildWindow(nId));
if (pRed)
pRed->ReInitDlg(GetDocShell());
// reinit IdxMarkDlg
nId = SwInsertIdxMarkWrapper::GetChildWindowId();
- SwInsertIdxMarkWrapper *pIdxMrk = (SwInsertIdxMarkWrapper*)pVFrame->GetChildWindow(nId);
+ SwInsertIdxMarkWrapper *pIdxMrk = static_cast<SwInsertIdxMarkWrapper*>(pVFrame->GetChildWindow(nId));
if (pIdxMrk)
pIdxMrk->ReInitDlg(*m_pWrtShell);
// reinit AuthMarkDlg
nId = SwInsertAuthMarkWrapper::GetChildWindowId();
- SwInsertAuthMarkWrapper *pAuthMrk = (SwInsertAuthMarkWrapper*)pVFrame->
- GetChildWindow(nId);
+ SwInsertAuthMarkWrapper *pAuthMrk = static_cast<SwInsertAuthMarkWrapper*>(pVFrame->
+ GetChildWindow(nId));
if (pAuthMrk)
pAuthMrk->ReInitDlg(*m_pWrtShell);
}
@@ -153,7 +153,7 @@ void SwView::ExecFormatPaintbrush(SfxRequest& rReq)
const SfxItemSet *pArgs = rReq.GetArgs();
if( pArgs && pArgs->Count() >= 1 )
{
- bPersistentCopy = static_cast<bool>(((SfxBoolItem &)pArgs->Get(
+ bPersistentCopy = static_cast<bool>(static_cast<const SfxBoolItem &>(pArgs->Get(
SID_FORMATPAINTBRUSH)).GetValue());
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 64ff288..8324cf0 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -584,7 +584,7 @@ void SwView::Execute(SfxRequest &rReq)
vcl::Window* pParent;
const SfxPoolItem* pParentItem;
if( SfxItemState::SET == pArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
- pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
+ pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
SfxPasswordDialog aPasswdDlg( pParent );
@@ -622,7 +622,7 @@ void SwView::Execute(SfxRequest &rReq)
vcl::Window* pParent;
const SfxPoolItem* pParentItem;
if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) )
- pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
+ pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
SfxPasswordDialog aPasswdDlg( pParent );
@@ -790,8 +790,8 @@ void SwView::Execute(SfxRequest &rReq)
// re-initialize the Redline dialog
const sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId();
- SwRedlineAcceptChild *pRed = (SwRedlineAcceptChild*)
- pVFrame->GetChildWindow(nId);
+ SwRedlineAcceptChild *pRed = static_cast<SwRedlineAcceptChild*>(
+ pVFrame->GetChildWindow(nId));
if (pRed)
pRed->ReInitDlg(GetDocShell());
}
@@ -1080,7 +1080,7 @@ void SwView::Execute(SfxRequest &rReq)
break;
case SID_JUMPTOMARK:
if( pArgs && SfxItemState::SET == pArgs->GetItemState(SID_JUMPTOMARK, false, &pItem))
- JumpToSwMark( (( const SfxStringItem*)pItem)->GetValue() );
+ JumpToSwMark( static_cast<const SfxStringItem*>(pItem)->GetValue() );
break;
case SID_GALLERY :
// First make sure that the sidebar is visible
@@ -1375,7 +1375,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
aWordCount = aWordCount.replaceFirst( "%2", rLocaleData.getNum( nChar, 0 ) );
rSet.Put( SfxStringItem( FN_STAT_WORDCOUNT, aWordCount ) );
- SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId());
+ SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()));
if (pWrdCnt)
pWrdCnt->SetCounts(selectionStats, documentStats);
}
@@ -2048,9 +2048,9 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem )
else
{
OUString sFile, sFilter;
- sFile = ( (const SfxStringItem *)pItem )->GetValue();
+ sFile = static_cast<const SfxStringItem *>( pItem )->GetValue();
if ( SfxItemState::SET == rRequest.GetArgs()->GetItemState( FN_PARAM_1, true, &pItem ) )
- sFilter = ( (const SfxStringItem *)pItem )->GetValue();
+ sFilter = static_cast<const SfxStringItem *>(pItem )->GetValue();
bool bHasFileName = !sFile.isEmpty();
long nFound = InsertDoc( nSlot, sFile, sFilter );
@@ -2441,7 +2441,7 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg )
// re-initialize Redline dialog
sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId();
- SwRedlineAcceptChild* pRed = (SwRedlineAcceptChild*)pVFrame->GetChildWindow( nId );
+ SwRedlineAcceptChild* pRed = static_cast<SwRedlineAcceptChild*>(pVFrame->GetChildWindow( nId ));
if ( pRed )
pRed->ReInitDlg( GetDocShell() );
}
diff --git a/sw/source/uibase/uiview/viewdlg.cxx b/sw/source/uibase/uiview/viewdlg.cxx
index a308f99..bb7d379 100644
--- a/sw/source/uibase/uiview/viewdlg.cxx
+++ b/sw/source/uibase/uiview/viewdlg.cxx
@@ -49,7 +49,7 @@ void SwView::ExecDlg(SfxRequest &rReq)
{
if ( pItem )
{
- sal_uInt16 nValue = ((SfxUInt16Item *)pItem)->GetValue();
+ sal_uInt16 nValue = static_cast<const SfxUInt16Item *>(pItem)->GetValue();
sal_uInt16 nOldValue = m_pWrtShell->GetPageOffset();
sal_uInt16 nPage, nLogPage;
m_pWrtShell->GetPageNum( nPage, nLogPage,
diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx
index 59633e6..c16e482 100644
--- a/sw/source/uibase/uiview/viewdlg2.cxx
+++ b/sw/source/uibase/uiview/viewdlg2.cxx
@@ -126,13 +126,13 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt)
SwFldMgr aMgr(&rSh);
SwSetExpFieldType* pFldType =
- (SwSetExpFieldType*)aMgr.GetFldType(RES_SETEXPFLD, rName);
+ static_cast<SwSetExpFieldType*>(aMgr.GetFldType(RES_SETEXPFLD, rName));
if (!pFldType && !rName.isEmpty() )
{
// Create new field types
SwSetExpFieldType aSwSetExpFieldType(rSh.GetDoc(), rName, nsSwGetSetExpType::GSE_SEQ);
aMgr.InsertFldType(aSwSetExpFieldType);
- pFldType = (SwSetExpFieldType*)aMgr.GetFldType(RES_SETEXPFLD, rName);
+ pFldType = static_cast<SwSetExpFieldType*>(aMgr.GetFldType(RES_SETEXPFLD, rName));
}
if (!pOpt->IgnoreSeqOpts())
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 1decd92..d3e3705 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -219,7 +219,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
SwDrawBase* pFuncPtr = GetDrawFuncPtr();
if( pFuncPtr && pFuncPtr->GetSlotId() == SID_DRAW_CS_ID )
{
- ConstCustomShape* pConstCustomShape = (ConstCustomShape*)(pFuncPtr);
+ ConstCustomShape* pConstCustomShape = static_cast<ConstCustomShape*>(pFuncPtr);
OUString aNew = ConstCustomShape::GetShapeTypeFromRequest( rReq );
OUString aOld = pConstCustomShape->GetShapeType();
if( aNew == aOld )
@@ -563,7 +563,7 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin,
if(pObj->ISA(SwDrawVirtObj))
{
- SwDrawVirtObj* pVirtObj = (SwDrawVirtObj*)pObj;
+ SwDrawVirtObj* pVirtObj = static_cast<SwDrawVirtObj*>(pObj);
pToBeActivated = &const_cast<SdrObject&>(pVirtObj->GetReferencedObj());
aNewTextEditOffset = pVirtObj->GetOffset();
}
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index b9938c2..1abec86 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -864,7 +864,7 @@ IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox )
OUString sKey = OUString( ODF_FORMDROPDOWN_RESULT );
(*pFieldmark->GetParameters())[ sKey ] = makeAny(selection);
pFieldmark->Invalidate();
- SwView& rView = ( ( SwEditWin* )GetParent() )->GetView();
+ SwView& rView = static_cast<SwEditWin*>( GetParent() )->GetView();
rView.GetDocShell()->SetModified( true );
}
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index ae721da..effb2be 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -110,7 +110,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
case SID_SEARCH_ITEM:
{
delete m_pSrchItem;
- m_pSrchItem = (SvxSearchItem*) pArgs->Get(SID_SEARCH_ITEM).Clone();
+ m_pSrchItem = static_cast<SvxSearchItem*>( pArgs->Get(SID_SEARCH_ITEM).Clone() );
}
break;
@@ -124,7 +124,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
{
// Unregister dialog
delete m_pSrchItem;
- m_pSrchItem = (SvxSearchItem*) pArgs->Get(SID_SEARCH_ITEM).Clone();
+ m_pSrchItem = static_cast<SvxSearchItem*>( pArgs->Get(SID_SEARCH_ITEM).Clone() );
DELETEZ( m_pSrchList );
DELETEZ( m_pReplList );
@@ -180,7 +180,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
if ( pArgs )
{
delete m_pSrchItem;
- m_pSrchItem = (SvxSearchItem*) pArgs->Get(SID_SEARCH_ITEM).Clone();
+ m_pSrchItem = static_cast<SvxSearchItem*>( pArgs->Get(SID_SEARCH_ITEM).Clone() );
}
}
switch (m_pSrchItem->GetCommand())
@@ -194,10 +194,10 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
#if HAVE_FEATURE_DESKTOP
{
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
- SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
+ SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>( GetViewFrame()->GetChildWindow(nChildId) );
if ( pDlgWrp )
{
- m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow());
+ m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin);
m_pSrchDlg->SetSrchFlag();
}
@@ -220,11 +220,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
#if HAVE_FEATURE_DESKTOP
{
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
- SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
+ SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId));
if ( pDlgWrp )
{
- m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow());
+ m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin);
m_pSrchDlg->SetSrchFlag();
}
@@ -281,11 +281,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
#if HAVE_FEATURE_DESKTOP
{
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
- SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
+ SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId));
if ( pDlgWrp )
{
- m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow());
+ m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin);
m_pSrchDlg->SetSrchFlag();
}
@@ -350,11 +350,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
}
#if HAVE_FEATURE_DESKTOP
const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId();
- SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId);
+ SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId));
if ( pDlgWrp )
{
- m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow());
+ m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow());
m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin);
m_pSrchDlg->SetSrchFlag();
}
@@ -778,7 +778,7 @@ SvxSearchDialog* SwView::GetSearchDialog()
{
#if HAVE_FEATURE_DESKTOP
const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId();
- SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*) SfxViewFrame::Current()->GetChildWindow(nId);
+ SvxSearchDialogWrapper *pWrp = static_cast<SvxSearchDialogWrapper*>( SfxViewFrame::Current()->GetChildWindow(nId) );
m_pSrchDlg = pWrp ? pWrp->getDialog () : 0;
return m_pSrchDlg;
#else
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index c742606..161892a 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -33,6 +33,7 @@
#include <sfx2/linkmgr.hxx>
#include <editeng/langitem.hxx>
#include <editeng/brushitem.hxx>
+#include <editeng/tstpitem.hxx>
#include <sfx2/htmlmode.hxx>
#include <editeng/unolingu.hxx>
#include <sfx2/msgpool.hxx>
@@ -167,8 +168,8 @@ void SwView::GetState(SfxItemSet &rSet)
const sal_uInt16 nCurIdx = m_pWrtShell->GetCurPageDesc();
const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx );
const SwFrmFmt& rMaster = rDesc.GetMaster();
- const SvxBrushItem& rBrush = (const SvxBrushItem&)
- rMaster.GetFmtAttr(RES_BACKGROUND, true);
+ const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>(
+ rMaster.GetFmtAttr(RES_BACKGROUND, true));
rSet.Put(rBrush);
}
break;
@@ -254,25 +255,25 @@ void SwView::GetState(SfxItemSet &rSet)
case SID_ATTR_DEFTABSTOP:
{
const SvxTabStopItem& rDefTabs =
- (const SvxTabStopItem&)m_pWrtShell->
- GetDefault(RES_PARATR_TABSTOP);
+ static_cast<const SvxTabStopItem&>(m_pWrtShell->
+ GetDefault(RES_PARATR_TABSTOP));
rSet.Put( SfxUInt16Item( nWhich,
(sal_uInt16)::GetTabDist(rDefTabs)));
}
break;
case SID_ATTR_LANGUAGE:
{
- rSet.Put((const SvxLanguageItem&)
- m_pWrtShell->GetDefault(RES_CHRATR_LANGUAGE), SID_ATTR_LANGUAGE);
+ rSet.Put(static_cast<const SvxLanguageItem&>(
+ m_pWrtShell->GetDefault(RES_CHRATR_LANGUAGE)), SID_ATTR_LANGUAGE);
}
break;
case RES_CHRATR_CJK_LANGUAGE:
- rSet.Put((const SvxLanguageItem&)
- m_pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE), RES_CHRATR_CJK_LANGUAGE);
+ rSet.Put(static_cast<const SvxLanguageItem&>(
+ m_pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE)), RES_CHRATR_CJK_LANGUAGE);
break;
case RES_CHRATR_CTL_LANGUAGE:
- rSet.Put((const SvxLanguageItem&)
- m_pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE), RES_CHRATR_CTL_LANGUAGE);
+ rSet.Put(static_cast<const SvxLanguageItem&>(
+ m_pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE)), RES_CHRATR_CTL_LANGUAGE);
break;
case FN_REDLINE_ON:
rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) );
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 506de8d..d34fd73 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -256,8 +256,8 @@ void SwView::ExecTabWin( SfxRequest& rReq )
case SID_ATTR_LONG_LRSPACE:
if ( pReqArgs )
{
- SvxLongLRSpaceItem aLongLR( (const SvxLongLRSpaceItem&)pReqArgs->
- Get( SID_ATTR_LONG_LRSPACE ) );
+ SvxLongLRSpaceItem aLongLR( static_cast<const SvxLongLRSpaceItem&>(pReqArgs->
+ Get( SID_ATTR_LONG_LRSPACE )) );
SvxLRSpaceItem aLR(RES_LR_SPACE);
if ( !bSect && (bFrmSelection || nFrmType & FRMTYPE_FLY_ANY) )
{
@@ -415,8 +415,8 @@ void SwView::ExecTabWin( SfxRequest& rReq )
case SID_ATTR_LONG_ULSPACE:
if ( pReqArgs )
{
- SvxLongULSpaceItem aLongULSpace( (const SvxLongULSpaceItem&)pReqArgs->
- Get( SID_ATTR_LONG_ULSPACE ));
+ SvxLongULSpaceItem aLongULSpace( static_cast<const SvxLongULSpaceItem&>(pReqArgs->
+ Get( SID_ATTR_LONG_ULSPACE )));
if( bFrmSelection || nFrmType & FRMTYPE_FLY_ANY )
{
@@ -556,7 +556,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
case SID_ATTR_PAGE_COLUMN:
if ( pReqArgs )
{
- const SfxInt16Item aColumnItem( (const SfxInt16Item&)pReqArgs->Get(nSlot) );
+ const SfxInt16Item aColumnItem( static_cast<const SfxInt16Item&>(pReqArgs->Get(nSlot)) );
const sal_uInt16 nPageColumnType = aColumnItem.GetValue();
// nPageColumnType =
@@ -617,16 +617,16 @@ void SwView::ExecTabWin( SfxRequest& rReq )
if (pReqArgs)
{
const sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
- SvxTabStopItem aTabStops( (const SvxTabStopItem&)pReqArgs->
- Get( nWhich ));
+ SvxTabStopItem aTabStops( static_cast<const SvxTabStopItem&>(pReqArgs->
+ Get( nWhich )));
aTabStops.SetWhich(RES_PARATR_TABSTOP);
const SvxTabStopItem& rDefTabs =
- (const SvxTabStopItem&)rSh.GetDefault(RES_PARATR_TABSTOP);
+ static_cast<const SvxTabStopItem&>(rSh.GetDefault(RES_PARATR_TABSTOP));
// Default tab at pos 0
SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE );
rSh.GetCurAttr( aSet );
- const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)aSet.Get(RES_LR_SPACE);
+ const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE));
if ( rLR.GetTxtFirstLineOfst() < 0 )
{
@@ -653,7 +653,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
case SID_ATTR_PARA_LRSPACE:
if ( pReqArgs )
{
- SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)pReqArgs->Get(nSlot));
+ SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(pReqArgs->Get(nSlot)));
aParaMargin.SetRight( aParaMargin.GetRight() - m_nRightBorderDistance );
aParaMargin.SetTxtLeft(aParaMargin.GetTxtLeft() - m_nLeftBorderDistance );
@@ -692,7 +692,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
SfxItemSet aSet( GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP );
rSh.GetCurAttr( aSet );
- const SvxTabStopItem& rTabStops = (const SvxTabStopItem&)aSet.Get(RES_PARATR_TABSTOP);
+ const SvxTabStopItem& rTabStops = static_cast<const SvxTabStopItem&>(aSet.Get(RES_PARATR_TABSTOP));
// Do we have a tab at position zero?
sal_uInt16 i;
@@ -713,7 +713,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
aTabStops.Insert(aSwTabStop);
const SvxTabStopItem& rDefTabs =
- (const SvxTabStopItem&)rSh.GetDefault(RES_PARATR_TABSTOP);
+ static_cast<const SvxTabStopItem&>(rSh.GetDefault(RES_PARATR_TABSTOP));
::MakeDefTabs( ::GetTabDist(rDefTabs), aTabStops );
if( pColl && pColl->IsAutoUpdateFmt())
@@ -732,7 +732,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
case SID_ATTR_PARA_ULSPACE:
if ( pReqArgs )
{
- SvxULSpaceItem aParaMargin((const SvxULSpaceItem&)pReqArgs->Get(nSlot));
+ SvxULSpaceItem aParaMargin(static_cast<const SvxULSpaceItem&>(pReqArgs->Get(nSlot)));
long nUDist = 0;
long nLDist = 0;
@@ -756,13 +756,13 @@ void SwView::ExecTabWin( SfxRequest& rReq )
case SID_RULER_BORDERS:
if ( pReqArgs )
{
- SvxColumnItem aColItem((const SvxColumnItem&)pReqArgs->Get(nSlot));
+ SvxColumnItem aColItem(static_cast<const SvxColumnItem&>(pReqArgs->Get(nSlot)));
if( m_bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
{
OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!");
- const bool bSingleLine = ((const SfxBoolItem&)rReq.
+ const bool bSingleLine = static_cast<const SfxBoolItem&>(rReq.
GetArgs()->Get(SID_RULER_ACT_LINE_ONLY)).GetValue();
SwTabCols aTabCols;
@@ -840,7 +840,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
SwFmtCol aCols(
bSect ?
pSectFmt->GetCol() :
- (const SwFmtCol&)aSet.Get( RES_COL, false ));
+ static_cast<const SwFmtCol&>(aSet.Get( RES_COL, false )));
SwRect aCurRect = rSh.GetAnyCurRect(bSect ? RECT_SECTION_PRT : RECT_FLY_PRT_EMBEDDED);
const long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width();
::lcl_ConvertToCols( aColItem, lWidth, aCols );
@@ -881,7 +881,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
case SID_RULER_ROWS_VERTICAL:
if (pReqArgs)
{
- SvxColumnItem aColItem((const SvxColumnItem&)pReqArgs->Get(nSlot));
+ SvxColumnItem aColItem(static_cast<const SvxColumnItem&>(pReqArgs->Get(nSlot)));
if( m_bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
{
@@ -927,7 +927,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
bool bSingleLine = false;
const SfxPoolItem* pSingleLine;
if( SfxItemState::SET == rReq.GetArgs()->GetItemState(SID_RULER_ACT_LINE_ONLY, false, &pSingleLine))
- bSingleLine = ((const SfxBoolItem*)pSingleLine)->GetValue();
+ bSingleLine = static_cast<const SfxBoolItem*>(pSingleLine)->GetValue();
if ( m_bSetTabRowFromDoc )
{
if( !rSh.IsViewLocked() )
@@ -1196,11 +1196,11 @@ void SwView::StateTabWin(SfxItemSet& rSet)
rSet.DisableItem( nWhich );
else
{
- SvxTabStopItem aTabStops((const SvxTabStopItem&)
- aCoreSet.Get( RES_PARATR_TABSTOP ));
+ SvxTabStopItem aTabStops(static_cast<const SvxTabStopItem&>(
+ aCoreSet.Get( RES_PARATR_TABSTOP )));
- const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&)
- rSh.GetDefault(RES_PARATR_TABSTOP);
+ const SvxTabStopItem& rDefTabs = static_cast<const SvxTabStopItem&>(
+ rSh.GetDefault(RES_PARATR_TABSTOP));
OSL_ENSURE(m_pHRuler, "why is there no ruler?");
const long nDefTabDist = ::GetTabDist(rDefTabs);
@@ -1230,7 +1230,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxLRSpaceItem aLR( RES_LR_SPACE );
if ( !IsTabColFromDoc() )
{
- aLR = (const SvxLRSpaceItem&)aCoreSet.Get(RES_LR_SPACE);
+ aLR = static_cast<const SvxLRSpaceItem&>(aCoreSet.Get(RES_LR_SPACE));
// #i23726#
if (m_pNumRuleNodeFromDoc)
@@ -1254,7 +1254,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_ATTR_PARA_ULSPACE:
{
- SvxULSpaceItem aUL = (const SvxULSpaceItem&)aCoreSet.Get(RES_UL_SPACE);
+ SvxULSpaceItem aUL = static_cast<const SvxULSpaceItem&>(aCoreSet.Get(RES_UL_SPACE));
aUL.SetWhich(nWhich);
SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE);
@@ -1293,7 +1293,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
aCoreSet.Put( aBoxInfo );
rSh.GetFlyFrmAttr( aCoreSet );
- const SvxBoxItem& rBox = (const SvxBoxItem&)aCoreSet.Get(RES_BOX);
+ const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aCoreSet.Get(RES_BOX));
aDistLR.SetLeft(rBox.GetDistance(BOX_LINE_LEFT));
aDistLR.SetRight(rBox.GetDistance(BOX_LINE_RIGHT));
@@ -1302,7 +1302,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
RES_BOX, RES_BOX,
0 );
rSh.GetCurAttr( aCoreSet1 );
- const SvxBoxItem& rParaBox = (const SvxBoxItem&)aCoreSet1.Get(RES_BOX);
+ const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX));
aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(BOX_LINE_LEFT));
aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(BOX_LINE_RIGHT));
}
@@ -1322,14 +1322,14 @@ void SwView::StateTabWin(SfxItemSet& rSet)
aBoxInfo.SetDist(true);
aCoreSet2.Put(aBoxInfo);
rSh.GetTabBorders( aCoreSet2 );
- const SvxBoxItem& rBox = (const SvxBoxItem&)aCoreSet2.Get(RES_BOX);
+ const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aCoreSet2.Get(RES_BOX));
aDistLR.SetLeft(rBox.GetDistance(BOX_LINE_LEFT));
aDistLR.SetRight(rBox.GetDistance(BOX_LINE_RIGHT));
//add the border distance of the paragraph
SfxItemSet aCoreSet1( GetPool(), RES_BOX, RES_BOX );
rSh.GetCurAttr( aCoreSet1 );
- const SvxBoxItem& rParaBox = (const SvxBoxItem&)aCoreSet1.Get(RES_BOX);
+ const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX));
aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(BOX_LINE_LEFT));
aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(BOX_LINE_RIGHT));
rSet.Put(aDistLR);
@@ -1340,7 +1340,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
//get the page/header/footer border distance
const SwFrmFmt& rMaster = rDesc.GetMaster();
- const SvxBoxItem& rBox = (const SvxBoxItem&)rMaster.GetAttrSet().Get(RES_BOX);
+ const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rMaster.GetAttrSet().Get(RES_BOX));
aDistLR.SetLeft(rBox.GetDistance(BOX_LINE_LEFT));
aDistLR.SetRight(rBox.GetDistance(BOX_LINE_RIGHT));
@@ -1371,7 +1371,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
RES_BOX, RES_BOX,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 );
rSh.GetCurAttr( aCoreSetTmp );
- const SvxBoxItem& rParaBox = (const SvxBoxItem&)aCoreSetTmp.Get(RES_BOX);
+ const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSetTmp.Get(RES_BOX));
aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(BOX_LINE_LEFT));
aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(BOX_LINE_RIGHT));
rSet.Put(aDistLR);
@@ -1599,7 +1599,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
SvxColumnItem aColItem(nNum);
const SwRect aPrtRect = rSh.GetAnyCurRect(RECT_PAGE_PRT, pPt);
- const SvxBoxItem& rBox = (const SvxBoxItem&)rMaster.GetFmtAttr(RES_BOX);
+ const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rMaster.GetFmtAttr(RES_BOX));
long nDist = rBox.GetDistance();
lcl_FillSvxColumn(
diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx
index 4687312..3962797 100644
--- a/sw/source/uibase/uno/unomailmerge.cxx
+++ b/sw/source/uibase/uno/unomailmerge.cxx
@@ -387,7 +387,7 @@ SwXMailMerge::SwXMailMerge() :
xDocSh = new SwDocShell( SFX_CREATE_MODE_STANDARD );
xDocSh->DoInitNew( 0 );
SfxViewFrame *pFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
- SwView *pView = (SwView*) pFrame->GetViewShell();
+ SwView *pView = static_cast<SwView*>( pFrame->GetViewShell() );
pView->AttrChangedNotify( &pView->GetWrtShell() ); //So that SelectShell is called.
xModel = xDocSh->GetModel();
}
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index e6a5f9b..551f767 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -535,10 +535,10 @@ Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeEx
{
const TypeId aTypeId = TYPE(SwView);
- SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId);
+ SwView* pView = static_cast<SwView*>(SfxViewShell::GetFirst(&aTypeId));
while(pView && pView->GetObjectShell() != pDocShell)
{
- pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId);
+ pView = static_cast<SwView*>(SfxViewShell::GetNext(*pView, &aTypeId));
}
if(pView)
{
@@ -707,7 +707,7 @@ SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xC
{
getText();
XText *const pText = xBodyText.get();
- SwXBodyText* pBText = (SwXBodyText*)pText;
+ SwXBodyText* pBText = static_cast<SwXBodyText*>(pText);
SwXTextCursor *const pXTextCursor = pBText->CreateTextCursor(true);
xCrsr.set( static_cast<text::XWordCursor*>(pXTextCursor) );
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 2379cb2..91bbfad 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -655,7 +655,7 @@ SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc()
pTempDoc->SetClipBoard(true);
rOldSh.FillPrtDoc(pTempDoc, pPrt);
SfxViewFrame* pDocFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
- SwView* pDocView = (SwView*) pDocFrame->GetViewShell();
+ SwView* pDocView = static_cast<SwView*>( pDocFrame->GetViewShell() );
pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//So that SelectShell is called.
SwWrtShell* pSh = pDocView->GetWrtShellPtr();
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 7567a20..d05e2a3 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -506,7 +506,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
// old one is compared with the new OutlinePos.
// cast for Win16
if(nOldMemberCount > (int)nPos &&
- ((SwOutlineContent*)(*pOldMember)[nPos])->GetOutlineLevel() != nLevel)
+ static_cast<SwOutlineContent*>((*pOldMember)[nPos])->GetOutlineLevel() != nLevel)
*pbLevelOrVisibilityChanged = true;
nPos++;
@@ -563,7 +563,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
if(CONTENT_TYPE_GRAPHIC == nContentType)
{
OUString sLink;
- pWrtShell->GetGrfNms( &sLink, 0, (SwFlyFrmFmt*) pFrmFmt);
+ pWrtShell->GetGrfNms( &sLink, 0, static_cast<const SwFlyFrmFmt*>( pFrmFmt));
pCnt = new SwGraphicContent(this, sFrmName,
INetURLObject::decode( sLink, '%',
INetURLObject::DECODE_UNAMBIGUOUS,
@@ -754,7 +754,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
// #i51726# - all drawing objects can be named now
if (!pTemp->GetName().isEmpty())
{
- SwContact* pContact = (SwContact*)pTemp->GetUserCall();
+ SwContact* pContact = static_cast<SwContact*>(pTemp->GetUserCall());
long nYPos = 0;
const Point aNullPt;
if(pContact && pContact->GetFmt())
@@ -1292,9 +1292,9 @@ sal_IntPtr SwContentTree::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
if(pCnt && 0 != (pParent = pCnt->GetParent()))
{
if(pParent->GetType() == CONTENT_TYPE_OUTLINE)
- nLevel = nLevel + ((SwOutlineContent*)pCnt)->GetOutlineLevel();
+ nLevel = nLevel + static_cast<SwOutlineContent*>(pCnt)->GetOutlineLevel();
else if(pParent->GetType() == CONTENT_TYPE_REGION)
- nLevel = nLevel + ((SwRegionContent*)pCnt)->GetRegionLevel();
+ nLevel = nLevel + static_cast<SwRegionContent*>(pCnt)->GetRegionLevel();
}
}
sal_uInt16 nBasis = bIsRoot ? 0 : 5;
@@ -1323,7 +1323,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent )
const SwContent* pCnt = pCntType->GetMember(i);
if(pCnt)
{
- const sal_uInt16 nLevel = ((SwOutlineContent*)pCnt)->GetOutlineLevel();
+ const sal_uInt16 nLevel = static_cast<const SwOutlineContent*>(pCnt)->GetOutlineLevel();
OUString sEntry = pCnt->GetName();
if(sEntry.isEmpty())
sEntry = sSpace;
@@ -1333,7 +1333,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent )
else
{
//back search parent.
- if(((SwOutlineContent*)pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel)
+ if(static_cast<const SwOutlineContent*>(pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel)
pChild = InsertEntry(sEntry, pChild,
false, TREELIST_APPEND, (void*)pCnt);
else
@@ -1788,7 +1788,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
{
case CONTENT_TYPE_OUTLINE:
{
- const sal_uInt16 nPos = ((SwOutlineContent*)pCnt)->GetPos();
+ const sal_uInt16 nPos = static_cast<SwOutlineContent*>(pCnt)->GetPos();
OSL_ENSURE(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(),
"outlinecnt changed");
@@ -1813,7 +1813,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
}
sEntry += pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineText(nPos, false);
sOutlineText = pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineText(nPos, true);
- bIsOutlineMoveable = ((SwOutlineContent*)pCnt)->IsMoveable();
+ bIsOutlineMoveable = static_cast<SwOutlineContent*>(pCnt)->IsMoveable();
bOutline = true;
}
}
@@ -1824,7 +1824,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer,
// cannot inserted as URL or as koennen weder als URL noch als region
break;
case CONTENT_TYPE_URLFIELD:
- sUrl = ((SwURLFieldContent*)pCnt)->GetURL();
+ sUrl = static_cast<SwURLFieldContent*>(pCnt)->GetURL();
// no break;
case CONTENT_TYPE_OLE:
case CONTENT_TYPE_GRAPHIC:
@@ -3205,7 +3205,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode)
pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell();
if(nMode == EDIT_MODE_DELETE)
{
- if (((SwPostItContent*)pCnt)->IsPostIt())
+ if (static_cast<SwPostItContent*>(pCnt)->IsPostIt())
{
pActiveShell->GetView().GetPostItMgr()->SetActiveSidebarWin(0);
pActiveShell->DelRight();
@@ -3213,7 +3213,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode)
}
else
{
- if (((SwPostItContent*)pCnt)->IsPostIt())
+ if (static_cast<SwPostItContent*>(pCnt)->IsPostIt())
nSlot = FN_POSTIT;
else
nSlot = FN_REDLINE_COMMENT;
@@ -3221,7 +3221,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode)
break;
case CONTENT_TYPE_INDEX:
{
- const SwTOXBase* pBase = ((SwTOXBaseContent*)pCnt)->GetTOXBase();
+ const SwTOXBase* pBase = static_cast<SwTOXBaseContent*>(pCnt)->GetTOXBase();
switch(nMode)
{
case EDIT_MODE_EDIT:
@@ -3307,7 +3307,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
{
case CONTENT_TYPE_OUTLINE :
{
- pActiveShell->GotoOutline(((SwOutlineContent*)pCnt)->GetPos());
+ pActiveShell->GotoOutline(static_cast<SwOutlineContent*>(pCnt)->GetPos());
}
break;
case CONTENT_TYPE_TABLE :
@@ -3336,7 +3336,7 @@ void SwContentTree::GotoContent(SwContent* pCnt)
case CONTENT_TYPE_URLFIELD:
{
if(pActiveShell->GotoINetAttr(
- *((SwURLFieldContent*)pCnt)->GetINetAttr() ))
+ *static_cast<SwURLFieldContent*>(pCnt)->GetINetAttr() ))
{
pActiveShell->Right( CRSR_SKIP_CHARS, true, 1, false);
pActiveShell->SwCrsrShell::SelectTxtAttr( RES_TXTATR_INETFMT, true );
@@ -3358,11 +3358,11 @@ void SwContentTree::GotoContent(SwContent* pCnt)
break;
case CONTENT_TYPE_POSTIT:
pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell();
- if (((SwPostItContent*)pCnt)->IsPostIt())
- pActiveShell->GotoFld(*((SwPostItContent*)pCnt)->GetPostIt());
+ if (static_cast<SwPostItContent*>(pCnt)->IsPostIt())
+ pActiveShell->GotoFld(*static_cast<SwPostItContent*>(pCnt)->GetPostIt());
else
pActiveShell->GetView().GetDocShell()->GetWrtShell()->GotoRedline(
- pActiveShell->GetView().GetDocShell()->GetWrtShell()->FindRedlineOfData(((SwPostItContent*)pCnt)->GetRedline()->GetRedlineData()));
+ pActiveShell->GetView().GetDocShell()->GetWrtShell()->FindRedlineOfData(static_cast<SwPostItContent*>(pCnt)->GetRedline()->GetRedlineData()));
break;
case CONTENT_TYPE_DRAWOBJECT:
@@ -3419,7 +3419,7 @@ NaviContentBookmark::NaviContentBookmark( const OUString &rUrl,
const SwDocShell* pDocSh ) :
aUrl( rUrl ),
aDescr(rDesc),
- nDocSh((sal_IntPtr)pDocSh),
+ nDocSh(reinterpret_cast<sal_IntPtr>(pDocSh)),
nDefDrag( nDragType )
{
}
@@ -3467,7 +3467,7 @@ void SwContentTree::InitEntry(SvTreeListEntry* pEntry,
{
const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2"
SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind );
- SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite );
+ SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite ));
SwContentLBoxString* pStr = new SwContentLBoxString( pEntry, 0, pCol->GetText() );
pEntry->ReplaceItem( pStr, nColToHilite );
}
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 1176dd3..eb4ffa3 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -920,18 +920,18 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
SfxStringItem aFactory(SID_NEWDOCDIRECT,
SwDocShell::Factory().GetFilterContainer()->GetName());
- const SfxFrameItem* pItem = (SfxFrameItem*)
+ const SfxFrameItem* pItem = static_cast<const SfxFrameItem*>(
rDispatch.Execute(SID_NEWDOCDIRECT,
- SfxCallMode::SYNCHRON, &aFactory, 0L);
+ SfxCallMode::SYNCHRON, &aFactory, 0L));
// save at
SfxFrame* pFrm = pItem ? pItem->GetFrame() : 0;
SfxViewFrame* pFrame = pFrm ? pFrm->GetCurrentViewFrame() : 0;
if( pFrame )
{
- const SfxBoolItem* pBool = (const SfxBoolItem*)
+ const SfxBoolItem* pBool = static_cast<const SfxBoolItem*>(
pFrame->GetDispatcher()->Execute(
- SID_SAVEASDOC, SfxCallMode::SYNCHRON );
+ SID_SAVEASDOC, SfxCallMode::SYNCHRON ));
SfxObjectShell& rObj = *pFrame->GetObjectShell();
const SfxMedium* pMedium = rObj.GetMedium();
OUString sNewFile(pMedium->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI));
@@ -1219,7 +1219,7 @@ void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry,
{
const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2"
SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind );
- SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite );
+ SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite ));
SwLBoxString* pStr = new SwLBoxString( pEntry, 0, pCol->GetText() );
pEntry->ReplaceItem( pStr, nColToHilite );
}
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 2909385..8411776 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -951,7 +951,7 @@ void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/,
NumEditAction& SwNavigationPI::GetPageEdit()
{
- return *(NumEditAction*)aContentToolBox.GetItemWindow(FN_PAGENUMBER);
+ return *static_cast<NumEditAction*>(aContentToolBox.GetItemWindow(FN_PAGENUMBER));
}
SfxChildAlignment SwNavigationPI::CheckAlignment
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index d7eb8d6..fc1b7d5 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -242,7 +242,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType)
nFormat != nSysLongDateFmt)
{
const sal_Int32 nPos = InsertEntry( sValue );
- SetEntryData( nPos, (void*)nFormat );
+ SetEntryData( nPos, reinterpret_cast<void*>(nFormat) );
if( nFormat == pFormatter->GetStandardFormat(
nFormatType, eCurLanguage ) )
@@ -292,7 +292,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt)
for (sal_Int32 i = 0; i < GetEntryCount(); i++)
{
- if (nFormat == (sal_uLong)GetEntryData(i))
+ if (nFormat == reinterpret_cast<sal_uLong>(GetEntryData(i)))
{
SelectEntryPos(i);
nStdEntry = i;
@@ -316,7 +316,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt)
}
sal_Int32 nPos = 0;
- while ((sal_uLong)GetEntryData(nPos) == ULONG_MAX)
+ while (reinterpret_cast<sal_uLong>(GetEntryData(nPos)) == ULONG_MAX)
nPos++;
sal_uLong nSysNumFmt = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, eCurLanguage);
@@ -347,7 +347,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt)
}
nPos = InsertEntry(sValue, nPos); // Insert as first numeric entry
- SetEntryData(nPos, (void*)nDefFmt);
+ SetEntryData(nPos, reinterpret_cast<void*>(nDefFmt));
SelectEntryPos(nPos);
nDefFormat = GetFormat();
}
@@ -356,7 +356,7 @@ sal_uLong NumFormatListBox::GetFormat() const
{
sal_Int32 nPos = GetSelectEntryPos();
- return (sal_uLong)GetEntryData(nPos);
+ return reinterpret_cast<sal_uLong>(GetEntryData(nPos));
}
IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
@@ -406,11 +406,11 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
const SfxPoolItem* pItem = pView->GetDocShell()->
GetItem( SID_ATTR_NUMBERFORMAT_INFO );
- if( pItem && 0 != ((SvxNumberInfoItem*)pItem)->GetDelCount() )
+ if( pItem && 0 != static_cast<const SvxNumberInfoItem*>(pItem)->GetDelCount() )
{
- const sal_uInt32* pDelArr = ((SvxNumberInfoItem*)pItem)->GetDelArray();
+ const sal_uInt32* pDelArr = static_cast<const SvxNumberInfoItem*>(pItem)->GetDelArray();
- for ( sal_uInt32 i = 0; i < ((SvxNumberInfoItem*)pItem)->GetDelCount(); i++ )
+ for ( sal_uInt32 i = 0; i < static_cast<const SvxNumberInfoItem*>(pItem)->GetDelCount(); i++ )
pFormatter->DeleteEntry( pDelArr[i] );
}
@@ -418,7 +418,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox )
if( SfxItemState::SET == pOutSet->GetItemState(
SID_ATTR_NUMBERFORMAT_VALUE, false, &pItem ))
{
- sal_uInt32 nNumberFormat = ((SfxUInt32Item*)pItem)->GetValue();
+ sal_uInt32 nNumberFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
// oj #105473# change order of calls
const SvNumberformat* pFmt = pFormatter->GetEntry(nNumberFormat);
if( pFmt )
diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx
index cdede9c..087dd8a 100644
--- a/sw/source/uibase/utlui/uiitems.cxx
+++ b/sw/source/uibase/utlui/uiitems.cxx
@@ -215,7 +215,7 @@ SfxPoolItem* SwPtrItem::Clone( SfxItemPool * /*pPool*/ ) const
bool SwPtrItem::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
- const SwPtrItem& rItem = (SwPtrItem&)rAttr;
+ const SwPtrItem& rItem = static_cast<const SwPtrItem&>(rAttr);
return ( pMisc == rItem.pMisc );
}
@@ -299,7 +299,7 @@ SfxPoolItem* SwPaMItem::Clone( SfxItemPool * /*pPool*/ ) const
bool SwPaMItem::operator==( const SfxPoolItem& rAttr ) const
{
assert(SfxPoolItem::operator==(rAttr));
- const SwPaMItem& rItem = (SwPaMItem&)rAttr;
+ const SwPaMItem& rItem = static_cast<const SwPaMItem&>(rAttr);
return ( m_pPaM == rItem.m_pPaM );
}
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 2b8c718..86a9cb1 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -103,7 +103,7 @@ void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
const SfxPoolItem *pBoxInfo;
if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER,
true, &pBoxInfo))
- aBoxInfo = *(SvxBoxInfoItem*)pBoxInfo;
+ aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
// Table variant: If more than one table cells are selected
rSh.GetCrsr(); //So that GetCrsrCnt() returns the right thing
@@ -127,7 +127,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode)
const SfxPoolItem *pTmpBrush;
if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, true, &pTmpBrush ) )
{
- SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) );
+ SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) );
aTmpBrush.SetWhich( RES_BACKGROUND );
rSet.Put( aTmpBrush );
}
@@ -141,7 +141,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode)
const SfxPoolItem *pTmpItem;
if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BOX, true, &pTmpItem ) )
{
- SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpItem) );
+ SvxBoxItem aTmpBox( *static_cast<const SvxBoxItem*>(pTmpItem) );
aTmpBox.SetWhich( RES_BOX );
rSet.Put( aTmpBox );
}
@@ -151,7 +151,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode)
// Border shadow
if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_SHADOW, false, &pTmpItem ) )
{
- SvxShadowItem aTmpShadow( *((SvxShadowItem*)pTmpItem) );
+ SvxShadowItem aTmpShadow( *static_cast<const SvxShadowItem*>(pTmpItem) );
aTmpShadow.SetWhich( RES_SHADOW );
rSet.Put( aTmpShadow );
}
@@ -167,7 +167,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const sal_uInt8 nMode)
const SfxPoolItem *pTmpBrush;
if( SfxItemState::SET == rSet.GetItemState( RES_BACKGROUND, false, &pTmpBrush ) )
{
- SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) );
+ SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) );
aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
rSet.Put( aTmpBrush );
}
@@ -180,7 +180,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const sal_uInt8 nMode)
const SfxPoolItem *pTmpItem;
if( SfxItemState::SET == rSet.GetItemState( RES_BOX, false, &pTmpItem ) )
{
- SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpItem) );
+ SvxBoxItem aTmpBox( *static_cast<const SvxBoxItem*>(pTmpItem) );
aTmpBox.SetWhich( RES_CHRATR_BOX );
rSet.Put( aTmpBox );
}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list