diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-24 10:40:18 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-25 10:09:53 +0200 |
commit | 9409b2eb454118eab93542d4dfb464b723b219e2 (patch) | |
tree | b143ccfb63af30b3e47637e096d03261f2586065 /sw/source/uibase/shells | |
parent | 88aaa3496161339d504876a2e84dc03e4d6191d9 (diff) |
loplugin: cstylecast
Change-Id: I030208a86a60609b0379c00957538677fac15ccf
Diffstat (limited to 'sw/source/uibase/shells')
-rw-r--r-- | sw/source/uibase/shells/annotsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtex.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/grfsh.cxx | 44 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 24 | ||||
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/shells/textidx.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 26 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh2.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtattr.cxx | 4 |
12 files changed, 67 insertions, 67 deletions
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 172bd26c62cf..b746f48f4e5b 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -1455,7 +1455,7 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq) sal_uInt16 nCnt = 1; const SfxPoolItem* pItem=0; if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem ) ) - nCnt = ((SfxUInt16Item*)pItem)->GetValue(); + nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); switch( nId ) { case SID_UNDO: diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 9002984956a5..16b666ef46fb 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -300,7 +300,7 @@ void SwBaseShell::ExecClpbrd(SfxRequest &rReq) SwView* pView = &rView; SwTransferable::PasteFormat( rSh, aDataHelper, - ((SfxUInt32Item*)pFmt)->GetValue() ); + static_cast<const SfxUInt32Item*>(pFmt)->GetValue() ); //Done() has to be called before the shell has been removed rReq.Done(); @@ -463,7 +463,7 @@ void SwBaseShell::ExecUndo(SfxRequest &rReq) const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem )) - nCnt = ((SfxUInt16Item*)pItem)->GetValue(); + nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); // #i106349#: save pointer: undo/redo may delete the shell, i.e., this! SfxViewFrame *const pViewFrame( GetView().GetViewFrame() ); @@ -1552,7 +1552,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) rSh.GetObjAttr(aSet); else rSh.GetFlyFrmAttr(aSet); - RndStdIds eSet = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetAnchorId(); + RndStdIds eSet = static_cast<const SwFmtAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId(); const bool bSet = ((nWhich == FN_TOOL_ANCHOR_PAGE) && (eSet == FLY_AT_PAGE)) @@ -1627,7 +1627,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) else { rSh.GetFlyFrmAttr(aSet); - nAnchorType = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetAnchorId(); + nAnchorType = static_cast<const SwFmtAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId(); } const SwFmtSurround& rWrap = (const SwFmtSurround&)aSet.Get(RES_SURROUND); diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index c3059ebdc172..0b8a4da5823e 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -663,7 +663,7 @@ ASK_ADJUST: if( !pAdjust || IsInvalidItem( pAdjust )) rSet.InvalidateItem( nSlotId ), nSlotId = 0; else - bFlag = eAdjust == ((SvxAdjustItem*)pAdjust)->GetAdjust(); + bFlag = eAdjust == static_cast<const SvxAdjustItem*>(pAdjust)->GetAdjust(); } break; diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 3ec5c14a34b6..a3807e81996c 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -527,7 +527,7 @@ void SwDrawTextShell::ExecUndo(SfxRequest &rReq) case SID_UNDO: case SID_REDO: if( SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem ) && - 1 < (nCnt = ((SfxUInt16Item*)pItem)->GetValue()) ) + 1 < (nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue()) ) { // then we make by ourself. ::svl::IUndoManager* pUndoManager = GetUndoManager(); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 7407d7f1bbbc..4fb574449078 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -356,14 +356,14 @@ void SwGrfShell::Execute(SfxRequest &rReq) SID_ATTR_GRAF_FRMSIZE, false, &pItem )) { SwFmtFrmSize aSize; - const Size& rSz = ((SvxSizeItem*)pItem)->GetSize(); + const Size& rSz = static_cast<const SvxSizeItem*>(pItem)->GetSize(); aSize.SetWidth( rSz.Width() ); aSize.SetHeight( rSz.Height() ); if( SfxItemState::SET == pSet->GetItemState( SID_ATTR_GRAF_FRMSIZE_PERCENT, false, &pItem )) { - const Size& rRelativeSize = ((SvxSizeItem*)pItem)->GetSize(); + const Size& rRelativeSize = static_cast<const SvxSizeItem*>(pItem)->GetSize(); aSize.SetWidthPercent( static_cast< sal_uInt8 >( rRelativeSize.Width() ) ); aSize.SetHeightPercent( static_cast< sal_uInt8 >( rRelativeSize.Height() ) ); } @@ -412,13 +412,13 @@ void SwGrfShell::Execute(SfxRequest &rReq) if( SfxItemState::SET == pSet->GetItemState( SID_ATTR_GRAF_GRAPHIC, true, &pItem )) { - if( !((SvxBrushItem*)pItem)->GetGraphicLink().isEmpty() ) - sGrfNm = ((SvxBrushItem*)pItem)->GetGraphicLink(); + if( !static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink().isEmpty() ) + sGrfNm = static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink(); else sGrfNm = ""; - if( !((SvxBrushItem*)pItem)->GetGraphicFilter().isEmpty() ) - sFilterNm = ((SvxBrushItem*)pItem)->GetGraphicFilter(); + if( !static_cast<const SvxBrushItem*>(pItem)->GetGraphicFilter().isEmpty() ) + sFilterNm = static_cast<const SvxBrushItem*>(pItem)->GetGraphicFilter(); else sFilterNm = ""; @@ -527,37 +527,37 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq ) case SID_ATTR_GRAF_LUMINANCE: if( pItem ) aGrfSet.Put( SwLuminanceGrf( - ((SfxInt16Item*)pItem)->GetValue() )); + static_cast<const SfxInt16Item*>(pItem)->GetValue() )); break; case SID_ATTR_GRAF_CONTRAST: if( pItem ) aGrfSet.Put( SwContrastGrf( - ((SfxInt16Item*)pItem)->GetValue() )); + static_cast<const SfxInt16Item*>(pItem)->GetValue() )); break; case SID_ATTR_GRAF_RED: if( pItem ) aGrfSet.Put( SwChannelRGrf( - ((SfxInt16Item*)pItem)->GetValue() )); + static_cast<const SfxInt16Item*>(pItem)->GetValue() )); break; case SID_ATTR_GRAF_GREEN: if( pItem ) aGrfSet.Put( SwChannelGGrf( - ((SfxInt16Item*)pItem)->GetValue() )); + static_cast<const SfxInt16Item*>(pItem)->GetValue() )); break; case SID_ATTR_GRAF_BLUE: if( pItem ) aGrfSet.Put( SwChannelBGrf( - ((SfxInt16Item*)pItem)->GetValue() )); + static_cast<const SfxInt16Item*>(pItem)->GetValue() )); break; case SID_ATTR_GRAF_GAMMA: if( pItem ) { - double fVal = ((SfxUInt32Item*)pItem)->GetValue(); + double fVal = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); aGrfSet.Put( SwGammaGrf(fVal/100. )); } break; @@ -571,13 +571,13 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq ) case SID_ATTR_GRAF_INVERT: if( pItem ) aGrfSet.Put( SwInvertGrf( - ((SfxBoolItem*)pItem)->GetValue() )); + static_cast<const SfxBoolItem*>(pItem)->GetValue() )); break; case SID_ATTR_GRAF_MODE: if( pItem ) aGrfSet.Put( SwDrawModeGrf( - ((SfxUInt16Item*)pItem)->GetValue() )); + static_cast<const SfxUInt16Item*>(pItem)->GetValue() )); break; case SID_COLOR_SETTINGS: @@ -695,31 +695,31 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) case SID_ATTR_GRAF_LUMINANCE: if( !bParentCntProt ) - rSet.Put( SfxInt16Item( nWhich, ((SwLuminanceGrf&) + rSet.Put( SfxInt16Item( nWhich, static_cast<const SwLuminanceGrf&>( aCoreSet.Get(RES_GRFATR_LUMINANCE)).GetValue() )); break; case SID_ATTR_GRAF_CONTRAST: if( !bParentCntProt ) - rSet.Put( SfxInt16Item( nWhich, ((SwContrastGrf&) + rSet.Put( SfxInt16Item( nWhich, static_cast<const SwContrastGrf&>( aCoreSet.Get(RES_GRFATR_CONTRAST)).GetValue() )); break; case SID_ATTR_GRAF_RED: if( !bParentCntProt ) - rSet.Put( SfxInt16Item( nWhich, ((SwChannelRGrf&) + rSet.Put( SfxInt16Item( nWhich, static_cast<const SwChannelRGrf&>( aCoreSet.Get(RES_GRFATR_CHANNELR)).GetValue() )); break; case SID_ATTR_GRAF_GREEN: if( !bParentCntProt ) - rSet.Put( SfxInt16Item( nWhich, ((SwChannelGGrf&) + rSet.Put( SfxInt16Item( nWhich, static_cast<const SwChannelGGrf&>( aCoreSet.Get(RES_GRFATR_CHANNELG)).GetValue() )); break; case SID_ATTR_GRAF_BLUE: if( !bParentCntProt ) - rSet.Put( SfxInt16Item( nWhich, ((SwChannelBGrf&) + rSet.Put( SfxInt16Item( nWhich, static_cast<const SwChannelBGrf&>( aCoreSet.Get(RES_GRFATR_CHANNELB)).GetValue() )); break; @@ -740,7 +740,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) GRAPHIC_GDIMETAFILE == pGrafObj->GetType() ) bDisable = true; else - rSet.Put( SfxUInt16Item( nWhich, ((SwTransparencyGrf&) + rSet.Put( SfxUInt16Item( nWhich, static_cast<const SwTransparencyGrf&>( aCoreSet.Get(RES_GRFATR_TRANSPARENCY)).GetValue() )); } } @@ -748,13 +748,13 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) case SID_ATTR_GRAF_INVERT: if( !bParentCntProt ) - rSet.Put( SfxBoolItem( nWhich, ((SwInvertGrf&) + rSet.Put( SfxBoolItem( nWhich, static_cast<const SwInvertGrf&>( aCoreSet.Get(RES_GRFATR_INVERT)).GetValue() )); break; case SID_ATTR_GRAF_MODE: if( !bParentCntProt ) - rSet.Put( SfxUInt16Item( nWhich, ((SwDrawModeGrf&) + rSet.Put( SfxUInt16Item( nWhich, static_cast<const SwDrawModeGrf&>( aCoreSet.Get(RES_GRFATR_DRAWMODE)).GetValue() )); break; diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index d6992baa967f..d4fe26b330ee 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -279,7 +279,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, if(SfxItemState::SET == rSet.GetItemState(SID_BACKGRND_DESTINATION, false, &pItem)) { SwViewOption aUsrPref( *rSh.GetViewOptions() ); - aUsrPref.SetTblDest((sal_uInt8)((SfxUInt16Item*)pItem)->GetValue()); + aUsrPref.SetTblDest((sal_uInt8)static_cast<const SfxUInt16Item*>(pItem)->GetValue()); SW_MOD()->ApplyUsrPref(aUsrPref, &rSh.GetView()); } bool bBorder = ( SfxItemState::SET == rSet.GetItemState( RES_BOX ) || @@ -389,7 +389,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, // The item must only be recorded while manual alignment, so that the // alignment is not overwritten by the distances while recording. if(eOrient != text::HoriOrientation::NONE) - ((SfxItemSet&)rSet).ClearItem( SID_ATTR_LRSPACE ); + const_cast<SfxItemSet&>(static_cast<const SfxItemSet&>(rSet)).ClearItem( SID_ATTR_LRSPACE ); if(pRep->HasColsChanged()) { @@ -398,10 +398,10 @@ void ItemSetToTableParam( const SfxItemSet& rSet, } if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_TABLE_HEADLINE, false, &pItem)) - rSh.SetRowsToRepeat( ((SfxUInt16Item*)pItem)->GetValue() ); + rSh.SetRowsToRepeat( static_cast<const SfxUInt16Item*>(pItem)->GetValue() ); if( SfxItemState::SET == rSet.GetItemState( FN_TABLE_SET_VERT_ALIGN, false, &pItem)) - rSh.SetBoxAlign(((SfxUInt16Item*)(pItem))->GetValue()); + rSh.SetBoxAlign(static_cast<const SfxUInt16Item*>((pItem))->GetValue()); if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_TABLE_NAME, false, &pItem )) rSh.SetTableName( *pFmt, ((const SfxStringItem*)pItem)->GetValue() ); @@ -636,12 +636,12 @@ void SwTableShell::Execute(SfxRequest &rReq) } else aCoreSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, - ((SwTblBoxNumFormat&)aBoxSet.Get( + static_cast<const SwTblBoxNumFormat&>(aBoxSet.Get( RES_BOXATR_FORMAT )).GetValue() )); OUString sCurText( rSh.GetTableBoxText() ); aCoreSet.Put( SvxNumberInfoItem( pFormatter, - ((SwTblBoxValue&)aBoxSet.Get( + static_cast<const SwTblBoxValue&>(aBoxSet.Get( RES_BOXATR_VALUE)).GetValue(), sCurText, SID_ATTR_NUMBERFORMAT_INFO )); @@ -658,13 +658,13 @@ void SwTableShell::Execute(SfxRequest &rReq) const SfxPoolItem* pNumberFormatItem = GetView().GetDocShell()-> GetItem( SID_ATTR_NUMBERFORMAT_INFO ); - if( pNumberFormatItem && 0 != ((SvxNumberInfoItem*)pNumberFormatItem)->GetDelCount() ) + if( pNumberFormatItem && 0 != static_cast<const SvxNumberInfoItem*>(pNumberFormatItem)->GetDelCount() ) { - const sal_uInt32* pDelArr = ((SvxNumberInfoItem*) + const sal_uInt32* pDelArr = static_cast<const SvxNumberInfoItem*>( pNumberFormatItem)->GetDelArray(); - for ( sal_uInt32 i = 0; i < ((SvxNumberInfoItem*)pNumberFormatItem)->GetDelCount(); i++ ) - ((SvxNumberInfoItem*)pNumberFormatItem)-> + for ( sal_uInt32 i = 0; i < static_cast<const SvxNumberInfoItem*>(pNumberFormatItem)->GetDelCount(); i++ ) + static_cast<const SvxNumberInfoItem*>(pNumberFormatItem)-> GetNumberFormatter()->DeleteEntry( pDelArr[i] ); } @@ -674,7 +674,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SfxItemSet aBoxFormatSet( *aCoreSet.GetPool(), RES_BOXATR_FORMAT, RES_BOXATR_FORMAT ); aBoxFormatSet.Put( SwTblBoxNumFormat( - ((SfxUInt32Item*)pNumberFormatItem)->GetValue() )); + static_cast<const SfxUInt32Item*>(pNumberFormatItem)->GetValue() )); rSh.SetTblBoxFormulaAttrs( aBoxFormatSet ); } @@ -710,7 +710,7 @@ void SwTableShell::Execute(SfxRequest &rReq) { bool bAppendLine = true; if( pItem ) - bAppendLine = ((SfxBoolItem*)pItem)->GetValue(); + bAppendLine = static_cast<const SfxBoolItem*>(pItem)->GetValue(); rReq.SetReturnValue( SfxBoolItem( nSlot, rSh.GoNextCell( bAppendLine ) ) ); bCallDone = true; diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index e4ba7d82454a..c38a45ec7eb8 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -134,7 +134,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) { case TYP_DDEFLD: { - ::sfx2::SvBaseLink& rLink = ((SwDDEFieldType*)pFld->GetTyp())-> + ::sfx2::SvBaseLink& rLink = static_cast<SwDDEFieldType*>(pFld->GetTyp())-> GetBaseLink(); if(rLink.IsVisible()) { @@ -166,7 +166,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) if(pFld && pFld->GetTyp()->Which() == RES_MACROFLD) { - const OUString& rMacro = ((SwMacroField*)pFld)->GetMacro(); + const OUString& rMacro = static_cast<SwMacroField*>(pFld)->GetMacro(); sal_Int32 nPos = rMacro.indexOf('.'); if(nPos != -1) { @@ -240,7 +240,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) } if( SfxItemState::SET == pArgs->GetItemState( FN_PARAM_3, false, &pItem )) - nCommand = ((SfxInt32Item*)pItem)->GetValue(); + nCommand = static_cast<const SfxInt32Item*>(pItem)->GetValue(); aPar1 += OUString(DB_DELIM); aPar1 += OUString::number(nCommand); aPar1 += OUString(DB_DELIM); @@ -542,7 +542,7 @@ void SwTextShell::ExecField(SfxRequest &rReq) SwFldMgr aMgr; if ( pItem ) { - aText = ((SfxStringItem*)pItem)->GetValue(); + aText = static_cast<const SfxStringItem*>(pItem)->GetValue(); SFX_REQUEST_ARG( rReq, pType, SfxStringItem, FN_PARAM_2 , false ); SFX_REQUEST_ARG( rReq, pIsUrl, SfxBoolItem, FN_PARAM_1 , false ); if ( pType ) @@ -685,7 +685,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) RES_AUTHORITY == nTempWhich ) rSet.DisableItem( nWhich ); else if( RES_DDEFLD == nTempWhich && - !((SwDDEFieldType*)pField->GetTyp())->GetBaseLink().IsVisible()) + !static_cast<SwDDEFieldType*>(pField->GetTyp())->GetBaseLink().IsVisible()) { // nested links cannot be edited rSet.DisableItem( nWhich ); diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index 601883ed072b..5f635ecb178a 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -125,7 +125,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) bool bGlobal = false; if(pItem) { - pCurTOX = (const SwTOXBase* )((SwPtrItem*)pItem)->GetValue(); + pCurTOX = (const SwTOXBase* )static_cast<const SwPtrItem*>(pItem)->GetValue(); bGlobal = true; } else diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index ea9e96f730d0..3d7bf34209e7 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -451,7 +451,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) svt::EmbeddedObjectRef& xObj = rSh.GetOLEObject(); if(pItem && xObj.is()) { - Size aSize(((SvxSizeItem*)pItem)->GetSize()); + Size aSize(static_cast<const SvxSizeItem*>(pItem)->GetSize()); aSize = OutputDevice::LogicToLogic ( aSize, MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ) ); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 51d9a9d030aa..2e679e8aed9c 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -526,7 +526,7 @@ void SwTextShell::Execute(SfxRequest &rReq) OUString aTemplateName; if ( pItem ) { - nKind = ((SfxInt16Item*)pItem)->GetValue(); + nKind = static_cast<const SfxInt16Item*>(pItem)->GetValue(); SFX_REQUEST_ARG( rReq, pTemplate, SfxStringItem, FN_PARAM_1 , false ); SFX_REQUEST_ARG( rReq, pNumber, SfxUInt16Item, FN_PARAM_2 , false ); SFX_REQUEST_ARG( rReq, pIsNumberFilled, SfxBoolItem, FN_PARAM_3, false ); @@ -590,7 +590,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { if ( pItem ) { - OUString sName = ((SfxStringItem*)pItem)->GetValue(); + OUString sName = static_cast<const SfxStringItem*>(pItem)->GetValue(); rWrtSh.SetBookmark( vcl::KeyCode(), sName, OUString() ); } else @@ -610,7 +610,7 @@ void SwTextShell::Execute(SfxRequest &rReq) if ( pItem ) { IDocumentMarkAccess* const pMarkAccess = rWrtSh.getIDocumentMarkAccess(); - pMarkAccess->deleteMark( pMarkAccess->findMark(((SfxStringItem*)pItem)->GetValue()) ); + pMarkAccess->deleteMark( pMarkAccess->findMark(static_cast<const SfxStringItem*>(pItem)->GetValue()) ); } break; } @@ -730,9 +730,9 @@ void SwTextShell::Execute(SfxRequest &rReq) if(pFld && pFld->GetTypeId() == TYP_GETREFFLD) { rWrtSh.StartAllAction(); - rWrtSh.SwCrsrShell::GotoRefMark( ((SwGetRefField*)pFld)->GetSetRefName(), - ((SwGetRefField*)pFld)->GetSubType(), - ((SwGetRefField*)pFld)->GetSeqNo() ); + rWrtSh.SwCrsrShell::GotoRefMark( static_cast<SwGetRefField*>(pFld)->GetSetRefName(), + static_cast<SwGetRefField*>(pFld)->GetSubType(), + static_cast<SwGetRefField*>(pFld)->GetSeqNo() ); rWrtSh.EndAllAction(); rReq.Done(); } @@ -953,7 +953,7 @@ void SwTextShell::Execute(SfxRequest &rReq) // Left border as offset //#i24363# tab stops relative to indent const long nOff = rWrtSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT) ? - ((SvxLRSpaceItem&)aCoreSet.Get( RES_LR_SPACE )).GetTxtLeft() : 0; + static_cast<const SvxLRSpaceItem&>(aCoreSet.Get( RES_LR_SPACE )).GetTxtLeft() : 0; SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aCoreSet.Put( aOff ); @@ -1006,7 +1006,7 @@ void SwTextShell::Execute(SfxRequest &rReq) pSet = (SfxItemSet*)pDlg->GetOutputItemSet(); sal_uInt16 nNewDist; if( SfxItemState::SET == pSet->GetItemState( SID_ATTR_TABSTOP_DEFAULTS, false, &pItem ) && - nDefDist != (nNewDist = ((SfxUInt16Item*)pItem)->GetValue()) ) + nDefDist != (nNewDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue()) ) { SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); MakeDefTabs( nNewDist, aDefTabs ); @@ -1048,8 +1048,8 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.StartAction(); if ( SfxItemState::SET == pSet->GetItemState(FN_DROP_TEXT, false, &pItem) ) { - if ( !((SfxStringItem*)pItem)->GetValue().isEmpty() ) - rWrtSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue(), pPaM); + if ( !static_cast<const SfxStringItem*>(pItem)->GetValue().isEmpty() ) + rWrtSh.ReplaceDropTxt(static_cast<const SfxStringItem*>(pItem)->GetValue(), pPaM); } rWrtSh.SetAttrSet( *pSet, 0, pPaM ); rWrtSh.EndAction(); @@ -1067,7 +1067,7 @@ void SwTextShell::Execute(SfxRequest &rReq) //otherwise the SetNodeNumStart() value determines the start //if it's set to something different than USHRT_MAX - bool bStart = ((SfxBoolItem&)pSet->Get(FN_NUMBER_NEWSTART)).GetValue(); + bool bStart = static_cast<const SfxBoolItem&>(pSet->Get(FN_NUMBER_NEWSTART)).GetValue(); // Default value for restart value has to be USHRT_MAX // in order to indicate that the restart value of the list @@ -1075,14 +1075,14 @@ void SwTextShell::Execute(SfxRequest &rReq) sal_uInt16 nNumStart = USHRT_MAX; if( SfxItemState::SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) ) { - nNumStart = ((SfxUInt16Item&)pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue(); + nNumStart = static_cast<const SfxUInt16Item&>(pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue(); } rWrtSh.SetNumRuleStart(bStart, pPaM); rWrtSh.SetNodeNumStart(nNumStart); } else if( SfxItemState::SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) ) { - rWrtSh.SetNodeNumStart(((SfxUInt16Item&)pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue()); + rWrtSh.SetNodeNumStart(static_cast<const SfxUInt16Item&>(pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue()); rWrtSh.SetNumRuleStart(false, pPaM); } // #i56253# diff --git a/sw/source/uibase/shells/textsh2.cxx b/sw/source/uibase/shells/textsh2.cxx index d1fcb65f0c36..8e1f349e6320 100644 --- a/sw/source/uibase/shells/textsh2.cxx +++ b/sw/source/uibase/shells/textsh2.cxx @@ -102,7 +102,7 @@ void SwTextShell::ExecDB(SfxRequest &rReq) Sequence<Any> aSelection; if(pSelectionItem) - ((SfxUsrAnyItem*)pSelectionItem)->GetValue() >>= aSelection; + static_cast<const SfxUsrAnyItem*>(pSelectionItem)->GetValue() >>= aSelection; // get the data source name pArgs->GetItemState(FN_DB_DATA_SOURCE_ANY, false, &pSourceItem); @@ -196,7 +196,7 @@ void SwTextShell::ExecDB(SfxRequest &rReq) OUString sColumnName; if(pColumnNameItem) - ((SfxUsrAnyItem*)pColumnNameItem)->GetValue() >>= sColumnName; + static_cast<const SfxUsrAnyItem*>(pColumnNameItem)->GetValue() >>= sColumnName; OUString sDBName = sSourceArg; sDBName += OUString(DB_DELIM); sDBName += sCommandArg; @@ -208,9 +208,9 @@ void SwTextShell::ExecDB(SfxRequest &rReq) SwFldMgr aFldMgr(GetShellPtr()); SwInsertFld_Data aData(TYP_DBFLD, 0, sDBName, OUString(), 0); if(pConnectionItem) - aData.aDBConnection = ((SfxUsrAnyItem*)pConnectionItem)->GetValue(); + aData.aDBConnection = static_cast<const SfxUsrAnyItem*>(pConnectionItem)->GetValue(); if(pColumnItem) - aData.aDBColumn = ((SfxUsrAnyItem*)pColumnItem)->GetValue(); + aData.aDBColumn = static_cast<const SfxUsrAnyItem*>(pColumnItem)->GetValue(); aFldMgr.InsertFld(aData); SfxViewFrame* pViewFrame = GetView().GetViewFrame(); uno::Reference< XDispatchRecorder > xRecorder = diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 9c9adcb30258..bd8baeb442af 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -471,8 +471,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) rSh.StartUndo( UNDO_START ); if ( SfxItemState::SET == aSet.GetItemState(HINT_END,false,&pItem) ) { - if ( !((SfxStringItem*)pItem)->GetValue().isEmpty() ) - rSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue()); + if ( !static_cast<const SfxStringItem*>(pItem)->GetValue().isEmpty() ) + rSh.ReplaceDropTxt(static_cast<const SfxStringItem*>(pItem)->GetValue()); } rSh.SetAttrSet(*pDlg->GetOutputItemSet()); rSh.StartUndo( UNDO_END ); |