diff options
Diffstat (limited to 'sd')
42 files changed, 263 insertions, 265 deletions
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 141db84478c1..bf988624c430 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -449,7 +449,7 @@ void SdImportTest::testFdo72998() { SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>(pPage->GetObj(2)); CPPUNIT_ASSERT( pObj ); - const SdrCustomShapeGeometryItem& rGeometryItem = (const SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); + const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); const ::com::sun::star::uno::Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( OUString( "ViewBox" ) ); CPPUNIT_ASSERT_MESSAGE( "Missing ViewBox", pViewBox ); com::sun::star::awt::Rectangle aViewBox; diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 8861fed4243e..4bf6e91542ab 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1272,7 +1272,7 @@ void PPTWriter::ImplWriteOLE( ) SdrObject* pSdrObj = GetSdrObjectFromXShape( pPtr->xShape ); if ( pSdrObj && pSdrObj->ISA( SdrOle2Obj ) ) { - ::uno::Reference < embed::XEmbeddedObject > xObj( ( (SdrOle2Obj*) pSdrObj )->GetObjRef() ); + ::uno::Reference < embed::XEmbeddedObject > xObj( static_cast<SdrOle2Obj*>(pSdrObj)->GetObjRef() ); if( xObj.is() ) { SvStorageRef xTempStorage( new SvStorage( new SvMemoryStream(), true ) ); diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index 1e17c096a696..2ec0569d8128 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -540,7 +540,7 @@ bool PPTWriterBase::GetStyleSheets() ? (sal_uInt16)( *(sal_Int32*)mAny.getValue() / 4.40972 ) : 1250; - maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, (PPTExBulletProvider&)*this ) ); + maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, *dynamic_cast<PPTExBulletProvider*>(this) ) ); SetCurrentStyleSheet( nPageNum ); if ( GetPageByIndex( nPageNum, MASTER ) ) aXNamed = Reference< XNamed > diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 0429ecfbe769..5f0faeb0f9cc 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -549,7 +549,7 @@ bool ImplSdPPTImport::Import() for ( sal_uInt16 nMasterNum = 0; nMasterNum < nMasterAnz; nMasterNum++ ) { SetPageNum( nMasterNum, PPT_MASTERPAGE ); - SdPage* pPage = (SdPage*)MakeBlancPage( true ); + SdPage* pPage = static_cast<SdPage*>(MakeBlancPage( true )); if ( pPage ) { bool bNotesMaster = (*GetPageList( eAktPageKind ) )[ nAktPageNum ].bNotesMaster; @@ -571,7 +571,7 @@ bool ImplSdPPTImport::Import() if ( nMasterNum == 1 ) { // standardsheet - pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_STANDARD_STYLESHEET_NAME), SD_STYLE_FAMILY_GRAPHICS ); + pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_STANDARD_STYLESHEET_NAME), SD_STYLE_FAMILY_GRAPHICS )); if ( pSheet ) { SfxItemSet& rItemSet = pSheet->GetItemSet(); @@ -584,7 +584,7 @@ bool ImplSdPPTImport::Import() } // PSEUDO - pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_PSEUDOSHEET_BACKGROUNDOBJECTS), SD_STYLE_FAMILY_PSEUDO ); + pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_PSEUDOSHEET_BACKGROUNDOBJECTS), SD_STYLE_FAMILY_PSEUDO )); if ( pSheet ) { SfxItemSet& rItemSet = pSheet->GetItemSet(); @@ -605,10 +605,10 @@ bool ImplSdPPTImport::Import() { // standard page: create new presentation layout aLayoutName = SD_RESSTR( STR_LAYOUT_DEFAULT_TITLE_NAME ); aLayoutName += OUString::number( (sal_Int32)( ( nMasterNum + 1 ) / 2 - 1 ) ); - ( (SdStyleSheetPool*)mpDoc->GetStyleSheetPool() )->CreateLayoutStyleSheets( aLayoutName ); + static_cast<SdStyleSheetPool*>( mpDoc->GetStyleSheetPool() )->CreateLayoutStyleSheets( aLayoutName ); } else // note page: use presentation layout of standard page - aLayoutName = ( (SdPage*)mpDoc->GetMasterPage( nMasterNum - 1 ) )->GetName(); + aLayoutName = static_cast<SdPage*>( mpDoc->GetMasterPage( nMasterNum - 1 ) )->GetName(); } pPage->SetName( aLayoutName ); aLayoutName += SD_LT_SEPARATOR; @@ -650,7 +650,7 @@ bool ImplSdPPTImport::Import() OUString aName( pPage->GetLayoutName() ); aName += " "; aName += OUString::number( nLevel + 1 ); - SfxStyleSheet* pOutlineSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE ); + SfxStyleSheet* pOutlineSheet = static_cast<SfxStyleSheet*>( mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE ) ); DBG_ASSERT( pOutlineSheet, "Template for outline object not found" ); if ( pOutlineSheet ) { @@ -698,7 +698,7 @@ bool ImplSdPPTImport::Import() } SdPage* pMPage; sal_uInt16 i; - for ( i = 0; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ ) + for ( i = 0; i < mpDoc->GetMasterPageCount() && ( (pMPage = static_cast<SdPage*>(mpDoc->GetMasterPage( i ))) != 0 ); i++ ) { SetPageNum( i, PPT_MASTERPAGE ); @@ -711,13 +711,13 @@ bool ImplSdPPTImport::Import() if ( pPersist->bStarDrawFiller && pPersist->bNotesMaster && ( nAktPageNum > 2 ) && ( ( nAktPageNum & 1 ) == 0 ) ) { pSdrModel->DeleteMasterPage( nAktPageNum ); - SdrPage* pNotesClone = ((SdPage*)pSdrModel->GetMasterPage( 2 ))->Clone(); + SdrPage* pNotesClone = static_cast<SdPage*>(pSdrModel->GetMasterPage( 2 ))->Clone(); pSdrModel->InsertMasterPage( pNotesClone, nAktPageNum ); if ( pNotesClone ) { - OUString aLayoutName( ((SdPage*)pSdrModel->GetMasterPage( nAktPageNum - 1 ))->GetLayoutName() ); - ((SdPage*)pNotesClone)->SetPresentationLayout( aLayoutName, false, false, false ); - ((SdPage*)pNotesClone)->SetLayoutName( aLayoutName ); + OUString aLayoutName( static_cast<SdPage*>(pSdrModel->GetMasterPage( nAktPageNum - 1 ))->GetLayoutName() ); + static_cast<SdPage*>(pNotesClone)->SetPresentationLayout( aLayoutName, false, false, false ); + static_cast<SdPage*>(pNotesClone)->SetLayoutName( aLayoutName ); } } else if ( pPersist->bStarDrawFiller == false ) @@ -862,7 +862,7 @@ bool ImplSdPPTImport::Import() PptPageKind ePageKind = eAktPageKind; sal_uInt16 nPageNum = nAktPageNum; - SdPage* pHandoutPage = (SdPage*)MakeBlancPage( false ); + SdPage* pHandoutPage = static_cast<SdPage*>(MakeBlancPage( false )); pHandoutPage->SetPageKind( PK_HANDOUT ); pSdrModel->InsertPage( pHandoutPage ); @@ -875,7 +875,7 @@ bool ImplSdPPTImport::Import() mePresChange = PRESCHANGE_SEMIAUTO; SetPageNum( nPage, PPT_SLIDEPAGE ); - SdPage* pPage = (SdPage*)MakeBlancPage( false ); + SdPage* pPage = static_cast<SdPage*>(MakeBlancPage( false )); PptSlidePersistEntry* pMasterPersist = NULL; if ( HasMasterPage( nPage, PPT_SLIDEPAGE ) ) // try to get the LayoutName from the masterpage { @@ -884,7 +884,7 @@ bool ImplSdPPTImport::Import() PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE ); if ( pPageList && nMasterNum < pPageList->size() ) pMasterPersist = &(*pPageList)[ nMasterNum ]; - pPage->SetLayoutName(((SdPage&)pPage->TRG_GetMasterPage()).GetLayoutName()); + pPage->SetLayoutName(static_cast<SdPage&>(pPage->TRG_GetMasterPage()).GetLayoutName()); } pPage->SetPageKind( PK_STANDARD ); pSdrModel->InsertPage( pPage ); // SJ: #i29625# because of form controls, the @@ -946,7 +946,7 @@ bool ImplSdPPTImport::Import() // creating the corresponding note page eAktPageKind = PPT_NOTEPAGE; - SdPage* pNotesPage = (SdPage*)MakeBlancPage( false ); + SdPage* pNotesPage = static_cast<SdPage*>(MakeBlancPage( false )); sal_uInt16 nNotesMasterNum = GetMasterPageIndex( nPage, PPT_SLIDEPAGE ) + 1; sal_uInt32 nNotesPageId = GetNotesPageId( nPage ); if ( nNotesPageId ) @@ -963,7 +963,7 @@ bool ImplSdPPTImport::Import() PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE ); if ( pPageList && nNotesMasterNum < pPageList->size() ) pMasterPersist2 = &(*pPageList)[ nNotesMasterNum ]; - pNotesPage->SetLayoutName( ((SdPage&)pNotesPage->TRG_GetMasterPage()).GetLayoutName() ); + pNotesPage->SetLayoutName( static_cast<SdPage&>(pNotesPage->TRG_GetMasterPage()).GetLayoutName() ); } pNotesPage->SetPageKind( PK_NOTES ); pNotesPage->TRG_SetMasterPage(*pSdrModel->GetMasterPage(nNotesMasterNum)); @@ -980,7 +980,7 @@ bool ImplSdPPTImport::Import() pSdrModel->InsertPage( pNotesPage ); SdrObject* pPageObj = pNotesPage->GetPresObj( PRESOBJ_PAGE, 1 ); if ( pPageObj ) - ((SdrPageObj*)pPageObj)->SetReferencedPage(pSdrModel->GetPage(( nPage << 1 ) + 1)); + static_cast<SdrPageObj*>(pPageObj)->SetReferencedPage(pSdrModel->GetPage(( nPage << 1 ) + 1)); } if( pStbMgr ) @@ -1013,10 +1013,10 @@ bool ImplSdPPTImport::Import() } if ( pFoundMaster ) { - ((SdPage*)pPage)->TRG_SetMasterPage( *((SdPage*)pFoundMaster) ); - ((SdPage*)pPage)->SetLayoutName( ((SdPage*)pFoundMaster)->GetLayoutName() ); + static_cast<SdPage*>(pPage)->TRG_SetMasterPage( *((SdPage*)pFoundMaster) ); + static_cast<SdPage*>(pPage)->SetLayoutName( ((SdPage*)pFoundMaster)->GetLayoutName() ); } - ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_TITLE, true, true ); + static_cast<SdPage*>(pPage)->SetAutoLayout( AUTOLAYOUT_TITLE, true, true ); eAktPageKind = PPT_NOTEPAGE; SdrPage* pNPage = MakeBlancPage( false ); @@ -2179,7 +2179,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj OUString aName( pPage->GetLayoutName() ); aName += " "; aName += OUString::number( nLevel ); - pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE ); + pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE )); if ( pSheet ) pText->StartListening( *pSheet ); pStyleSheetAry[ nLevel - 1 ] = pSheet; @@ -2218,15 +2218,15 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj case PRESOBJ_SLIDENUMBER : case PRESOBJ_FOOTER : case PRESOBJ_HEADER : - pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_PSEUDOSHEET_BACKGROUNDOBJECTS), SD_STYLE_FAMILY_PSEUDO ); + pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_PSEUDOSHEET_BACKGROUNDOBJECTS), SD_STYLE_FAMILY_PSEUDO )); break; default : - pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_STANDARD_STYLESHEET_NAME), SD_STYLE_FAMILY_GRAPHICS ); + pSheet = static_cast<SfxStyleSheet*>(mpDoc->GetStyleSheetPool()->Find(SD_RESSTR(STR_STANDARD_STYLESHEET_NAME), SD_STYLE_FAMILY_GRAPHICS )); } } break; } - pText = (SdrTextObj*)SdrPowerPointImport::ApplyTextObj( pTextObj, pText, pPage, pSheet, ppStyleSheetAry ); + pText = static_cast<SdrTextObj*>(SdrPowerPointImport::ApplyTextObj( pTextObj, pText, pPage, pSheet, ppStyleSheetAry )); if ( pPlaceHolder && pPlaceHolder->nPlaceholderId ) { if ( eAktPageKind == PPT_MASTERPAGE ) @@ -2257,12 +2257,12 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj if ( pSheet2 ) { SfxItemSet& rItemSet = pSheet2->GetItemSet(); - rItemSet.Put( (SdrMetricItem&)pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) ); - rItemSet.Put( (SdrMetricItem&)pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST ) ); - rItemSet.Put( (SdrMetricItem&)pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST ) ); - rItemSet.Put( (SdrMetricItem&)pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST ) ); - rItemSet.Put( (SdrTextVertAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST ) ); - rItemSet.Put( (SdrTextHorzAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST ) ); + rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_LEFTDIST ) ) ); + rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_RIGHTDIST )) ); + rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_UPPERDIST )) ); + rItemSet.Put( static_cast<const SdrMetricItem&>(pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST )) ); + rItemSet.Put( static_cast<const SdrTextVertAdjustItem&>(pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST )) ); + rItemSet.Put( static_cast<const SdrTextHorzAdjustItem&>(pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST )) ); if ( pTextObj->GetInstance() == TSS_TYPE_TITLE || pTextObj->GetInstance() == TSS_TYPE_SUBTITLE) { @@ -2376,8 +2376,8 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj if ((eAktPageKind != PPT_NOTEPAGE) && (nPlacementId != 0xffffffff) && pPage->TRG_HasMasterPage()) { - SdrObject* pTitleObj = ((SdPage&)pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_TITLE ); - SdrObject* pOutlineObj = ((SdPage&)pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_OUTLINE ); + SdrObject* pTitleObj = static_cast<SdPage&>(pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_TITLE ); + SdrObject* pOutlineObj = static_cast<SdPage&>(pPage->TRG_GetMasterPage()).GetPresObj( PRESOBJ_OUTLINE ); Rectangle aTitleRect; Rectangle aOutlineRect; @@ -2563,8 +2563,8 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi { const SfxItemSet& rObjItemSet = pObj->GetMergedItemSet(); - drawing::FillStyle eFillStyle = ((XFillStyleItem&)(rObjItemSet.Get(XATTR_FILLSTYLE))).GetValue(); - XLineStyle eLineStyle = ((XLineStyleItem&)(rObjItemSet.Get(XATTR_LINESTYLE))).GetValue(); + drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(rObjItemSet.Get(XATTR_FILLSTYLE)).GetValue(); + XLineStyle eLineStyle = static_cast<const XLineStyleItem&>(rObjItemSet.Get(XATTR_LINESTYLE)).GetValue(); if ( ( eFillStyle == drawing::FillStyle_NONE ) && ( eLineStyle == XLINE_NONE ) ) bDontAnimateInvisibleShape = true; diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx index 40f55e74996a..ab540914a2b6 100644 --- a/sd/source/filter/sdpptwrp.cxx +++ b/sd/source/filter/sdpptwrp.cxx @@ -19,6 +19,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> +#include <sfx2/objsh.hxx> #include <osl/module.hxx> #include <filter/msfilter/msoleexp.hxx> #include <filter/msfilter/svxmsbas.hxx> @@ -28,6 +29,7 @@ #include "sdpptwrp.hxx" #include "ppt/pptin.hxx" #include "drawdoc.hxx" +#include "DrawDocShell.hxx" #include <tools/urlobj.hxx> // - Namespaces - @@ -192,7 +194,7 @@ void SdPPTFilter::PreSaveBasic() SaveVBAPointer pSaveVBA= reinterpret_cast<SaveVBAPointer>(pLibrary->getFunctionSymbol( "SaveVBA" )); if( pSaveVBA ) { - pSaveVBA( (SfxObjectShell&) mrDocShell, pBas ); + pSaveVBA( static_cast<SfxObjectShell&>(mrDocShell), pBas ); } delete pLibrary; } diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 31335697a01f..82dd8a773aa2 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -200,7 +200,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent const SfxPoolItem* pItem = NULL; if ( pDocSh && ( ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) != 0) ) - pColorList = ( (SvxColorListItem*)pItem )->GetColorList(); + pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); if ( !pColorList.is() ) pColorList = XColorList::CreateStdColorList(); @@ -230,7 +230,7 @@ void ColorPropertyBox::setValue( const Any& rValue, const OUString& ) rValue >>= nColor; mpControl->SetNoSelection(); - mpControl->SelectEntryPos( mpControl->GetEntryPos( (Color)nColor ) ); + mpControl->SelectEntryPos( mpControl->GetEntryPos( static_cast<Color>(nColor) ) ); } } @@ -274,7 +274,7 @@ FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, bool bMustDelete = false; if ( pDocSh && ( (pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ) ) != 0) ) - pFontList = ( (SvxFontListItem*)pItem )->GetFontList(); + pFontList = static_cast<const SvxFontListItem*>(pItem)->GetFontList(); if(!pFontList) { @@ -1060,7 +1060,7 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( vcl::Window* pParent const SfxPoolItem* pItem = NULL; if ( pDocSh && ( (pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) != 0 ) ) - pColorList = ( (SvxColorListItem*)pItem )->GetColorList(); + pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); if ( !pColorList.is() ) pColorList = XColorList::CreateStdColorList(); @@ -1745,7 +1745,7 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pPar OUString aDescription( getShapeDescription( xShape, true ) ); sal_Int32 nPos = mpLBTrigger->InsertEntry( aDescription ); - mpLBTrigger->SetEntryData( nPos, (void*)(sal_IntPtr)nShape ); + mpLBTrigger->SetEntryData( nPos, reinterpret_cast<void*>((sal_IntPtr)nShape) ); if( xShape == xTrigger ) mpLBTrigger->SelectEntryPos( nPos ); } @@ -1895,7 +1895,7 @@ void CustomAnimationDurationTabPage::update( STLPropertySet* pSet ) nPos = mpLBTrigger->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - sal_Int32 nShape = (sal_Int32)(sal_IntPtr)mpLBTrigger->GetEntryData( nPos ); + sal_Int32 nShape = (sal_Int32)reinterpret_cast<sal_IntPtr>(mpLBTrigger->GetEntryData( nPos )); Reference< XDrawPage > xCurrentPage; mpSet->getPropertyValue( nHandleCurrentPage ) >>= xCurrentPage; diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index ae85a92b7ad4..8f0d8aefd2b9 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -131,19 +131,19 @@ void fillDurationComboBox( ListBox* pBox ) void fillRepeatComboBox( ListBox* pBox ) { OUString aNone( SD_RESSTR( STR_CUSTOMANIMATION_REPEAT_NONE ) ); - pBox->SetEntryData( pBox->InsertEntry( aNone ), (void*)((sal_Int32)0) ); + pBox->SetEntryData( pBox->InsertEntry( aNone ), reinterpret_cast<void*>((sal_Int32)0) ); - pBox->SetEntryData( pBox->InsertEntry( OUString::number( 2 ) ), (void*)((sal_Int32)1) ); - pBox->SetEntryData( pBox->InsertEntry( OUString::number( 3 ) ), (void*)((sal_Int32)3) ); - pBox->SetEntryData( pBox->InsertEntry( OUString::number( 4 ) ), (void*)((sal_Int32)4) ); - pBox->SetEntryData( pBox->InsertEntry( OUString::number( 5 ) ), (void*)((sal_Int32)5) ); - pBox->SetEntryData( pBox->InsertEntry( OUString::number( 10 ) ), (void*)((sal_Int32)10) ); + pBox->SetEntryData( pBox->InsertEntry( OUString::number( 2 ) ), reinterpret_cast<void*>((sal_Int32)1) ); + pBox->SetEntryData( pBox->InsertEntry( OUString::number( 3 ) ), reinterpret_cast<void*>((sal_Int32)3) ); + pBox->SetEntryData( pBox->InsertEntry( OUString::number( 4 ) ), reinterpret_cast<void*>((sal_Int32)4) ); + pBox->SetEntryData( pBox->InsertEntry( OUString::number( 5 ) ), reinterpret_cast<void*>((sal_Int32)5) ); + pBox->SetEntryData( pBox->InsertEntry( OUString::number( 10 ) ), reinterpret_cast<void*>((sal_Int32)10) ); OUString aUntilClick( SD_RESSTR( STR_CUSTOMANIMATION_REPEAT_UNTIL_NEXT_CLICK ) ); - pBox->SetEntryData( pBox->InsertEntry( aUntilClick ), (void*)((sal_Int32)-1) ); + pBox->SetEntryData( pBox->InsertEntry( aUntilClick ), reinterpret_cast<void*>((sal_Int32)-1) ); OUString aEndOfSlide( SD_RESSTR( STR_CUSTOMANIMATION_REPEAT_UNTIL_END_OF_SLIDE ) ); - pBox->SetEntryData( pBox->InsertEntry( aEndOfSlide ), (void*)((sal_Int32)-2) ); + pBox->SetEntryData( pBox->InsertEntry( aEndOfSlide ), reinterpret_cast<void*>((sal_Int32)-2) ); } CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase, diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 9c1a84b93592..6a43cb093ede 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -305,7 +305,7 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq) const SfxPoolItem* pPoolItem = NULL; if( SfxItemState::SET == pArgs->GetItemState( SID_DELETEALLBYAUTHOR_POSTIT, true, &pPoolItem ) ) { - OUString sAuthor( (( const SfxStringItem* ) pPoolItem )->GetValue() ); + OUString sAuthor( static_cast<const SfxStringItem*>( pPoolItem )->GetValue() ); DeleteAnnotationsByAuthor( sAuthor ); } } @@ -320,7 +320,7 @@ void AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest& rReq) { const SfxPoolItem* pPoolItem = NULL; if( SfxItemState::SET == pArgs->GetItemState( SID_DELETE_POSTIT, true, &pPoolItem ) ) - ( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue() >>= xAnnotation; + static_cast<const SfxUnoAnyItem*>(pPoolItem)->GetValue() >>= xAnnotation; } } @@ -420,7 +420,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq ) { const SfxPoolItem* pPoolItem = NULL; if( SfxItemState::SET == pArgs->GetItemState( rReq.GetSlot(), true, &pPoolItem ) ) - ( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue() >>= xAnnotation; + static_cast<const SfxUnoAnyItem*>( pPoolItem )->GetValue() >>= xAnnotation; } TextApiObject* pTextApi = getTextApiObject( xAnnotation ); @@ -949,25 +949,25 @@ void AnnotationManagerImpl::ExecuteAnnotationContextMenu( Reference< XAnnotation if ( aSet.GetItemState( EE_CHAR_WEIGHT ) == SfxItemState::SET ) { - if( ((const SvxWeightItem&)aSet.Get( EE_CHAR_WEIGHT )).GetWeight() == WEIGHT_BOLD ) + if( static_cast<const SvxWeightItem&>(aSet.Get( EE_CHAR_WEIGHT )).GetWeight() == WEIGHT_BOLD ) pMenu->CheckItem( SID_ATTR_CHAR_WEIGHT ); } if ( aSet.GetItemState( EE_CHAR_ITALIC ) == SfxItemState::SET ) { - if( ((const SvxPostureItem&)aSet.Get( EE_CHAR_ITALIC )).GetPosture() != ITALIC_NONE ) + if( static_cast<const SvxPostureItem&>(aSet.Get( EE_CHAR_ITALIC )).GetPosture() != ITALIC_NONE ) pMenu->CheckItem( SID_ATTR_CHAR_POSTURE ); } if ( aSet.GetItemState( EE_CHAR_UNDERLINE ) == SfxItemState::SET ) { - if( ((const SvxUnderlineItem&)aSet.Get( EE_CHAR_UNDERLINE )).GetLineStyle() != UNDERLINE_NONE ) + if( static_cast<const SvxUnderlineItem&>(aSet.Get( EE_CHAR_UNDERLINE )).GetLineStyle() != UNDERLINE_NONE ) pMenu->CheckItem( SID_ATTR_CHAR_UNDERLINE ); } if ( aSet.GetItemState( EE_CHAR_STRIKEOUT ) == SfxItemState::SET ) { - if( ((const SvxCrossedOutItem&)aSet.Get( EE_CHAR_STRIKEOUT )).GetStrikeout() != STRIKEOUT_NONE ) + if( static_cast<const SvxCrossedOutItem&>(aSet.Get( EE_CHAR_STRIKEOUT )).GetStrikeout() != STRIKEOUT_NONE ) pMenu->CheckItem( SID_ATTR_CHAR_STRIKEOUT ); } TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pAnnotationWindow ) ); diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 47063aad5fc8..e132cef20764 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -770,25 +770,25 @@ void AnnotationWindow::ExecuteSlot( sal_uInt16 nSID ) { case SID_ATTR_CHAR_WEIGHT: { - FontWeight eFW = ( (const SvxWeightItem&) aEditAttr.Get( EE_CHAR_WEIGHT ) ).GetWeight(); + FontWeight eFW = static_cast<const SvxWeightItem&>( aEditAttr.Get( EE_CHAR_WEIGHT ) ).GetWeight(); aNewAttr.Put( SvxWeightItem( eFW == WEIGHT_NORMAL ? WEIGHT_BOLD : WEIGHT_NORMAL, EE_CHAR_WEIGHT ) ); } break; case SID_ATTR_CHAR_POSTURE: { - FontItalic eFI = ( (const SvxPostureItem&) aEditAttr.Get( EE_CHAR_ITALIC ) ).GetPosture(); + FontItalic eFI = static_cast<const SvxPostureItem&>( aEditAttr.Get( EE_CHAR_ITALIC ) ).GetPosture(); aNewAttr.Put( SvxPostureItem( eFI == ITALIC_NORMAL ? ITALIC_NONE : ITALIC_NORMAL, EE_CHAR_ITALIC ) ); } break; case SID_ATTR_CHAR_UNDERLINE: { - 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_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE ) ); } break; case SID_ATTR_CHAR_STRIKEOUT: { - FontStrikeout eFSO = ( ( (const SvxCrossedOutItem&) aEditAttr.Get( EE_CHAR_STRIKEOUT ) ).GetStrikeout() ); + 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 ) ); } break; diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 1af99370d306..a4aff4d943f2 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -110,7 +110,7 @@ void SdModule::Execute(SfxRequest& rReq) if( pSet && SfxItemState::SET == pSet->GetItemState( SID_AUTOSPELL_CHECK, false, &pItem ) ) { - bool bOnlineSpelling = ( (const SfxBoolItem*) pItem )->GetValue(); + bool bOnlineSpelling = static_cast<const SfxBoolItem*>( pItem )->GetValue(); // save at document: ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); if( pDocSh ) @@ -127,7 +127,7 @@ void SdModule::Execute(SfxRequest& rReq) const SfxPoolItem* pItem; if ( pSet && SfxItemState::SET == pSet->GetItemState( SID_ATTR_METRIC, true, &pItem ) ) { - FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)pItem)->GetValue(); + FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem)->GetValue(); switch( eUnit ) { case FUNIT_MM: // only the units which are also in the dialog @@ -174,7 +174,7 @@ void SdModule::Execute(SfxRequest& rReq) ::sd::DrawDocShell* pDocSh = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); if ( pDocSh ) { - LanguageType eLanguage = ( (SvxLanguageItem*)pItem )->GetValue(); + LanguageType eLanguage = static_cast<const SvxLanguageItem*>(pItem)->GetValue(); SdDrawDocument* pDoc = pDocSh->GetDoc(); if( nSlotId == SID_ATTR_CHAR_CJK_LANGUAGE ) @@ -258,7 +258,7 @@ void SdModule::OutlineToImpress (SfxRequest& rRequest) if (pSet) { - SvLockBytes* pBytes = ((SfxLockBytesItem&) pSet->Get(SID_OUTLINE_TO_IMPRESS)).GetValue(); + SvLockBytes* pBytes = static_cast<const SfxLockBytesItem&>(pSet->Get(SID_OUTLINE_TO_IMPRESS)).GetValue(); if (pBytes) { diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 2c83b2d5102e..dd5c666d98c5 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -554,7 +554,7 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS , false, (const SfxPoolItem**) &pItem )) { - const SdOptionsGridItem* pGridItem = (SdOptionsGridItem*) pItem; + const SdOptionsGridItem* pGridItem = static_cast<const SdOptionsGridItem*>(pItem); pGridItem->SetOptions( pOptions ); } @@ -571,13 +571,13 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) { if( pDoc && eDocType == pDoc->GetDocumentType() ) PutItem( *pItem ); - pOptions->SetMetric( ( (SfxUInt16Item*) pItem )->GetValue() ); + pOptions->SetMetric( static_cast<const SfxUInt16Item*>( pItem )->GetValue() ); } sal_uInt16 nDefTab = pOptions->GetDefTab(); // Default-Tabulator if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_DEFTABSTOP, false, &pItem ) ) { - nDefTab = ( (SfxUInt16Item*) pItem )->GetValue(); + nDefTab = static_cast<const SfxUInt16Item*>( pItem )->GetValue(); pOptions->SetDefTab( nDefTab ); bNewDefTab = true; @@ -586,10 +586,10 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) // Scale if( SfxItemState::SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_X, false, &pItem ) ) { - sal_Int32 nX = ( (SfxInt32Item*) pItem )->GetValue(); + sal_Int32 nX = static_cast<const SfxInt32Item*>( pItem )->GetValue(); if( SfxItemState::SET == rSet.GetItemState( ATTR_OPTIONS_SCALE_Y, false, &pItem ) ) { - sal_Int32 nY = ( (SfxInt32Item*) pItem )->GetValue(); + sal_Int32 nY = static_cast<const SfxInt32Item*>( pItem )->GetValue(); pOptions->SetScale( nX, nY ); // Apply to document only if doc type match diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index b9c2475205d2..565498183fca 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -57,7 +57,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) if( pField->ISA( SvxDateField ) ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; + const SvxDateField* pDateField = static_cast<const SvxDateField*>( pField ); SvxDateField aDateField( *pDateField ); if( pDateField->GetType() == SVXDATETYPE_FIX ) @@ -89,7 +89,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) } else if( pField->ISA( SvxExtTimeField ) ) { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; + const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>( pField ); SvxExtTimeField aTimeField( *pTimeField ); if( pTimeField->GetType() == SVXTIMETYPE_FIX ) @@ -123,7 +123,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) } else if( pField->ISA( SvxExtFileField ) ) { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; + const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>(pField); //SvxExtFileField aFileField( *pFileField ); if( pFileField->GetType() == SVXFILETYPE_FIX ) @@ -140,7 +140,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) } else if( pField->ISA( SvxAuthorField ) ) { - const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField; + const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorField aAuthorField( *pAuthorField ); if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX ) @@ -168,7 +168,7 @@ SvxFieldData* SdFieldPopup::GetField() if( pField->ISA( SvxDateField ) ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; + const SvxDateField* pDateField = static_cast<const SvxDateField*>(pField); SvxDateType eType; SvxDateFormat eFormat; sal_uInt16 i; @@ -189,19 +189,19 @@ SvxFieldData* SdFieldPopup::GetField() pDateField->GetType() != eType ) { pNewField = new SvxDateField( *pDateField ); - ( (SvxDateField*) pNewField )->SetType( eType ); - ( (SvxDateField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxDateField*>( pNewField )->SetType( eType ); + static_cast<SvxDateField*>( pNewField )->SetFormat( eFormat ); if( (pDateField->GetType() == SVXDATETYPE_VAR) && (eType == SVXDATETYPE_FIX) ) { Date aDate( Date::SYSTEM ); - ( (SvxDateField*) pNewField )->SetFixDate( aDate ); + static_cast<SvxDateField*>( pNewField )->SetFixDate( aDate ); } } } else if( pField->ISA( SvxExtTimeField ) ) { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; + const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>(pField); SvxTimeType eType; SvxTimeFormat eFormat; sal_uInt16 i; @@ -222,20 +222,20 @@ SvxFieldData* SdFieldPopup::GetField() pTimeField->GetType() != eType ) { pNewField = new SvxExtTimeField( *pTimeField ); - ( (SvxExtTimeField*) pNewField )->SetType( eType ); - ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxExtTimeField*>( pNewField )->SetType( eType ); + static_cast<SvxExtTimeField*>( pNewField )->SetFormat( eFormat ); if( (pTimeField->GetType() == SVXTIMETYPE_VAR) && (eType == SVXTIMETYPE_FIX) ) { tools::Time aTime( tools::Time::SYSTEM ); - ( (SvxExtTimeField*) pNewField )->SetFixTime( aTime ); + static_cast<SvxExtTimeField*>( pNewField )->SetFixTime( aTime ); } } } else if( pField->ISA( SvxExtFileField ) ) { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; + const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>(pField); SvxFileType eType; SvxFileFormat eFormat; sal_uInt16 i; @@ -268,14 +268,14 @@ SvxFieldData* SdFieldPopup::GetField() // Get current filename, not the one stored in the old field pNewField = new SvxExtFileField( aName ); - ( (SvxExtFileField*) pNewField )->SetType( eType ); - ( (SvxExtFileField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxExtFileField*>( pNewField )->SetType( eType ); + static_cast<SvxExtFileField*>( pNewField )->SetFormat( eFormat ); } } } else if( pField->ISA( SvxAuthorField ) ) { - const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField; + const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorType eType; SvxAuthorFormat eFormat; sal_uInt16 i; @@ -298,8 +298,8 @@ SvxFieldData* SdFieldPopup::GetField() // Get current state of address, not the old one SvtUserOptions aUserOptions; pNewField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() ); - ( (SvxAuthorField*) pNewField )->SetType( eType ); - ( (SvxAuthorField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxAuthorField*>( pNewField )->SetType( eType ); + static_cast<SvxAuthorField*>( pNewField )->SetFormat( eFormat ); } } return( pNewField ); diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index e967d188d3c4..43172099a9c8 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -225,7 +225,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) if( pData && pData->ISA( SvxURLField ) ) { - const SvxURLField* pURL = (SvxURLField*) pData; + const SvxURLField* pURL = static_cast<const SvxURLField*>(pData); // #i63399# This special code identifies TextFrames which have just an URL // as content and directly add this to the clipboard, probably to avoid adding @@ -279,7 +279,7 @@ void SdTransferable::CreateData() if( mpSourceDoc ) mpSourceDoc->CreatingDataObj(this); - mpSdDrawDocumentIntern = (SdDrawDocument*) mpSdView->GetMarkedObjModel(); + mpSdDrawDocumentIntern = static_cast<SdDrawDocument*>( mpSdView->GetMarkedObjModel() ); if( mpSourceDoc ) mpSourceDoc->CreatingDataObj(0); @@ -294,10 +294,10 @@ void SdTransferable::CreateData() // Use dimension of source page SdrPageView* pPgView = mpSdView->GetSdrPageView(); - SdPage* pOldPage = (SdPage*) pPgView->GetPage(); + SdPage* pOldPage = static_cast<SdPage*>( pPgView->GetPage() ); SdrModel* pOldModel = mpSdView->GetModel(); - SdStyleSheetPool* pOldStylePool = (SdStyleSheetPool*) pOldModel->GetStyleSheetPool(); - SdStyleSheetPool* pNewStylePool = (SdStyleSheetPool*) mpSdDrawDocumentIntern->GetStyleSheetPool(); + SdStyleSheetPool* pOldStylePool = static_cast<SdStyleSheetPool*>( pOldModel->GetStyleSheetPool() ); + SdStyleSheetPool* pNewStylePool = static_cast<SdStyleSheetPool*>( mpSdDrawDocumentIntern->GetStyleSheetPool() ); SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PK_STANDARD ); OUString aOldLayoutName( pOldPage->GetLayoutName() ); diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index c494cdce10a2..15d8ec5fbc80 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -77,7 +77,7 @@ void SdTemplateControl::StateChanged( GetStatusBar().SetItemText( GetId(), OUString() ); else if ( pState->ISA( SfxStringItem ) ) { - msTemplate = ((SfxStringItem*)pState)->GetValue(); + msTemplate = static_cast<const SfxStringItem*>(pState)->GetValue(); GetStatusBar().SetItemText( GetId(), msTemplate ); } } diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index a8ad2ffab4f9..67c292adcf4b 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -814,9 +814,9 @@ void AnimationWindow::AddObj (::sd::View& rView ) sal_uInt16 nId = pObject->GetObjIdentifier(); // Animated Bitmap (GIF) - if( nInv == SdrInventor && nId == OBJ_GRAF && ( (SdrGrafObj*) pObject )->IsAnimated() ) + if( nInv == SdrInventor && nId == OBJ_GRAF && static_cast<SdrGrafObj*>( pObject )->IsAnimated() ) { - const SdrGrafObj* pGrafObj = (SdrGrafObj*) pObject; + const SdrGrafObj* pGrafObj = static_cast<SdrGrafObj*>(pObject); Graphic aGraphic( pGrafObj->GetTransformedGraphic() ); sal_uInt16 nCount = 0; @@ -863,7 +863,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) else if( bAllObjects || ( pAnimInfo && pAnimInfo->mbIsMovie ) ) { // several objects - SdrObjList* pObjList = ((SdrObjGroup*)pObject)->GetSubList(); + SdrObjList* pObjList = static_cast<SdrObjGroup*>(pObject)->GetSubList(); for( size_t nObject = 0; nObject < pObjList->GetObjCount(); ++nObject ) { diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx index b596addfbc8b..0925a11c7143 100644 --- a/sd/source/ui/dlg/brkdlg.cxx +++ b/sd/source/ui/dlg/brkdlg.cxx @@ -91,7 +91,7 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit ) return 1L; // update status bar or show a error message? - if(nInit == (void*)1L) + if(nInit == reinterpret_cast<void*>(1L)) { MessageDialog aErrBox(this, SD_RESSTR(STR_BREAK_FAIL)); aErrBox.Execute(); diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 56e865215205..c0b9b05f0b02 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -121,38 +121,38 @@ void CopyDlg::Reset() if (comphelper::string::getTokenCount(aStr, TOKEN) < 8) { if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_NUMBER, true, &pPoolItem ) ) - m_pNumFldCopies->SetValue( ( ( const SfxUInt16Item* ) pPoolItem )->GetValue() ); + m_pNumFldCopies->SetValue( static_cast<const SfxUInt16Item*>( pPoolItem )->GetValue() ); else m_pNumFldCopies->SetValue( 1L ); long nMoveX = 500L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) ) - nMoveX = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); + nMoveX = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); SetMetricValue( *m_pMtrFldMoveX, Fraction(nMoveX) / maUIScale, SFX_MAPUNIT_100TH_MM); long nMoveY = 500L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) ) - nMoveY = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); + nMoveY = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); SetMetricValue( *m_pMtrFldMoveY, Fraction(nMoveY) / maUIScale, SFX_MAPUNIT_100TH_MM); if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) ) - m_pMtrFldAngle->SetValue( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); + m_pMtrFldAngle->SetValue( static_cast<const SfxInt32Item*>( pPoolItem )->GetValue() ); else m_pMtrFldAngle->SetValue( 0L ); long nWidth = 0L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) ) - nWidth = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); + nWidth = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); SetMetricValue( *m_pMtrFldWidth, Fraction(nWidth) / maUIScale, SFX_MAPUNIT_100TH_MM); long nHeight = 0L; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) ) - nHeight = ( ( ( const SfxInt32Item* ) pPoolItem )->GetValue() ); + nHeight = static_cast<const SfxInt32Item*>( pPoolItem )->GetValue(); SetMetricValue( *m_pMtrFldHeight, Fraction(nHeight) / maUIScale, SFX_MAPUNIT_100TH_MM); if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { - Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); + Color aColor = static_cast<const XColorItem*>( pPoolItem )->GetColorValue(); m_pLbStartColor->SelectEntry( aColor ); m_pLbEndColor->SelectEntry( aColor ); } @@ -258,7 +258,7 @@ IMPL_LINK_NOARG(CopyDlg, SetViewData) const SfxPoolItem* pPoolItem = NULL; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { - Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); + Color aColor = static_cast<const XColorItem*>( pPoolItem )->GetColorValue(); m_pLbStartColor->SelectEntry( aColor ); } @@ -285,7 +285,7 @@ IMPL_LINK_NOARG(CopyDlg, SetDefault) const SfxPoolItem* pPoolItem = NULL; if( SfxItemState::SET == mrOutAttrs.GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { - Color aColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); + Color aColor = static_cast<const XColorItem*>( pPoolItem )->GetColorValue(); m_pLbStartColor->SelectEntry( aColor ); m_pLbEndColor->SelectEntry( aColor ); } diff --git a/sd/source/ui/dlg/diactrl.cxx b/sd/source/ui/dlg/diactrl.cxx index 999c45e6e4d8..41c2754c2a4f 100644 --- a/sd/source/ui/dlg/diactrl.cxx +++ b/sd/source/ui/dlg/diactrl.cxx @@ -109,7 +109,7 @@ SdTbxCtlDiaPages::~SdTbxCtlDiaPages() void SdTbxCtlDiaPages::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState ) { - SdPagesField* pFld = (SdPagesField*) GetToolBox().GetItemWindow( GetId() ); + SdPagesField* pFld = static_cast<SdPagesField*>( GetToolBox().GetItemWindow( GetId() ) ); DBG_ASSERT( pFld, "Window not found" ); if ( eState == SfxItemState::DISABLED ) diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx index a2fe444d0b79..7802b96a8f8b 100644 --- a/sd/source/ui/dlg/dlgassim.cxx +++ b/sd/source/ui/dlg/dlgassim.cxx @@ -117,13 +117,13 @@ void SdPageListControl::Fill( SdDrawDocument* pDoc ) const sal_uInt16 nMaxPages = pDoc->GetPageCount(); while( nPage < nMaxPages ) { - SdPage* pPage = (SdPage*) pDoc->GetPage( nPage ); + SdPage* pPage = static_cast<SdPage*>( pDoc->GetPage( nPage ) ); if( pPage->GetPageKind() == PK_STANDARD ) { SvTreeListEntry* pEntry = InsertPage( pPage->GetName() ); SetCheckButtonState(pEntry, SvButtonState( SV_BUTTON_CHECKED ) ); - SdrTextObj* pTO = (SdrTextObj*)pPage->GetPresObj(PRESOBJ_TEXT); + SdrTextObj* pTO = static_cast<SdrTextObj*>(pPage->GetPresObj(PRESOBJ_TEXT)); if(!pTO) { // determines the SdrTextObject with the layout text of this page @@ -133,7 +133,7 @@ void SdPageListControl::Fill( SdDrawDocument* pDoc ) SdrObject* pObject = pPage->GetObj(nObject); if (pObject->GetObjInventor() == SdrInventor && pObject->GetObjIdentifier() == OBJ_OUTLINETEXT) { - pTO = (SdrTextObj*)pObject; + pTO = static_cast<SdrTextObj*>(pObject); break; } } diff --git a/sd/source/ui/dlg/dlgchar.cxx b/sd/source/ui/dlg/dlgchar.cxx index 5b23fe32e35c..a23cd804c95a 100644 --- a/sd/source/ui/dlg/dlgchar.cxx +++ b/sd/source/ui/dlg/dlgchar.cxx @@ -53,7 +53,7 @@ void SdCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); if (nId == mnCharName) { - SvxFontListItem aItem(*( (const SvxFontListItem*) ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); + SvxFontListItem aItem(*( static_cast<const SvxFontListItem*>( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index 575dfe57b892..17181cd62237 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -67,7 +67,7 @@ SvxFieldData* SdModifyFieldDlg::GetField() { if( pField->ISA( SvxDateField ) ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; + const SvxDateField* pDateField = static_cast<const SvxDateField*>(pField); SvxDateType eType; SvxDateFormat eFormat; @@ -79,12 +79,12 @@ SvxFieldData* SdModifyFieldDlg::GetField() eFormat = (SvxDateFormat) ( m_pLbFormat->GetSelectEntryPos() + 2 ); pNewField = new SvxDateField( *pDateField ); - ( (SvxDateField*) pNewField )->SetType( eType ); - ( (SvxDateField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxDateField*>( pNewField )->SetType( eType ); + static_cast<SvxDateField*>( pNewField )->SetFormat( eFormat ); } else if( pField->ISA( SvxExtTimeField ) ) { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; + const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>( pField ); SvxTimeType eType; SvxTimeFormat eFormat; @@ -96,12 +96,12 @@ SvxFieldData* SdModifyFieldDlg::GetField() eFormat = (SvxTimeFormat) ( m_pLbFormat->GetSelectEntryPos() + 2 ); pNewField = new SvxExtTimeField( *pTimeField ); - ( (SvxExtTimeField*) pNewField )->SetType( eType ); - ( (SvxExtTimeField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxExtTimeField*>( pNewField )->SetType( eType ); + static_cast<SvxExtTimeField*>( pNewField )->SetFormat( eFormat ); } else if( pField->ISA( SvxExtFileField ) ) { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; + const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>( pField ); SvxFileType eType; SvxFileFormat eFormat; @@ -125,8 +125,8 @@ SvxFieldData* SdModifyFieldDlg::GetField() // Get current filename, not the one stored in the old field pNewField = new SvxExtFileField( aName ); - ( (SvxExtFileField*) pNewField )->SetType( eType ); - ( (SvxExtFileField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxExtFileField*>( pNewField )->SetType( eType ); + static_cast<SvxExtFileField*>( pNewField )->SetFormat( eFormat ); } } else if( pField->ISA( SvxAuthorField ) ) @@ -144,8 +144,8 @@ SvxFieldData* SdModifyFieldDlg::GetField() // Get current state of address, not the old one SvtUserOptions aUserOptions; pNewField = new SvxAuthorField( aUserOptions.GetFirstName(), aUserOptions.GetLastName(), aUserOptions.GetID() ); - ( (SvxAuthorField*) pNewField )->SetType( eType ); - ( (SvxAuthorField*) pNewField )->SetFormat( eFormat ); + static_cast<SvxAuthorField*>( pNewField )->SetType( eType ); + static_cast<SvxAuthorField*>( pNewField )->SetFormat( eFormat ); } } @@ -160,7 +160,7 @@ void SdModifyFieldDlg::FillFormatList() if( pField->ISA( SvxDateField ) ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; + const SvxDateField* pDateField = static_cast<const SvxDateField*>( pField ); SvxDateField aDateField( *pDateField ); //SVXDATEFORMAT_APPDEFAULT, // not used @@ -186,7 +186,7 @@ void SdModifyFieldDlg::FillFormatList() } else if( pField->ISA( SvxExtTimeField ) ) { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; + const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>( pField ); SvxExtTimeField aTimeField( *pTimeField ); //SVXTIMEFORMAT_APPDEFAULT, // not used @@ -214,7 +214,7 @@ void SdModifyFieldDlg::FillFormatList() } else if( pField->ISA( SvxExtFileField ) ) { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; + const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>( pField ); SvxExtFileField aFileField( *pFileField ); m_pLbFormat->InsertEntry( SD_RESSTR( STR_FILEFORMAT_NAME_EXT ) ); @@ -226,7 +226,7 @@ void SdModifyFieldDlg::FillFormatList() } else if( pField->ISA( SvxAuthorField ) ) { - const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField; + const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>( pField ); SvxAuthorField aAuthorField( *pAuthorField ); for( sal_uInt16 i = 0; i < 4; i++ ) @@ -247,7 +247,7 @@ void SdModifyFieldDlg::FillControls() if( pField->ISA( SvxDateField ) ) { - const SvxDateField* pDateField = (const SvxDateField*) pField; + const SvxDateField* pDateField = static_cast<const SvxDateField*>(pField); SvxDateField aDateField( *pDateField ); if( pDateField->GetType() == SVXDATETYPE_FIX ) @@ -257,7 +257,7 @@ void SdModifyFieldDlg::FillControls() } else if( pField->ISA( SvxExtTimeField ) ) { - const SvxExtTimeField* pTimeField = (const SvxExtTimeField*) pField; + const SvxExtTimeField* pTimeField = static_cast<const SvxExtTimeField*>(pField); SvxExtTimeField aTimeField( *pTimeField ); if( pTimeField->GetType() == SVXTIMETYPE_FIX ) @@ -267,7 +267,7 @@ void SdModifyFieldDlg::FillControls() } else if( pField->ISA( SvxExtFileField ) ) { - const SvxExtFileField* pFileField = (const SvxExtFileField*) pField; + const SvxExtFileField* pFileField = static_cast<const SvxExtFileField*>(pField); SvxExtFileField aFileField( *pFileField ); if( pFileField->GetType() == SVXFILETYPE_FIX ) @@ -277,7 +277,7 @@ void SdModifyFieldDlg::FillControls() } else if( pField->ISA( SvxAuthorField ) ) { - const SvxAuthorField* pAuthorField = (const SvxAuthorField*) pField; + const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorField aAuthorField( *pAuthorField ); if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX ) diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index ab1ea95b6cde..0eecf6a5fd35 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -102,7 +102,7 @@ OutlineBulletDlg::OutlineBulletDlg( } if( pItem == NULL ) - pItem = (SvxNumBulletItem*) aInputSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET); + pItem = static_cast<const SvxNumBulletItem*>( aInputSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET) ); DBG_ASSERT( pItem, "No EE_PARA_NUMBULLET in Pool! [CL]" ); @@ -111,7 +111,7 @@ OutlineBulletDlg::OutlineBulletDlg( if(bTitle && aInputSet.GetItemState(EE_PARA_NUMBULLET,true) == SfxItemState::SET ) { - SvxNumBulletItem* pItem = (SvxNumBulletItem*)aInputSet.GetItem(EE_PARA_NUMBULLET,true); + const SvxNumBulletItem* pItem = static_cast<const SvxNumBulletItem*>( aInputSet.GetItem(EE_PARA_NUMBULLET,true) ); SvxNumRule* pRule = pItem->GetNumRule(); if(pRule) { @@ -173,14 +173,14 @@ const SfxItemSet* OutlineBulletDlg::GetOutputItemSet() const const SfxPoolItem *pItem = NULL; if( SfxItemState::SET == pOutputSet->GetItemState(pOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE), false, &pItem )) { - SdBulletMapper::MapFontsInNumRule( *((SvxNumBulletItem*)pItem)->GetNumRule(), *pOutputSet ); + SdBulletMapper::MapFontsInNumRule( *static_cast<const SvxNumBulletItem*>(pItem)->GetNumRule(), *pOutputSet ); // #i35937 - removed EE_PARA_BULLETSTATE setting } if(bTitle && pOutputSet->GetItemState(EE_PARA_NUMBULLET,true) == SfxItemState::SET ) { - SvxNumBulletItem* pBulletItem = (SvxNumBulletItem*)pOutputSet->GetItem(EE_PARA_NUMBULLET,true); + const SvxNumBulletItem* pBulletItem = static_cast<const SvxNumBulletItem*>(pOutputSet->GetItem(EE_PARA_NUMBULLET,true)); SvxNumRule* pRule = pBulletItem->GetNumRule(); if(pRule) pRule->SetFeatureFlag( NUM_NO_NUMBERS, false ); diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx index 347b572038c8..b1bcc5d7f0df 100644 --- a/sd/source/ui/dlg/dlgpage.cxx +++ b/sd/source/ui/dlg/dlgpage.cxx @@ -40,13 +40,13 @@ SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SfxIte , pAttr ), mpDocShell ( pDocSh ) { - SvxColorListItem aColorListItem(*( (const SvxColorListItem*) + SvxColorListItem aColorListItem(*static_cast<const SvxColorListItem*>( ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) ); - SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*) + SvxGradientListItem aGradientListItem(*static_cast<const SvxGradientListItem*>( ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) ); - SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*) + SvxBitmapListItem aBitmapListItem(*static_cast<const SvxBitmapListItem*>( ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) ); - SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*) + SvxHatchListItem aHatchListItem(*static_cast<const SvxHatchListItem*>( ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) ); mpColorList = aColorListItem.GetColorList(); diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx index ee8548f07c6a..07d6e2c2886d 100644 --- a/sd/source/ui/dlg/dlgsnap.cxx +++ b/sd/source/ui/dlg/dlgsnap.cxx @@ -101,8 +101,8 @@ SdSnapLineDlg::SdSnapLineDlg( m_pMtrFldY->SetLast( nValue ); // set values - nXValue = ((const SfxInt32Item&) rInAttrs.Get(ATTR_SNAPLINE_X)).GetValue(); - nYValue = ((const SfxInt32Item&) rInAttrs.Get(ATTR_SNAPLINE_Y)).GetValue(); + nXValue = static_cast<const SfxInt32Item&>( rInAttrs.Get(ATTR_SNAPLINE_X)).GetValue(); + nYValue = static_cast<const SfxInt32Item&>( rInAttrs.Get(ATTR_SNAPLINE_Y)).GetValue(); nXValue = Fraction(nXValue) / aUIScale; nYValue = Fraction(nYValue) / aUIScale; SetMetricValue( *m_pMtrFldX, nXValue, SFX_MAPUNIT_100TH_MM); diff --git a/sd/source/ui/dlg/gluectrl.cxx b/sd/source/ui/dlg/gluectrl.cxx index 7cbbb8d69400..79c6ebe63374 100644 --- a/sd/source/ui/dlg/gluectrl.cxx +++ b/sd/source/ui/dlg/gluectrl.cxx @@ -132,7 +132,7 @@ void SdTbxCtlGlueEscDir::StateChanged( sal_uInt16 nSId, { if( eState == SfxItemState::DEFAULT ) { - GlueEscDirLB* pGlueEscDirLB = (GlueEscDirLB*) ( GetToolBox(). + GlueEscDirLB* pGlueEscDirLB = static_cast<GlueEscDirLB*> ( GetToolBox(). GetItemWindow( GetId() ) ); if( pGlueEscDirLB ) { @@ -145,7 +145,7 @@ void SdTbxCtlGlueEscDir::StateChanged( sal_uInt16 nSId, } else { - sal_uInt16 nEscDir = ( (const SfxUInt16Item*) pState )->GetValue(); + sal_uInt16 nEscDir = static_cast<const SfxUInt16Item*>( pState )->GetValue(); pGlueEscDirLB->SelectEntryPos( GetEscDirPos( nEscDir ) ); } } diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 4b17fc718543..2d402c682114 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -178,12 +178,12 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar if( pCurrentPage->GetPageKind() == PK_STANDARD ) { pSlide = pCurrentPage; - pNotes = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNum() + 1 ); + pNotes = static_cast<SdPage*>(pDoc->GetPage( pCurrentPage->GetPageNum() + 1 )); } else if( pCurrentPage->GetPageKind() == PK_NOTES ) { pNotes = pCurrentPage; - pSlide = (SdPage*)pDoc->GetPage( pCurrentPage->GetPageNum() -1 ); + pSlide = static_cast<SdPage*>(pDoc->GetPage( pCurrentPage->GetPageNum() -1 )); mpCurrentPage = pSlide; } else @@ -416,7 +416,7 @@ HeaderFooterTabPage::HeaderFooterTabPage( vcl::Window* pWindow, SdDrawDocument* get(mpCTPreview, "preview"); mpCTPreview->init( pActualPage ? - (pActualPage->IsMasterPage() ? pActualPage : (SdPage*)(&(pActualPage->TRG_GetMasterPage()))) : + (pActualPage->IsMasterPage() ? pActualPage : static_cast<SdPage*>(&(pActualPage->TRG_GetMasterPage()))) : (pDoc->GetMasterSdPage( 0, bHandoutMode ? PK_NOTES : PK_STANDARD )) ); if( mbHandoutMode ) @@ -455,7 +455,7 @@ HeaderFooterTabPage::~HeaderFooterTabPage() IMPL_LINK_NOARG(HeaderFooterTabPage, LanguageChangeHdl) { - FillFormatList( (int)(sal_IntPtr)mpCBDateTimeFormat->GetEntryData( mpCBDateTimeFormat->GetSelectEntryPos() ) ); + FillFormatList( (int)reinterpret_cast<sal_IntPtr>(mpCBDateTimeFormat->GetEntryData( mpCBDateTimeFormat->GetSelectEntryPos() )) ); return 0L; } @@ -476,7 +476,7 @@ void HeaderFooterTabPage::FillFormatList( int eFormat ) aDate, aTime, nDateTimeFormats[nFormat], *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); sal_uInt16 nEntry = mpCBDateTimeFormat->InsertEntry( aStr ); - mpCBDateTimeFormat->SetEntryData( nEntry, (void*)(sal_IntPtr)nDateTimeFormats[nFormat] ); + mpCBDateTimeFormat->SetEntryData( nEntry, reinterpret_cast<void*>((sal_IntPtr)nDateTimeFormats[nFormat] )); if( nDateTimeFormats[nFormat] == eFormat ) { mpCBDateTimeFormat->SelectEntryPos( nEntry ); @@ -507,7 +507,7 @@ void HeaderFooterTabPage::init( const HeaderFooterSettings& rSettings, bool bNot sal_uInt16 nPos; for( nPos = 0; nPos < mpCBDateTimeFormat->GetEntryCount(); nPos++ ) { - int nFormat = (int)(sal_IntPtr)mpCBDateTimeFormat->GetEntryData( nPos ); + int nFormat = (int)reinterpret_cast<sal_IntPtr>(mpCBDateTimeFormat->GetEntryData( nPos )); if( nFormat == rSettings.meDateTimeFormat ) { mpCBDateTimeFormat->SelectEntryPos( nPos ); @@ -531,7 +531,7 @@ void HeaderFooterTabPage::getData( HeaderFooterSettings& rSettings, bool& rNotOn rSettings.maHeaderText = mpTBHeader->GetText(); if( mpCBDateTimeFormat->GetSelectEntryCount() == 1 ) - rSettings.meDateTimeFormat = (int)(sal_IntPtr)mpCBDateTimeFormat->GetEntryData( mpCBDateTimeFormat->GetSelectEntryPos() ); + rSettings.meDateTimeFormat = (int)reinterpret_cast<sal_IntPtr>(mpCBDateTimeFormat->GetEntryData( mpCBDateTimeFormat->GetSelectEntryPos() )); LanguageType eLanguage = mpCBDateTimeLanguage->GetSelectLanguage(); if( eLanguage != meOldLanguage ) @@ -601,7 +601,7 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo { if( pPage ) { - SdrTextObj* pObj = (SdrTextObj*)pPage->GetPresObj( PRESOBJ_DATETIME ); + SdrTextObj* pObj = static_cast<SdrTextObj*>(pPage->GetPresObj( PRESOBJ_DATETIME )); if( pObj ) { Outliner* pOutl = mpDoc->GetInternalOutliner(); @@ -781,12 +781,12 @@ void PresLayoutPreview::Paint( const Rectangle& ) DrawRect( maOutRect ); // paint presentation objects from masterpage - SdrTextObj* pMasterTitle = (SdrTextObj*)mpMaster->GetPresObj( PRESOBJ_TITLE ); - SdrTextObj* pMasterOutline = (SdrTextObj*)mpMaster->GetPresObj( mpMaster->GetPageKind()==PK_NOTES ? PRESOBJ_NOTES : PRESOBJ_OUTLINE ); - SdrTextObj* pHeader = (SdrTextObj*)mpMaster->GetPresObj( PRESOBJ_HEADER ); - SdrTextObj* pFooter = (SdrTextObj*)mpMaster->GetPresObj( PRESOBJ_FOOTER ); - SdrTextObj* pDate = (SdrTextObj*)mpMaster->GetPresObj( PRESOBJ_DATETIME ); - SdrTextObj* pNumber = (SdrTextObj*)mpMaster->GetPresObj( PRESOBJ_SLIDENUMBER ); + SdrTextObj* pMasterTitle = static_cast<SdrTextObj*>(mpMaster->GetPresObj( PRESOBJ_TITLE )); + SdrTextObj* pMasterOutline = static_cast<SdrTextObj*>(mpMaster->GetPresObj( mpMaster->GetPageKind()==PK_NOTES ? PRESOBJ_NOTES : PRESOBJ_OUTLINE )); + SdrTextObj* pHeader = static_cast<SdrTextObj*>(mpMaster->GetPresObj( PRESOBJ_HEADER )); + SdrTextObj* pFooter = static_cast<SdrTextObj*>(mpMaster->GetPresObj( PRESOBJ_FOOTER )); + SdrTextObj* pDate = static_cast<SdrTextObj*>(mpMaster->GetPresObj( PRESOBJ_DATETIME )); + SdrTextObj* pNumber = static_cast<SdrTextObj*>(mpMaster->GetPresObj( PRESOBJ_SLIDENUMBER )); if( pMasterTitle ) Paint( *this, pMasterTitle, true, true ); diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx b/sd/source/ui/dlg/layeroptionsdlg.cxx index fbf030fd0881..86df27c22cb1 100644 --- a/sd/source/ui/dlg/layeroptionsdlg.cxx +++ b/sd/source/ui/dlg/layeroptionsdlg.cxx @@ -39,13 +39,13 @@ SdInsertLayerDlg::SdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInA get(m_pCbxPrintable, "printable"); get(m_pCbxLocked, "locked"); - m_pEdtName->SetText( ( ( const SdAttrLayerName& ) mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() ); - m_pEdtTitle->SetText( ( ( const SdAttrLayerTitle& ) mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() ); - m_pEdtDesc->SetText( ( ( const SdAttrLayerDesc& ) mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() ); + m_pEdtName->SetText( static_cast<const SdAttrLayerName&>( mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() ); + m_pEdtTitle->SetText( static_cast<const SdAttrLayerTitle&>( mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() ); + m_pEdtDesc->SetText( static_cast<const SdAttrLayerDesc&>( mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() ); m_pEdtDesc->set_height_request(4 * m_pEdtDesc->GetTextHeight()); - m_pCbxVisible->Check( ( ( const SdAttrLayerVisible& ) mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() ); - m_pCbxPrintable->Check( ( ( const SdAttrLayerPrintable& ) mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() ); - m_pCbxLocked->Check( ( ( const SdAttrLayerLocked& ) mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() ); + m_pCbxVisible->Check( static_cast<const SdAttrLayerVisible&>( mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() ); + m_pCbxPrintable->Check( static_cast<const SdAttrLayerPrintable&>( mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() ); + m_pCbxLocked->Check( static_cast<const SdAttrLayerLocked&>( mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() ); get<VclContainer>("nameframe")->Enable(bDeletable); } diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx index 840037256ef2..d10f8224ad8b 100644 --- a/sd/source/ui/dlg/masterlayoutdlg.cxx +++ b/sd/source/ui/dlg/masterlayoutdlg.cxx @@ -41,7 +41,7 @@ MasterLayoutDialog::MasterLayoutDialog( vcl::Window* pParent, SdDrawDocument* pD if( mpCurrentPage && !mpCurrentPage->IsMasterPage() ) { - mpCurrentPage = (SdPage*)(&(mpCurrentPage->TRG_GetMasterPage())); + mpCurrentPage = static_cast<SdPage*>(&(mpCurrentPage->TRG_GetMasterPage())); } if( mpCurrentPage == 0 ) diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index ddd7e5e99301..d00aa94d8a7f 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -51,10 +51,10 @@ MorphDlg::MorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObjec aSet1.Put(pObj1->GetMergedItemSet()); aSet2.Put(pObj2->GetMergedItemSet()); - const XLineStyle eLineStyle1 = ( (const XLineStyleItem&) aSet1.Get( XATTR_LINESTYLE ) ).GetValue(); - const XLineStyle eLineStyle2 = ( (const XLineStyleItem&) aSet2.Get( XATTR_LINESTYLE ) ).GetValue(); - const drawing::FillStyle eFillStyle1 = ( (const XFillStyleItem&) aSet1.Get( XATTR_FILLSTYLE ) ).GetValue(); - const drawing::FillStyle eFillStyle2 = ( (const XFillStyleItem&) aSet2.Get( XATTR_FILLSTYLE ) ).GetValue(); + const XLineStyle eLineStyle1 = static_cast<const XLineStyleItem&>( aSet1.Get( XATTR_LINESTYLE ) ).GetValue(); + const XLineStyle eLineStyle2 = static_cast<const XLineStyleItem&>( aSet2.Get( XATTR_LINESTYLE ) ).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 ( ( ( eLineStyle1 == XLINE_NONE ) || ( eLineStyle2 == XLINE_NONE ) ) && ( ( eFillStyle1 != drawing::FillStyle_SOLID ) || ( eFillStyle2 != drawing::FillStyle_SOLID ) ) ) diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index d87c3d615a6e..53fb0adb873e 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -113,7 +113,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet* rSet ) SfxItemState eItemState = rSet->GetItemState( ATTR_NUMBER_NEWSTART ); if(eItemState > SfxItemState::DEFAULT ) { - const SfxBoolItem& rStart = (const SfxBoolItem&)rSet->Get(ATTR_NUMBER_NEWSTART); + const SfxBoolItem& rStart = static_cast<const SfxBoolItem&>(rSet->Get(ATTR_NUMBER_NEWSTART)); m_pNewStartCB->SetState( rStart.GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE ); m_pNewStartCB->EnableTriState(false); } @@ -127,7 +127,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet* rSet ) eItemState = rSet->GetItemState( ATTR_NUMBER_NEWSTART_AT); if( eItemState > SfxItemState::DEFAULT ) { - sal_Int16 nNewStart = ((const SfxInt16Item&)rSet->Get(ATTR_NUMBER_NEWSTART_AT)).GetValue(); + sal_Int16 nNewStart = static_cast<const SfxInt16Item&>(rSet->Get(ATTR_NUMBER_NEWSTART_AT)).GetValue(); m_pNewStartNumberCB->Check(-1 != nNewStart); if(-1 == nNewStart) nNewStart = 1; diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index c8196434f594..d462faf8b8ce 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -107,25 +107,25 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow, else aRbtCustomshow->Disable(); - if( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_CUSTOMSHOW ) ).GetValue() && pCSList ) + if( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_CUSTOMSHOW ) ).GetValue() && pCSList ) aRbtCustomshow->Check(); - else if( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ALL ) ).GetValue() ) + else if( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ALL ) ).GetValue() ) aRbtAll->Check(); else aRbtAtDia->Check(); - aLbDias->SelectEntry( ( ( const SfxStringItem& ) rOutAttrs.Get( ATTR_PRESENT_DIANAME ) ).GetValue() ); - aCbxManuel->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_MANUEL ) ).GetValue() ); - aCbxMousepointer->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_MOUSE ) ).GetValue() ); - aCbxPen->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_PEN ) ).GetValue() ); - aCbxNavigator->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_NAVIGATOR ) ).GetValue() ); - aCbxAnimationAllowed->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ANIMATION_ALLOWED ) ).GetValue() ); - aCbxChangePage->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_CHANGE_PAGE ) ).GetValue() ); - aCbxAlwaysOnTop->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ALWAYS_ON_TOP ) ).GetValue() ); + aLbDias->SelectEntry( static_cast<const SfxStringItem&>( rOutAttrs.Get( ATTR_PRESENT_DIANAME ) ).GetValue() ); + aCbxManuel->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_MANUEL ) ).GetValue() ); + aCbxMousepointer->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_MOUSE ) ).GetValue() ); + aCbxPen->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_PEN ) ).GetValue() ); + aCbxNavigator->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_NAVIGATOR ) ).GetValue() ); + aCbxAnimationAllowed->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ANIMATION_ALLOWED ) ).GetValue() ); + aCbxChangePage->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_CHANGE_PAGE ) ).GetValue() ); + aCbxAlwaysOnTop->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ALWAYS_ON_TOP ) ).GetValue() ); - const bool bEndless = ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue(); - const bool bWindow = !( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue(); - const long nPause = ( ( const SfxUInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue(); + const bool bEndless = static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_ENDLESS ) ).GetValue(); + const bool bWindow = !static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_FULLSCREEN ) ).GetValue(); + const long nPause = static_cast<const SfxUInt32Item&>( rOutAttrs.Get( ATTR_PRESENT_PAUSE_TIMEOUT ) ).GetValue(); aTmfPause->SetTime( tools::Time( 0, 0, nPause ) ); // set cursor in timefield @@ -133,7 +133,7 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow, Selection aSel( pEdit->GetMaxTextLen(), pEdit->GetMaxTextLen() ); pEdit->SetSelection( aSel ); - aCbxAutoLogo->Check( ( ( const SfxBoolItem& ) rOutAttrs.Get( ATTR_PRESENT_SHOW_PAUSELOGO ) ).GetValue() ); + aCbxAutoLogo->Check( static_cast<const SfxBoolItem&>( rOutAttrs.Get( ATTR_PRESENT_SHOW_PAUSELOGO ) ).GetValue() ); if( bWindow ) aRbtWindow->Check( true ); @@ -179,7 +179,7 @@ sal_Int32 SdStartPresentationDlg::InsertDisplayEntry(const rtl::OUString &aName, { maLBMonitor->InsertEntry( aName ); const sal_uInt32 nEntryIndex = maLBMonitor->GetEntryCount() - 1; - maLBMonitor->SetEntryData( nEntryIndex, (void*)(sal_IntPtr)nDisplay ); + maLBMonitor->SetEntryData( nEntryIndex, reinterpret_cast<void*>((sal_IntPtr)nDisplay) ); return nEntryIndex; } @@ -206,7 +206,7 @@ void SdStartPresentationDlg::InitMonitorSettings() sal_Int32 nSelectedIndex (-1); sal_Int32 nDefaultExternalIndex (-1); const sal_Int32 nDefaultSelectedDisplay ( - ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue()); + static_cast<const SfxInt32Item&>( rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue()); // Un-conditionally add a version for '0' the default external display sal_Int32 nInsertedEntry; @@ -279,7 +279,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr ) sal_Int32 nPos = maLBMonitor->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) - rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)(sal_IntPtr)maLBMonitor->GetEntryData(nPos)) ); + rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)reinterpret_cast<sal_IntPtr>(maLBMonitor->GetEntryData(nPos))) ); nPos = aLbCustomshow->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx index ceafcc5a4ea3..171b82a24fc8 100644 --- a/sd/source/ui/dlg/prltempl.cxx +++ b/sd/source/ui/dlg/prltempl.cxx @@ -115,12 +115,12 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, else SetInputSet( pOrgSet ); - SvxColorListItem aColorListItem(*( (const SvxColorListItem*) ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) ); - SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*) ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) ); - SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*) ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) ); - SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*) ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) ); - SvxDashListItem aDashListItem(*( (const SvxDashListItem*) ( mpDocShell->GetItem( SID_DASH_LIST ) ) ) ); - SvxLineEndListItem aLineEndListItem(*( (const SvxLineEndListItem*) ( mpDocShell->GetItem( SID_LINEEND_LIST ) ) ) ); + SvxColorListItem aColorListItem(*static_cast<const SvxColorListItem*>( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ); + SvxGradientListItem aGradientListItem(*static_cast<const SvxGradientListItem*>( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ); + SvxBitmapListItem aBitmapListItem(*static_cast<const SvxBitmapListItem*>( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ); + SvxHatchListItem aHatchListItem(*static_cast<const SvxHatchListItem*>( mpDocShell->GetItem( SID_HATCH_LIST ) ) ); + SvxDashListItem aDashListItem(*static_cast<const SvxDashListItem*>( mpDocShell->GetItem( SID_DASH_LIST ) ) ); + SvxLineEndListItem aLineEndListItem(*static_cast<const SvxLineEndListItem*>( mpDocShell->GetItem( SID_LINEEND_LIST ) ) ); pColorTab = aColorListItem.GetColorList(); pDashList = aDashListItem.GetDashList(); @@ -268,7 +268,7 @@ void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) else if (nId == mnFont) { - SvxFontListItem aItem(*( (const SvxFontListItem*)( mpDocShell->GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); + SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(mpDocShell->GetItem( SID_ATTR_CHAR_FONTLIST) ) ); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); } diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index 6f0bc81600fa..6d1c1f90202e 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -68,7 +68,7 @@ void SdPresLayoutDlg::Reset() // replace master page if( mrOutAttrs.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE, false, &pPoolItem ) == SfxItemState::SET ) { - bool bMasterPage = ( (const SfxBoolItem*) pPoolItem)->GetValue(); + bool bMasterPage = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue(); m_pCbxMasterPage->Enable( !bMasterPage ); m_pCbxMasterPage->Check( bMasterPage ); } @@ -77,7 +77,7 @@ void SdPresLayoutDlg::Reset() m_pCbxCheckMasters->Check(false); if(mrOutAttrs.GetItemState(ATTR_PRESLAYOUT_NAME, true, &pPoolItem) == SfxItemState::SET) - maName = ((const SfxStringItem*)pPoolItem)->GetValue(); + maName = static_cast<const SfxStringItem*>(pPoolItem)->GetValue(); else maName = ""; @@ -140,7 +140,7 @@ void SdPresLayoutDlg::FillValueSet() for (sal_uInt16 nLayout = 0; nLayout < nCount; nLayout++) { - SdPage* pMaster = (SdPage*)pDoc->GetMasterPage(nLayout); + SdPage* pMaster = static_cast<SdPage*>(pDoc->GetMasterPage(nLayout)); if (pMaster->GetPageKind() == PK_STANDARD) { OUString aLayoutName(pMaster->GetLayoutName()); @@ -239,7 +239,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl) for (sal_uInt16 nLayout = 0; nLayout < nCount; nLayout++) { - SdPage* pMaster = (SdPage*) pTemplDoc->GetMasterPage(nLayout); + SdPage* pMaster = static_cast<SdPage*>( pTemplDoc->GetMasterPage(nLayout) ); if (pMaster->GetPageKind() == PK_STANDARD) { OUString aLayoutName(pMaster->GetLayoutName()); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index e8dee4a407b8..4deac8d75f45 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -148,7 +148,7 @@ sal_Int64 SAL_CALL SdPageObjsTLB::SdPageObjsTransferable::getSomething( const :: if( ( rId.getLength() == 16 ) && ( 0 == memcmp( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) ) { - nRet = (sal_Int64)(sal_IntPtr)this; + nRet = (sal_Int64)reinterpret_cast<sal_IntPtr>(this); } else nRet = SdTransferable::getSomething(rId); @@ -268,13 +268,12 @@ OUString SdPageObjsTLB::getAltLongDescText(SvTreeListEntry* pEntry , bool isAltT sal_uInt16 maxPages = mpDoc->GetPageCount(); sal_uInt16 pageNo; SdrObject* pObj = NULL; - SdPage* pPage = NULL; OUString ParentName = GetEntryText( GetRootLevelParent( pEntry ) ); for( pageNo = 0; pageNo < maxPages; pageNo++ ) { - pPage = (SdPage*) mpDoc->GetPage( pageNo ); + const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetPage( pageNo ) ); if( pPage->GetPageKind() != PK_STANDARD ) continue; if( pPage->GetName() != ParentName ) continue; SdrObjListIter aIter( *pPage, IM_FLAT ); @@ -363,7 +362,7 @@ void SdPageObjsTLB::InitEntry(SvTreeListEntry* pEntry, { sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); - SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); + SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite )); SvLBoxString* pStr = new SvLBoxString( pEntry, 0, pCol->GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } @@ -499,8 +498,6 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, mbShowAllPages = bAllPages; mpMedium = NULL; - SdPage* pPage = NULL; - IconProvider aIconProvider; // first insert all pages including objects @@ -509,7 +506,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, while( nPage < nMaxPages ) { - pPage = (SdPage*) mpDoc->GetPage( nPage ); + const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetPage( nPage ) ); if( (mbShowAllPages || pPage->GetPageKind() == PK_STANDARD) && !(pPage->GetPageKind()==PK_HANDOUT) ) //#94954# never list the normal handout page ( handout-masterpage is used instead ) { @@ -531,7 +528,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, while( nPage < nMaxMasterPages ) { - pPage = (SdPage*) mpDoc->GetMasterPage( nPage ); + const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetMasterPage( nPage ) ); AddShapeList(*pPage, NULL, pPage->GetName(), false, NULL, aIconProvider); nPage++; } @@ -607,7 +604,7 @@ void SdPageObjsTLB::AddShapeList ( if(pEntry) pWindow=(vcl::Window*)GetParent(pEntry); if(pWindow) - pSdNavigatorWin = (SdNavigatorWin*)pWindow; + pSdNavigatorWin = static_cast<SdNavigatorWin*>(pWindow); if( pSdNavigatorWin ) pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); if(pSdDrawDocShell) @@ -650,7 +647,7 @@ void SdPageObjsTLB::AddShapeList ( if(pNewEntry) pWindow=(vcl::Window*)GetParent(pNewEntry); if(pWindow) - pSdNavigatorWin = (SdNavigatorWin*)pWindow; + pSdNavigatorWin = static_cast<SdNavigatorWin*>(pWindow); if( pSdNavigatorWin ) pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); if(pSdDrawDocShell) @@ -684,7 +681,7 @@ void SdPageObjsTLB::AddShapeList ( if(pNewEntry) pWindow=(vcl::Window*)GetParent(pNewEntry); if(pWindow) - pSdNavigatorWin = (SdNavigatorWin*)pWindow; + pSdNavigatorWin = static_cast<SdNavigatorWin*>(pWindow); if( pSdNavigatorWin ) pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); if(pSdDrawDocShell) @@ -733,7 +730,7 @@ void SdPageObjsTLB::AddShapeList ( if(pNewEntry) pWindow=(vcl::Window*)GetParent(pNewEntry); if(pWindow) - pSdNavigatorWin = (SdNavigatorWin*)pWindow; + pSdNavigatorWin = static_cast<SdNavigatorWin*>(pWindow); if( pSdNavigatorWin ) pSdDrawDocShell = pSdNavigatorWin->GetDrawDocShell(mpDoc); if(pSdDrawDocShell) @@ -810,7 +807,6 @@ bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) return false; SdrObject* pObj = NULL; - SdPage* pPage = NULL; SvTreeListEntry* pEntry = First(); OUString aName; @@ -820,7 +816,7 @@ bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) while( nPage < nMaxPages ) { - pPage = (SdPage*) mpDoc->GetPage( nPage ); + const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetPage( nPage ) ); if( pPage->GetPageKind() == PK_STANDARD ) { if( !pEntry ) @@ -915,7 +911,7 @@ void SdPageObjsTLB::RequestingChildren( SvTreeListEntry* pFileEntry ) while( nPage < nMaxPages ) { - pPage = (SdPage*) mpBookmarkDoc->GetPage( nPage ); + pPage = static_cast<SdPage*>( mpBookmarkDoc->GetPage( nPage ) ); if( pPage->GetPageKind() == PK_STANDARD ) { pPageEntry = InsertEntry( pPage->GetName(), @@ -1126,7 +1122,7 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel) SvTreeListEntry* pEntry = GetEntry(rPosPixel); if( mpFrame->HasChildWindow( SID_NAVIGATOR ) ) - pNavWin = (SdNavigatorWin*) ( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ); + pNavWin = static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ); if (pEntry != NULL && pNavWin !=NULL @@ -1173,7 +1169,7 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel) void SdPageObjsTLB::DoDrag() { mpDropNavWin = ( mpFrame->HasChildWindow( SID_NAVIGATOR ) ) ? - (SdNavigatorWin*)( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ) : + static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ) : NULL; if( mpDropNavWin ) @@ -1228,7 +1224,7 @@ void SdPageObjsTLB::DoDrag() SdrObject* pObject = NULL; void* pUserData = GetCurEntry()->GetUserData(); - if (pUserData != NULL && pUserData != (void*)1) + if (pUserData != NULL && pUserData != reinterpret_cast<void*>(1)) pObject = reinterpret_cast<SdrObject*>(pUserData); if (pObject != NULL) { @@ -1264,7 +1260,7 @@ void SdPageObjsTLB::OnDragFinished( sal_uInt8 ) { if( mpFrame->HasChildWindow( SID_NAVIGATOR ) ) { - SdNavigatorWin* pNewNavWin = (SdNavigatorWin*) ( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ); + SdNavigatorWin* pNewNavWin = static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ); if( mpDropNavWin == pNewNavWin) { @@ -1335,7 +1331,7 @@ sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt ) sal_uInt16 nId = SID_NAVIGATOR; if( mpFrame->HasChildWindow( nId ) ) - pNavWin = (SdNavigatorWin*)( mpFrame->GetChildWindow( nId )->GetContextWindow( SD_MOD() ) ); + pNavWin = static_cast<SdNavigatorWin*>( mpFrame->GetChildWindow( nId )->GetContextWindow( SD_MOD() ) ); if( pNavWin && ( pNavWin == mpParent ) ) { @@ -1343,7 +1339,7 @@ sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt ) OUString aFile; if( aDataHelper.GetString( FORMAT_FILE, aFile ) && - ( (SdNavigatorWin*) mpParent)->InsertFile( aFile ) ) + static_cast<SdNavigatorWin*>(mpParent)->InsertFile( aFile ) ) { nRet = rEvt.mnAction; } diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx index 4d633580d476..409d4bf477b0 100644 --- a/sd/source/ui/dlg/tabtempl.cxx +++ b/sd/source/ui/dlg/tabtempl.cxx @@ -144,8 +144,8 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } else if (nId == m_nFontId) { - SvxFontListItem aItem(*( (const SvxFontListItem*) - ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); + SvxFontListItem aItem(*static_cast<const SvxFontListItem*>( + rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index be80813b5957..b07f8b3bc207 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -86,8 +86,8 @@ SdActionDlg::SdActionDlg ( assert(pNewPage); //Unable to create page // formerly in PageCreated - ( (SdTPAction*) pNewPage )->SetView( pView ); - ( (SdTPAction*) pNewPage )->Construct(); + static_cast<SdTPAction*>( pNewPage )->SetView( pView ); + static_cast<SdTPAction*>( pNewPage )->Construct(); SetTabPage( pNewPage ); } @@ -156,7 +156,7 @@ void SdTPAction::SetView( const ::sd::View* pSdView ) m_pLbTree->SetViewFrame( pFrame ); m_pLbTreeDocument->SetViewFrame( pFrame ); - SvxColorListItem aItem( *(const SvxColorListItem*)( pDocSh->GetItem( SID_COLOR_TABLE ) ) ); + SvxColorListItem aItem( *static_cast<const SvxColorListItem*>( pDocSh->GetItem( SID_COLOR_TABLE ) ) ); pColList = aItem.GetColorList(); DBG_ASSERT( pColList.is(), "No color table available!" ); } @@ -188,7 +188,7 @@ void SdTPAction::Construct() if (nInv == SdrInventor && nSdrObjKind == OBJ_OLE2) { - pOleObj = (SdrOle2Obj*) pObj; + pOleObj = static_cast<SdrOle2Obj*>(pObj); } else if (nInv == SdrInventor && nSdrObjKind == OBJ_GRAF) { @@ -307,7 +307,7 @@ void SdTPAction::Reset( const SfxItemSet* rAttrs ) // m_pLbAction if( rAttrs->GetItemState( ATTR_ACTION ) != SfxItemState::DONTCARE ) { - eCA = (presentation::ClickAction) ( ( const SfxAllEnumItem& ) rAttrs-> + eCA = (presentation::ClickAction) static_cast<const SfxAllEnumItem&>( rAttrs-> Get( ATTR_ACTION ) ).GetValue(); SetActualClickAction( eCA ); } @@ -317,7 +317,7 @@ void SdTPAction::Reset( const SfxItemSet* rAttrs ) // m_pEdtSound if( rAttrs->GetItemState( ATTR_ACTION_FILENAME ) != SfxItemState::DONTCARE ) { - aFileName = ( ( const SfxStringItem& ) rAttrs->Get( ATTR_ACTION_FILENAME ) ).GetValue(); + aFileName = static_cast<const SfxStringItem&>( rAttrs->Get( ATTR_ACTION_FILENAME ) ).GetValue(); SetEditText( aFileName ); } diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 82a12dc8f6c0..632ed078249d 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -82,8 +82,8 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) { SvxGridTabPage::Reset(rAttrs); - SdOptionsSnapItem aOptsItem( (const SdOptionsSnapItem&) rAttrs-> - Get( ATTR_OPTIONS_SNAP ) ); + SdOptionsSnapItem aOptsItem( static_cast<const SdOptionsSnapItem&>( rAttrs-> + Get( ATTR_OPTIONS_SNAP ) ) ); pCbxSnapHelplines->Check( aOptsItem.GetOptionsSnap().IsSnapHelplines() ); pCbxSnapBorder->Check( aOptsItem.GetOptionsSnap().IsSnapBorder() ); @@ -148,11 +148,11 @@ bool SdTpOptionsContents::FillItemSet( SfxItemSet* rAttrs ) void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs ) { - SdOptionsContentsItem aOptsItem( (const SdOptionsContentsItem&) rAttrs-> - Get( ATTR_OPTIONS_CONTENTS ) ); + SdOptionsContentsItem aOptsItem( static_cast<const SdOptionsContentsItem&>( rAttrs-> + Get( ATTR_OPTIONS_CONTENTS ) ) ); - SdOptionsLayoutItem aLayoutItem( (const SdOptionsLayoutItem&) rAttrs-> - Get( ATTR_OPTIONS_LAYOUT ) ); + SdOptionsLayoutItem aLayoutItem( static_cast<const SdOptionsLayoutItem&>( rAttrs-> + Get( ATTR_OPTIONS_LAYOUT ) ) ); m_pCbxRuler->Check( aLayoutItem.GetOptionsLayout().IsRulerVisible() ); m_pCbxMoveOutline->Check( aLayoutItem.GetOptionsLayout().IsMoveOutline() ); @@ -219,7 +219,7 @@ SdTpOptionsMisc::SdTpOptionsMisc(vcl::Window* pParent, const SfxItemSet& rInAttr sal_uInt16 nWhich = GetWhich( SID_ATTR_METRIC ); if ( rInAttrs.GetItemState( nWhich ) >= SfxItemState::DEFAULT ) { - const SfxUInt16Item& rItem = (SfxUInt16Item&)rInAttrs.Get( nWhich ); + const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rInAttrs.Get( nWhich )); eFUnit = (FieldUnit)rItem.GetValue(); } else @@ -240,7 +240,7 @@ SdTpOptionsMisc::SdTpOptionsMisc(vcl::Window* pParent, const SfxItemSet& rInAttr OUString sMetric = aMetricArr.GetStringByPos( i ); sal_IntPtr nFieldUnit = aMetricArr.GetValue( i ); sal_Int32 nPos = m_pLbMetric->InsertEntry( sMetric ); - m_pLbMetric->SetEntryData( nPos, (void*)nFieldUnit ); + m_pLbMetric->SetEntryData( nPos, reinterpret_cast<void*>(nFieldUnit) ); } m_pLbMetric->SetSelectHdl( LINK( this, SdTpOptionsMisc, SelectMetricHdl_Impl ) ); @@ -289,7 +289,7 @@ void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet ) if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_METRIC , false, (const SfxPoolItem**)&pAttr )) { - const SfxUInt16Item* pItem = (SfxUInt16Item*) pAttr; + const SfxUInt16Item* pItem = static_cast<const SfxUInt16Item*>(pAttr); FieldUnit eFUnit = (FieldUnit)(long)pItem->GetValue(); @@ -382,7 +382,7 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) const sal_Int32 nMPos = m_pLbMetric->GetSelectEntryPos(); if ( m_pLbMetric->IsValueChangedFromSaved() ) { - sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pLbMetric->GetEntryData( nMPos ); + sal_uInt16 nFieldUnit = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pLbMetric->GetEntryData( nMPos )); rAttrs->Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ), (sal_uInt16)nFieldUnit ) ); bModified = true; @@ -412,8 +412,8 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) { - SdOptionsMiscItem aOptsItem( (const SdOptionsMiscItem&) rAttrs-> - Get( ATTR_OPTIONS_MISC ) ); + SdOptionsMiscItem aOptsItem( static_cast<const SdOptionsMiscItem&>( rAttrs-> + Get( ATTR_OPTIONS_MISC ) ) ); m_pCbxStartWithTemplate->Check( aOptsItem.GetOptionsMisc().IsStartWithTemplate() ); m_pCbxMarkedHitMovesAlways->Check( aOptsItem.GetOptionsMisc().IsMarkedHitMovesAlways() ); @@ -443,12 +443,12 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) if ( rAttrs->GetItemState( nWhich ) >= SfxItemState::DEFAULT ) { - const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs->Get( nWhich ); + const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rAttrs->Get( nWhich )); long nFieldUnit = (long)rItem.GetValue(); for ( sal_Int32 i = 0; i < m_pLbMetric->GetEntryCount(); ++i ) { - if ( (sal_IntPtr)m_pLbMetric->GetEntryData( i ) == nFieldUnit ) + if ( reinterpret_cast<sal_IntPtr>(m_pLbMetric->GetEntryData( i )) == nFieldUnit ) { m_pLbMetric->SelectEntryPos( i ); break; @@ -461,19 +461,19 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) if( rAttrs->GetItemState( nWhich ) >= SfxItemState::DEFAULT ) { SfxMapUnit eUnit = rAttrs->GetPool()->GetMetric( nWhich ); - const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs->Get( nWhich ); + const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rAttrs->Get( nWhich )); SetMetricValue( *m_pMtrFldTabstop, rItem.GetValue(), eUnit ); } m_pLbMetric->SaveValue(); m_pMtrFldTabstop->SaveValue(); //Scale - sal_Int32 nX = ( (const SfxInt32Item&) rAttrs-> + sal_Int32 nX = static_cast<const SfxInt32Item&>( rAttrs-> Get( ATTR_OPTIONS_SCALE_X ) ).GetValue(); - sal_Int32 nY = ( (const SfxInt32Item&) rAttrs-> + sal_Int32 nY = static_cast<const SfxInt32Item&>( rAttrs-> Get( ATTR_OPTIONS_SCALE_Y ) ).GetValue(); - nWidth = ( (const SfxUInt32Item&) rAttrs-> + nWidth = static_cast<const SfxUInt32Item&>( rAttrs-> Get( ATTR_OPTIONS_SCALE_WIDTH ) ).GetValue(); - nHeight = ( (const SfxUInt32Item&) rAttrs-> + nHeight = static_cast<const SfxUInt32Item&>( rAttrs-> Get( ATTR_OPTIONS_SCALE_HEIGHT ) ).GetValue(); m_pCbScale->SetText( GetScale( nX, nY ) ); @@ -500,7 +500,7 @@ IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - FieldUnit eUnit = (FieldUnit)(sal_IntPtr)m_pLbMetric->GetEntryData( nPos ); + FieldUnit eUnit = (FieldUnit)reinterpret_cast<sal_IntPtr>(m_pLbMetric->GetEntryData( nPos )); sal_Int64 nVal = m_pMtrFldTabstop->Denormalize( m_pMtrFldTabstop->GetValue( FUNIT_TWIP ) ); SetFieldUnit( *m_pMtrFldTabstop, eUnit ); diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx index eb7f1334e2e2..c8f290ff2ec2 100644 --- a/sd/source/ui/dlg/unchss.cxx +++ b/sd/source/ui/dlg/unchss.cxx @@ -21,6 +21,7 @@ #include <svl/style.hxx> #include <svl/smplhint.hxx> #include <svx/svdobj.hxx> +#include <svx/svdpool.hxx> #include "unchss.hxx" @@ -43,10 +44,10 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, // Create ItemSets; Attention, it is possible that the new one is from a, // different pool. Therefore we clone it with its items. - pNewSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(), pTheNewItemSet->GetRanges()); + pNewSet = new SfxItemSet(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges()); SdrModel::MigrateItemSet( pTheNewItemSet, pNewSet, pTheDoc ); - pOldSet = new SfxItemSet((SfxItemPool&)SdrObject::GetGlobalDrawObjectItemPool(),pStyleSheet->GetItemSet().GetRanges()); + pOldSet = new SfxItemSet(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pStyleSheet->GetItemSet().GetRanges()); SdrModel::MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet, pTheDoc ); aComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT); @@ -99,7 +100,7 @@ void StyleSheetUndoAction::Undo() pStyleSheet->GetItemSet().Set(aNewSet); if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) - ( (SdStyleSheet*)pStyleSheet )->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + static_cast<SdStyleSheet*>(pStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); else pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } @@ -111,7 +112,7 @@ void StyleSheetUndoAction::Redo() pStyleSheet->GetItemSet().Set(aNewSet); if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) - ( (SdStyleSheet*)pStyleSheet )->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); + static_cast<SdStyleSheet*>(pStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); else pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 7d7774242449..c58665666b4a 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -246,7 +246,7 @@ void SdVectorizeDlg::AddTile( BitmapReadAccess* pRAcc, GDIMetaFile& rMtf, IMPL_LINK( SdVectorizeDlg, ProgressHdl, void*, pData ) { - m_pPrgs->SetValue( (sal_uInt16)(sal_uLong) pData ); + m_pPrgs->SetValue( (sal_uInt16)reinterpret_cast<sal_uLong>(pData) ); return 0L; } diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 6c81c2f8f1c2..87783e8a7f2f 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -144,13 +144,12 @@ void DrawDocShell::Execute( SfxRequest& rReq ) if (pReqArgs) { - const SvxSearchItem* pSearchItem = - (const SvxSearchItem*) &pReqArgs->Get(SID_SEARCH_ITEM); + const SvxSearchItem* pSearchItem = static_cast<const SvxSearchItem*>( &pReqArgs->Get(SID_SEARCH_ITEM) ); // would be nice to have an assign operation at SearchItem SvxSearchItem* pAppSearchItem = SD_MOD()->GetSearchItem(); delete pAppSearchItem; - pAppSearchItem = (SvxSearchItem*) pSearchItem->Clone(); + pAppSearchItem = static_cast<SvxSearchItem*>( pSearchItem->Clone() ); SD_MOD()->SetSearchItem(pAppSearchItem); } @@ -177,7 +176,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) { if (pShell->ISA(DrawDocShell)) { - ( (DrawDocShell*) pShell)->CancelSearching(); + static_cast<DrawDocShell*>(pShell)->CancelSearching(); } pShell = SfxObjectShell::GetNext(*pShell); @@ -213,12 +212,12 @@ void DrawDocShell::Execute( SfxRequest& rReq ) if( xFuSearch.is() ) { const SvxSearchItem* pSearchItem = - (const SvxSearchItem*) &pReqArgs->Get(SID_SEARCH_ITEM); + static_cast<const SvxSearchItem*>( &pReqArgs->Get(SID_SEARCH_ITEM) ); // would be nice to have an assign operation at SearchItem SvxSearchItem* pAppSearchItem = SD_MOD()->GetSearchItem(); delete pAppSearchItem; - pAppSearchItem = (SvxSearchItem*)pSearchItem->Clone(); + pAppSearchItem = static_cast<SvxSearchItem*>( pSearchItem->Clone() ); SD_MOD()->SetSearchItem(pAppSearchItem); xFuSearch->SearchAndReplace(pSearchItem); } @@ -236,7 +235,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) case SID_GET_COLORLIST: { - SvxColorListItem* pColItem = (SvxColorListItem*) GetItem( SID_COLOR_TABLE ); + const SvxColorListItem* pColItem = static_cast<const SvxColorListItem*>( GetItem( SID_COLOR_TABLE ) ); XColorListRef pList = pColItem->GetColorList(); rReq.SetReturnValue( OfaRefItem<XColorList>( SID_GET_COLORLIST, pList ) ); } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 6286f942c505..07cd46c1d867 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -901,7 +901,7 @@ bool DrawDocShell::GetObjectIsmarked(const OUString& rBookmark) GetDispatcher()->Execute( SID_VIEWSHELL0, SfxCallMode::SYNCHRON | SfxCallMode::RECORD ); // The current ViewShell changed - pDrViewSh = (DrawViewShell*) mpViewShell; + pDrViewSh = static_cast<DrawViewShell*>( mpViewShell ); } setEditMode(pDrViewSh, bIsMasterPage); @@ -994,7 +994,7 @@ bool DrawDocShell::GotoTreeBookmark(const OUString& rBookmark) GetDispatcher()->Execute( SID_VIEWSHELL0, SfxCallMode::SYNCHRON | SfxCallMode::RECORD ); // The current ViewShell changed - pDrViewSh = (DrawViewShell*) mpViewShell; + pDrViewSh = static_cast<DrawViewShell*>( mpViewShell ); } setEditMode(pDrViewSh, bIsMasterPage); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 2ba46fd45a44..a66a09138bdd 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -638,7 +638,7 @@ void DrawViewShell::FuDeleteSelectedObjects() for (size_t i=0; i < rMarkList.GetMarkCount(); ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); - SdPage* pPage = (SdPage*)pObj->GetPage(); + SdPage* pPage = static_cast<SdPage*>(pObj->GetPage()); PresObjKind eKind = pPage->GetPresObjKind(pObj); if (eKind == PRESOBJ_FOOTER || eKind == PRESOBJ_HEADER || eKind == PRESOBJ_DATETIME || eKind == PRESOBJ_SLIDENUMBER) @@ -651,7 +651,7 @@ void DrawViewShell::FuDeleteSelectedObjects() { //Unmark object mpDrawView->MarkObj(pObj, mpDrawView->GetSdrPageView(), true); - SdPage* pPage = (SdPage*)pObj->GetPage(); + SdPage* pPage = static_cast<SdPage*>(pObj->GetPage()); //remove placeholder from master page pPage->DestroyDefaultPresObj(pPage->GetPresObjKind(pObj)); } |