diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-30 09:37:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-10 15:22:17 +0200 |
commit | 526917bbd06e290bb6669e2e52730a5941570b34 (patch) | |
tree | e663048111c00fb0738550d3cdbeff5e573b91e2 /sd | |
parent | 36057c3a11deb3a7c3748d7aafd5e6dd08b58984 (diff) |
loplugin: cstylecast
Change-Id: I9d3f642239bc5c7a52611b9c27fd0291940c7483
Diffstat (limited to 'sd')
33 files changed, 245 insertions, 245 deletions
diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx index 83b41756f04f..b4c77a5cbd3c 100644 --- a/sd/source/ui/view/GraphicObjectBar.cxx +++ b/sd/source/ui/view/GraphicObjectBar.cxx @@ -108,7 +108,7 @@ void GraphicObjectBar::GetFilterState( SfxItemSet& rSet ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && ( ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) ) + if( pObj && pObj->ISA( SdrGrafObj ) && ( static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) ) bEnable = true; } @@ -124,9 +124,9 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest& rReq ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { - GraphicObject aFilterObj( ( (SdrGrafObj*) pObj )->GetGraphicObject() ); + GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); if( SVX_GRAPHICFILTER_ERRCODE_NONE == SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) ) @@ -135,7 +135,7 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest& rReq ) if( pPageView ) { - SdrGrafObj* pFilteredObj = (SdrGrafObj*) pObj->Clone(); + SdrGrafObj* pFilteredObj = static_cast<SdrGrafObj*>( pObj->Clone() ); OUString aStr = mpView->GetDescriptionOfMarkedObjects(); aStr += " " + SD_RESSTR(STR_UNDO_GRAFFILTER); mpView->BegUndo( aStr ); diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index f40af072005f..044e6422ce52 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -166,7 +166,7 @@ Outliner::Outliner( SdDrawDocument* pDoc, sal_uInt16 nMode ) mbWholeDocumentProcessed(false), mbPrepareSpellingPending(true) { - SetStyleSheetPool((SfxStyleSheetPool*) mpDrawDocument->GetStyleSheetPool()); + SetStyleSheetPool(static_cast<SfxStyleSheetPool*>( mpDrawDocument->GetStyleSheetPool() )); SetEditTextObjectPool( &pDoc->GetItemPool() ); SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); SetForbiddenCharsTable( pDoc->GetForbiddenCharsTable() ); @@ -369,7 +369,7 @@ bool Outliner::SpellNextDocument() else { if (mpView->ISA(OutlineView)) - ((OutlineView*)mpView)->PrepareClose(false); + static_cast<OutlineView*>(mpView)->PrepareClose(false); mpDrawDocument->GetDocSh()->SetWaitCursor( true ); Initialize (true); @@ -502,7 +502,7 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) if (pChildWin) { SvxSearchDialog* pSearchDlg = - ((SvxSearchDialog*)(pChildWin->GetWindow())); + static_cast<SvxSearchDialog*>(pChildWin->GetWindow()); pSearchDlg->SetDocWin( pViewShell->GetActiveWindow() ); pSearchDlg->SetSrchFlag(); } @@ -1319,7 +1319,7 @@ void Outliner::EnterEditMode (bool bGrabFocus) IMPL_LINK_INLINE_START( Outliner, SpellError, void *, nLang ) { mbError = true; - OUString aError( SvtLanguageTable::GetLanguageString( (LanguageType)(sal_uLong)nLang ) ); + OUString aError( SvtLanguageTable::GetLanguageString( (LanguageType)reinterpret_cast<sal_uLong>(nLang) ) ); ErrorHandler::HandleError(* new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aError) ); return 0; diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx index 2f6554ccbfd4..a699cfdc3635 100644 --- a/sd/source/ui/view/ViewClipboard.cxx +++ b/sd/source/ui/view/ViewClipboard.cxx @@ -201,7 +201,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( // Otherwise all pages of the document of the transferable are // inserted. SfxObjectShell* pShell = rTransferable.GetDocShell(); - pDataDocSh = (DrawDocShell*) pShell; + pDataDocSh = static_cast<DrawDocShell*>(pShell); SdDrawDocument* pDataDoc = pDataDocSh->GetDoc(); if (pDataDoc!=NULL && pDataDoc->GetSdPageCount(PK_STANDARD)) diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 6e01b5244a40..b7e5f322d03d 100644 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -217,7 +217,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( if (pArgs && pArgs->Count() == 1) { - bSetModified = ((SfxBoolItem&) pArgs->Get(SID_MODIFYPAGE)).GetValue(); + bSetModified = static_cast<const SfxBoolItem&>(pArgs->Get(SID_MODIFYPAGE)).GetValue(); } pUndoManager->AddUndoAction( new UndoAutoLayoutPosAndSize( *pUndoPage ) ); diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 65bdd9ee7423..a2a8153474e4 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -152,7 +152,7 @@ private: ViewShellBase& mrBase; mutable ::osl::Mutex maMutex; - class ShellHash{public: size_t operator()(const SfxShell* p) const { return (size_t)p;} }; + class ShellHash { public: size_t operator()(const SfxShell* p) const { return reinterpret_cast<size_t>(p);} }; typedef ::boost::unordered_multimap<const SfxShell*,SharedShellFactory,ShellHash> FactoryList; FactoryList maShellFactories; diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index eb94dc6b1372..a73048c00d57 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -196,7 +196,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, sal_Int16 nDepth = pOutliner->GetDepth( nParaPos ); OUString aName = rPage.GetLayoutName() + " " + OUString::number((nDepth <= 0) ? 1 : nDepth + 1); - SfxStyleSheet* pSheet = (SfxStyleSheet*)pStShPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE); + SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pStShPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE)); //We have no stylesheet if we access outline level 10 //in the master preview, there is no true style backing //that entry @@ -304,8 +304,8 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, { OUString aName = rPage.GetLayoutName() + " " + OUString::number(nLevel); - SfxStyleSheet* pSheet = (SfxStyleSheet*)pStShPool-> - Find(aName, SD_STYLE_FAMILY_MASTERPAGE); + SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pStShPool-> + Find(aName, SD_STYLE_FAMILY_MASTERPAGE)); DBG_ASSERT(pSheet, "StyleSheet not found"); SfxItemSet aTempSet( pSheet->GetItemSet() ); @@ -375,7 +375,7 @@ void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { if ( mpDrawViewShell && dynamic_cast<const SdrHint*>(&rHint) ) { - SdrHintKind eHintKind = ( (SdrHint&) rHint).GetKind(); + SdrHintKind eHintKind = static_cast<const SdrHint&>(rHint).GetKind(); if ( mnPOCHSmph == 0 && eHintKind == HINT_PAGEORDERCHG ) { @@ -389,7 +389,7 @@ void DrawView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) // switch to that page when it's not a master page if(HINT_SWITCHTOPAGE == eHintKind) { - const SdrPage* pPage = ((const SdrHint&)rHint).GetPage(); + const SdrPage* pPage = static_cast<const SdrHint&>(rHint).GetPage(); if(pPage && !pPage->IsMasterPage()) { diff --git a/sd/source/ui/view/drbezob.cxx b/sd/source/ui/view/drbezob.cxx index fb0d194f9aad..22a073e1eace 100644 --- a/sd/source/ui/view/drbezob.cxx +++ b/sd/source/ui/view/drbezob.cxx @@ -262,7 +262,7 @@ void BezierObjectBar::Execute(SfxRequest& rReq) case SID_BEZIER_CLOSE: { - SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj(); + SdrPathObj* pPathObj = static_cast<SdrPathObj*>( rMarkList.GetMark(0)->GetMarkedSdrObj() ); const bool bUndo = mpView->IsUndoEnabled(); if( bUndo ) mpView->BegUndo(SD_RESSTR(STR_UNDO_BEZCLOSE)); diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 37c82a1e7ace..1327ea7e6ce5 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -135,7 +135,7 @@ void TextObjectBar::GetCharState( SfxItemSet& rSet ) aNewAttr.Put(aCharAttrSet, false); rSet.Put(aNewAttr, false); - SvxKerningItem aKern = ( (const SvxKerningItem&) aCharAttrSet.Get( EE_CHAR_KERNING ) ); + SvxKerningItem aKern = static_cast<const SvxKerningItem&>( aCharAttrSet.Get( EE_CHAR_KERNING ) ); //aKern.SetWhich(SID_ATTR_CHAR_KERNING); rSet.Put(aKern); @@ -375,7 +375,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) bLeftToRight = false; } else - bLeftToRight = ( (const SvxWritingModeItem&) aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB; + bLeftToRight = static_cast<const SvxWritingModeItem&>( aAttrSet.Get( SDRATTR_TEXTDIRECTION ) ).GetValue() == com::sun::star::text::WritingMode_LR_TB; rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_LEFT_TO_RIGHT, bLeftToRight ) ); rSet.Put( SfxBoolItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM, !bLeftToRight ) ); @@ -463,7 +463,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) for( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( nPara ); - const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) rItems.Get( EE_PARA_ULSPACE ); + const SvxULSpaceItem& rItem = static_cast<const SvxULSpaceItem&>( rItems.Get( EE_PARA_ULSPACE ) ); nUpper = std::max( nUpper, (long)rItem.GetUpper() ); } if( nUpper == 0L ) @@ -477,9 +477,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } // paragraph justification - SvxLRSpaceItem aLR = ( (const SvxLRSpaceItem&) aAttrSet.Get( EE_PARA_LRSPACE ) ); + SvxLRSpaceItem aLR = static_cast<const SvxLRSpaceItem&>( aAttrSet.Get( EE_PARA_LRSPACE ) ); rSet.Put(aLR); - SvxAdjust eAdj = ( (const SvxAdjustItem&) aAttrSet.Get( EE_PARA_JUST ) ).GetAdjust(); + SvxAdjust eAdj = static_cast<const SvxAdjustItem&>( aAttrSet.Get( EE_PARA_JUST ) ).GetAdjust(); switch( eAdj ) { case SVX_ADJUST_LEFT: @@ -513,7 +513,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } else { - switch( ( ( (SvxFrameDirectionItem&) aAttrSet.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() ) + switch( static_cast<const SvxFrameDirectionItem&>( aAttrSet.Get( EE_PARA_WRITINGDIR ) ).GetValue() ) { case FRMDIR_VERT_TOP_LEFT: case FRMDIR_VERT_TOP_RIGHT: @@ -553,7 +553,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } } - SvxLRSpaceItem aLRSpace = ( (const SvxLRSpaceItem&) aAttrSet.Get( EE_PARA_LRSPACE ) ); + SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>( aAttrSet.Get( EE_PARA_LRSPACE ) ); aLRSpace.SetWhich(SID_ATTR_PARA_LRSPACE); rSet.Put(aLRSpace); Invalidate(SID_ATTR_PARA_LRSPACE); @@ -564,7 +564,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) rSet.InvalidateItem(EE_PARA_LRSPACE); rSet.InvalidateItem(SID_ATTR_PARA_LRSPACE); } - sal_uInt16 nLineSpace = (sal_uInt16) ( (const SvxLineSpacingItem&) aAttrSet. + sal_uInt16 nLineSpace = (sal_uInt16) static_cast<const SvxLineSpacingItem&>( aAttrSet. Get( EE_PARA_SBL ) ).GetPropLineSpace(); switch( nLineSpace ) { @@ -581,7 +581,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } // justification (superscript, subscript) is also needed in outline-mode - SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>( aAttrSet.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT ) diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 1a01e03e4292..2cf2594be488 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -153,8 +153,8 @@ void TextObjectBar::Execute( SfxRequest &rReq ) SfxItemSet aAttr( pStyleSheet->GetItemSet() ); SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( nPara ) ); aAttr.Put( aTmpSet, false ); // sal_False= InvalidItems is not default, handle it as "holes" - const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aAttr.Get( EE_PARA_ULSPACE ); - boost::scoped_ptr<SvxULSpaceItem> pNewItem((SvxULSpaceItem*) rItem.Clone()); + const SvxULSpaceItem& rItem = static_cast<const SvxULSpaceItem&>( aAttr.Get( EE_PARA_ULSPACE ) ); + boost::scoped_ptr<SvxULSpaceItem> pNewItem(static_cast<SvxULSpaceItem*>(rItem.Clone())); long nUpper = pNewItem->GetUpper(); if( nSlot == SID_PARASPACE_INCREASE ) @@ -194,8 +194,8 @@ void TextObjectBar::Execute( SfxRequest &rReq ) if( aEditAttr.GetItemState( EE_PARA_ULSPACE ) >= SfxItemState::DEFAULT ) { SfxItemSet aNewAttrs(*(aEditAttr.GetPool()), aEditAttr.GetRanges()); - const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aEditAttr.Get( EE_PARA_ULSPACE ); - boost::scoped_ptr<SvxULSpaceItem> pNewItem((SvxULSpaceItem*) rItem.Clone()); + const SvxULSpaceItem& rItem = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) ); + boost::scoped_ptr<SvxULSpaceItem> pNewItem(static_cast<SvxULSpaceItem*>( rItem.Clone() )); long nUpper = pNewItem->GetUpper(); if( nSlot == SID_PARASPACE_INCREASE ) @@ -264,8 +264,8 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_ATTR_PARA_LRSPACE: { sal_uInt16 nSpaceSlot = SID_ATTR_PARA_LRSPACE; - SvxLRSpaceItem aLRSpace = (const SvxLRSpaceItem&)pArgs->Get( - GetPool().GetWhich(nSpaceSlot)); + SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get( + GetPool().GetWhich(nSpaceSlot))); SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE ); aLRSpace.SetWhich( EE_PARA_LRSPACE ); @@ -327,7 +327,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) SdrPageView* pPageView = mpView->GetSdrPageView(); if (pPageView) { - SdPage* pPage = (SdPage*)pPageView->GetPage(); + SdPage* pPage = static_cast<SdPage*>(pPageView->GetPage()); bMasterPage = pPage && (pPage->GetPageKind() == PK_STANDARD) && pPage->IsMasterPage(); } @@ -391,7 +391,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_GROW_FONT_SIZE: case SID_SHRINK_FONT_SIZE: { - const SvxFontListItem* pFonts = (const SvxFontListItem*)mpViewShell->GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ); + const SvxFontListItem* pFonts = static_cast<const SvxFontListItem*>(mpViewShell->GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST )); const FontList* pFontList = pFonts ? pFonts->GetFontList(): 0; if( pFontList ) { @@ -440,7 +440,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) { case SID_ATTR_CHAR_WEIGHT: { - FontWeight eFW = ( (const SvxWeightItem&) aEditAttr. + FontWeight eFW = static_cast<const SvxWeightItem&>( aEditAttr. Get( EE_CHAR_WEIGHT ) ).GetWeight(); aNewAttr.Put( SvxWeightItem( eFW == WEIGHT_NORMAL ? WEIGHT_BOLD : WEIGHT_NORMAL, @@ -449,7 +449,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) break; case SID_ATTR_CHAR_POSTURE: { - FontItalic eFI = ( (const SvxPostureItem&) aEditAttr. + FontItalic eFI = static_cast<const SvxPostureItem&>( aEditAttr. Get( EE_CHAR_ITALIC ) ).GetPosture(); aNewAttr.Put( SvxPostureItem( eFI == ITALIC_NORMAL ? ITALIC_NONE : ITALIC_NORMAL, @@ -458,7 +458,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) break; case SID_ATTR_CHAR_UNDERLINE: { - FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr. + FontUnderline eFU = static_cast<const SvxUnderlineItem&>( aEditAttr. Get( EE_CHAR_UNDERLINE ) ).GetLineStyle(); aNewAttr.Put( SvxUnderlineItem( eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, @@ -467,7 +467,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) break; case SID_ATTR_CHAR_OVERLINE: { - FontUnderline eFO = ( (const SvxOverlineItem&) aEditAttr. + FontUnderline eFO = static_cast<const SvxOverlineItem&>( aEditAttr. Get( EE_CHAR_OVERLINE ) ).GetLineStyle(); aNewAttr.Put( SvxOverlineItem( eFO == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, @@ -476,25 +476,25 @@ void TextObjectBar::Execute( SfxRequest &rReq ) break; case SID_ATTR_CHAR_CONTOUR: { - aNewAttr.Put( SvxContourItem( !( (const SvxContourItem&) aEditAttr. + aNewAttr.Put( SvxContourItem( !static_cast<const SvxContourItem&>( aEditAttr. Get( EE_CHAR_OUTLINE ) ).GetValue(), EE_CHAR_OUTLINE ) ); } break; case SID_ATTR_CHAR_SHADOWED: { - aNewAttr.Put( SvxShadowedItem( !( (const SvxShadowedItem&) aEditAttr. + aNewAttr.Put( SvxShadowedItem( !static_cast<const SvxShadowedItem&>( aEditAttr. Get( EE_CHAR_SHADOW ) ).GetValue(), EE_CHAR_SHADOW ) ); } break; case SID_ATTR_CHAR_CASEMAP: { - aNewAttr.Put( SvxCaseMapItem( ( (const SvxCaseMapItem&) aEditAttr. + aNewAttr.Put( SvxCaseMapItem( static_cast<const SvxCaseMapItem&>( aEditAttr. Get( EE_CHAR_CASEMAP ) ) ) ); } break; case SID_ATTR_CHAR_STRIKEOUT: { - FontStrikeout eFSO = ( ( (const SvxCrossedOutItem&) aEditAttr. + FontStrikeout eFSO = ( static_cast<const SvxCrossedOutItem&>( aEditAttr. Get( EE_CHAR_STRIKEOUT ) ).GetStrikeout() ); aNewAttr.Put( SvxCrossedOutItem( eFSO == STRIKEOUT_SINGLE ? STRIKEOUT_NONE : STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT ) ); @@ -545,7 +545,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_SET_SUPER_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>( aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT ) @@ -558,7 +558,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_SET_SUB_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>( aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT ) @@ -593,7 +593,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) sal_uInt16 nAdjust = SVX_ADJUST_LEFT; if( SfxItemState::SET == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) ) - nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue(); + nAdjust = static_cast<const SvxAdjustItem*>(pPoolItem)->GetEnumValue(); if( bLeftToRight ) { @@ -670,7 +670,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else if(nSlot == SID_SET_SUPER_SCRIPT ) { SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT); - SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>( aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT ) @@ -684,7 +684,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) else if( nSlot == SID_SET_SUB_SCRIPT ) { SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT); - SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>( aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT ) diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index a2c2622f000b..14149761ebf7 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -181,7 +181,7 @@ void DrawViewShell::SelectionHasChanged (void) if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2) { - pOleObj = (SdrOle2Obj*) pObj; + pOleObj = static_cast<SdrOle2Obj*>(pObj); UpdateIMapDlg( pObj ); } else if (nSdrObjKind == OBJ_GRAF) @@ -717,7 +717,7 @@ ErrCode DrawViewShell::DoVerb(long nVerb) if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2) { - ActivateObject( (SdrOle2Obj*) pObj, nVerb); + ActivateObject( static_cast<SdrOle2Obj*>(pObj), nVerb); } } } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 7cd3c733afe5..c85eb2cf3a29 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -202,7 +202,7 @@ public: SdrPageView* pPageView = m_pView->GetSdrPageView(); if( pPageView ) { - SdrGrafObj* pNewObj = (SdrGrafObj*) m_pObj->Clone(); + SdrGrafObj* pNewObj = static_cast<SdrGrafObj*>( m_pObj->Clone() ); OUString aStr = m_pView->GetDescriptionOfMarkedObjects(); aStr += " External Edit"; m_pView->BegUndo( aStr ); @@ -249,7 +249,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) mpDrawView->BegUndo(); pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - bool bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE; + bool bSet = static_cast<const SdrTextFitToSizeTypeItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE; mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj)); @@ -607,12 +607,12 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( pArgs ) { - SvxZoomType eZT = ( ( const SvxZoomItem& ) pArgs-> + SvxZoomType eZT = static_cast<const SvxZoomItem&>( pArgs-> Get( SID_ATTR_ZOOM ) ).GetType(); switch( eZT ) { case SVX_ZOOM_PERCENT: - SetZoom( (long) ( ( const SvxZoomItem& ) pArgs-> + SetZoom( (long) static_cast<const SvxZoomItem&>( pArgs-> Get( SID_ATTR_ZOOM ) ).GetValue() ); break; @@ -850,7 +850,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // at the following mpDrawView->SetAttributes( *pSet, sal_True ) // they get lost and have to be restored. std::vector<std::pair<SfxItemSet*,SdrObjUserCall*> > aAttrList; - SdPage* pPresPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage(); + SdPage* pPresPage = static_cast<SdPage*>( mpDrawView->GetSdrPageView()->GetPage() ); for ( size_t i = 0; i < nCount; ++i ) { @@ -979,9 +979,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { - GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() ); + GraphicObject aGraphicObject( static_cast<SdrGrafObj*>( pObj )->GetGraphicObject() ); { GraphicHelper::ExportGraphic( aGraphicObject.GetGraphic(), "" ); } @@ -998,9 +998,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { - GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() ); + GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); SdExternalToolEdit* aExternalToolEdit = new SdExternalToolEdit( mpDrawView, pObj ); aExternalToolEdit->Edit( &aGraphicObject ); } @@ -1017,9 +1017,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) + if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { - SdrGrafObj* pGraphicObj = (SdrGrafObj*) pObj; + SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); CompressGraphicsDialog dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() ); if ( dialog.Execute() == RET_OK ) { @@ -1450,7 +1450,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) while( bLoop && pDlg->Execute() == RET_OK ) { pDlg->GetAttr( aNewAttr ); - aLayerName = ((SdAttrLayerName &) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue (); + aLayerName = static_cast<const SdAttrLayerName &>( aNewAttr.Get (ATTR_LAYER_NAME)).GetValue (); if( rLayerAdmin.GetLayer( aLayerName, false ) || aLayerName.isEmpty() ) @@ -1474,11 +1474,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } else { - aLayerTitle = ((SdAttrLayerTitle &) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue (); - aLayerDesc = ((SdAttrLayerDesc &) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue (); - bIsVisible = ((SdAttrLayerVisible &) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue (); - bIsLocked = ((SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue () ; - bIsPrintable = ((SdAttrLayerPrintable &) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue () ; + aLayerTitle = static_cast<const SdAttrLayerTitle &>( aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue (); + aLayerDesc = static_cast<const SdAttrLayerDesc &>( aNewAttr.Get (ATTR_LAYER_DESC)).GetValue (); + bIsVisible = static_cast<const SdAttrLayerVisible &>( aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue (); + bIsLocked = static_cast<const SdAttrLayerLocked &>( aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue () ; + bIsPrintable = static_cast<const SdAttrLayerPrintable &>( aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue () ; } } } @@ -1619,7 +1619,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) while( bLoop && ( (nRet = pDlg->Execute()) == RET_OK ) ) { pDlg->GetAttr( aNewAttr ); - aLayerName = ((SdAttrLayerName &) aNewAttr.Get (ATTR_LAYER_NAME)).GetValue (); + aLayerName = static_cast<const SdAttrLayerName &>( aNewAttr.Get (ATTR_LAYER_NAME)).GetValue (); if( (rLayerAdmin.GetLayer( aLayerName, false ) && aLayerName != aOldLayerName) || aLayerName.isEmpty() ) @@ -1637,11 +1637,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) switch (nRet) { case RET_OK : - aLayerTitle = ((SdAttrLayerTitle &) aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue (); - aLayerDesc = ((SdAttrLayerDesc &) aNewAttr.Get (ATTR_LAYER_DESC)).GetValue (); - bIsVisible = ((const SdAttrLayerVisible &) aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue (); - bIsLocked = ((const SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue (); - bIsPrintable = ((const SdAttrLayerLocked &) aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue (); + aLayerTitle = static_cast<const SdAttrLayerTitle &>( aNewAttr.Get (ATTR_LAYER_TITLE)).GetValue (); + aLayerDesc = static_cast<const SdAttrLayerDesc &>( aNewAttr.Get (ATTR_LAYER_DESC)).GetValue (); + bIsVisible = static_cast<const SdAttrLayerVisible &>( aNewAttr.Get (ATTR_LAYER_VISIBLE)).GetValue (); + bIsLocked = static_cast<const SdAttrLayerLocked &>( aNewAttr.Get (ATTR_LAYER_LOCKED)).GetValue (); + bIsPrintable = static_cast<const SdAttrLayerLocked &>( aNewAttr.Get (ATTR_LAYER_PRINTABLE)).GetValue (); break; default : @@ -1782,8 +1782,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if (pReqArgs) { - SvxHyperlinkItem* pHLItem = - (SvxHyperlinkItem*) &pReqArgs->Get(SID_HYPERLINK_SETLINK); + const SvxHyperlinkItem* pHLItem = + static_cast<const SvxHyperlinkItem*>( &pReqArgs->Get(SID_HYPERLINK_SETLINK) ); if (pHLItem->GetInsertMode() == HLINK_FIELD) { @@ -2568,7 +2568,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { SfxStyleSheet* pStyleSheet = mpDrawView->GetStyleSheet(); if( pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) - pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet(); + pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); if( (pStyleSheet == NULL) && GetView()->IsTextEdit() ) { @@ -2576,7 +2576,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) pStyleSheet = mpDrawView->GetStyleSheet(); if(pStyleSheet && pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) - pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet(); + pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); } if( pStyleSheet == NULL ) @@ -2651,8 +2651,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( rReq.GetArgs() ) { GetViewFrame()->SetChildWindow(SvxFontWorkChildWindow::GetChildWindowId(), - ((const SfxBoolItem&) (rReq.GetArgs()-> - Get(SID_FONTWORK))).GetValue()); + static_cast<const SfxBoolItem&>(rReq.GetArgs()-> + Get(SID_FONTWORK)).GetValue()); } else { @@ -2669,8 +2669,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { if ( rReq.GetArgs() ) GetViewFrame()->SetChildWindow(SvxColorChildWindow::GetChildWindowId(), - ((const SfxBoolItem&) (rReq.GetArgs()-> - Get(SID_COLOR_CONTROL))).GetValue()); + static_cast<const SfxBoolItem&>(rReq.GetArgs()-> + Get(SID_COLOR_CONTROL)).GetValue()); else GetViewFrame()->ToggleChildWindow(SvxColorChildWindow::GetChildWindowId() ); @@ -2731,8 +2731,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { if ( rReq.GetArgs() ) GetViewFrame()->SetChildWindow(SID_NAVIGATOR, - ((const SfxBoolItem&) (rReq.GetArgs()-> - Get(SID_NAVIGATOR))).GetValue()); + static_cast<const SfxBoolItem&>(rReq.GetArgs()-> + Get(SID_NAVIGATOR)).GetValue()); else GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR ); @@ -2771,8 +2771,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if ( rReq.GetArgs() ) GetViewFrame()->SetChildWindow( AnimationChildWindow::GetChildWindowId(), - ((const SfxBoolItem&) (rReq.GetArgs()-> - Get(SID_ANIMATION_OBJECTS))).GetValue()); + static_cast<const SfxBoolItem&>(rReq.GetArgs()-> + Get(SID_ANIMATION_OBJECTS)).GetValue()); else GetViewFrame()->ToggleChildWindow( AnimationChildWindow::GetChildWindowId() ); @@ -2787,8 +2787,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { if ( rReq.GetArgs() ) GetViewFrame()->SetChildWindow( Svx3DChildWindow::GetChildWindowId(), - ((const SfxBoolItem&) (rReq.GetArgs()-> - Get( SID_3D_WIN ))).GetValue()); + static_cast<const SfxBoolItem&>(rReq.GetArgs()-> + Get( SID_3D_WIN )).GetValue()); else GetViewFrame()->ToggleChildWindow( Svx3DChildWindow::GetChildWindowId() ); @@ -3021,7 +3021,7 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) } else { - FontUnderline eFU = ( (const SvxUnderlineItem&) aEditAttr.Get( EE_CHAR_UNDERLINE ) ).GetLineStyle(); + FontUnderline eFU = static_cast<const SvxUnderlineItem&>( aEditAttr.Get( EE_CHAR_UNDERLINE ) ).GetLineStyle(); aNewAttr.Put( SvxUnderlineItem( eFU != UNDERLINE_NONE ?UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE ) ); }//aNewAttr.Put( (const SvxUnderlineItem&)aEditAttr.Get( EE_CHAR_UNDERLINE ) ); } @@ -3069,7 +3069,7 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) case SID_SET_SUB_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>( aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT ) aItem.SetEscapement( SVX_ESCAPEMENT_OFF ); @@ -3081,7 +3081,7 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) case SID_SET_SUPER_SCRIPT: { SvxEscapementItem aItem( EE_CHAR_ESCAPEMENT ); - SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement ) static_cast<const SvxEscapementItem&>( aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT ) aItem.SetEscapement( SVX_ESCAPEMENT_OFF ); @@ -3189,7 +3189,7 @@ void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet) SfxItemState eConState = aAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME ); if( eConState != SfxItemState::DONTCARE ) { - bContour = ( ( const SdrOnOffItem& )aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue(); + bContour = static_cast<const SdrOnOffItem&>( aAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue(); } if (bContour) break; @@ -3199,7 +3199,7 @@ void DrawViewShell::GetStatePropPanelAttr(SfxItemSet& rSet) //if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState) if(SfxItemState::DONTCARE != eVState) { - SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); + SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(aAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); bool bSet = (nSlotId == SID_TABLE_VERT_NONE && eTVA == SDRTEXTVERTADJUST_TOP) || (nSlotId == SID_TABLE_VERT_CENTER && eTVA == SDRTEXTVERTADJUST_CENTER) || (nSlotId == SID_TABLE_VERT_BOTTOM && eTVA == SDRTEXTVERTADJUST_BOTTOM); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 0c257dbdbe46..acc191b730ac 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -336,7 +336,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) if ( pIPClient && pIPClient->IsObjectInPlaceActive() ) { const SfxRectangleItem& rRect = - (SfxRectangleItem&)rReq.GetArgs()->Get(SID_OBJECTRESIZE); + static_cast<const SfxRectangleItem&>(rReq.GetArgs()->Get(SID_OBJECTRESIZE)); Rectangle aRect( GetActiveWindow()->PixelToLogic( rRect.GetValue() ) ); if ( mpDrawView->AreObjectsMarked() ) @@ -383,7 +383,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) SfxChildWindow* pWindow = pFrame->GetChildWindow(nId); if(pWindow) { - Svx3DWin* p3DWin = (Svx3DWin*)(pWindow->GetWindow()); + Svx3DWin* p3DWin = static_cast<Svx3DWin*>(pWindow->GetWindow()); if(p3DWin) p3DWin->DocumentReload(); } @@ -506,8 +506,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) { case SID_ATTR_LONG_LRSPACE: { - const SvxLongLRSpaceItem& rLRSpace = (const SvxLongLRSpaceItem&) - pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE)); + const SvxLongLRSpaceItem& rLRSpace = static_cast<const SvxLongLRSpaceItem&>( + pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE))); if( mpDrawView->IsTextEdit() ) { @@ -563,8 +563,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) } case SID_ATTR_LONG_ULSPACE: { - const SvxLongULSpaceItem& rULSpace = (const SvxLongULSpaceItem&) - pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE)); + const SvxLongULSpaceItem& rULSpace = static_cast<const SvxLongULSpaceItem&>( + pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE))); if( mpDrawView->IsTextEdit() ) { @@ -625,8 +625,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) Rectangle aRect = maMarkRect; aRect.SetPos(aRect.TopLeft() + aPagePos); - const SvxObjectItem& rOI = (const SvxObjectItem&) - pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT)); + const SvxObjectItem& rOI = static_cast<const SvxObjectItem&>( + pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT))); if ( rOI.GetStartX() != rOI.GetEndX() ) { @@ -652,8 +652,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) { if( mpDrawView->IsTextEdit() ) { - const SvxTabStopItem& rItem = (const SvxTabStopItem&) - pArgs->Get( EE_PARA_TABS ); + const SvxTabStopItem& rItem = static_cast<const SvxTabStopItem&>( + pArgs->Get( EE_PARA_TABS )); SfxItemSet aEditAttr( GetPool(), EE_PARA_TABS, EE_PARA_TABS ); @@ -668,8 +668,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) case SID_ATTR_PARA_LINESPACE: { sal_uInt16 nSlot = SID_ATTR_PARA_LINESPACE; - SvxLineSpacingItem aParaLineSP = (const SvxLineSpacingItem&)pArgs->Get( - GetPool().GetWhich(nSlot)); + SvxLineSpacingItem aParaLineSP = static_cast<const SvxLineSpacingItem&>(pArgs->Get( + GetPool().GetWhich(nSlot))); SfxItemSet aEditAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL ); aParaLineSP.SetWhich( EE_PARA_SBL ); @@ -727,8 +727,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) case SID_ATTR_PARA_ULSPACE: { sal_uInt16 nSlot = SID_ATTR_PARA_ULSPACE; - SvxULSpaceItem aULSP = (const SvxULSpaceItem&)pArgs->Get( - GetPool().GetWhich(nSlot)); + SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>(pArgs->Get( + GetPool().GetWhich(nSlot))); SfxItemSet aEditAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE ); aULSP.SetWhich( EE_PARA_ULSPACE ); @@ -742,8 +742,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) case SID_ATTR_PARA_LRSPACE: { sal_uInt16 nSlot = SID_ATTR_PARA_LRSPACE; - SvxLRSpaceItem aLRSpace = (const SvxLRSpaceItem&)pArgs->Get( - GetPool().GetWhich(nSlot)); + SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get( + GetPool().GetWhich(nSlot))); SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE ); aLRSpace.SetWhich( EE_PARA_LRSPACE ); @@ -759,8 +759,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) if( mpDrawView->IsTextEdit() ) { sal_uInt16 nId = SID_ATTR_PARA_LRSPACE; - const SvxLRSpaceItem& rItem = (const SvxLRSpaceItem&) - pArgs->Get( nId ); + const SvxLRSpaceItem& rItem = static_cast<const SvxLRSpaceItem&>( + pArgs->Get( nId )); static const sal_uInt16 aWhichTable[]= { @@ -779,9 +779,9 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) rItem.GetRight(), rItem.GetTxtLeft(), rItem.GetTxtFirstLineOfst(), nId ); - const sal_Int16 nOutlineLevel = ((const SfxInt16Item&)aEditAttr.Get( EE_PARA_OUTLLEVEL )).GetValue(); - const SvxLRSpaceItem& rOrigLRSpaceItem = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE ); - const SvxNumBulletItem& rNumBulletItem = (const SvxNumBulletItem&) aEditAttr.Get( EE_PARA_NUMBULLET ); + const sal_Int16 nOutlineLevel = static_cast<const SfxInt16Item&>(aEditAttr.Get( EE_PARA_OUTLLEVEL )).GetValue(); + const SvxLRSpaceItem& rOrigLRSpaceItem = static_cast<const SvxLRSpaceItem&>( aEditAttr.Get( EE_PARA_LRSPACE )); + const SvxNumBulletItem& rNumBulletItem = static_cast<const SvxNumBulletItem&>( aEditAttr.Get( EE_PARA_NUMBULLET ) ); if( nOutlineLevel != -1 && rNumBulletItem.GetNumRule() && rNumBulletItem.GetNumRule()->GetLevelCount() > nOutlineLevel ) @@ -908,17 +908,17 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) mpDrawView->GetAttributes( aEditAttr ); if( aEditAttr.GetItemState( EE_PARA_TABS ) >= SfxItemState::DEFAULT ) { - const SvxTabStopItem& rItem = (const SvxTabStopItem&) aEditAttr.Get( EE_PARA_TABS ); + const SvxTabStopItem& rItem = static_cast<const SvxTabStopItem&>( aEditAttr.Get( EE_PARA_TABS ) ); rSet.Put( rItem ); - const SvxLRSpaceItem& rLRSpaceItem = (const SvxLRSpaceItem&) aEditAttr.Get( EE_PARA_LRSPACE ); + const SvxLRSpaceItem& rLRSpaceItem = static_cast<const SvxLRSpaceItem&>( aEditAttr.Get( EE_PARA_LRSPACE ) ); sal_uInt16 nId = SID_ATTR_PARA_LRSPACE; SvxLRSpaceItem aLRSpaceItem( rLRSpaceItem.GetLeft(), rLRSpaceItem.GetRight(), rLRSpaceItem.GetTxtLeft(), rLRSpaceItem.GetTxtFirstLineOfst(), nId ); - const sal_Int16 nOutlineLevel = ((const SfxInt16Item&)aEditAttr.Get( EE_PARA_OUTLLEVEL )).GetValue(); - const SvxNumBulletItem& rNumBulletItem = (const SvxNumBulletItem&) aEditAttr.Get( EE_PARA_NUMBULLET ); + const sal_Int16 nOutlineLevel = static_cast<const SfxInt16Item&>( aEditAttr.Get( EE_PARA_OUTLLEVEL )).GetValue(); + const SvxNumBulletItem& rNumBulletItem = static_cast<const SvxNumBulletItem&>( aEditAttr.Get( EE_PARA_NUMBULLET ) ); if( nOutlineLevel != -1 && rNumBulletItem.GetNumRule() && rNumBulletItem.GetNumRule()->GetLevelCount() > nOutlineLevel ) @@ -936,8 +936,8 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET ) { - const SdrMetricItem& rTLDItem = (const SdrMetricItem&) - aEditAttr.Get( SDRATTR_TEXT_LEFTDIST ); + const SdrMetricItem& rTLDItem = static_cast<const SdrMetricItem&>( + aEditAttr.Get( SDRATTR_TEXT_LEFTDIST )); long nLD = rTLDItem.GetValue(); aPos.X() += nLD; } @@ -948,8 +948,8 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if ( aEditAttr.GetItemState( SDRATTR_TEXT_LEFTDIST ) == SfxItemState::SET ) { - const SdrMetricItem& rTLDItem = (const SdrMetricItem&) - aEditAttr.Get( SDRATTR_TEXT_LEFTDIST ); + const SdrMetricItem& rTLDItem = static_cast<const SdrMetricItem&>( + aEditAttr.Get( SDRATTR_TEXT_LEFTDIST )); long nLD = rTLDItem.GetValue(); aLRSpace.SetLeft( aLRSpace.GetLeft() + nLD ); } @@ -967,7 +967,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SfxItemState::DEFAULT ) { - const SvxFrameDirectionItem& rItem = (const SvxFrameDirectionItem&) aEditAttr.Get( EE_PARA_WRITINGDIR ); + const SvxFrameDirectionItem& rItem = static_cast<const SvxFrameDirectionItem&>( aEditAttr.Get( EE_PARA_WRITINGDIR ) ); rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == ::com::sun::star::text::WritingMode_RL_TB)); } } diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 8b7d1a06a59f..4552403c82e6 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -162,7 +162,7 @@ bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin) (OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd) && bDidVisitOldObject) { - pCandidate = (SdrTextObj*)pObj; + pCandidate = static_cast<SdrTextObj*>(pObj); } if(pObj == pOldObj) @@ -248,7 +248,7 @@ void DrawViewShell::FreshNavigatrEntry() SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); if( pWindow ) { - SdNavigatorWin* pNavWin = (SdNavigatorWin*)( pWindow->GetContextWindow( SD_MOD() ) ); + SdNavigatorWin* pNavWin = static_cast<SdNavigatorWin*>( pWindow->GetContextWindow( SD_MOD() ) ); if( pNavWin ) pNavWin->FreshEntry(); } @@ -260,7 +260,7 @@ void DrawViewShell::FreshNavigatrTree() SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); if( pWindow ) { - SdNavigatorWin* pNavWin = (SdNavigatorWin*)( pWindow->GetContextWindow( SD_MOD() ) ); + SdNavigatorWin* pNavWin = static_cast<SdNavigatorWin*>( pWindow->GetContextWindow( SD_MOD() ) ); if( pNavWin ) pNavWin->FreshTree( GetDoc() ); } @@ -289,7 +289,7 @@ void DrawViewShell::MouseButtonDown(const MouseEvent& rMEvt, //else the corresponding entry is set false . FreshNavigatrTree(); if ( mbPipette ) - ( (SvxBmpMask*) GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->PipetteClicked(); + static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )->PipetteClicked(); } } @@ -392,7 +392,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin) } } - ( (SvxBmpMask*) GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> + static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> SetColor( Color( (sal_uInt8) ( nRed / fDiv + .5 ), (sal_uInt8) ( nGreen / fDiv + .5 ), (sal_uInt8) ( nBlue / fDiv + .5 ) ) ); @@ -420,7 +420,7 @@ void DrawViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) else if (rMEvt.IsLeft() && bIsSetPageOrg) { mpDrawView->BrkAction(); - SdPage* pPage = (SdPage*) mpDrawView->GetSdrPageView()->GetPage(); + SdPage* pPage = static_cast<SdPage*>( mpDrawView->GetSdrPageView()->GetPage() ); Point aOrg(pPage->GetLftBorder(), pPage->GetUppBorder()); mpDrawView->GetSdrPageView()->SetPageOrigin(aOrg); GetViewFrame()->GetBindings().Invalidate(SID_RULER_NULL_OFFSET); diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index bad2da97c85c..ec85b5df4cfc 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -80,7 +80,7 @@ void DrawViewShell::ModelHasChanged() ::Outliner* pOutliner = mpDrawView->GetTextEditOutliner(); if (pOutliner) { - SfxStyleSheetPool* pSPool = (SfxStyleSheetPool*) GetDocSh()->GetStyleSheetPool(); + SfxStyleSheetPool* pSPool = static_cast<SfxStyleSheetPool*>( GetDocSh()->GetStyleSheetPool() ); pOutliner->SetStyleSheetPool(pSPool); } } diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index ad8233ac5cc2..bf3e3d888506 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -93,7 +93,7 @@ void DrawViewShell::GetFormTextState(SfxItemSet& rSet) sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); if ( GetViewFrame()->HasChildWindow(nId) ) - pDlg = (SvxFontWorkDialog*)(GetViewFrame()->GetChildWindow(nId)->GetWindow()); + pDlg = static_cast<SvxFontWorkDialog*>(GetViewFrame()->GetChildWindow(nId)->GetWindow()); if ( rMarkList.GetMarkCount() == 1 ) pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); @@ -201,8 +201,8 @@ void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet ) { sal_uInt16 nCount = 0; - if( ( (SdrGrafObj*) pObj )->IsAnimated() ) - nCount = ( (SdrGrafObj*) pObj )->GetGraphic().GetAnimation().Count(); + if( static_cast<const SdrGrafObj*>(pObj)->IsAnimated() ) + nCount = static_cast<const SdrGrafObj*>(pObj)->GetGraphic().GetAnimation().Count(); if( nCount > 0 ) nValue = 2; else @@ -272,8 +272,8 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq ) { case ( SID_BMPMASK_PIPETTE ) : { - mbPipette = ( (const SfxBoolItem&) ( rReq.GetArgs()-> - Get( SID_BMPMASK_PIPETTE ) ) ).GetValue(); + mbPipette = static_cast<const SfxBoolItem&>( rReq.GetArgs()-> + Get( SID_BMPMASK_PIPETTE ) ).GetValue(); } break; @@ -304,7 +304,7 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq ) if( bCont ) { const Graphic& rOldGraphic = pNewObj->GetGraphic(); - const Graphic aNewGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow( + const Graphic aNewGraphic( static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> Mask( rOldGraphic ) ); @@ -313,7 +313,7 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq ) SdrPageView* pPV = mpDrawView->GetSdrPageView(); pNewObj->SetEmptyPresObj( false ); - pNewObj->SetGraphic( ( (SvxBmpMask*) GetViewFrame()->GetChildWindow( + pNewObj->SetGraphic( static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( SvxBmpMaskChildWindow::GetChildWindowId() )->GetWindow() )-> Mask( pNewObj->GetGraphic() ) ); @@ -343,7 +343,7 @@ void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet ) if ( GetViewFrame()->HasChildWindow( nId ) ) { - SvxBmpMask* pDlg = (SvxBmpMask*) ( GetViewFrame()->GetChildWindow( nId )->GetWindow() ); + SvxBmpMask* pDlg = static_cast<SvxBmpMask*>( GetViewFrame()->GetChildWindow( nId )->GetWindow() ); if ( pDlg->NeedsColorList() ) pDlg->SetColorList( GetDoc()->GetColorList() ); @@ -354,7 +354,7 @@ void DrawViewShell::GetBmpMaskState( SfxItemSet& rSet ) // valid graphic object? if( pObj && pObj->ISA( SdrGrafObj ) && - !((SdrGrafObj*) pObj)->IsEPS() && + !static_cast<const SdrGrafObj*>(pObj)->IsEPS() && !mpDrawView->IsTextEdit() ) { bEnable = true; diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 6a575865492d..4bb781fff1e6 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -229,7 +229,7 @@ void DrawViewShell::GetDrawAttrState(SfxItemSet& rSet) if (!pPageView) return NULL; - SdPage* pPage = (SdPage*)pPageView->GetPage(); + SdPage* pPage = static_cast<SdPage*>(pPageView->GetPage()); //only show these in a normal master page if (!pPage || (pPage->GetPageKind() != PK_STANDARD) || !pPage->IsMasterPage()) return NULL; @@ -859,7 +859,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) // a page does have a AutoLayout "Title" bDisable = false; - SdPage& rRefMPage = (SdPage&)(pPage->TRG_GetMasterPage()); + SdPage& rRefMPage = static_cast<SdPage&>(pPage->TRG_GetMasterPage()); if(&rRefMPage == pMPage) { @@ -1785,8 +1785,8 @@ void DrawViewShell::Execute (SfxRequest& rReq) SfxViewFrame* pViewFrame = GetViewFrame(); if (rReq.GetArgs() != NULL) pViewFrame->SetChildWindow (SID_SPELL_DIALOG, - ((const SfxBoolItem&) (rReq.GetArgs()-> - Get(SID_SPELL_DIALOG))).GetValue()); + static_cast<const SfxBoolItem&>(rReq.GetArgs()-> + Get(SID_SPELL_DIALOG)).GetValue()); else pViewFrame->ToggleChildWindow(SID_SPELL_DIALOG); diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 4319cdaa2912..0e67b9626ba0 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -142,7 +142,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq) if (pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF) { - pGrafObj = (SdrGrafObj*) pObj; + pGrafObj = static_cast<SdrGrafObj*>(pObj); if( pGrafObj->IsEmptyPresObj() ) { @@ -746,7 +746,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) { case SID_GETFILLSTYLE : { - const XFillStyleItem &rFillStyleItem = (const XFillStyleItem &) aAttr.Get (XATTR_FILLSTYLE); + const XFillStyleItem &rFillStyleItem = static_cast<const XFillStyleItem &>(aAttr.Get (XATTR_FILLSTYLE)); rSet.Put (SfxUInt32Item (nWhich, (long) rFillStyleItem.GetValue ())); break; @@ -754,7 +754,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case SID_GETLINESTYLE : { - const XLineStyleItem &rLineStyleItem = (const XLineStyleItem &) aAttr.Get (XATTR_LINESTYLE); + const XLineStyleItem &rLineStyleItem = static_cast<const XLineStyleItem &>( aAttr.Get (XATTR_LINESTYLE) ); rSet.Put (SfxUInt32Item (nWhich, (long) rLineStyleItem.GetValue ())); break; @@ -762,7 +762,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case SID_GETLINEWIDTH : { - const XLineWidthItem &rLineWidthItem = (const XLineWidthItem &) aAttr.Get (XATTR_LINEWIDTH); + const XLineWidthItem &rLineWidthItem = static_cast<const XLineWidthItem &>( aAttr.Get (XATTR_LINEWIDTH) ); rSet.Put (SfxUInt32Item (nWhich, (long) rLineWidthItem.GetValue ())); break; @@ -772,14 +772,14 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case SID_GETRED : case SID_GETBLUE : { - const SfxUInt32Item &rWhatKind = (const SfxUInt32Item &) rSet.Get (ID_VAL_WHATKIND); + const SfxUInt32Item &rWhatKind = static_cast<const SfxUInt32Item &>( rSet.Get (ID_VAL_WHATKIND) ); Color aColor; switch (rWhatKind.GetValue ()) { case 1 : { - const XLineColorItem &rLineColorItem = (const XLineColorItem &) aAttr.Get (XATTR_LINECOLOR); + const XLineColorItem &rLineColorItem = static_cast<const XLineColorItem &>( aAttr.Get (XATTR_LINECOLOR) ); aColor = rLineColorItem.GetColorValue (); break; @@ -787,7 +787,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case 2 : { - const XFillColorItem &rFillColorItem = (const XFillColorItem &) aAttr.Get (XATTR_FILLCOLOR); + const XFillColorItem &rFillColorItem = static_cast<const XFillColorItem &>( aAttr.Get (XATTR_FILLCOLOR) ); aColor = rFillColorItem.GetColorValue (); break; @@ -796,7 +796,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case 3 : case 4 : { - const XFillGradientItem &rFillGradientItem = (const XFillGradientItem &) aAttr.Get (XATTR_FILLGRADIENT); + const XFillGradientItem &rFillGradientItem = static_cast<const XFillGradientItem &>( aAttr.Get (XATTR_FILLGRADIENT) ); const XGradient &rGradient = rFillGradientItem.GetGradientValue (); aColor = (rWhatKind.GetValue () == 3) @@ -807,7 +807,7 @@ void DrawViewShell::AttrState (SfxItemSet& rSet) case 5: { - const XFillHatchItem &rFillHatchItem = (const XFillHatchItem &) aAttr.Get (XATTR_FILLHATCH); + const XFillHatchItem &rFillHatchItem = static_cast<const XFillHatchItem &>( aAttr.Get (XATTR_FILLHATCH) ); const XHatch &rHatch = rFillHatchItem.GetHatchValue (); aColor = rHatch.GetColor (); diff --git a/sd/source/ui/view/drviewsd.cxx b/sd/source/ui/view/drviewsd.cxx index 21357a1c96dd..922f148ae50c 100644 --- a/sd/source/ui/view/drviewsd.cxx +++ b/sd/source/ui/view/drviewsd.cxx @@ -60,7 +60,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq ) SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); if( pWindow ) { - SdNavigatorWin* pNavWin = (SdNavigatorWin*)( pWindow->GetContextWindow( SD_MOD() ) ); + SdNavigatorWin* pNavWin = static_cast<SdNavigatorWin*>( pWindow->GetContextWindow( SD_MOD() ) ); if( pNavWin ) pNavWin->InitTreeLB( GetDoc() ); } @@ -82,7 +82,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq ) mpDrawView->SdrEndTextEdit(); const SfxItemSet* pArgs = rReq.GetArgs(); - PageJump eJump = (PageJump)((SfxAllEnumItem&) pArgs-> + PageJump eJump = (PageJump)static_cast<const SfxAllEnumItem&>( pArgs-> Get(SID_NAVIGATOR_PAGE)).GetValue(); switch (eJump) @@ -133,7 +133,7 @@ void DrawViewShell::ExecNavigatorWin( SfxRequest& rReq ) { OUString aBookmarkStr("#"); const SfxItemSet* pArgs = rReq.GetArgs(); - OUString aTarget = ((SfxStringItem&) pArgs-> + OUString aTarget = static_cast<const SfxStringItem&>( pArgs-> Get(SID_NAVIGATOR_OBJECT)).GetValue(); aBookmarkStr += aTarget; SfxStringItem aStrItem(SID_FILE_NAME, aBookmarkStr); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index d0901b11c304..2ba46fd45a44 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -114,7 +114,7 @@ void ImpAddPrintableCharactersToTextEdit(SfxRequest& rReq, ::sd::View* pView) OUString aInputString; if(SfxItemState::SET == pSet->GetItemState(SID_ATTR_CHAR)) - aInputString = ((SfxStringItem&)pSet->Get(SID_ATTR_CHAR)).GetValue(); + aInputString = static_cast<const SfxStringItem&>(pSet->Get(SID_ATTR_CHAR)).GetValue(); if(!aInputString.isEmpty()) { @@ -685,7 +685,7 @@ void DrawViewShell::FuDeleteSelectedObjects() void DrawViewShell::FuSupport(SfxRequest& rReq) { if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) - GetDocSh()->SetStyleFamily(((SfxUInt16Item&)rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); + GetDocSh()->SetStyleFamily(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); // We do not execute a thing during a native slide show if(SlideShow::IsRunning(GetViewShellBase()) && @@ -775,7 +775,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); if ( rMarkList.GetMark(0) && !mpDrawView->IsAction() ) { - SdrPathObj* pPathObj = (SdrPathObj*) rMarkList.GetMark(0)->GetMarkedSdrObj(); + SdrPathObj* pPathObj = static_cast<SdrPathObj*>( rMarkList.GetMark(0)->GetMarkedSdrObj()); const bool bUndo = mpDrawView->IsUndoEnabled(); if( bUndo ) mpDrawView->BegUndo(SD_RESSTR(STR_UNDO_BEZCLOSE)); @@ -1423,13 +1423,13 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) if (pObj->GetObjInventor() == SdrInventor) { - if (pObj->GetObjIdentifier() == OBJ_GRAF && !((SdrGrafObj*) pObj)->IsLinkedGraphic()) + if (pObj->GetObjIdentifier() == OBJ_GRAF && !static_cast<SdrGrafObj*>(pObj)->IsLinkedGraphic()) { - const Graphic& rGraphic = ((SdrGrafObj*) pObj)->GetGraphic(); + const Graphic& rGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic(); if( rGraphic.GetType() == GRAPHIC_BITMAP ) { - SdrGrafObj* pNewObj = (SdrGrafObj*) pObj->Clone(); + SdrGrafObj* pNewObj = static_cast<SdrGrafObj*>( pObj->Clone() ); if( rGraphic.IsAnimated() ) { diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index ec7543378aad..6b46f061f4c6 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -99,9 +99,9 @@ void DrawViewShell::GetCtrlState(SfxItemSet &rSet) const SvxFieldData* pField = pFieldItem->GetField(); if (pField->ISA(SvxURLField)) { - aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation()); - aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL()); - aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame()); + aHLinkItem.SetName(static_cast<const SvxURLField*>(pField)->GetRepresentation()); + aHLinkItem.SetURL(static_cast<const SvxURLField*>(pField)->GetURL()); + aHLinkItem.SetTargetFrame(static_cast<const SvxURLField*>(pField)->GetTargetFrame()); bField = true; } } @@ -289,7 +289,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) SfxItemSet aAttrs( GetDoc()->GetPool() ); mpDrawView->GetAttributes( aAttrs ); - SvxAdjustItem aItem= ( (const SvxAdjustItem&) aAttrs.Get( EE_PARA_JUST ) ); + SvxAdjustItem aItem= static_cast<const SvxAdjustItem&>( aAttrs.Get( EE_PARA_JUST ) ); SvxAdjust eAdj = aItem.GetAdjust(); if ( eAdj == SVX_ADJUST_LEFT) { @@ -306,7 +306,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) SfxItemSet aAttrs( GetDoc()->GetPool() ); mpDrawView->GetAttributes( aAttrs ); - SvxAdjustItem aItem= ( (const SvxAdjustItem&) aAttrs.Get( EE_PARA_JUST ) ); + SvxAdjustItem aItem= static_cast<const SvxAdjustItem&>( aAttrs.Get( EE_PARA_JUST ) ); SvxAdjust eAdj = aItem.GetAdjust(); if ( eAdj == SVX_ADJUST_CENTER) { @@ -323,7 +323,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) SfxItemSet aAttrs( GetDoc()->GetPool() ); mpDrawView->GetAttributes( aAttrs ); - SvxAdjustItem aItem= ( (const SvxAdjustItem&) aAttrs.Get( EE_PARA_JUST ) ); + SvxAdjustItem aItem= static_cast<const SvxAdjustItem&>( aAttrs.Get( EE_PARA_JUST ) ); SvxAdjust eAdj = aItem.GetAdjust(); if ( eAdj == SVX_ADJUST_RIGHT) { @@ -340,7 +340,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) SfxItemSet aAttrs( GetDoc()->GetPool() ); mpDrawView->GetAttributes( aAttrs ); - SvxAdjustItem aItem= ( (const SvxAdjustItem&) aAttrs.Get( EE_PARA_JUST ) ); + SvxAdjustItem aItem= static_cast<const SvxAdjustItem&>( aAttrs.Get( EE_PARA_JUST ) ); SvxAdjust eAdj = aItem.GetAdjust(); if ( eAdj == SVX_ADJUST_BLOCK) { @@ -356,7 +356,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) { SfxItemSet aAttrs( GetDoc()->GetPool() ); mpDrawView->GetAttributes( aAttrs ); - SvxLRSpaceItem aLRSpace = ( (const SvxLRSpaceItem&) aAttrs.Get( EE_PARA_LRSPACE ) ); + SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>( aAttrs.Get( EE_PARA_LRSPACE ) ); aLRSpace.SetWhich(SID_ATTR_PARA_LRSPACE); rSet.Put(aLRSpace); bAttr = true; @@ -367,7 +367,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) { SfxItemSet aAttrs( GetDoc()->GetPool() ); mpDrawView->GetAttributes( aAttrs ); - SvxLineSpacingItem aLineLR = ( (const SvxLineSpacingItem&) aAttrs.Get( EE_PARA_SBL ) ); + SvxLineSpacingItem aLineLR = static_cast<const SvxLineSpacingItem&>( aAttrs.Get( EE_PARA_SBL ) ); rSet.Put(aLineLR); bAttr = true; Invalidate(SID_ATTR_PARA_LINESPACE); @@ -377,7 +377,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) { SfxItemSet aAttrs( GetDoc()->GetPool() ); mpDrawView->GetAttributes( aAttrs ); - SvxULSpaceItem aULSP = ( (const SvxULSpaceItem&) aAttrs.Get( EE_PARA_ULSPACE ) ); + SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>( aAttrs.Get( EE_PARA_ULSPACE ) ); aULSP.SetWhich(SID_ATTR_PARA_ULSPACE); rSet.Put(aULSP); bAttr = true; @@ -422,7 +422,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) mpDrawView->GetAttributes( aAttrs ); if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT ) { - bool bValue = ( (const SfxBoolItem&) aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue(); + bool bValue = static_cast<const SfxBoolItem&>( aAttrs.Get( EE_PARA_HYPHENATE ) ).GetValue(); rSet.Put( SfxBoolItem( SID_HYPHENATION, bValue ) ); } } @@ -444,7 +444,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) else { if (pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) - pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet(); + pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); if( pStyleSheet ) { @@ -583,7 +583,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) pTmpItem=GetNumBulletItem(aNewAttr, nNumItemId); if (pTmpItem) - pNumRule.reset(new SvxNumRule(*((SvxNumBulletItem*)pTmpItem)->GetNumRule())); + pNumRule.reset(new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pTmpItem)->GetNumRule())); if ( pNumRule ) { @@ -726,7 +726,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) rSet.InvalidateItem(SID_ATTR_PARA_ULSPACE); } - SvxEscapement eEsc = (SvxEscapement) ( (const SvxEscapementItem&) + SvxEscapement eEsc = (SvxEscapement) static_cast<const SvxEscapementItem&>( pSet->Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue(); if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT ) { diff --git a/sd/source/ui/view/drviewsi.cxx b/sd/source/ui/view/drviewsi.cxx index 0394c23515d6..e969c84a3a16 100644 --- a/sd/source/ui/view/drviewsi.cxx +++ b/sd/source/ui/view/drviewsi.cxx @@ -51,7 +51,7 @@ using namespace ::com::sun::star; namespace sd { -#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue() +#define ITEMVALUE(ItemSet,Id,Cast) static_cast<const Cast&>((ItemSet).Get(Id)).GetValue() /** * Handle SfxRequests for EffekteWindow @@ -70,7 +70,7 @@ void DrawViewShell::ExecEffectWin( SfxRequest& rReq ) SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); if( pWindow ) { - Svx3DWin* p3DWin = (Svx3DWin*)( pWindow->GetWindow() ); + Svx3DWin* p3DWin = static_cast<Svx3DWin*>( pWindow->GetWindow() ); if( p3DWin ) p3DWin->InitColorLB( GetDoc() ); } @@ -98,7 +98,7 @@ void DrawViewShell::Update3DWindow() SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( nId ); if( pWindow ) { - Svx3DWin* p3DWin = (Svx3DWin*) pWindow->GetWindow(); + Svx3DWin* p3DWin = static_cast<Svx3DWin*>( pWindow->GetWindow() ); if( p3DWin && p3DWin->IsUpdateMode() ) { SfxItemSet aTmpItemSet = GetView()->Get3DAttributes(); @@ -115,7 +115,7 @@ void DrawViewShell::AssignFrom3DWindow() SfxChildWindow* pWin = GetViewFrame()->GetChildWindow( nId ); if( pWin ) { - Svx3DWin* p3DWin = (Svx3DWin*) pWin->GetWindow(); + Svx3DWin* p3DWin = static_cast<Svx3DWin*>( pWin->GetWindow() ); if( p3DWin && GetView() ) { if(!GetView()->IsPresObjSelected()) diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index d48c46243766..857601ffa853 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -205,9 +205,9 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) aAttrSet.GetItemState( SDRATTR_EDGELINE2DELTA ) >= SfxItemState::DEFAULT && aAttrSet.GetItemState( SDRATTR_EDGELINE3DELTA ) >= SfxItemState::DEFAULT ) { - long nVal1 = ( ( const SdrMetricItem& ) aAttrSet.Get( SDRATTR_EDGELINE1DELTA ) ).GetValue(); - long nVal2 = ( ( const SdrMetricItem& ) aAttrSet.Get( SDRATTR_EDGELINE2DELTA ) ).GetValue(); - long nVal3 = ( ( const SdrMetricItem& ) aAttrSet.Get( SDRATTR_EDGELINE3DELTA ) ).GetValue(); + long nVal1 = static_cast<const SdrMetricItem&>( aAttrSet.Get( SDRATTR_EDGELINE1DELTA ) ).GetValue(); + long nVal2 = static_cast<const SdrMetricItem&>( aAttrSet.Get( SDRATTR_EDGELINE2DELTA ) ).GetValue(); + long nVal3 = static_cast<const SdrMetricItem&>( aAttrSet.Get( SDRATTR_EDGELINE3DELTA ) ).GetValue(); { if( nVal1 != 0 || nVal2 != 0 || nVal3 != 0 ) bDisable = false; @@ -280,7 +280,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) if( SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) ) { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const bool bSet = ((const SdrTextFitToSizeTypeItem*)pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE; + const bool bSet = static_cast<const SdrTextFitToSizeTypeItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SDRTEXTFIT_NONE; rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet)); } diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 0c8f960749c1..bbe02cfaa362 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -92,12 +92,12 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) if ( pArgs ) { - SvxZoomType eZT = ( ( const SvxZoomItem& ) pArgs-> + SvxZoomType eZT = static_cast<const SvxZoomItem&>( pArgs-> Get( SID_ATTR_ZOOM ) ).GetType(); switch( eZT ) { case SVX_ZOOM_PERCENT: - SetZoom( (long) ( ( const SvxZoomItem& ) pArgs-> + SetZoom( (long) static_cast<const SvxZoomItem&>( pArgs-> Get( SID_ATTR_ZOOM ) ).GetValue() ); Invalidate( SID_ATTR_ZOOM ); Invalidate( SID_ATTR_ZOOMSLIDER ); @@ -375,8 +375,8 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq) if (pReqArgs) { - SvxHyperlinkItem* pHLItem = - (SvxHyperlinkItem*) &pReqArgs->Get(SID_HYPERLINK_SETLINK); + const SvxHyperlinkItem* pHLItem = + static_cast<const SvxHyperlinkItem*>( &pReqArgs->Get(SID_HYPERLINK_SETLINK) ); SvxFieldItem aURLItem(SvxURLField(pHLItem->GetURL(), pHLItem->GetName(), diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 46dc77e9d85b..6b9c3f7c9329 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -388,9 +388,9 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet) const SvxFieldData* pField = pFieldItem->GetField(); if ( pField->ISA(SvxURLField) ) { - aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation()); - aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL()); - aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame()); + aHLinkItem.SetName(static_cast<const SvxURLField*>(pField)->GetRepresentation()); + aHLinkItem.SetURL(static_cast<const SvxURLField*>(pField)->GetURL()); + aHLinkItem.SetTargetFrame(static_cast<const SvxURLField*>(pField)->GetTargetFrame()); } } } @@ -435,7 +435,7 @@ void OutlineViewShell::GetCtrlState(SfxItemSet &rSet) void OutlineViewShell::FuSupport(SfxRequest &rReq) { if( rReq.GetSlot() == SID_STYLE_FAMILY && rReq.GetArgs()) - GetDocSh()->SetStyleFamily(((SfxUInt16Item&)rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); + GetDocSh()->SetStyleFamily(static_cast<const SfxUInt16Item&>(rReq.GetArgs()->Get( SID_STYLE_FAMILY )).GetValue()); bool bPreviewState = false; sal_uLong nSlot = rReq.GetSlot(); @@ -857,7 +857,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) // if not, the templates must not be edited SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT); GetStatusBarState(aSet); - OUString aTest = ((SfxStringItem&)aSet.Get(SID_STATUS_LAYOUT)).GetValue(); + OUString aTest = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue(); if (aTest.isEmpty()) { bUnique = false; @@ -1218,8 +1218,8 @@ void OutlineViewShell::Execute(SfxRequest& rReq) SfxViewFrame* pViewFrame = GetViewFrame(); if (rReq.GetArgs() != NULL) pViewFrame->SetChildWindow (SID_SPELL_DIALOG, - ((const SfxBoolItem&) (rReq.GetArgs()-> - Get(SID_SPELL_DIALOG))).GetValue()); + static_cast<const SfxBoolItem&>(rReq.GetArgs()-> + Get(SID_SPELL_DIALOG)).GetValue()); else pViewFrame->ToggleChildWindow(SID_SPELL_DIALOG); @@ -1237,7 +1237,7 @@ void OutlineViewShell::Execute(SfxRequest& rReq) } if (bForwardCall) - ((DrawDocShell*)GetViewFrame()->GetObjectShell())->ExecuteSlot( rReq ); + static_cast<DrawDocShell*>(GetViewFrame()->GetObjectShell())->ExecuteSlot( rReq ); } /** @@ -1530,7 +1530,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) if( pStyleSheet ) { - pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet(); + pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); if (pStyleSheet) { @@ -1557,7 +1557,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) { SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT); GetStatusBarState(aSet); - OUString aRealStyle = ((SfxStringItem&) aSet.Get(SID_STATUS_LAYOUT)).GetValue(); + OUString aRealStyle = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue(); if (aRealStyle.isEmpty()) { // no unique layout name found @@ -1742,7 +1742,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara ) bool bNewObject = false; sal_uInt16 eOutlinerMode = OUTLINERMODE_TITLEOBJECT; - pTO = (SdrTextObj*)pPage->GetPresObj( PRESOBJ_TEXT ); + pTO = static_cast<SdrTextObj*>(pPage->GetPresObj( PRESOBJ_TEXT )); if( !pTO ) { eOutlinerMode = OUTLINERMODE_OUTLINEOBJECT; @@ -1878,7 +1878,7 @@ sal_uLong OutlineViewShell::Read(SvStream& rInput, const OUString& rBaseURL, sal aStyleSheetName = aStyleSheetName.copy(0, aStyleSheetName.getLength() - 1); aStyleSheetName += OUString::number( nDepth ); SfxStyleSheetBasePool* pStylePool = GetDoc()->GetStyleSheetPool(); - SfxStyleSheet* pStyle = (SfxStyleSheet*) pStylePool->Find( aStyleSheetName, pOutlSheet->GetFamily() ); + SfxStyleSheet* pStyle = static_cast<SfxStyleSheet*>( pStylePool->Find( aStyleSheetName, pOutlSheet->GetFamily() ) ); DBG_ASSERT( pStyle, "AutoStyleSheetName - Style not found!" ); if ( pStyle ) rOutl.SetStyleSheet( nPara, pStyle ); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index ddf05e2f8626..c901efb10601 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -768,7 +768,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) aNewStyleSheetName = aNewStyleSheetName.copy(0, aNewStyleSheetName.getLength() - 1); aNewStyleSheetName += OUString::number( nDepth+1 ); SfxStyleSheetBasePool* pStylePool = mrDoc.GetStyleSheetPool(); - pStyleSheet = (SfxStyleSheet*) pStylePool->Find( aNewStyleSheetName, pStyleSheet->GetFamily() ); + pStyleSheet = static_cast<SfxStyleSheet*>( pStylePool->Find( aNewStyleSheetName, pStyleSheet->GetFamily() ) ); } } @@ -964,7 +964,7 @@ SdrTextObj* OutlineView::GetTitleTextObject(SdrPage* pPage) if (pObject->GetObjInventor() == SdrInventor && pObject->GetObjIdentifier() == OBJ_TITLETEXT) { - pResult = (SdrTextObj*)pObject; + pResult = static_cast<SdrTextObj*>(pObject); break; } } @@ -986,7 +986,7 @@ SdrTextObj* OutlineView::GetOutlineTextObject(SdrPage* pPage) if (pObject->GetObjInventor() == SdrInventor && pObject->GetObjIdentifier() == OBJ_OUTLINETEXT) { - pResult = (SdrTextObj*)pObject; + pResult = static_cast<SdrTextObj*>(pObject); break; } } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index d087c755cdd1..9b93c8c47cb3 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -475,7 +475,7 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const vcl::Region& rReg, sdr::c if (pPgView) { - SdPage* pPage = (SdPage*) pPgView->GetPage(); + SdPage* pPage = static_cast<SdPage*>( pPgView->GetPage() ); if( pPage ) { SdrOutliner& rOutl = mrDoc.GetDrawOutliner(NULL); @@ -570,7 +570,7 @@ bool View::IsPresObjSelected(bool bOnPage, bool bOnMasterPage, bool bCheckPresOb if ( pObj && ( bCheckPresObjListOnly || pObj->IsEmptyPresObj() || pObj->GetUserCall() ) ) { - pPage = (SdPage*) pObj->GetPage(); + pPage = static_cast<SdPage*>( pObj->GetPage() ); bMasterPage = pPage && pPage->IsMasterPage(); if ( (bMasterPage && bOnMasterPage) || (!bMasterPage && bOnPage) ) @@ -676,7 +676,7 @@ bool View::SdrBeginTextEdit( // make draw&impress specific initialisations if( pOutl ) { - pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mrDoc.GetStyleSheetPool()); + pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>( mrDoc.GetStyleSheetPool() )); pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); sal_uLong nCntrl = pOutl->GetControlWord(); nCntrl |= EE_CNTRL_ALLOWBIGOBJS; @@ -843,18 +843,18 @@ void View::SetMarkedOriginalSize() { if( pObj->GetObjIdentifier() == OBJ_OLE2 ) { - uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObj)->GetObjRef(); + uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObj)->GetObjRef(); if( xObj.is() ) { // TODO/LEAN: working with VisualArea can switch object to running state - sal_Int64 nAspect = ((SdrOle2Obj*)pObj)->GetAspect(); + sal_Int64 nAspect = static_cast<SdrOle2Obj*>(pObj)->GetAspect(); Size aOleSize; if ( nAspect == embed::Aspects::MSOLE_ICON ) { MapMode aMap100( MAP_100TH_MM ); - aOleSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize( &aMap100 ); + aOleSize = static_cast<SdrOle2Obj*>(pObj)->GetOrigObjSize( &aMap100 ); bOK = true; } else @@ -987,8 +987,8 @@ bool View::IsMorphingAllowed() const aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); - const drawing::FillStyle eFillStyle1 = ( (const XFillStyleItem&) aSet1.Get( XATTR_FILLSTYLE ) ).GetValue(); - const drawing::FillStyle eFillStyle2 = ( (const XFillStyleItem&) aSet2.Get( XATTR_FILLSTYLE ) ).GetValue(); + const drawing::FillStyle eFillStyle1 = static_cast<const XFillStyleItem&>( aSet1.Get( XATTR_FILLSTYLE ) ).GetValue(); + const drawing::FillStyle eFillStyle2 = static_cast<const XFillStyleItem&>( aSet2.Get( XATTR_FILLSTYLE ) ).GetValue(); if( ( eFillStyle1 == drawing::FillStyle_NONE || eFillStyle1 == drawing::FillStyle_SOLID ) && ( eFillStyle2 == drawing::FillStyle_NONE || eFillStyle2 == drawing::FillStyle_SOLID ) ) diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index cb986360164e..59ca186e9650 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -104,7 +104,7 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent SD_MOD()->pTransferClip = pTransferable; mrDoc.CreatingDataObj( pTransferable ); - pTransferable->SetWorkDocument( (SdDrawDocument*) GetMarkedObjModel() ); + pTransferable->SetWorkDocument( static_cast<SdDrawDocument*>(GetMarkedObjModel()) ); mrDoc.CreatingDataObj( NULL ); // #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get @@ -113,8 +113,8 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent TransferableObjectDescriptor aObjDesc; SdrOle2Obj* pSdrOleObj = NULL; SdrPageView* pPgView = GetSdrPageView(); - SdPage* pOldPage = pPgView ? ( (SdPage*) pPgView->GetPage() ) : NULL; - SdPage* pNewPage = (SdPage*) pTransferable->GetWorkDocument()->GetPage( 0 ); + SdPage* pOldPage = pPgView ? static_cast<SdPage*>( pPgView->GetPage() ) : NULL; + SdPage* pNewPage = const_cast<SdPage*>(static_cast<const SdPage*>( pTransferable->GetWorkDocument()->GetPage( 0 ) )); if( pOldPage ) { @@ -126,14 +126,14 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent { SdrObject* pObj = GetMarkedObjectByIndex(0); - if( pObj && pObj->ISA(SdrOle2Obj) && ((SdrOle2Obj*) pObj)->GetObjRef().is() ) + if( pObj && pObj->ISA(SdrOle2Obj) && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { // If object has no persistence it must be copied as part of the document try { - uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY ); + uno::Reference< embed::XEmbedPersist > xPersObj( static_cast<SdrOle2Obj*>(pObj)->GetObjRef(), uno::UNO_QUERY ); if ( xPersObj.is() && xPersObj->hasEntry() ) - pSdrOleObj = (SdrOle2Obj*) pObj; + pSdrOleObj = static_cast<SdrOle2Obj*>(pObj); } catch( uno::Exception& ) {} @@ -172,14 +172,14 @@ struct SdNavigatorDropEvent : public ExecuteDropEvent { SdrObject* pObj = GetMarkedObjectByIndex( 0 ); - if( pObj && pObj->ISA( SdrOle2Obj ) && ( (SdrOle2Obj*) pObj )->GetObjRef().is() ) + if( pObj && pObj->ISA( SdrOle2Obj ) && static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { // If object has no persistence it must be copied as part of the document try { - uno::Reference< embed::XEmbedPersist > xPersObj( ((SdrOle2Obj*)pObj)->GetObjRef(), uno::UNO_QUERY ); + uno::Reference< embed::XEmbedPersist > xPersObj( static_cast<SdrOle2Obj*>(pObj)->GetObjRef(), uno::UNO_QUERY ); if ( xPersObj.is() && xPersObj->hasEntry() ) - pSdrOleObj = (SdrOle2Obj*) pObj; + pSdrOleObj = static_cast<SdrOle2Obj*>(pObj); } catch( uno::Exception& ) {} @@ -288,7 +288,7 @@ void View::DoPaste (vcl::Window* pWindow) const_cast< OutlinerView* >(pOLV)->PasteSpecial(); SdrObject* pObj = GetTextEditObject(); - SdPage* pPage = (SdPage*)( pObj ? pObj->GetPage() : NULL ); + SdPage* pPage = static_cast<SdPage*>( pObj ? pObj->GetPage() : NULL ); ::Outliner* pOutliner = pOLV->GetOutliner(); if( pOutliner) @@ -332,7 +332,7 @@ void View::DoPaste (vcl::Window* pWindow) if( pWindow ) aPos = pWindow->PixelToLogic( Rectangle( aPos, pWindow->GetOutputSizePixel() ).Center() ); - DrawViewShell* pDrViewSh = (DrawViewShell*) mpDocSh->GetViewShell(); + DrawViewShell* pDrViewSh = static_cast<DrawViewShell*>( mpDocSh->GetViewShell() ); if (pDrViewSh != NULL) { @@ -555,7 +555,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge if( bHasPickObj && pPickObj && ( pPickObj->IsEmptyPresObj() || pPickObj->GetUserCall() ) ) { - SdPage* pPage = (SdPage*) pPickObj->GetPage(); + SdPage* pPage = static_cast<SdPage*>( pPickObj->GetPage() ); if( pPage && pPage->IsMasterPage() ) bIsPresTarget = pPage->IsPresObj( pPickObj ); @@ -693,7 +693,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar XFillExchangeData aFillData( XFillAttrSetItem( &mrDoc.GetPool() ) ); ReadXFillExchangeData( *xStm, aFillData ); - const Color aColor( ( (XFillColorItem&) aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ) ).GetColorValue() ); + const Color aColor( static_cast<const XFillColorItem&>( aFillData.GetXFillAttrSetItem()->GetItemSet().Get( XATTR_FILLCOLOR ) ).GetColorValue() ); static_cast< SdrHdlColor* >( pIAOHandle )->SetColor( aColor, true ); nRet = nDropAction; } @@ -797,7 +797,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTar else if( mpViewSh->ISA( DrawViewShell ) ) { // insert as normal URL button - ( (DrawViewShell*) mpViewSh )->InsertURLButton( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), OUString(), &aPos ); + static_cast<DrawViewShell*>( mpViewSh )->InsertURLButton( aINetBookmark.GetURL(), aINetBookmark.GetDescription(), OUString(), &aPos ); nRet = nDropAction; } } @@ -819,7 +819,7 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv { Point aPos; OUString aBookmark; - SdPage* pPage = (SdPage*) GetSdrPageView()->GetPage(); + SdPage* pPage = static_cast<SdPage*>( GetSdrPageView()->GetPage() ); sal_uInt16 nPgPos = 0xFFFF; if( pSdNavigatorDropEvent->mpTargetWindow ) diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index c620601d1d0f..2cc0b56becbf 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -287,7 +287,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, } if( nPage != SDRPAGE_NOTFOUND ) - pPage = (SdPage*) mrDoc.GetPage( nPage ); + pPage = static_cast<SdPage*>( mrDoc.GetPage( nPage ) ); SdTransferable* pOwnData = NULL; SdTransferable* pImplementation = SdTransferable::getImplementation( aDataHelper.GetTransferable() ); @@ -410,7 +410,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( !pPage && pPV->GetPage()->GetPageNum() != mnDragSrcPgNum ) { - pPage = (SdPage*) pPV->GetPage(); + pPage = static_cast<SdPage*>( pPV->GetPage() ); bDropOnTabBar = false; } @@ -499,8 +499,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(pRem->pClone->ISA(SdrEdgeObj)) { - SdrEdgeObj* pOrigEdge = (SdrEdgeObj*)pRem->pOrig; - SdrEdgeObj* pCloneEdge = (SdrEdgeObj*)pRem->pClone; + SdrEdgeObj* pOrigEdge = static_cast<SdrEdgeObj*>(pRem->pOrig); + SdrEdgeObj* pCloneEdge = static_cast<SdrEdgeObj*>(pRem->pClone); // test first connection SdrObjConnection& rConn0 = pOrigEdge->GetConnection(false); @@ -600,13 +600,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( !pSourceView->IsPresObjSelected() ) { // model is owned by from AllocModel() created DocShell - SdDrawDocument* pSourceDoc = (SdDrawDocument*) pSourceView->GetModel(); + SdDrawDocument* pSourceDoc = static_cast<SdDrawDocument*>( pSourceView->GetModel() ); pSourceDoc->CreatingDataObj( pOwnData ); - SdDrawDocument* pModel = (SdDrawDocument*) pSourceView->GetMarkedObjModel(); + SdDrawDocument* pModel = static_cast<SdDrawDocument*>( pSourceView->GetMarkedObjModel() ); bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString()); if( !pPage ) - pPage = (SdPage*) GetSdrPageView()->GetPage(); + pPage = static_cast<SdPage*>( GetSdrPageView()->GetPage() ); OUString aLayout = pPage->GetLayoutName(); sal_Int32 nPos = aLayout.indexOf(SD_LT_SEPARATOR); @@ -647,7 +647,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, bReturn = Paste(*pWorkModel, maDropPos, pPage, nPasteOptions, OUString(), OUString()); if( !pPage ) - pPage = (SdPage*) GetSdrPageView()->GetPage(); + pPage = static_cast<SdPage*>( GetSdrPageView()->GetPage() ); OUString aLayout = pPage->GetLayoutName(); sal_Int32 nPos = aLayout.indexOf(SD_LT_SEPARATOR); @@ -777,7 +777,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, aNewSet.Put( pObj->GetMergedItemSet() ); if( bUndo ) - AddUndo( new E3dAttributesUndoAction( mrDoc, (E3dObject*) pPickObj, aNewSet, aOldSet ) ); + AddUndo( new E3dAttributesUndoAction( mrDoc, static_cast<E3dObject*>(pPickObj), aNewSet, aOldSet ) ); pPickObj->SetMergedItemSetAndBroadcast( aNewSet ); } @@ -889,7 +889,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions, OUString(), OUString()); if( !pPage ) - pPage = (SdPage*) GetSdrPageView()->GetPage(); + pPage = static_cast<SdPage*>(GetSdrPageView()->GetPage()); OUString aLayout = pPage->GetLayoutName(); sal_Int32 nPos = aLayout.indexOf(SD_LT_SEPARATOR); @@ -1314,11 +1314,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, XFillAttrSetItem* pSetItem = aFillData.GetXFillAttrSetItem(); SfxItemSet rSet = pSetItem->GetItemSet(); - drawing::FillStyle eFill= ( (XFillStyleItem&) rSet.Get( XATTR_FILLSTYLE ) ).GetValue(); + drawing::FillStyle eFill = static_cast<const XFillStyleItem&>( rSet.Get( XATTR_FILLSTYLE ) ).GetValue(); if( eFill == drawing::FillStyle_SOLID || eFill == drawing::FillStyle_NONE ) { - const XFillColorItem& rColItem = (XFillColorItem&) rSet.Get( XATTR_FILLCOLOR ); + const XFillColorItem& rColItem = static_cast<const XFillColorItem&>( rSet.Get( XATTR_FILLCOLOR ) ); Color aColor( rColItem.GetColorValue() ); OUString aName( rColItem.GetName() ); SfxItemSet aSet( mrDoc.GetPool() ); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index f139a3695e39..6a30a19f2275 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -109,12 +109,12 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, if( IsUndoEnabled() ) BegUndo(OUString(SdResId(STR_INSERTGRAPHIC))); - SdPage* pPage = (SdPage*) pPickObj->GetPage(); + SdPage* pPage = static_cast<SdPage*>( pPickObj->GetPage() ); if( bIsGraphic ) { // We fill the object with the Bitmap - pNewGrafObj = (SdrGrafObj*) pPickObj->Clone(); + pNewGrafObj = static_cast<SdrGrafObj*>( pPickObj->Clone() ); pNewGrafObj->SetGraphic(rGraphic); } else diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 46bf5e8ddb7b..622774bbf672 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -330,7 +330,7 @@ long Window::SetZoomFactor(long nZoom) // Update the view's snapping to the new zoom factor. if ( mpViewShell && mpViewShell->ISA(DrawViewShell) ) - ((DrawViewShell*) mpViewShell)->GetView()-> + static_cast<DrawViewShell*>(mpViewShell)->GetView()-> RecalcLogicSnapMagnetic(*this); // Return the zoom factor just in case it has been changed above to lie diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx index 4c112ed5d7bf..abe3d73e0bae 100644 --- a/sd/source/ui/view/unmodpg.cxx +++ b/sd/source/ui/view/unmodpg.cxx @@ -98,7 +98,7 @@ void ModifyPageUndoAction::Undo() if (mpPage->GetPageKind() == PK_STANDARD) { - SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNum() + 1); + SdPage* pNotesPage = static_cast<SdPage*>(mpDoc->GetPage(mpPage->GetPageNum() + 1)); pNotesPage->SetName(maOldName); } } @@ -141,7 +141,7 @@ void ModifyPageUndoAction::Redo() if (mpPage->GetPageKind() == PK_STANDARD) { - SdPage* pNotesPage = (SdPage*)mpDoc->GetPage(mpPage->GetPageNum() + 1); + SdPage* pNotesPage = static_cast<SdPage*>(mpDoc->GetPage(mpPage->GetPageNum() + 1)); pNotesPage->SetName(maNewName); } } diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index 52a2d5f636aa..32551c14bd9d 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -99,7 +99,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) if( pStyleSheet ) { if (pStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE) - pStyleSheet = ((SdStyleSheet*)pStyleSheet)->GetPseudoStyleSheet(); + pStyleSheet = static_cast<SdStyleSheet*>(pStyleSheet)->GetPseudoStyleSheet(); if( pStyleSheet ) { diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 792c5da4bf35..da3d6edbb35a 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -770,13 +770,13 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& } if( pItem == NULL ) - pItem = (SvxNumBulletItem*) aNewAttr.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET); + pItem = static_cast<const SvxNumBulletItem*>( aNewAttr.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET) ); aNewAttr.Put(*pItem, EE_PARA_NUMBULLET); if(bTitle && aNewAttr.GetItemState(EE_PARA_NUMBULLET,true) == SfxItemState::SET ) { - SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)aNewAttr.GetItem(EE_PARA_NUMBULLET,true); + const SvxNumBulletItem* pBulletItem = static_cast<const SvxNumBulletItem*>(aNewAttr.GetItem(EE_PARA_NUMBULLET,true)); SvxNumRule* pRule = pBulletItem->GetNumRule(); if(pRule) { @@ -1098,7 +1098,7 @@ void ViewShell::ImpSidUndo(bool, SfxRequest& rReq) if(pReqArgs) { - SfxUInt16Item* pUIntItem = (SfxUInt16Item*)&pReqArgs->Get(SID_UNDO); + const SfxUInt16Item* pUIntItem = static_cast<const SfxUInt16Item*>(&pReqArgs->Get(SID_UNDO)); nNumber = pUIntItem->GetValue(); } @@ -1145,7 +1145,7 @@ void ViewShell::ImpSidRedo(bool, SfxRequest& rReq) if(pReqArgs) { - SfxUInt16Item* pUIntItem = (SfxUInt16Item*)&pReqArgs->Get(SID_REDO); + const SfxUInt16Item* pUIntItem = static_cast<const SfxUInt16Item*>(&pReqArgs->Get(SID_REDO)); nNumber = pUIntItem->GetValue(); } |