diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-29 11:04:25 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-10 15:22:16 +0200 |
commit | 34966ecb6fb139d49e55796229aa98e27ef8e4b2 (patch) | |
tree | 246ae77e211806aac31c8774cfdd3b50de1d0dbb /sd | |
parent | be36b1644dcf593b0a50d5a76a503bb0e6565a84 (diff) |
loplugin: cstylecast
Change-Id: I7b438934a13a6e42ef80084c709460b2a01b26c9
Diffstat (limited to 'sd')
47 files changed, 231 insertions, 232 deletions
diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx index d0b505c615ec..0bffcd8cb5e1 100644 --- a/sd/source/ui/func/bulmaper.cxx +++ b/sd/source/ui/func/bulmaper.cxx @@ -64,37 +64,37 @@ void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const SfxItemSet& vcl::Font aMyFont; const SvxFontItem& rFItem = - (SvxFontItem&)rSet.Get(GetWhich( (sal_uInt16)nFontID )); + static_cast<const SvxFontItem&>(rSet.Get(GetWhich( (sal_uInt16)nFontID ))); aMyFont.SetFamily(rFItem.GetFamily()); aMyFont.SetName(rFItem.GetFamilyName()); aMyFont.SetCharSet(rFItem.GetCharSet()); aMyFont.SetPitch(rFItem.GetPitch()); const SvxFontHeightItem& rFHItem = - (SvxFontHeightItem&)rSet.Get(GetWhich( (sal_uInt16)nFontHeightID )); + static_cast<const SvxFontHeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nFontHeightID ))); aMyFont.SetSize(Size(0, rFHItem.GetHeight())); const SvxWeightItem& rWItem = - (SvxWeightItem&)rSet.Get(GetWhich( (sal_uInt16)nWeightID )); + static_cast<const SvxWeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nWeightID ))); aMyFont.SetWeight(rWItem.GetWeight()); const SvxPostureItem& rPItem = - (SvxPostureItem&)rSet.Get(GetWhich( (sal_uInt16)nPostureID )); + static_cast<const SvxPostureItem&>(rSet.Get(GetWhich( (sal_uInt16)nPostureID ))); aMyFont.SetItalic(rPItem.GetPosture()); - const SvxUnderlineItem& rUItem = (SvxUnderlineItem&)rSet.Get(GetWhich(SID_ATTR_CHAR_UNDERLINE)); + const SvxUnderlineItem& rUItem = static_cast<const SvxUnderlineItem&>(rSet.Get(GetWhich(SID_ATTR_CHAR_UNDERLINE))); aMyFont.SetUnderline(rUItem.GetLineStyle()); - const SvxOverlineItem& rOItem = (SvxOverlineItem&)rSet.Get(GetWhich(SID_ATTR_CHAR_OVERLINE)); + const SvxOverlineItem& rOItem = static_cast<const SvxOverlineItem&>(rSet.Get(GetWhich(SID_ATTR_CHAR_OVERLINE))); aMyFont.SetOverline(rOItem.GetLineStyle()); - const SvxCrossedOutItem& rCOItem = (SvxCrossedOutItem&)rSet.Get(GetWhich(SID_ATTR_CHAR_STRIKEOUT)); + const SvxCrossedOutItem& rCOItem = static_cast<const SvxCrossedOutItem&>(rSet.Get(GetWhich(SID_ATTR_CHAR_STRIKEOUT))); aMyFont.SetStrikeout(rCOItem.GetStrikeout()); - const SvxContourItem& rCItem = (SvxContourItem&)rSet.Get(GetWhich(SID_ATTR_CHAR_CONTOUR)); + const SvxContourItem& rCItem = static_cast<const SvxContourItem&>(rSet.Get(GetWhich(SID_ATTR_CHAR_CONTOUR))); aMyFont.SetOutline(rCItem.GetValue()); - const SvxShadowedItem& rSItem = (SvxShadowedItem&)rSet.Get(GetWhich(SID_ATTR_CHAR_SHADOWED)); + const SvxShadowedItem& rSItem = static_cast<const SvxShadowedItem&>(rSet.Get(GetWhich(SID_ATTR_CHAR_SHADOWED))); aMyFont.SetShadow(rSItem.GetValue()); aNewLevel.SetBulletFont(&aMyFont); diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 30d239c4e374..f0a59f62ca90 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -159,7 +159,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) vcl::Font aFont; if ( pItem ) { - aChars = ((const SfxStringItem*)pItem)->GetValue(); + aChars = static_cast<const SfxStringItem*>(pItem)->GetValue(); const SfxPoolItem* pFtItem = NULL; pArgs->GetItemState( mpDoc->GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem ); @@ -172,7 +172,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) { SfxItemSet aFontAttr( mpDoc->GetPool() ); mpView->GetAttributes( aFontAttr ); - const SvxFontItem* pFItem = (const SvxFontItem*)aFontAttr.GetItem( SID_ATTR_CHAR_FONT ); + const SvxFontItem* pFItem = static_cast<const SvxFontItem*>(aFontAttr.GetItem( SID_ATTR_CHAR_FONT )); if( pFItem ) aFont = vcl::Font( pFItem->GetFamilyName(), pFItem->GetStyleName(), Size( 1, 1 ) ); } @@ -185,7 +185,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) SfxItemSet aFontAttr( mpDoc->GetPool() ); mpView->GetAttributes( aFontAttr ); - const SvxFontItem* pFontItem = (const SvxFontItem*)aFontAttr.GetItem( SID_ATTR_CHAR_FONT ); + const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(aFontAttr.GetItem( SID_ATTR_CHAR_FONT )); if( pFontItem ) aSet.Put( *pFontItem ); diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index 8b1ebdcf5a10..76c70d2f5537 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -80,7 +80,7 @@ void FuConstructBezierPolygon::DoExecute( SfxRequest& rReq ) { const SfxPoolItem* pPoolItem = NULL; if( SfxItemState::SET == pArgs->GetItemState( SID_ADD_MOTION_PATH, true, &pPoolItem ) ) - maTargets = ( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue(); + maTargets = static_cast<const SfxUnoAnyItem*>( pPoolItem )->GetValue(); } } @@ -448,7 +448,7 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c } } - ((SdrPathObj*)pObj)->SetPathPoly(aPoly); + static_cast<SdrPathObj*>(pObj)->SetPathPoly(aPoly); } else { diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx index a17388a067a1..03c1ad5e0b9e 100644 --- a/sd/source/ui/func/fuconcs.cxx +++ b/sd/source/ui/func/fuconcs.cxx @@ -97,7 +97,7 @@ void FuConstructCustomShape::DoExecute( SfxRequest& rReq ) const SfxItemSet* pArgs = rReq.GetArgs(); if ( pArgs ) { - const SfxStringItem& rItm = (const SfxStringItem&)pArgs->Get( rReq.GetSlot() ); + const SfxStringItem& rItm = static_cast<const SfxStringItem&>(pArgs->Get( rReq.GetSlot() )); aCustomShape = rItm.GetValue(); } @@ -125,7 +125,7 @@ bool FuConstructCustomShape::MouseButtonDown(const MouseEvent& rMEvt) SetAttributes( pObj ); bool bForceFillStyle = true; bool bForceNoFillStyle = false; - if ( ((SdrObjCustomShape*)pObj)->UseNoFillStyle() ) + if ( static_cast<SdrObjCustomShape*>(pObj)->UseNoFillStyle() ) { bForceFillStyle = false; bForceNoFillStyle = true; @@ -255,7 +255,7 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj ) pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) ); pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) ); pObj->SetMergedItem( makeSdrTextAutoGrowHeightItem( false ) ); - ((SdrObjCustomShape*)pObj)->MergeDefaultAttributes( &aCustomShape ); + static_cast<SdrObjCustomShape*>(pObj)->MergeDefaultAttributes( &aCustomShape ); } } diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index ec44ea456fae..86129b98d8ce 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -210,7 +210,7 @@ bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt) pObj->SetMergedItemSet(aAttr); if( nSlotId == SID_DRAW_CAPTION_VERTICAL ) - ( (SdrTextObj*) pObj)->SetVerticalWriting( true ); + static_cast<SdrTextObj*>(pObj)->SetVerticalWriting( true ); } } return bReturn; @@ -490,11 +490,11 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj) else if (nSlotId == SID_DRAW_MEASURELINE) { // dimension line - SdPage* pPage = (SdPage*) mpView->GetSdrPageView()->GetPage(); + SdPage* pPage = static_cast<SdPage*>( mpView->GetSdrPageView()->GetPage() ); OUString aName(SD_RESSTR(STR_POOLSHEET_MEASURE)); - SfxStyleSheet* pSheet = (SfxStyleSheet*) pPage->GetModel()-> + SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>( pPage->GetModel()-> GetStyleSheetPool()-> - Find(aName, SD_STYLE_FAMILY_GRAPHICS); + Find(aName, SD_STYLE_FAMILY_GRAPHICS)); DBG_ASSERT(pSheet, "StyleSheet missing"); if (pSheet) @@ -601,7 +601,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj) // determine line width and calculate with it the line end width if( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE ) { - long nValue = ( ( const XLineWidthItem& ) aSet.Get( XATTR_LINEWIDTH ) ).GetValue(); + long nValue = static_cast<const XLineWidthItem&>( aSet.Get( XATTR_LINEWIDTH ) ).GetValue(); if( nValue > 0 ) nWidth = nValue * 3; } @@ -822,7 +822,7 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const ::basegfx::B2DPolygon aB2DPolygon; aB2DPolygon.append(::basegfx::B2DPoint(aStart.X(), nYMiddle)); aB2DPolygon.append(::basegfx::B2DPoint(aEnd.X(), nYMiddle)); - ((SdrPathObj*)pObj)->SetPathPoly(::basegfx::B2DPolyPolygon(aB2DPolygon)); + static_cast<SdrPathObj*>(pObj)->SetPathPoly(::basegfx::B2DPolyPolygon(aB2DPolygon)); } else { @@ -837,8 +837,8 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const if(pObj->ISA(SdrMeasureObj)) { sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2); - ((SdrMeasureObj*)pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0); - ((SdrMeasureObj*)pObj)->SetPoint(Point(aEnd.X(), nYMiddle), 1); + static_cast<SdrMeasureObj*>(pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0); + static_cast<SdrMeasureObj*>(pObj)->SetPoint(Point(aEnd.X(), nYMiddle), 1); } else { @@ -879,8 +879,8 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const { if(pObj->ISA(SdrEdgeObj)) { - ((SdrEdgeObj*)pObj)->SetTailPoint(false, aStart); - ((SdrEdgeObj*)pObj)->SetTailPoint(true, aEnd); + static_cast<SdrEdgeObj*>(pObj)->SetTailPoint(false, aStart); + static_cast<SdrEdgeObj*>(pObj)->SetTailPoint(true, aEnd); } else { @@ -896,7 +896,7 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const { bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID); - ((SdrTextObj*)pObj)->SetVerticalWriting(bIsVertical); + static_cast<SdrTextObj*>(pObj)->SetVerticalWriting(bIsVertical); if(bIsVertical) { @@ -910,8 +910,8 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const // String aText(SdResId(STR_POOLSHEET_TEXT)); // ((SdrCaptionObj*)pObj)->SetText(aText); - ((SdrCaptionObj*)pObj)->SetLogicRect(aRect); - ((SdrCaptionObj*)pObj)->SetTailPos( + static_cast<SdrCaptionObj*>(pObj)->SetLogicRect(aRect); + static_cast<SdrCaptionObj*>(pObj)->SetTailPos( aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2)); } else diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index a6842ba07f13..e615e9475bbe 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -327,7 +327,7 @@ void FuConstruct::SetStyleSheet(SfxItemSet& rAttr, SdrObject* pObj) void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj, const bool bForceFillStyle, const bool bForceNoFillStyle ) { - SdPage* pPage = (SdPage*)mpView->GetSdrPageView()->GetPage(); + SdPage* pPage = static_cast<SdPage*>(mpView->GetSdrPageView()->GetPage()); if ( pPage->IsMasterPage() && pPage->GetPageKind() == PK_STANDARD && mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS ) { @@ -337,16 +337,16 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj, OUString aName( pPage->GetLayoutName() ); sal_Int32 n = aName.indexOf(SD_LT_SEPARATOR) + strlen(SD_LT_SEPARATOR); aName = aName.copy(0, n) + SD_RESSTR(STR_LAYOUT_BACKGROUNDOBJECTS); - SfxStyleSheet* pSheet = (SfxStyleSheet*)pPage->GetModel()-> + SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pPage->GetModel()-> GetStyleSheetPool()-> - Find(aName, SD_STYLE_FAMILY_MASTERPAGE); + Find(aName, SD_STYLE_FAMILY_MASTERPAGE)); DBG_ASSERT(pSheet, "StyleSheet missing"); if (pSheet) { // applying style sheet for background objects pObj->SetStyleSheet(pSheet, false); SfxItemSet& rSet = pSheet->GetItemSet(); - const XFillStyleItem& rFillStyle = (const XFillStyleItem&)rSet.Get(XATTR_FILLSTYLE); + const XFillStyleItem& rFillStyle = static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)); if ( bForceFillStyle ) { if (rFillStyle.GetValue() == drawing::FillStyle_NONE) @@ -367,9 +367,9 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj, if ( bForceNoFillStyle ) { OUString aName(SD_RESSTR(STR_POOLSHEET_OBJWITHOUTFILL)); - SfxStyleSheet* pSheet = (SfxStyleSheet*)pPage->GetModel()-> + SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pPage->GetModel()-> GetStyleSheetPool()-> - Find(aName, SD_STYLE_FAMILY_GRAPHICS); + Find(aName, SD_STYLE_FAMILY_GRAPHICS)); DBG_ASSERT(pSheet, "Stylesheet missing"); if (pSheet) { diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index 03477a588620..5f6ee2ce0511 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -86,12 +86,12 @@ void FuCopy::DoExecute( SfxRequest& rReq ) if( SfxItemState::SET == aAttr.GetItemState( XATTR_FILLSTYLE, true, &pPoolItem ) ) { - drawing::FillStyle eStyle = ( ( const XFillStyleItem* ) pPoolItem )->GetValue(); + drawing::FillStyle eStyle = static_cast<const XFillStyleItem*>(pPoolItem)->GetValue(); if( eStyle == drawing::FillStyle_SOLID && SfxItemState::SET == aAttr.GetItemState( XATTR_FILLCOLOR, true, &pPoolItem ) ) { - const XFillColorItem* pItem = ( const XFillColorItem* ) pPoolItem; + const XFillColorItem* pItem = static_cast<const XFillColorItem*>(pPoolItem); XColorItem aXColorItem( ATTR_COPY_START_COLOR, pItem->GetName(), pItem->GetColorValue() ); aSet.Put( aXColorItem ); @@ -135,31 +135,31 @@ void FuCopy::DoExecute( SfxRequest& rReq ) // Count if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_NUMBER, true, &pPoolItem ) ) - nNumber = ( ( const SfxUInt16Item* ) pPoolItem )->GetValue(); + nNumber = static_cast<const SfxUInt16Item*>( pPoolItem )->GetValue(); // translation if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) ) - lSizeX = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); + lSizeX = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) ) - lSizeY = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); + lSizeY = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) ) - lAngle = ( ( const SfxInt32Item* )pPoolItem )->GetValue(); + lAngle = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); // scale if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) ) - lWidth = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); + lWidth = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) ) - lHeight = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); + lHeight = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); // start/end color if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { - aStartColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); + aStartColor = static_cast<const XColorItem*>( pPoolItem )->GetColorValue(); bColor = true; } if( pArgs && SfxItemState::SET == pArgs->GetItemState( ATTR_COPY_END_COLOR, true, &pPoolItem ) ) { - aEndColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); + aEndColor = static_cast<const XColorItem*>( pPoolItem )->GetColorValue(); if( aStartColor == aEndColor ) bColor = false; } diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 613e74fe0827..e5e327afeca9 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -522,7 +522,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) mpViewShell->GetViewFrame()->HasChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())) { // pipette mode - SvxBmpMask* pMask = (SvxBmpMask*) mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())->GetWindow(); + SvxBmpMask* pMask = static_cast<SvxBmpMask*>( mpViewShell->GetViewFrame()->GetChildWindow(SvxBmpMaskChildWindow::GetChildWindowId())->GetWindow() ); if (pMask && pMask->IsEyedropping()) { diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx index 74e1f5974c3e..0030d8343dc5 100644 --- a/sd/source/ui/func/fuediglu.cxx +++ b/sd/source/ui/func/fuediglu.cxx @@ -425,7 +425,7 @@ void FuEditGluePoints::ReceiveRequest(SfxRequest& rReq) { const SfxItemSet* pSet = rReq.GetArgs(); const SfxPoolItem& rItem = pSet->Get(SID_GLUE_PERCENT); - bool bPercent = ((const SfxBoolItem&) rItem).GetValue(); + bool bPercent = static_cast<const SfxBoolItem&>(rItem).GetValue(); mpView->SetMarkedGluePointsPercent(bPercent); } break; diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx index 5d58d83d875a..2d5e484f4e50 100644 --- a/sd/source/ui/func/fuexpand.cxx +++ b/sd/source/ui/func/fuexpand.cxx @@ -97,12 +97,12 @@ void FuExpandPage::DoExecute( SfxRequest& ) pOutl->SetRefDevice( SD_MOD()->GetRefDevice( *mpDocSh ) ); pOutl->SetDefTab( mpDoc->GetDefaultTabulator() ); - pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool()); + pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool())); SetOfByte aVisibleLayers = pActualPage->TRG_GetMasterPageVisibleLayers(); sal_uInt16 nActualPageNum = pActualPage->GetPageNum(); - SdPage* pActualNotesPage = (SdPage*) mpDoc->GetPage(nActualPageNum + 1); - SdrTextObj* pActualOutline = (SdrTextObj*) pActualPage->GetPresObj(PRESOBJ_OUTLINE); + SdPage* pActualNotesPage = static_cast<SdPage*>(mpDoc->GetPage(nActualPageNum + 1)); + SdrTextObj* pActualOutline = static_cast<SdrTextObj*>(pActualPage->GetPresObj(PRESOBJ_OUTLINE)); if (pActualOutline) { @@ -180,7 +180,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) pNotesPage->TRG_SetMasterPageVisibleLayers(aVisibleLayers); // create title text objects - SdrTextObj* pTextObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_TITLE); + SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pPage->GetPresObj(PRESOBJ_TITLE)); assert(pTextObj); if (!pTextObj) continue; @@ -212,7 +212,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) SdrTextObj* pOutlineObj = NULL; sal_Int32 nChildCount = pOutl->GetChildCount(pPara); if (nChildCount > 0) - pOutlineObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_OUTLINE); + pOutlineObj = static_cast<SdrTextObj*>( pPage->GetPresObj(PRESOBJ_OUTLINE) ); if (pOutlineObj) { // create structuring text objects diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index 2eaa074da246..d4fb0d6ae87e 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -66,7 +66,7 @@ void FuFormatPaintBrush::DoExecute( SfxRequest& rReq ) const SfxItemSet *pArgs = rReq.GetArgs(); if( pArgs && pArgs->Count() >= 1 ) { - mbPermanent = static_cast<bool>(((SfxBoolItem &)pArgs->Get(SID_FORMATPAINTBRUSH)).GetValue()); + mbPermanent = static_cast<bool>(static_cast<const SfxBoolItem &>(pArgs->Get(SID_FORMATPAINTBRUSH)).GetValue()); } if( mpView ) diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx index c5049a502c01..4721b49e9dfd 100644 --- a/sd/source/ui/func/fuhhconv.cxx +++ b/sd/source/ui/func/fuhhconv.cxx @@ -171,7 +171,7 @@ void FuHangulHanjaConversion::ConvertStyles( sal_Int16 nTargetLanguage, const vc ( !bHasParent || rSet.GetItemState( EE_CHAR_FONTINFO_CJK, false ) == SfxItemState::SET ) ) { // set new font attribute - SvxFontItem aFontItem( (SvxFontItem&) rSet.Get( EE_CHAR_FONTINFO_CJK ) ); + SvxFontItem aFontItem( static_cast<const SvxFontItem&>( rSet.Get( EE_CHAR_FONTINFO_CJK ) ) ); aFontItem.SetFamilyName( pTargetFont->GetName()); aFontItem.SetFamily( pTargetFont->GetFamily()); aFontItem.SetStyleName( pTargetFont->GetStyleName()); diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 4d20dcb17987..4177c6ed27c2 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -574,22 +574,22 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) if (pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2) { - if ( !( (SdrOle2Obj*) pObj)->GetObjRef().is() ) + if ( !static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { // the empty OLE object gets a new IPObj bInsertNewObject = false; pObj->SetEmptyPresObj(false); - ( (SdrOle2Obj*) pObj)->SetOutlinerParaObject(NULL); - ( (SdrOle2Obj*) pObj)->SetObjRef(xObj); - ( (SdrOle2Obj*) pObj)->SetPersistName(aName); - ( (SdrOle2Obj*) pObj)->SetName(aName); - ( (SdrOle2Obj*) pObj)->SetAspect(nAspect); - Rectangle aRect = ( (SdrOle2Obj*) pObj)->GetLogicRect(); + static_cast<SdrOle2Obj*>(pObj)->SetOutlinerParaObject(NULL); + static_cast<SdrOle2Obj*>(pObj)->SetObjRef(xObj); + static_cast<SdrOle2Obj*>(pObj)->SetPersistName(aName); + static_cast<SdrOle2Obj*>(pObj)->SetName(aName); + static_cast<SdrOle2Obj*>(pObj)->SetAspect(nAspect); + Rectangle aRect = static_cast<SdrOle2Obj*>(pObj)->GetLogicRect(); if ( nAspect == embed::Aspects::MSOLE_ICON ) { if( xIconMetaFile.is() ) - ( (SdrOle2Obj*) pObj)->SetGraphicToObj( xIconMetaFile, aIconMediaType ); + static_cast<SdrOle2Obj*>(pObj)->SetGraphicToObj( xIconMetaFile, aIconMediaType ); } else { diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index a608fd74a926..5fa1a0a0f769 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -465,7 +465,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) if (static_cast<DrawViewShell*>(mpViewShell)->GetEditMode() == EM_MASTERPAGE && !pPage->IsMasterPage()) { - pPage = (SdPage*)(&(pPage->TRG_GetMasterPage())); + pPage = static_cast<SdPage*>(&(pPage->TRG_GetMasterPage())); } assert(pPage && "page not found"); @@ -586,7 +586,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) between - the global outliner could be used in SdPage::CreatePresObj */ boost::scoped_ptr< ::Outliner> pOutliner(new ::Outliner( &mpDoc->GetItemPool(), OUTLINERMODE_OUTLINEOBJECT )); - pOutliner->SetStyleSheetPool((SfxStyleSheetPool*)mpDoc->GetStyleSheetPool()); + pOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool())); // set reference device pOutliner->SetRefDevice(SD_MOD()->GetRefDevice( *mpDocSh )); @@ -646,7 +646,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) aStyleSheetName = aStyleSheetName.copy( 0, aStyleSheetName.getLength()-1 ); aStyleSheetName += OUString::number( nDepth <= 0 ? 1 : nDepth+1 ); SfxStyleSheetBasePool* pStylePool = mpDoc->GetStyleSheetPool(); - SfxStyleSheet* pOutlStyle = (SfxStyleSheet*) pStylePool->Find( aStyleSheetName, pStyleSheet->GetFamily() ); + SfxStyleSheet* pOutlStyle = static_cast<SfxStyleSheet*>( pStylePool->Find( aStyleSheetName, pStyleSheet->GetFamily() ) ); rDocliner.SetStyleSheet( nTargetPos, pOutlStyle ); } diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx index e5073aa035f4..e8f441cc7398 100644 --- a/sd/source/ui/func/fulinend.cxx +++ b/sd/source/ui/func/fulinend.cxx @@ -85,7 +85,7 @@ void FuLineEnd::DoExecute( SfxRequest& ) else return; // Cancel } - const ::basegfx::B2DPolyPolygon aPolyPolygon = ( (SdrPathObj*) pNewObj )->GetPathPoly(); + const ::basegfx::B2DPolyPolygon aPolyPolygon = static_cast<const SdrPathObj*>(pNewObj)->GetPathPoly(); // Delete the created poly-object SdrObject::Free( pConvPolyObj ); diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index f608fd117323..475c63a67a3a 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -49,7 +49,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() ) TYPEINIT1( FuMorph, FuPoor ); FuMorph::FuMorph ( @@ -113,14 +113,14 @@ void FuMorph::DoExecute( SfxRequest& ) { SdrObject* pObj = aIter1.Next(); if(pObj && pObj->ISA(SdrPathObj)) - aPolyPoly1.append(((SdrPathObj*)pObj)->GetPathPoly()); + aPolyPoly1.append(static_cast<SdrPathObj*>(pObj)->GetPathPoly()); } while(aIter2.IsMore()) { SdrObject* pObj = aIter2.Next(); if(pObj && pObj->ISA(SdrPathObj)) - aPolyPoly2.append(((SdrPathObj*)pObj)->GetPathPoly()); + aPolyPoly2.append(static_cast<SdrPathObj*>(pObj)->GetPathPoly()); } // perform morphing diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index fe23ac51e4fb..8ceff8b190be 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -463,7 +463,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) // evaluation of the ItemSets if (pArgs->GetItemState(ATTR_ANIMATION_ACTIVE) == SfxItemState::SET) { - bActive = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_ACTIVE)).GetValue(); + bActive = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_ANIMATION_ACTIVE)).GetValue(); nAnimationSet = ATTR_SET; } else @@ -471,7 +471,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_EFFECT) == SfxItemState::SET) { - eEffect = (presentation::AnimationEffect)((SfxAllEnumItem&) pArgs-> + eEffect = (presentation::AnimationEffect)static_cast<const SfxAllEnumItem&>( pArgs-> Get(ATTR_ANIMATION_EFFECT)).GetValue(); nEffectSet = ATTR_SET; } @@ -480,7 +480,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_TEXTEFFECT) == SfxItemState::SET) { - eTextEffect = (presentation::AnimationEffect)((SfxAllEnumItem&) pArgs-> + eTextEffect = (presentation::AnimationEffect)static_cast<const SfxAllEnumItem&>( pArgs-> Get(ATTR_ANIMATION_TEXTEFFECT)).GetValue(); nTextEffectSet = ATTR_SET; } @@ -489,7 +489,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_SPEED) == SfxItemState::SET) { - eSpeed = (presentation::AnimationSpeed)((SfxAllEnumItem&) pArgs-> + eSpeed = (presentation::AnimationSpeed)static_cast<const SfxAllEnumItem&>( pArgs-> Get(ATTR_ANIMATION_SPEED)).GetValue(); nSpeedSet = ATTR_SET; } @@ -498,7 +498,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_FADEOUT) == SfxItemState::SET) { - bFadeOut = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_FADEOUT)).GetValue(); + bFadeOut = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_ANIMATION_FADEOUT)).GetValue(); nFadeOutSet = ATTR_SET; } else @@ -506,7 +506,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_INVISIBLE) == SfxItemState::SET) { - bInvisible = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_INVISIBLE)).GetValue(); + bInvisible = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_ANIMATION_INVISIBLE)).GetValue(); nInvisibleSet = ATTR_SET; } else @@ -514,7 +514,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_SOUNDON) == SfxItemState::SET) { - bSoundOn = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_SOUNDON)).GetValue(); + bSoundOn = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_ANIMATION_SOUNDON)).GetValue(); nSoundOnSet = ATTR_SET; } else @@ -522,7 +522,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_SOUNDFILE) == SfxItemState::SET) { - aSound = ((SfxStringItem&)pArgs->Get(ATTR_ANIMATION_SOUNDFILE)).GetValue(); + aSound = static_cast<const SfxStringItem&>(pArgs->Get(ATTR_ANIMATION_SOUNDFILE)).GetValue(); nSoundFileSet = ATTR_SET; } else @@ -530,7 +530,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_COLOR) == SfxItemState::SET) { - aFadeColor = ((SvxColorItem&)pArgs->Get(ATTR_ANIMATION_COLOR)).GetValue(); + aFadeColor = static_cast<const SvxColorItem&>(pArgs->Get(ATTR_ANIMATION_COLOR)).GetValue(); nFadeColorSet = ATTR_SET; } else @@ -538,7 +538,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ANIMATION_PLAYFULL) == SfxItemState::SET) { - bPlayFull = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_PLAYFULL)).GetValue(); + bPlayFull = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_ANIMATION_PLAYFULL)).GetValue(); nPlayFullSet = ATTR_SET; } else @@ -546,7 +546,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION) == SfxItemState::SET) { - eClickAction = (presentation::ClickAction)((SfxAllEnumItem&)pArgs-> + eClickAction = (presentation::ClickAction)static_cast<const SfxAllEnumItem&>(pArgs-> Get(ATTR_ACTION)).GetValue(); nClickActionSet = ATTR_SET; } @@ -555,7 +555,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_FILENAME) == SfxItemState::SET) { - aBookmark = ((SfxStringItem&)pArgs-> + aBookmark = static_cast<const SfxStringItem&>(pArgs-> Get(ATTR_ACTION_FILENAME)).GetValue(); nBookmarkSet = ATTR_SET; } @@ -564,7 +564,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_EFFECT) == SfxItemState::SET) { - eSecondEffect = (presentation::AnimationEffect)((SfxAllEnumItem&) pArgs-> + eSecondEffect = (presentation::AnimationEffect)static_cast<const SfxAllEnumItem&>( pArgs-> Get(ATTR_ACTION_EFFECT)).GetValue(); nSecondEffectSet = ATTR_SET; } @@ -573,7 +573,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_EFFECTSPEED) == SfxItemState::SET) { - eSecondSpeed = (presentation::AnimationSpeed)((SfxAllEnumItem&) pArgs-> + eSecondSpeed = (presentation::AnimationSpeed)static_cast<const SfxAllEnumItem&>( pArgs-> Get(ATTR_ACTION_EFFECTSPEED)).GetValue(); nSecondSpeedSet = ATTR_SET; } @@ -582,7 +582,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_SOUNDON) == SfxItemState::SET) { - bSecondSoundOn = ((SfxBoolItem&)pArgs->Get(ATTR_ACTION_SOUNDON)).GetValue(); + bSecondSoundOn = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_ACTION_SOUNDON)).GetValue(); nSecondSoundOnSet = ATTR_SET; } else @@ -590,7 +590,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_ACTION_PLAYFULL) == SfxItemState::SET) { - bSecondPlayFull = ((SfxBoolItem&)pArgs->Get(ATTR_ACTION_PLAYFULL)).GetValue(); + bSecondPlayFull = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_ACTION_PLAYFULL)).GetValue(); nSecondPlayFullSet = ATTR_SET; } else @@ -641,7 +641,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) (eKind1 == OBJ_PLIN) || // Polygon (eKind1 == OBJ_PATHLINE))) // Bezier curve { - pPath = (SdrPathObj*)pObject1; + pPath = static_cast<SdrPathObj*>(pObject1); pRunningObj = pObject2; } @@ -650,7 +650,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) (eKind2 == OBJ_PLIN) || // Polygon (eKind2 == OBJ_PATHLINE))) // Bezier curve { - pPath = (SdrPathObj*)pObject2; + pPath = static_cast<SdrPathObj*>(pObject2); pRunningObj = pObject1; } diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 1f329416b541..aa19030e00b3 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -197,7 +197,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) SvxNumRule* pNumRule = NULL; if ( pTmpItem ) { - pNumRule = new SvxNumRule(*((SvxNumBulletItem*)pTmpItem)->GetNumRule()); + pNumRule = new SvxNumRule(*static_cast<const SvxNumBulletItem*>(pTmpItem)->GetNumRule()); // get numbering rule corresponding to <nIdx> and apply the needed number formats to <pNumRule> NBOTypeMgrBase* pNumRuleMgr = @@ -208,7 +208,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF; const SfxPoolItem* pNumLevelItem = NULL; if(SfxItemState::SET == aNewAttr.GetItemState(SID_PARAM_CUR_NUM_LEVEL, false, &pNumLevelItem)) - nActNumLvl = ((const SfxUInt16Item*)pNumLevelItem)->GetValue(); + nActNumLvl = static_cast<const SfxUInt16Item*>(pNumLevelItem)->GetValue(); pNumRuleMgr->SetItems(&aNewAttr); SvxNumRule aTmpRule( *pNumRule ); @@ -350,7 +350,7 @@ const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_u } if( pItem == NULL ) - pItem = (SvxNumBulletItem*) aNewAttr.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET); + pItem = static_cast<const SvxNumBulletItem*>( aNewAttr.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET) ); //DBG_ASSERT( pItem, "No EE_PARA_NUMBULLET in the Pool!" ); @@ -358,7 +358,7 @@ const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_u 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* pLclRule = pBulletItem->GetNumRule(); if(pLclRule) { diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx index 1040ab1e7b2c..f68d033c7442 100644 --- a/sd/source/ui/func/fuoltext.cxx +++ b/sd/source/ui/func/fuoltext.cxx @@ -146,7 +146,7 @@ bool FuOutlineText::MouseButtonUp(const MouseEvent& rMEvt) { bReturn = true; mpWindow->ReleaseMouse(); - SfxStringItem aStrItem( SID_FILE_NAME, ( (SvxURLField*) pField)->GetURL() ); + SfxStringItem aStrItem( SID_FILE_NAME, static_cast<const SvxURLField*>(pField)->GetURL() ); SfxStringItem aReferer( SID_REFERER, mpDocSh->GetMedium()->GetName() ); SfxBoolItem aBrowseItem( SID_BROWSE, true ); SfxViewFrame* pFrame = mpViewShell->GetViewFrame(); diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index c20e90a51b1d..8253ee54c6a8 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -225,7 +225,7 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT1, bScale ? sal_True : sal_False ) ); bool bFullSize = mpPage->IsMasterPage() ? - mpPage->IsBackgroundFullSize() : ((SdPage&)mpPage->TRG_GetMasterPage()).IsBackgroundFullSize(); + mpPage->IsBackgroundFullSize() : static_cast<SdPage&>(mpPage->TRG_GetMasterPage()).IsBackgroundFullSize(); aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT2, bFullSize ) ); @@ -257,7 +257,7 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) // Only this page, get attributes for background fill const SfxItemSet& rBackgroundAttributes = mpPage->getSdrPageProperties().GetItemSet(); - if(drawing::FillStyle_NONE != ((const XFillStyleItem&)rBackgroundAttributes.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE != static_cast<const XFillStyleItem&>(rBackgroundAttributes.Get(XATTR_FILLSTYLE)).GetValue()) { // page attributes are used, take them aMergedAttr.Put(rBackgroundAttributes); @@ -265,7 +265,7 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) else { if(pStyleSheet - && drawing::FillStyle_NONE != ((const XFillStyleItem&)pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) + && drawing::FillStyle_NONE != static_cast<const XFillStyleItem&>(pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) { // if the page has no fill style, use the settings from the // background stylesheet (if used) @@ -337,9 +337,9 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) } // if the background for this page was set to invisible, the background-object has to be deleted, too. - if( ( ( (XFillStyleItem*) pTempSet->GetItem( XATTR_FILLSTYLE ) )->GetValue() == drawing::FillStyle_NONE ) || + if( ( static_cast<const XFillStyleItem*>( pTempSet->GetItem( XATTR_FILLSTYLE ) )->GetValue() == drawing::FillStyle_NONE ) || ( ( pTempSet->GetItemState( XATTR_FILLSTYLE ) == SfxItemState::DEFAULT ) && - ( ( (XFillStyleItem*) aMergedAttr.GetItem( XATTR_FILLSTYLE ) )->GetValue() == drawing::FillStyle_NONE ) ) ) + ( static_cast<const XFillStyleItem*>( aMergedAttr.GetItem( XATTR_FILLSTYLE ) )->GetValue() == drawing::FillStyle_NONE ) ) ) mbPageBckgrdDeleted = true; bool bSetToAllPages = false; @@ -420,7 +420,7 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) SdPage *pPage = mpDoc->GetSdPage(i, ePageKind); const SfxItemSet& rFillAttributes = pPage->getSdrPageProperties().GetItemSet(); - if(drawing::FillStyle_NONE != ((const XFillStyleItem&)rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE != static_cast<const XFillStyleItem&>(rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue()) { SdBackgroundObjUndoAction *pBackgroundObjUndoAction = new SdBackgroundObjUndoAction(*mpDoc, *pPage, rFillAttributes); pUndoGroup->AddAction(pBackgroundObjUndoAction); @@ -453,7 +453,7 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent ) const SfxPoolItem *pItem; if( SfxItemState::SET == pTempSet->GetItemState( EE_PARA_WRITINGDIR, false, &pItem ) ) { - sal_uInt32 nVal = ((SvxFrameDirectionItem*)pItem)->GetValue(); + sal_uInt32 nVal = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue(); mpDoc->SetDefaultWritingMode( nVal == FRMDIR_HORI_RIGHT_TOP ? ::com::sun::star::text::WritingMode_RL_TB : ::com::sun::star::text::WritingMode_LR_TB ); } @@ -491,15 +491,15 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1; bool bScaleAll = true; Orientation eOrientation = mpPage->GetOrientation(); - SdPage* pMasterPage = mpPage->IsMasterPage() ? mpPage : &(SdPage&)(mpPage->TRG_GetMasterPage()); + SdPage* pMasterPage = mpPage->IsMasterPage() ? mpPage : &static_cast<SdPage&>(mpPage->TRG_GetMasterPage()); bool bFullSize = pMasterPage->IsBackgroundFullSize(); - sal_uInt16 nPaperBin = mpPage->GetPaperBin(); + sal_uInt16 nPaperBin = mpPage->GetPaperBin(); if( pArgs->GetItemState(SID_ATTR_PAGE, true, &pPoolItem) == SfxItemState::SET ) { - mpDoc->SetPageNumType(((const SvxPageItem*) pPoolItem)->GetNumType()); + mpDoc->SetPageNumType(static_cast<const SvxPageItem*>(pPoolItem)->GetNumType()); - eOrientation = ((const SvxPageItem*) pPoolItem)->IsLandscape() ? + eOrientation = static_cast<const SvxPageItem*>(pPoolItem)->IsLandscape() ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT; if( mpPage->GetOrientation() != eOrientation ) @@ -510,7 +510,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) if( pArgs->GetItemState(SID_ATTR_PAGE_SIZE, true, &pPoolItem) == SfxItemState::SET ) { - aNewSize = ((const SvxSizeItem*) pPoolItem)->GetSize(); + aNewSize = static_cast<const SvxSizeItem*>(pPoolItem)->GetSize(); if( mpPage->GetSize() != aNewSize ) bSetPageSizeAndBorder = true; @@ -519,8 +519,8 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE), true, &pPoolItem) == SfxItemState::SET ) { - nLeft = ((const SvxLRSpaceItem*) pPoolItem)->GetLeft(); - nRight = ((const SvxLRSpaceItem*) pPoolItem)->GetRight(); + nLeft = static_cast<const SvxLRSpaceItem*>(pPoolItem)->GetLeft(); + nRight = static_cast<const SvxLRSpaceItem*>(pPoolItem)->GetRight(); if( mpPage->GetLftBorder() != nLeft || mpPage->GetRgtBorder() != nRight ) bSetPageSizeAndBorder = true; @@ -530,8 +530,8 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE), true, &pPoolItem) == SfxItemState::SET ) { - nUpper = ((const SvxULSpaceItem*) pPoolItem)->GetUpper(); - nLower = ((const SvxULSpaceItem*) pPoolItem)->GetLower(); + nUpper = static_cast<const SvxULSpaceItem*>(pPoolItem)->GetUpper(); + nLower = static_cast<const SvxULSpaceItem*>(pPoolItem)->GetLower(); if( mpPage->GetUppBorder() != nUpper || mpPage->GetLwrBorder() != nLower ) bSetPageSizeAndBorder = true; @@ -539,12 +539,12 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_EXT1), true, &pPoolItem) == SfxItemState::SET ) { - bScaleAll = ((const SfxBoolItem*) pPoolItem)->GetValue(); + bScaleAll = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue(); } if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_EXT2), true, &pPoolItem) == SfxItemState::SET ) { - bFullSize = ((const SfxBoolItem*) pPoolItem)->GetValue(); + bFullSize = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue(); if(pMasterPage->IsBackgroundFullSize() != bFullSize ) bSetPageSizeAndBorder = true; @@ -553,7 +553,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) // Paper Bin if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_PAPERBIN), true, &pPoolItem) == SfxItemState::SET ) { - nPaperBin = ((const SvxPaperBinItem*) pPoolItem)->GetValue(); + nPaperBin = static_cast<const SvxPaperBinItem*>(pPoolItem)->GetValue(); if( mpPage->GetPaperBin() != nPaperBin ) bSetPageSizeAndBorder = true; diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx index 2b62f4013d05..9c24fc15d677 100644 --- a/sd/source/ui/func/fuparagr.cxx +++ b/sd/source/ui/func/fuparagr.cxx @@ -78,7 +78,7 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) aNewAttr.Put( aEditAttr ); // left border is offset - const long nOff = ( (SvxLRSpaceItem&)aNewAttr.Get( EE_PARA_LRSPACE ) ).GetTxtLeft(); + const long nOff = static_cast<const SvxLRSpaceItem&>(aNewAttr.Get( EE_PARA_LRSPACE ) ).GetTxtLeft(); // conversion since TabulatorTabPage always uses Twips! SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aNewAttr.Put( aOff ); @@ -120,13 +120,13 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) const SfxPoolItem *pItem = 0; if( SfxItemState::SET == pArgs->GetItemState( ATTR_NUMBER_NEWSTART, false, &pItem ) ) { - const bool bNewStart = ((SfxBoolItem*)pItem)->GetValue() ? sal_True : sal_False; + const bool bNewStart = static_cast<const SfxBoolItem*>(pItem)->GetValue() ? sal_True : sal_False; pOutliner->SetParaIsNumberingRestart( eSelection.nStartPara, bNewStart ); } if( SfxItemState::SET == pArgs->GetItemState( ATTR_NUMBER_NEWSTART_AT, false, &pItem ) ) { - const sal_Int16 nStartAt = ((SfxInt16Item*)pItem)->GetValue(); + const sal_Int16 nStartAt = static_cast<const SfxInt16Item*>(pItem)->GetValue(); pOutliner->SetNumberingStartValue( eSelection.nStartPara, nStartAt ); } } diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index 1f19ac34ccbd..523f5b50e59f 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -225,7 +225,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if(SdrInventor == nInv && (OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd)) { - pCandidate = (SdrTextObj*)pObj; + pCandidate = static_cast<SdrTextObj*>(pObj); } } } @@ -628,7 +628,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if(pHdl && pHdl->GetObj() && pHdl->GetObj()->ISA(SdrEdgeObj) && 0 == pHdl->GetPolyNum()) { - pEdgeObj = (SdrEdgeObj*)pHdl->GetObj(); + pEdgeObj = static_cast<SdrEdgeObj*>(pHdl->GetObj()); if(0L == pHdl->GetPointNum()) { @@ -859,7 +859,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if(SdrInventor == nInv && OBJ_TITLETEXT == nKnd) { - pCandidate = (SdrTextObj*)pObj; + pCandidate = static_cast<SdrTextObj*>(pObj); } } } @@ -1027,7 +1027,7 @@ bool FuPoor::RequestHelp(const HelpEvent& rHEvt) if (pPV) { - SdPage* pPage = (SdPage*) pPV->GetPage(); + SdPage* pPage = static_cast<SdPage*>( pPV->GetPage() ); if (pPage) { @@ -1054,7 +1054,7 @@ void FuPoor::ReceiveRequest(SfxRequest& rReq) if( rItem.ISA( SfxAllEnumItem ) ) { - nSlotValue = ( ( const SfxAllEnumItem& ) rItem ).GetValue(); + nSlotValue = static_cast<const SfxAllEnumItem&>( rItem ).GetValue(); } } } diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index 11f1237cb07e..c0fffc972193 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -136,13 +136,13 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) if (pArgs) { if (pArgs->GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET) - bLoad = ((SfxBoolItem&)pArgs->Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); + bLoad = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); if( pArgs->GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET ) - bMasterPage = ( (SfxBoolItem&) pArgs->Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); + bMasterPage = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); if( pArgs->GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET ) - bCheckMasters = ( (SfxBoolItem&) pArgs->Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); + bCheckMasters = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); if (pArgs->GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET) - aFile = ((SfxStringItem&)pArgs->Get(ATTR_PRESLAYOUT_NAME)).GetValue(); + aFile = static_cast<const SfxStringItem&>(pArgs->Get(ATTR_PRESLAYOUT_NAME)).GetValue(); } else { @@ -157,13 +157,13 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) { pDlg->GetAttr(aSet); if (aSet.GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET) - bLoad = ((SfxBoolItem&)aSet.Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); + bLoad = static_cast<const SfxBoolItem&>(aSet.Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); if( aSet.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET ) - bMasterPage = ( (SfxBoolItem&) aSet.Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); + bMasterPage = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); if( aSet.GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET ) - bCheckMasters = ( (SfxBoolItem&) aSet.Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); + bCheckMasters = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); if (aSet.GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET) - aFile = ((SfxStringItem&)aSet.Get(ATTR_PRESLAYOUT_NAME)).GetValue(); + aFile = static_cast<const SfxStringItem&>(aSet.Get(ATTR_PRESLAYOUT_NAME)).GetValue(); } break; diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index 6e46e4b8c2c1..3885d21e35fd 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -73,7 +73,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) if not, it is not allowed to edit the templates */ SfxItemSet aSet(mpDoc->GetItemPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT); pOutlineViewShell->GetStatusBarState( aSet ); - OUString aLayoutName = ((SfxStringItem&)aSet.Get(SID_STATUS_LAYOUT)).GetValue(); + OUString aLayoutName = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue(); DBG_ASSERT(!aLayoutName.isEmpty(), "Layout not defined"); bool bUnique = false; @@ -147,12 +147,11 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); // Undo-Action StyleSheetUndoAction* pAction = new StyleSheetUndoAction - (mpDoc, (SfxStyleSheet*)pStyleSheet, - pOutSet); + (mpDoc, static_cast<SfxStyleSheet*>(pStyleSheet), pOutSet); mpDocSh->GetUndoManager()->AddUndoAction(pAction); pStyleSheet->GetItemSet().Put( *pOutSet ); - ( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); } } } diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx index 8b3269c3e34e..125ea0c4609f 100644 --- a/sd/source/ui/func/fuscale.cxx +++ b/sd/source/ui/func/fuscale.cxx @@ -142,11 +142,11 @@ void FuScale::DoExecute( SfxRequest& rReq ) if (!mpViewShell) return; - switch (((const SvxZoomItem &) aArgs.Get (SID_ATTR_ZOOM)).GetType ()) + switch (static_cast<const SvxZoomItem &>( aArgs.Get (SID_ATTR_ZOOM)).GetType ()) { case SVX_ZOOM_PERCENT: { - nValue = ((const SvxZoomItem &) aArgs.Get (SID_ATTR_ZOOM)).GetValue (); + nValue = static_cast<const SvxZoomItem &>( aArgs.Get (SID_ATTR_ZOOM)).GetValue (); mpViewShell->SetZoom( nValue ); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 0e3c0ded7220..0c1512560aec 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -1200,7 +1200,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) aSet.Put(pObj->GetMergedItemSet()); - const XFillStyleItem& rFillStyle = (const XFillStyleItem&) aSet.Get(XATTR_FILLSTYLE); + const XFillStyleItem& rFillStyle = static_cast<const XFillStyleItem&>( aSet.Get(XATTR_FILLSTYLE) ); bFilled = rFillStyle.GetValue() != drawing::FillStyle_NONE; } diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index ec78699c0555..8309219a8d31 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -36,7 +36,7 @@ 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() TYPEINIT1( FuSlideShowDlg, FuPoor ); diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx index 3fc967dd69d0..2ae7004eb922 100644 --- a/sd/source/ui/func/fusnapln.cxx +++ b/sd/source/ui/func/fusnapln.cxx @@ -163,8 +163,8 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) } Point aHlpPos; - aHlpPos.X() = ((const SfxInt32Item&) pArgs->Get(ATTR_SNAPLINE_X)).GetValue(); - aHlpPos.Y() = ((const SfxInt32Item&) pArgs->Get(ATTR_SNAPLINE_Y)).GetValue(); + aHlpPos.X() = static_cast<const SfxInt32Item&>( pArgs->Get(ATTR_SNAPLINE_X)).GetValue(); + aHlpPos.Y() = static_cast<const SfxInt32Item&>( pArgs->Get(ATTR_SNAPLINE_Y)).GetValue(); pPV->PagePosToLogic(aHlpPos); if ( bCreateNew ) @@ -173,7 +173,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq ) pPV = mpView->GetSdrPageView(); - switch ( (SnapKind) ((const SfxAllEnumItem&) + switch ( (SnapKind) static_cast<const SfxAllEnumItem&>( pArgs->Get(ATTR_SNAPLINE_KIND)).GetValue() ) { case SK_HORIZONTAL : eKind = SDRHELPLINE_HORIZONTAL; break; diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx index dc5283dcb2f5..3ec9524446ee 100644 --- a/sd/source/ui/func/fusumry.cxx +++ b/sd/source/ui/func/fusumry.cxx @@ -101,7 +101,7 @@ void FuSummaryPage::DoExecute( SfxRequest& ) if (nSelectedPages <= 1 || pActualPage->IsSelected()) { SdPage* pActualNotesPage = mpDoc->GetSdPage(i, PK_NOTES); - SdrTextObj* pTextObj = (SdrTextObj*) pActualPage->GetPresObj(PRESOBJ_TITLE); + SdrTextObj* pTextObj = static_cast<SdrTextObj*>( pActualPage->GetPresObj(PRESOBJ_TITLE) ); if (pTextObj && !pTextObj->IsEmptyPresObj()) { @@ -168,7 +168,7 @@ void FuSummaryPage::DoExecute( SfxRequest& ) pOutl->SetRefDevice(SD_MOD()->GetRefDevice( *mpDocSh )); pOutl->SetDefTab( mpDoc->GetDefaultTabulator() ); - pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool()); + pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(mpDoc->GetStyleSheetPool())); pStyle = pSummaryPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE ); pOutl->SetStyleSheet( 0, pStyle ); } @@ -188,7 +188,7 @@ void FuSummaryPage::DoExecute( SfxRequest& ) if (!pSummaryPage) return; - SdrTextObj* pTextObj = (SdrTextObj*) pSummaryPage->GetPresObj(PRESOBJ_OUTLINE); + SdrTextObj* pTextObj = static_cast<SdrTextObj*>( pSummaryPage->GetPresObj(PRESOBJ_OUTLINE) ); if (!pTextObj) return; diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 8d1f439bf4ca..5825eaa6aec1 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -108,12 +108,12 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY, false, &pItem )) { - nFamily = ( (const SfxUInt16Item &) pArgs->Get( SID_STYLE_FAMILY ) ).GetValue(); + nFamily = static_cast<const SfxUInt16Item &>( pArgs->Get( SID_STYLE_FAMILY ) ).GetValue(); } else if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME, false, &pItem )) { - OUString sFamily = ( (const SfxStringItem &) pArgs->Get( SID_STYLE_FAMILYNAME ) ).GetValue(); + OUString sFamily = static_cast<const SfxStringItem &>( pArgs->Get( SID_STYLE_FAMILYNAME ) ).GetValue(); if (sFamily == "graphics") nFamily = SD_STYLE_FAMILY_GRAPHICS; else @@ -155,7 +155,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) } if (pArgs && pArgs->GetItemState(nSId) == SfxItemState::SET) - aStyleName = ( ( (const SfxStringItem &) pArgs->Get( nSId ) ).GetValue() ); + aStyleName = static_cast<const SfxStringItem &>( pArgs->Get( nSId ) ).GetValue(); } } @@ -173,7 +173,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if (pArgs && pArgs->GetItemState(SID_STYLE_REFERENCE) == SfxItemState::SET) { - OUString aParentName(((const SfxStringItem&) pArgs->Get(SID_STYLE_REFERENCE)).GetValue()); + OUString aParentName(static_cast<const SfxStringItem&>( pArgs->Get(SID_STYLE_REFERENCE)).GetValue()); pStyleSheet->SetParent(aParentName); } else @@ -244,7 +244,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) // allow if old was presentation and we are a drawing document (pOldStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE && mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW) ) { - mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet); + mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet)); mpDoc->SetChanged(true); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 ); } @@ -257,14 +257,14 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { if (pArgs && pArgs->GetItemState( nSId ) == SfxItemState::SET) { - aStyleName = ( ( (const SfxStringItem &) pArgs->Get( nSId ) ).GetValue() ); + aStyleName = static_cast<const SfxStringItem &>( pArgs->Get( nSId ) ).GetValue(); SD_MOD()->SetWaterCan( true ); pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); } // no presentation object templates, they are only allowed implicitly if( pStyleSheet && pStyleSheet->GetFamily() != SD_STYLE_FAMILY_PSEUDO ) { - ( (SdStyleSheetPool*) pSSPool )->SetActualStyleSheet( pStyleSheet ); + static_cast<SdStyleSheetPool*>( pSSPool )->SetActualStyleSheet( pStyleSheet ); // we switch explicitly into selection mode mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_SELECT, @@ -399,7 +399,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if (eFamily == SD_STYLE_FAMILY_PSEUDO) { SfxItemSet aTempSet(*pOutSet); - ((SdStyleSheet*)pStyleSheet)->AdjustToFontHeight(aTempSet); + static_cast<SdStyleSheet*>(pStyleSheet)->AdjustToFontHeight(aTempSet); /* Special treatment: reset the INVALIDS to NULL-Pointer (otherwise INVALIDs or pointer point @@ -412,7 +412,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { if (aTempSet.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET) { - SvxNumRule aRule(*((SvxNumBulletItem*)aTempSet.GetItem(EE_PARA_NUMBULLET))->GetNumRule()); + SvxNumRule aRule(*static_cast<const SvxNumBulletItem*>(aTempSet.GetItem(EE_PARA_NUMBULLET))->GetNumRule()); OUString sStyleName(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE) + " 1"); SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( sStyleName, SD_STYLE_FAMILY_PSEUDO); @@ -420,7 +420,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if(pFirstStyleSheet) { pFirstStyleSheet->GetItemSet().Put( SvxNumBulletItem( aRule, EE_PARA_NUMBULLET )); - SdStyleSheet* pRealSheet = ((SdStyleSheet*)pFirstStyleSheet)->GetRealStyleSheet(); + SdStyleSheet* pRealSheet = static_cast<SdStyleSheet*>(pFirstStyleSheet)->GetRealStyleSheet(); pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } @@ -440,7 +440,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SfxItemState::SET ) { const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLBITMAP ); - SfxPoolItem* pNewItem = ((XFillBitmapItem*)pOldItem)->checkForUniqueItem( mpDoc ); + SfxPoolItem* pNewItem = static_cast<const XFillBitmapItem*>(pOldItem)->checkForUniqueItem( mpDoc ); if( pNewItem ) { rAttr.Put( *pNewItem ); @@ -450,7 +450,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( rAttr.GetItemState( XATTR_LINEDASH ) == SfxItemState::SET ) { const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEDASH ); - SfxPoolItem* pNewItem = ((XLineDashItem*)pOldItem)->checkForUniqueItem( mpDoc ); + SfxPoolItem* pNewItem = static_cast<const XLineDashItem*>(pOldItem)->checkForUniqueItem( mpDoc ); if( pNewItem ) { rAttr.Put( *pNewItem ); @@ -460,7 +460,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( rAttr.GetItemState( XATTR_LINESTART ) == SfxItemState::SET ) { const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINESTART ); - SfxPoolItem* pNewItem = ((XLineStartItem*)pOldItem)->checkForUniqueItem( mpDoc ); + SfxPoolItem* pNewItem = static_cast<const XLineStartItem*>(pOldItem)->checkForUniqueItem( mpDoc ); if( pNewItem ) { rAttr.Put( *pNewItem ); @@ -470,7 +470,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( rAttr.GetItemState( XATTR_LINEEND ) == SfxItemState::SET ) { const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEEND ); - SfxPoolItem* pNewItem = ((XLineEndItem*)pOldItem)->checkForUniqueItem( mpDoc ); + SfxPoolItem* pNewItem = static_cast<const XLineEndItem*>(pOldItem)->checkForUniqueItem( mpDoc ); if( pNewItem ) { rAttr.Put( *pNewItem ); @@ -480,7 +480,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( rAttr.GetItemState( XATTR_FILLGRADIENT ) == SfxItemState::SET ) { const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLGRADIENT ); - SfxPoolItem* pNewItem = ((XFillGradientItem*)pOldItem)->checkForUniqueItem( mpDoc ); + SfxPoolItem* pNewItem = static_cast<const XFillGradientItem*>(pOldItem)->checkForUniqueItem( mpDoc ); if( pNewItem ) { rAttr.Put( *pNewItem ); @@ -490,7 +490,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SfxItemState::SET ) { const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLFLOATTRANSPARENCE ); - SfxPoolItem* pNewItem = ((XFillFloatTransparenceItem*)pOldItem)->checkForUniqueItem( mpDoc ); + SfxPoolItem* pNewItem = static_cast<const XFillFloatTransparenceItem*>(pOldItem)->checkForUniqueItem( mpDoc ); if( pNewItem ) { rAttr.Put( *pNewItem ); @@ -500,7 +500,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) if( rAttr.GetItemState( XATTR_FILLHATCH ) == SfxItemState::SET ) { const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLHATCH ); - SfxPoolItem* pNewItem = ((XFillHatchItem*)pOldItem)->checkForUniqueItem( mpDoc ); + SfxPoolItem* pNewItem = static_cast<const XFillHatchItem*>(pOldItem)->checkForUniqueItem( mpDoc ); if( pNewItem ) { rAttr.Put( *pNewItem ); @@ -508,7 +508,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) } } - ( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpViewShell ); if( pDrawViewShell ) @@ -594,10 +594,10 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) templates on a character level. */ if (!mpView->GetTextEditObject()) { - mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet); + mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet)); } - ( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); mpDoc->SetChanged(true); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 ); @@ -622,9 +622,9 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) SfxItemSet* pStyleSet = &pStyleSheet->GetItemSet(); pStyleSet->Put( aCoreSet ); - mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet); + mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet)); - ( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); + static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); mpDoc->SetChanged(true); mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 ); } diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index be1ac08a9812..ace31a3954b3 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -237,7 +237,7 @@ void FuText::DoExecute( SfxRequest& ) && SID_TEXTEDIT == nSlotId && SfxItemState::SET == pArgs->GetItemState(SID_TEXTEDIT) - && (sal_uInt16)((SfxUInt16Item&)pArgs->Get(SID_TEXTEDIT)).GetValue() == 2) + && (sal_uInt16)static_cast<const SfxUInt16Item&>(pArgs->Get(SID_TEXTEDIT)).GetValue() == 2) { // Selection by doubleclick -> don't allow QuickDrag bQuickDrag = false; @@ -825,7 +825,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) // one of the defaulted setted items from ImpSetAttributesForNewTextObject // needs to be adapted to non-block mode. const SfxItemSet& rSet = mpView->GetDefaultAttr(); - SvxFrameDirection eDirection = (SvxFrameDirection)((SvxFrameDirectionItem&)rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); + SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); if(FRMDIR_HORI_RIGHT_TOP == eDirection || FRMDIR_VERT_TOP_RIGHT == eDirection) { @@ -845,7 +845,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) // Look in the object defaults if left-to-right is wanted. If // yes, set text anchoring to right to let the box grow to left. const SfxItemSet& rSet = mpView->GetDefaultAttr(); - SvxFrameDirection eDirection = (SvxFrameDirection)((SvxFrameDirectionItem&)rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); + SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); if(FRMDIR_HORI_RIGHT_TOP == eDirection) { @@ -1120,7 +1120,7 @@ bool FuText::DeleteDefaultText() if ( mxTextObj.is() && mxTextObj->IsEmptyPresObj() ) { - SdPage* pPage = (SdPage*) mxTextObj->GetPage(); + SdPage* pPage = static_cast<SdPage*>( mxTextObj->GetPage() ); if (pPage) { @@ -1177,7 +1177,7 @@ bool FuText::RequestHelp(const HelpEvent& rHEvt) if (pField && pField->ISA(SvxURLField)) { // URL-Field - aHelpText = INetURLObject::decode( ((const SvxURLField*)pField)->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET ); + aHelpText = INetURLObject::decode( static_cast<const SvxURLField*>(pField)->GetURL(), '%', INetURLObject::DECODE_WITH_CHARSET ); } if (!aHelpText.isEmpty()) { @@ -1262,7 +1262,7 @@ void FuText::ReceiveRequest(SfxRequest& rReq) && SID_TEXTEDIT == nSlotId && SfxItemState::SET == pArgs->GetItemState(SID_TEXTEDIT) - && (sal_uInt16) ((SfxUInt16Item&) pArgs->Get(SID_TEXTEDIT)).GetValue() == 2) + && (sal_uInt16) static_cast<const SfxUInt16Item&>( pArgs->Get(SID_TEXTEDIT)).GetValue() == 2) { // selection wit double click -> do not allow QuickDrag bQuickDrag = false; @@ -1291,7 +1291,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR { if(pObj->ISA(SdrTextObj)) { - SdrTextObj* pText = (SdrTextObj*)pObj; + SdrTextObj* pText = static_cast<SdrTextObj*>(pObj); pText->SetLogicRect(rRectangle); bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID); diff --git a/sd/source/ui/func/futhes.cxx b/sd/source/ui/func/futhes.cxx index a6c1fb9d6d75..7ce18a54100b 100644 --- a/sd/source/ui/func/futhes.cxx +++ b/sd/source/ui/func/futhes.cxx @@ -85,7 +85,7 @@ void FuThesaurus::DoExecute( SfxRequest& ) if ( pObj->ISA(SdrTextObj) ) { - pTextObj = (SdrTextObj*) pObj; + pTextObj = static_cast<SdrTextObj*>(pObj); } } } diff --git a/sd/source/ui/func/fuvect.cxx b/sd/source/ui/func/fuvect.cxx index 97e880521f63..798639c89030 100644 --- a/sd/source/ui/func/fuvect.cxx +++ b/sd/source/ui/func/fuvect.cxx @@ -64,7 +64,7 @@ void FuVectorize::DoExecute( SfxRequest& ) if( pObj && pObj->ISA( SdrGrafObj ) ) { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - boost::scoped_ptr<AbstractSdVectorizeDlg> pDlg(pFact ? pFact->CreateSdVectorizeDlg( mpWindow, ( (SdrGrafObj*) pObj )->GetGraphic().GetBitmap(), mpDocSh ) : 0); + boost::scoped_ptr<AbstractSdVectorizeDlg> pDlg(pFact ? pFact->CreateSdVectorizeDlg( mpWindow, static_cast<SdrGrafObj*>( pObj )->GetGraphic().GetBitmap(), mpDocSh ) : 0); if( pDlg && pDlg->Execute() == RET_OK ) { const GDIMetaFile& rMtf = pDlg->GetGDIMetaFile(); @@ -72,7 +72,7 @@ void FuVectorize::DoExecute( SfxRequest& ) if( pPageView && rMtf.GetActionSize() ) { - SdrGrafObj* pVectObj = (SdrGrafObj*) pObj->Clone(); + SdrGrafObj* pVectObj = static_cast<SdrGrafObj*>( pObj->Clone() ); OUString aStr( mpView->GetDescriptionOfMarkedObjects() ); aStr += " " + SD_RESSTR( STR_UNDO_VECTORIZE ); mpView->BegUndo( aStr ); diff --git a/sd/source/ui/func/undopage.cxx b/sd/source/ui/func/undopage.cxx index 70348204a8d7..3f3401bf20bd 100644 --- a/sd/source/ui/func/undopage.cxx +++ b/sd/source/ui/func/undopage.cxx @@ -51,7 +51,7 @@ void SdPageFormatUndoAction::Undo() mpPage->SetBackgroundFullSize( mbOldFullSize ); if( !mpPage->IsMasterPage() ) - ( (SdPage&) mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbOldFullSize ); + static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbOldFullSize ); } @@ -69,7 +69,7 @@ void SdPageFormatUndoAction::Redo() mpPage->SetBackgroundFullSize( mbNewFullSize ); if( !mpPage->IsMasterPage() ) - ( (SdPage&) mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbNewFullSize ); + static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbNewFullSize ); } diff --git a/sd/source/ui/func/unoaprms.cxx b/sd/source/ui/func/unoaprms.cxx index 08bf3e05c4ad..e777fb1a2692 100644 --- a/sd/source/ui/func/unoaprms.cxx +++ b/sd/source/ui/func/unoaprms.cxx @@ -28,7 +28,7 @@ void SdAnimationPrmsUndoAction::Undo() // no new info created: restore data if (!bInfoCreated) { - SdDrawDocument* pDoc = (SdDrawDocument*)pObject->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(pObject->GetModel()); if( pDoc ) { SdAnimationInfo* pInfo = pDoc->GetAnimationInfo( pObject ); diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx index e0c70e2c3e2f..9ec4fb202926 100644 --- a/sd/source/ui/inc/unopage.hxx +++ b/sd/source/ui/inc/unopage.hxx @@ -97,7 +97,7 @@ public: // intern bool isValid() { return (SvxDrawPage::mpPage != NULL) && (mpModel != NULL); } - SdPage* GetPage() const { return (SdPage*)SvxDrawPage::mpPage; } + SdPage* GetPage() const { return static_cast<SdPage*>(SvxDrawPage::mpPage); } SdXImpressDocument* GetModel() const; static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index 75e6a6cc05eb..82af6de95587 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -490,7 +490,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) std::max( aOutOrg.Y() + aOutSize.Height() - aGrfSize.Height() - aOffset.Height(), aOutOrg.Y() ) ); if( maLogo.IsAnimated() ) - maLogo.StartAnimation( this, aGrfPos, aGrfSize, (sal_IntPtr) this ); + maLogo.StartAnimation( this, aGrfPos, aGrfSize, reinterpret_cast<sal_IntPtr>(this) ); else maLogo.Draw( this, aGrfPos, aGrfSize ); } diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 1b9cdd43b2dd..3f6c6cab1714 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2696,7 +2696,7 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq) case SID_NAVIGATOR_PAGE: { - PageJump eJump = (PageJump)((SfxAllEnumItem&) pArgs->Get(SID_NAVIGATOR_PAGE)).GetValue(); + PageJump eJump = (PageJump)static_cast<const SfxAllEnumItem&>( pArgs->Get(SID_NAVIGATOR_PAGE)).GetValue(); switch( eJump ) { case PAGE_FIRST: gotoFirstSlide(); break; @@ -2710,7 +2710,7 @@ void SlideshowImpl::receiveRequest(SfxRequest& rReq) case SID_NAVIGATOR_OBJECT: { - const OUString aTarget( ((SfxStringItem&) pArgs->Get(SID_NAVIGATOR_OBJECT)).GetValue() ); + const OUString aTarget( static_cast<const SfxStringItem&>(pArgs->Get(SID_NAVIGATOR_OBJECT)).GetValue() ); // is the bookmark a Slide? bool bIsMasterPage; diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx index e8b387244b80..bfc098d0bac9 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx @@ -81,7 +81,7 @@ class CacheEntry; class CacheHash { public: size_t operator()(const BitmapCache::CacheKey& p) const - { return (size_t)p; } + { return reinterpret_cast<size_t>(p); } }; class BitmapCache::CacheBitmapContainer diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx index 69cdad364e3b..23abe792dd6f 100644 --- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx +++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx @@ -50,7 +50,7 @@ public: } }; /// Hash function that takes all members into account. class Hash {public: size_t operator() (const CacheDescriptor& rDescriptor) const { - return (size_t)rDescriptor.mpDocument.get() + rDescriptor.maPreviewSize.Width(); + return reinterpret_cast<size_t>(rDescriptor.mpDocument.get()) + rDescriptor.maPreviewSize.Width(); } }; }; diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index f633a4fe8ae5..9638e610656b 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -327,7 +327,7 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition) else { SfxObjectShell* pShell = pClipTransferable->GetDocShell(); - DrawDocShell* pDataDocSh = (DrawDocShell*)pShell; + DrawDocShell* pDataDocSh = static_cast<DrawDocShell*>(pShell); SdDrawDocument* pDataDoc = pDataDocSh->GetDoc(); if (pDataDoc!=NULL diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 331210a48e7d..455c800e0fde 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -724,7 +724,7 @@ void SlotManager::GetClipboardState ( SfxItemSet& rSet) { SfxObjectShell* pTransferDocShell = pTransferClip->GetDocShell(); - if( !pTransferDocShell || ( (DrawDocShell*) pTransferDocShell)->GetDoc()->GetPageCount() <= 1 ) + if( !pTransferDocShell || static_cast<DrawDocShell*>(pTransferDocShell)->GetDoc()->GetPageCount() <= 1 ) { bool bIsPastingSupported (false); diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx index b044d0b65710..c8f1c76553d7 100644 --- a/sd/source/ui/unoidl/unocpres.cxx +++ b/sd/source/ui/unoidl/unocpres.cxx @@ -112,7 +112,7 @@ void SAL_CALL SdXCustomPresentation::insertByIndex( sal_Int32 Index, const uno:: mpSdCustomShow = new SdCustomShow( mpModel->GetDoc() ); mpSdCustomShow->PagesVector().insert(mpSdCustomShow->PagesVector().begin() + Index, - (SdPage*) pPage->GetSdrPage()); + static_cast<SdPage*>(pPage->GetSdrPage())); } if( mpModel ) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 34becc4195c9..b461f8751787 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -486,7 +486,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) follows. */ sal_uInt16 nStandardPageNum = pPreviousStandardPage->GetPageNum() + 2; - SdPage* pPreviousNotesPage = (SdPage*) mpDoc->GetPage( nStandardPageNum - 1 ); + SdPage* pPreviousNotesPage = static_cast<SdPage*>( mpDoc->GetPage( nStandardPageNum - 1 ) ); sal_uInt16 nNotesPageNum = nStandardPageNum + 1; OUString aStandardPageName; OUString aNotesPageName; @@ -495,7 +495,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) * standard page **************************************************************/ if( bDuplicate ) - pStandardPage = (SdPage*) pPreviousStandardPage->Clone(); + pStandardPage = static_cast<SdPage*>( pPreviousStandardPage->Clone() ); else pStandardPage = mpDoc->AllocSdPage(false); @@ -530,7 +530,7 @@ SdPage* SdXImpressDocument::InsertSdPage( sal_uInt16 nPage, bool bDuplicate ) SdPage* pNotesPage = NULL; if( bDuplicate ) - pNotesPage = (SdPage*) pPreviousNotesPage->Clone(); + pNotesPage = static_cast<SdPage*>( pPreviousNotesPage->Clone() ); else pNotesPage = mpDoc->AllocSdPage(false); @@ -689,7 +689,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::duplicate( con SvxDrawPage* pSvxPage = SvxDrawPage::getImplementation( xPage ); if( pSvxPage ) { - SdPage* pPage = (SdPage*) pSvxPage->GetSdrPage(); + SdPage* pPage = static_cast<SdPage*>( pSvxPage->GetSdrPage() ); sal_uInt16 nPos = pPage->GetPageNum(); nPos = ( nPos - 1 ) / 2; pPage = InsertSdPage( nPos, true ); @@ -1381,7 +1381,7 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property { if( 0 != (pItem = rPool.GetItem2( nWhichId, j ) ) ) { - const SvxFontItem *pFont = (const SvxFontItem *)pItem; + const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); aSeq[nSeqIndex++] <<= OUString(pFont->GetFamilyName()); aSeq[nSeqIndex++] <<= OUString(pFont->GetStyleName()); @@ -1391,7 +1391,7 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property } } - const SvxFontItem& rFont = (const SvxFontItem&)rPool.GetDefaultItem( nWhichId ); + const SvxFontItem& rFont = static_cast<const SvxFontItem&>(rPool.GetDefaultItem( nWhichId )); aSeq[nSeqIndex++] <<= OUString(rFont.GetFamilyName()); aSeq[nSeqIndex++] <<= OUString(rFont.GetStyleName()); @@ -1765,7 +1765,7 @@ vcl::PDFWriter::StructElement ImplRenderPaintProc::ImplBegStructureTag( SdrObjec eElement = vcl::PDFWriter::Heading; else if ( nIdentifier == OBJ_OUTLINETEXT ) eElement = vcl::PDFWriter::Division; - else if ( !bIsTextObj || !((SdrTextObj&)rObject).HasText() ) + else if ( !bIsTextObj || !static_cast<SdrTextObj&>(rObject).HasText() ) eElement = vcl::PDFWriter::Figure; } } @@ -1926,7 +1926,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r pPV, pPDFExtOutDevData ); // background color for outliner :o - SdPage* pPage = pPV ? (SdPage*)pPV->GetPage() : NULL; + SdPage* pPage = pPV ? static_cast<SdPage*>(pPV->GetPage()) : NULL; if( pPage ) { SdrOutliner& rOutl = mpDoc->GetDrawOutliner( NULL ); @@ -2664,7 +2664,7 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag SdDrawPage* pSvxPage = SdDrawPage::getImplementation( xPage ); if( pSvxPage ) { - SdPage* pPage = (SdPage*) pSvxPage->GetSdrPage(); + SdPage* pPage = static_cast<SdPage*>(pSvxPage->GetSdrPage()); if(pPage && ( pPage->GetPageKind() == PK_STANDARD ) ) { sal_uInt16 nPage = pPage->GetPageNum(); @@ -2846,7 +2846,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn bUnique = true; for( sal_Int32 nMaster = 1; nMaster < nMPageCount; nMaster++ ) { - SdPage* pPage = (SdPage*)mpDoc->GetMasterPage((sal_uInt16)nMaster); + SdPage* pPage = static_cast<SdPage*>(mpDoc->GetMasterPage((sal_uInt16)nMaster)); if( pPage && pPage->GetName() == aPrefix ) { bUnique = false; @@ -2867,7 +2867,7 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdMasterPagesAccess::insertNewByIn aLayoutName += SD_RESSTR(STR_LAYOUT_OUTLINE); // create styles - ((SdStyleSheetPool*)mpDoc->GetStyleSheetPool())->CreateLayoutStyleSheets( aPrefix ); + static_cast<SdStyleSheetPool*>(mpDoc->GetStyleSheetPool())->CreateLayoutStyleSheets( aPrefix ); // get the first page for initial size and border settings SdPage* pPage = mpModel->mpDoc->GetSdPage( (sal_uInt16)0, PK_STANDARD ); @@ -3080,11 +3080,11 @@ uno::Sequence< OUString > SAL_CALL SdDocLinkTargets::getElementNames() sal_uInt16 nPage; // standard pages for( nPage = 0; nPage < nMaxPages; nPage++ ) - *pStr++ = ((SdPage*)mpDoc->GetPage( nPage ))->GetName(); + *pStr++ = static_cast<SdPage*>(mpDoc->GetPage( nPage ))->GetName(); // master pages for( nPage = 0; nPage < nMaxMasterPages; nPage++ ) - *pStr++ = ((SdPage*)mpDoc->GetMasterPage( nPage ))->GetName(); + *pStr++ = static_cast<SdPage*>(mpDoc->GetMasterPage( nPage ))->GetName(); return aSeq; } } @@ -3137,7 +3137,7 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw() // standard pages for( nPage = 0; nPage < nMaxPages; nPage++ ) { - pPage = (SdPage*)mpDoc->GetPage( nPage ); + pPage = static_cast<SdPage*>(mpDoc->GetPage( nPage )); if( (pPage->GetName() == aName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) ) return pPage; } @@ -3145,7 +3145,7 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw() // master pages for( nPage = 0; nPage < nMaxMasterPages; nPage++ ) { - pPage = (SdPage*)mpDoc->GetMasterPage( nPage ); + pPage = static_cast<SdPage*>(mpDoc->GetMasterPage( nPage )); if( (pPage->GetName() == aName) && (!bDraw || (pPage->GetPageKind() == PK_STANDARD)) ) return pPage; } diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index c124631157ea..94cde9c233b0 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -435,7 +435,7 @@ uno::Any SAL_CALL SdXShape::getPropertyDefault( const OUString& aPropertyName ) ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL SdXShape::getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException) { - sal_uIntPtr nObjId = (sal_uIntPtr)mpShape->getPropertyMapEntries(); + sal_uIntPtr nObjId = reinterpret_cast<sal_uIntPtr>(mpShape->getPropertyMapEntries()); SfxExtItemPropertySetInfo* pInfo = NULL; SdExtPropertySetInfoCache* pCache = (mpModel && mpModel->IsImpressDocument()) ? @@ -993,7 +993,7 @@ void SdXShape::SetEmptyPresObj(bool bEmpty) // really delete SdrOutlinerObj at pObj pObj->NbcSetOutlinerParaObject(0L); if( bVertical && PTR_CAST( SdrTextObj, pObj ) ) - ((SdrTextObj*)pObj)->SetVerticalWriting( true ); + static_cast<SdrTextObj*>(pObj)->SetVerticalWriting( true ); SdrGrafObj* pGraphicObj = PTR_CAST( SdrGrafObj, pObj ); if( pGraphicObj ) @@ -1038,7 +1038,7 @@ void SdXShape::SetEmptyPresObj(bool bEmpty) pOutliner->Clear(); pOutliner->SetVertical( bVertical ); - pOutliner->SetStyleSheetPool( (SfxStyleSheetPool*)pDoc->GetStyleSheetPool() ); + pOutliner->SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(pDoc->GetStyleSheetPool()) ); pOutliner->SetStyleSheet( 0, pPage->GetTextStyleSheetForObject( pObj ) ); pOutliner->Insert( pPage->GetPresObjText( pPage->GetPresObjKind(pObj) ) ); pObj->SetOutlinerParaObject( pOutliner->CreateParaObject() ); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 1ab438f0e03e..589e45bf3761 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -399,7 +399,7 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap SdrObject* pObj = SvxFmDrawPage::_CreateSdrObject( xShape ); if( pObj && ( (pObj->GetObjInventor() != SdrInventor) || (pObj->GetObjIdentifier() != OBJ_PAGE) ) ) { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); if( pDoc ) { // #i119287# similar to the code in the SdrObject methods the graphic and ole @@ -511,7 +511,7 @@ SdrObject * SdGenericDrawPage::_CreateSdrObject( const Reference< drawing::XShap pPresObj = SvxFmDrawPage::_CreateSdrObject( xShape ); if( pPresObj ) { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); if( pDoc ) pPresObj->NbcSetStyleSheet( pDoc->GetDefaultStyleSheet(), true ); GetPage()->InsertPresObj( pPresObj, eObjKind ); @@ -686,7 +686,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if( eOri != GetPage()->GetOrientation() ) { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); const PageKind ePageKind = GetPage()->GetPageKind(); sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind); @@ -782,7 +782,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName SdrPage* pPage = GetPage(); if( pPage ) { - SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(pPage->GetModel()); if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); @@ -802,7 +802,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName SdrPage* pPage = GetPage(); if( pPage ) { - SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(pPage->GetModel()); if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); @@ -1096,7 +1096,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) break; case WID_PAGE_PREVIEW : { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); if ( pDoc ) { ::sd::DrawDocShell* pDocShell = pDoc->GetDocSh(); @@ -1133,7 +1133,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) case WID_PAGE_PREVIEWBITMAP : { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); if ( pDoc ) { ::sd::DrawDocShell* pDocShell = pDoc->GetDocSh(); @@ -1200,7 +1200,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) SdrPage* pPage = GetPage(); if( pPage ) { - SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(pPage->GetModel()); if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); @@ -1219,7 +1219,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) SdrPage* pPage = GetPage(); if( pPage ) { - SdDrawDocument* pDoc = (SdDrawDocument*)pPage->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(pPage->GetModel()); if( pDoc->GetMasterPageCount() ) { SdrLayerAdmin& rLayerAdmin = pDoc->GetLayerAdmin(); @@ -1681,7 +1681,7 @@ void SdGenericDrawPage::SetLftBorder( sal_Int32 nValue ) { if( nValue != GetPage()->GetLftBorder() ) { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); const PageKind ePageKind = GetPage()->GetPageKind(); sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind); @@ -1705,7 +1705,7 @@ void SdGenericDrawPage::SetRgtBorder( sal_Int32 nValue ) { if( nValue != GetPage()->GetRgtBorder() ) { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); const PageKind ePageKind = GetPage()->GetPageKind(); sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind); @@ -1729,7 +1729,7 @@ void SdGenericDrawPage::SetUppBorder( sal_Int32 nValue ) { if( nValue != GetPage()->GetUppBorder() ) { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); const PageKind ePageKind = GetPage()->GetPageKind(); sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind); @@ -1753,7 +1753,7 @@ void SdGenericDrawPage::SetLwrBorder( sal_Int32 nValue ) { if( nValue != GetPage()->GetLwrBorder() ) { - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); const PageKind ePageKind = GetPage()->GetPageKind(); sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind); @@ -1808,7 +1808,7 @@ void SdGenericDrawPage::SetWidth( sal_Int32 nWidth ) { aSize.setWidth( nWidth ); - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); const PageKind ePageKind = GetPage()->GetPageKind(); sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind); @@ -1837,7 +1837,7 @@ void SdGenericDrawPage::SetHeight( sal_Int32 nHeight ) { aSize.setHeight( nHeight ); - SdDrawDocument* pDoc = (SdDrawDocument*)GetPage()->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(GetPage()->GetModel()); const PageKind ePageKind = GetPage()->GetPageKind(); sal_uInt16 i, nPageCnt = pDoc->GetMasterSdPageCount(ePageKind); @@ -2386,7 +2386,7 @@ void SAL_CALL SdDrawPage::setMasterPage( const Reference< drawing::XDrawPage >& { SvxFmDrawPage::mpPage->TRG_ClearMasterPage(); - SdPage* pSdPage = (SdPage*) pMasterPage->GetSdrPage(); + SdPage* pSdPage = static_cast<SdPage*>(pMasterPage->GetSdrPage()); SvxFmDrawPage::mpPage->TRG_SetMasterPage(*pSdPage); SvxFmDrawPage::mpPage->SetBorder(pSdPage->GetLftBorder(),pSdPage->GetUppBorder(), @@ -2394,7 +2394,7 @@ void SAL_CALL SdDrawPage::setMasterPage( const Reference< drawing::XDrawPage >& SvxFmDrawPage::mpPage->SetSize( pSdPage->GetSize() ); SvxFmDrawPage::mpPage->SetOrientation( pSdPage->GetOrientation() ); - ((SdPage*)SvxFmDrawPage::mpPage)->SetLayoutName( ( (SdPage*)pSdPage )->GetLayoutName() ); + static_cast<SdPage*>(SvxFmDrawPage::mpPage)->SetLayoutName( ( (SdPage*)pSdPage )->GetLayoutName() ); // set notes master also SdPage* pNotesPage = GetModel()->GetDoc()->GetSdPage( (SvxFmDrawPage::mpPage->GetPageNum()-1)>>1, PK_NOTES ); @@ -2506,7 +2506,7 @@ void SdDrawPage::setBackground( const Any& rValue ) if( pBack ) { - pBack->fillItemSet( (SdDrawDocument*)GetPage()->GetModel(), aSet ); + pBack->fillItemSet( static_cast<SdDrawDocument*>(GetPage()->GetModel()), aSet ); } else { @@ -2530,7 +2530,7 @@ void SdDrawPage::setBackground( const Any& rValue ) pProp++; } - pBackground->fillItemSet( (SdDrawDocument*)GetPage()->GetModel(), aSet ); + pBackground->fillItemSet( static_cast<SdDrawDocument*>(GetPage()->GetModel()), aSet ); } if( aSet.Count() == 0 ) @@ -2574,7 +2574,7 @@ void SdDrawPage::getBackground( Any& rValue ) throw() { const SfxItemSet& rFillAttributes = GetPage()->getSdrPageProperties().GetItemSet(); - if(drawing::FillStyle_NONE == ((const XFillStyleItem&)rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(rFillAttributes.Get(XATTR_FILLSTYLE)).GetValue()) { // no fill set (switched off by drawing::FillStyle_NONE), clear rValue to represent this rValue.clear(); @@ -2796,7 +2796,7 @@ Sequence< OUString > SAL_CALL SdMasterPage::getSupportedServiceNames() throw(uno Sequence< OUString > aSeq( SdGenericDrawPage::getSupportedServiceNames() ); comphelper::ServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.drawing.MasterPage" ); - if( SvxFmDrawPage::mpPage && ((SdPage*)SvxFmDrawPage::mpPage)->GetPageKind() == PK_HANDOUT ) + if( SvxFmDrawPage::mpPage && static_cast<SdPage*>(SvxFmDrawPage::mpPage)->GetPageKind() == PK_HANDOUT ) comphelper::ServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.presentation.HandoutMasterPage" ); return aSeq; @@ -2898,7 +2898,7 @@ void SdMasterPage::setBackground( const Any& rValue ) if( pBack ) { - pBack->fillItemSet( (SdDrawDocument*)GetPage()->GetModel(), aSet ); + pBack->fillItemSet( static_cast<SdDrawDocument*>(GetPage()->GetModel()), aSet ); } else { @@ -2921,11 +2921,11 @@ void SdMasterPage::setBackground( const Any& rValue ) pProp++; } - pBackground->fillItemSet( (SdDrawDocument*)SvxFmDrawPage::mpPage->GetModel(), aSet ); + pBackground->fillItemSet( static_cast<SdDrawDocument*>(SvxFmDrawPage::mpPage->GetModel()), aSet ); } // if we find the background style, copy the set to the background - SdDrawDocument* pDoc = (SdDrawDocument*)SvxFmDrawPage::mpPage->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(SvxFmDrawPage::mpPage->GetModel()); SfxStyleSheetBasePool* pSSPool = (SfxStyleSheetBasePool*)pDoc->GetStyleSheetPool(); if(pSSPool) { @@ -2969,7 +2969,7 @@ void SdMasterPage::getBackground( Any& rValue ) throw() } else { - SdDrawDocument* pDoc = (SdDrawDocument*)SvxFmDrawPage::mpPage->GetModel(); + SdDrawDocument* pDoc = static_cast<SdDrawDocument*>(SvxFmDrawPage::mpPage->GetModel()); SfxStyleSheetBasePool* pSSPool = (SfxStyleSheetBasePool*)pDoc->GetStyleSheetPool(); if(pSSPool) { @@ -2993,7 +2993,7 @@ void SdMasterPage::getBackground( Any& rValue ) throw() // should NOT happen and is an error const SfxItemSet& rFallbackItemSet(SvxFmDrawPage::mpPage->getSdrPageProperties().GetItemSet()); - if(drawing::FillStyle_NONE == ((const XFillStyleItem&)rFallbackItemSet.Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(rFallbackItemSet.Get(XATTR_FILLSTYLE)).GetValue()) { rValue <<= Reference< beans::XPropertySet >( new SdUnoPageBackground(GetModel()->GetDoc(), &rFallbackItemSet)); diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index cb85fd959d62..f9b2cccadbe0 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -286,8 +286,8 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert { if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { - XFillBmpStretchItem* pStretchItem = (XFillBmpStretchItem*)mpSet->GetItem(XATTR_FILLBMP_STRETCH); - XFillBmpTileItem* pTileItem = (XFillBmpTileItem*)mpSet->GetItem(XATTR_FILLBMP_TILE); + const XFillBmpStretchItem* pStretchItem = static_cast<const XFillBmpStretchItem*>(mpSet->GetItem(XATTR_FILLBMP_STRETCH)); + const XFillBmpTileItem* pTileItem = static_cast<const XFillBmpTileItem*>(mpSet->GetItem(XATTR_FILLBMP_TILE)); if( pStretchItem && pTileItem ) { |