diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-01 10:18:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-12-02 09:32:10 +0200 |
commit | cf16234a23a716fe98adf32dd5b56d48be242c99 (patch) | |
tree | 71bde1012375f19303809d233f02c00274854559 /sw/source/uibase | |
parent | aeb6c0ed64a76c722158bf91313b42561cd66071 (diff) |
loplugin: cstylecast
Change-Id: If31b41296a91c6a6ac990494e88ab7b47240a823
Diffstat (limited to 'sw/source/uibase')
23 files changed, 157 insertions, 156 deletions
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx index ebe50a6303de..ed4a66aeb3b1 100644 --- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx +++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx @@ -535,7 +535,7 @@ void PagePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pSt meFUnit = FUNIT_NONE; if ( pState && eState >= SfxItemState::DEFAULT ) { - meFUnit = (FieldUnit)( (const SfxUInt16Item*)pState )->GetValue(); + meFUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pState )->GetValue(); } else { @@ -550,7 +550,7 @@ void PagePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pSt { const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); if ( pItem ) - meFUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); + meFUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem )->GetValue(); } else { diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index 5540680ac9e6..ffaa51547446 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -141,16 +141,16 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh ) if(bBackground) { if(pItem) - rSh.SetBoxBackground( *(const SvxBrushItem*)pItem ); + rSh.SetBoxBackground( *static_cast<const SvxBrushItem*>(pItem) ); if(pRowItem) { - SvxBrushItem aBrush(*(const SvxBrushItem*)pRowItem); + SvxBrushItem aBrush(*static_cast<const SvxBrushItem*>(pRowItem)); aBrush.SetWhich(RES_BACKGROUND); rSh.SetRowBackground(aBrush); } if(pTableItem) { - SvxBrushItem aBrush(*(const SvxBrushItem*)pTableItem); + SvxBrushItem aBrush(*static_cast<const SvxBrushItem*>(pTableItem)); aBrush.SetWhich(RES_BACKGROUND); rSh.SetTabBackground( aBrush ); } diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index c15d1670f3bc..612b4aa3ba50 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -688,9 +688,9 @@ void SwPagePreview::Execute( SfxRequest &rReq ) const SfxItemSet *pArgs = rReq.GetArgs(); if( pArgs && pArgs->Count() >= 2 ) { - sal_uInt8 nCols = (sal_uInt8)((SfxUInt16Item &)pArgs->Get( + sal_uInt8 nCols = (sal_uInt8)static_cast<const SfxUInt16Item &>(pArgs->Get( SID_ATTR_TABLE_COLUMN)).GetValue(); - sal_uInt8 nRows = (sal_uInt8)((SfxUInt16Item &)pArgs->Get( + sal_uInt8 nRows = (sal_uInt8)static_cast<const SfxUInt16Item &>(pArgs->Get( SID_ATTR_TABLE_ROW)).GetValue(); pViewWin->CalcWish( nRows, nCols ); @@ -1103,7 +1103,7 @@ void SwPagePreview::Init(const SwViewOption * pPrefs) // Update the fields // ATTENTION: Do cast the EditShell up, to use the SS. // At the methodes the current shell will be queried! - SwEditShell* pESh = (SwEditShell*)GetViewShell(); + SwEditShell* pESh = static_cast<SwEditShell*>(GetViewShell()); bool bIsModified = pESh->IsModified(); SwViewOption aOpt( *pPrefs ); @@ -1643,7 +1643,7 @@ sal_uInt16 SwPagePreview::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, if ( pOld && pOld->IsPrinting() ) return SFX_PRINTERROR_BUSY; - SwEditShell &rESh = (SwEditShell&)rSh; //Buh... + SwEditShell &rESh = static_cast<SwEditShell&>(rSh); //Buh... if( ( SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ) & nDiffFlags ) { rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true ); diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index b54333dad3be..276094914e42 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -342,7 +342,7 @@ void SwSrcView::Execute(SfxRequest& rReq) pMed = pDocShell->GetMedium(); else { - SfxBoolItem* pItem = (SfxBoolItem*)pDocShell->ExecuteSlot(rReq, pDocShell->GetInterface()); + const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(pDocShell->ExecuteSlot(rReq, pDocShell->GetInterface())); if(pItem && pItem->GetValue()) pMed = pDocShell->GetMedium(); } @@ -368,8 +368,8 @@ void SwSrcView::Execute(SfxRequest& rReq) const sal_uInt16 nWhich = pTmpArgs->GetWhichByPos( 0 ); OSL_ENSURE( nWhich, "Which for SearchItem ?" ); const SfxPoolItem& rItem = pTmpArgs->Get( nWhich ); - SetSearchItem( (const SvxSearchItem&)rItem); - StartSearchAndReplace( (const SvxSearchItem&)rItem, false, rReq.IsAPI() ); + SetSearchItem( static_cast<const SvxSearchItem&>(rItem)); + StartSearchAndReplace( static_cast<const SvxSearchItem&>(rItem), false, rReq.IsAPI() ); if(aEditWin.IsModified()) GetDocShell()->GetDoc()->getIDocumentState().SetModified(); } @@ -563,7 +563,7 @@ SvxSearchItem* SwSrcView::GetSearchItem() void SwSrcView::SetSearchItem( const SvxSearchItem& rItem ) { delete pSearchItem; - pSearchItem = (SvxSearchItem*)rItem.Clone(); + pSearchItem = static_cast<SvxSearchItem*>(rItem.Clone()); } sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 346c9e124618..f0841cc194c0 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -801,7 +801,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) } else if( dynamic_cast<SwWrtShell*>( pDocSh->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() ) ) { - m_pWrtShell = new SwWrtShell( *(SwWrtShell*)pDocSh->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(), + m_pWrtShell = new SwWrtShell( *static_cast<SwWrtShell*>(pDocSh->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()), m_pEditWin, *this); } else diff --git a/sw/source/uibase/uiview/view1.cxx b/sw/source/uibase/uiview/view1.cxx index 0a56ee679108..b35767476df2 100644 --- a/sw/source/uibase/uiview/view1.cxx +++ b/sw/source/uibase/uiview/view1.cxx @@ -83,26 +83,26 @@ void SwView::Activate(bool bMDIActivate) // Initialize Flddlg newly if necessary (e.g. for TYP_SETVAR) sal_uInt16 nId = SwFldDlgWrapper::GetChildWindowId(); SfxViewFrame* pVFrame = GetViewFrame(); - SwFldDlgWrapper *pWrp = (SwFldDlgWrapper*)pVFrame->GetChildWindow(nId); + SwFldDlgWrapper *pWrp = static_cast<SwFldDlgWrapper*>(pVFrame->GetChildWindow(nId)); if (pWrp) pWrp->ReInitDlg(GetDocShell()); // Initialize RedlineDlg newly if necessary nId = SwRedlineAcceptChild::GetChildWindowId(); - SwRedlineAcceptChild *pRed = (SwRedlineAcceptChild*)pVFrame->GetChildWindow(nId); + SwRedlineAcceptChild *pRed = static_cast<SwRedlineAcceptChild*>(pVFrame->GetChildWindow(nId)); if (pRed) pRed->ReInitDlg(GetDocShell()); // reinit IdxMarkDlg nId = SwInsertIdxMarkWrapper::GetChildWindowId(); - SwInsertIdxMarkWrapper *pIdxMrk = (SwInsertIdxMarkWrapper*)pVFrame->GetChildWindow(nId); + SwInsertIdxMarkWrapper *pIdxMrk = static_cast<SwInsertIdxMarkWrapper*>(pVFrame->GetChildWindow(nId)); if (pIdxMrk) pIdxMrk->ReInitDlg(*m_pWrtShell); // reinit AuthMarkDlg nId = SwInsertAuthMarkWrapper::GetChildWindowId(); - SwInsertAuthMarkWrapper *pAuthMrk = (SwInsertAuthMarkWrapper*)pVFrame-> - GetChildWindow(nId); + SwInsertAuthMarkWrapper *pAuthMrk = static_cast<SwInsertAuthMarkWrapper*>(pVFrame-> + GetChildWindow(nId)); if (pAuthMrk) pAuthMrk->ReInitDlg(*m_pWrtShell); } @@ -153,7 +153,7 @@ void SwView::ExecFormatPaintbrush(SfxRequest& rReq) const SfxItemSet *pArgs = rReq.GetArgs(); if( pArgs && pArgs->Count() >= 1 ) { - bPersistentCopy = static_cast<bool>(((SfxBoolItem &)pArgs->Get( + bPersistentCopy = static_cast<bool>(static_cast<const SfxBoolItem &>(pArgs->Get( SID_FORMATPAINTBRUSH)).GetValue()); } diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 64ff288b8005..8324cf0387e6 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -584,7 +584,7 @@ void SwView::Execute(SfxRequest &rReq) vcl::Window* pParent; const SfxPoolItem* pParentItem; if( SfxItemState::SET == pArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) ) - pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr(); + pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); SfxPasswordDialog aPasswdDlg( pParent ); @@ -622,7 +622,7 @@ void SwView::Execute(SfxRequest &rReq) vcl::Window* pParent; const SfxPoolItem* pParentItem; if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_ATTR_XWINDOW, false, &pParentItem ) ) - pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr(); + pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); SfxPasswordDialog aPasswdDlg( pParent ); @@ -790,8 +790,8 @@ void SwView::Execute(SfxRequest &rReq) // re-initialize the Redline dialog const sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId(); - SwRedlineAcceptChild *pRed = (SwRedlineAcceptChild*) - pVFrame->GetChildWindow(nId); + SwRedlineAcceptChild *pRed = static_cast<SwRedlineAcceptChild*>( + pVFrame->GetChildWindow(nId)); if (pRed) pRed->ReInitDlg(GetDocShell()); } @@ -1080,7 +1080,7 @@ void SwView::Execute(SfxRequest &rReq) break; case SID_JUMPTOMARK: if( pArgs && SfxItemState::SET == pArgs->GetItemState(SID_JUMPTOMARK, false, &pItem)) - JumpToSwMark( (( const SfxStringItem*)pItem)->GetValue() ); + JumpToSwMark( static_cast<const SfxStringItem*>(pItem)->GetValue() ); break; case SID_GALLERY : // First make sure that the sidebar is visible @@ -1375,7 +1375,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) aWordCount = aWordCount.replaceFirst( "%2", rLocaleData.getNum( nChar, 0 ) ); rSet.Put( SfxStringItem( FN_STAT_WORDCOUNT, aWordCount ) ); - SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId())); if (pWrdCnt) pWrdCnt->SetCounts(selectionStats, documentStats); } @@ -2048,9 +2048,9 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) else { OUString sFile, sFilter; - sFile = ( (const SfxStringItem *)pItem )->GetValue(); + sFile = static_cast<const SfxStringItem *>( pItem )->GetValue(); if ( SfxItemState::SET == rRequest.GetArgs()->GetItemState( FN_PARAM_1, true, &pItem ) ) - sFilter = ( (const SfxStringItem *)pItem )->GetValue(); + sFilter = static_cast<const SfxStringItem *>(pItem )->GetValue(); bool bHasFileName = !sFile.isEmpty(); long nFound = InsertDoc( nSlot, sFile, sFilter ); @@ -2441,7 +2441,7 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) // re-initialize Redline dialog sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId(); - SwRedlineAcceptChild* pRed = (SwRedlineAcceptChild*)pVFrame->GetChildWindow( nId ); + SwRedlineAcceptChild* pRed = static_cast<SwRedlineAcceptChild*>(pVFrame->GetChildWindow( nId )); if ( pRed ) pRed->ReInitDlg( GetDocShell() ); } diff --git a/sw/source/uibase/uiview/viewdlg.cxx b/sw/source/uibase/uiview/viewdlg.cxx index a308f9978f36..bb7d3796b3e9 100644 --- a/sw/source/uibase/uiview/viewdlg.cxx +++ b/sw/source/uibase/uiview/viewdlg.cxx @@ -49,7 +49,7 @@ void SwView::ExecDlg(SfxRequest &rReq) { if ( pItem ) { - sal_uInt16 nValue = ((SfxUInt16Item *)pItem)->GetValue(); + sal_uInt16 nValue = static_cast<const SfxUInt16Item *>(pItem)->GetValue(); sal_uInt16 nOldValue = m_pWrtShell->GetPageOffset(); sal_uInt16 nPage, nLogPage; m_pWrtShell->GetPageNum( nPage, nLogPage, diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx index 59633e69980a..c16e48274d8c 100644 --- a/sw/source/uibase/uiview/viewdlg2.cxx +++ b/sw/source/uibase/uiview/viewdlg2.cxx @@ -126,13 +126,13 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt) SwFldMgr aMgr(&rSh); SwSetExpFieldType* pFldType = - (SwSetExpFieldType*)aMgr.GetFldType(RES_SETEXPFLD, rName); + static_cast<SwSetExpFieldType*>(aMgr.GetFldType(RES_SETEXPFLD, rName)); if (!pFldType && !rName.isEmpty() ) { // Create new field types SwSetExpFieldType aSwSetExpFieldType(rSh.GetDoc(), rName, nsSwGetSetExpType::GSE_SEQ); aMgr.InsertFldType(aSwSetExpFieldType); - pFldType = (SwSetExpFieldType*)aMgr.GetFldType(RES_SETEXPFLD, rName); + pFldType = static_cast<SwSetExpFieldType*>(aMgr.GetFldType(RES_SETEXPFLD, rName)); } if (!pOpt->IgnoreSeqOpts()) diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 1decd9275a92..d3e3705206a4 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -219,7 +219,7 @@ void SwView::ExecDraw(SfxRequest& rReq) SwDrawBase* pFuncPtr = GetDrawFuncPtr(); if( pFuncPtr && pFuncPtr->GetSlotId() == SID_DRAW_CS_ID ) { - ConstCustomShape* pConstCustomShape = (ConstCustomShape*)(pFuncPtr); + ConstCustomShape* pConstCustomShape = static_cast<ConstCustomShape*>(pFuncPtr); OUString aNew = ConstCustomShape::GetShapeTypeFromRequest( rReq ); OUString aOld = pConstCustomShape->GetShapeType(); if( aNew == aOld ) @@ -563,7 +563,7 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, if(pObj->ISA(SwDrawVirtObj)) { - SwDrawVirtObj* pVirtObj = (SwDrawVirtObj*)pObj; + SwDrawVirtObj* pVirtObj = static_cast<SwDrawVirtObj*>(pObj); pToBeActivated = &const_cast<SdrObject&>(pVirtObj->GetReferencedObj()); aNewTextEditOffset = pVirtObj->GetOffset(); } diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index b9938c2691b4..1abec862378a 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -864,7 +864,7 @@ IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) OUString sKey = OUString( ODF_FORMDROPDOWN_RESULT ); (*pFieldmark->GetParameters())[ sKey ] = makeAny(selection); pFieldmark->Invalidate(); - SwView& rView = ( ( SwEditWin* )GetParent() )->GetView(); + SwView& rView = static_cast<SwEditWin*>( GetParent() )->GetView(); rView.GetDocShell()->SetModified( true ); } diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index ae721da903e2..effb2bef9c42 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -110,7 +110,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) case SID_SEARCH_ITEM: { delete m_pSrchItem; - m_pSrchItem = (SvxSearchItem*) pArgs->Get(SID_SEARCH_ITEM).Clone(); + m_pSrchItem = static_cast<SvxSearchItem*>( pArgs->Get(SID_SEARCH_ITEM).Clone() ); } break; @@ -124,7 +124,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) { // Unregister dialog delete m_pSrchItem; - m_pSrchItem = (SvxSearchItem*) pArgs->Get(SID_SEARCH_ITEM).Clone(); + m_pSrchItem = static_cast<SvxSearchItem*>( pArgs->Get(SID_SEARCH_ITEM).Clone() ); DELETEZ( m_pSrchList ); DELETEZ( m_pReplList ); @@ -180,7 +180,7 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) if ( pArgs ) { delete m_pSrchItem; - m_pSrchItem = (SvxSearchItem*) pArgs->Get(SID_SEARCH_ITEM).Clone(); + m_pSrchItem = static_cast<SvxSearchItem*>( pArgs->Get(SID_SEARCH_ITEM).Clone() ); } } switch (m_pSrchItem->GetCommand()) @@ -194,10 +194,10 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) #if HAVE_FEATURE_DESKTOP { const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId); + SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>( GetViewFrame()->GetChildWindow(nChildId) ); if ( pDlgWrp ) { - m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow()); + m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow()); m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin); m_pSrchDlg->SetSrchFlag(); } @@ -220,11 +220,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) #if HAVE_FEATURE_DESKTOP { const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId); + SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId)); if ( pDlgWrp ) { - m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow()); + m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow()); m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin); m_pSrchDlg->SetSrchFlag(); } @@ -281,11 +281,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) #if HAVE_FEATURE_DESKTOP { const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId); + SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId)); if ( pDlgWrp ) { - m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow()); + m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow()); m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin); m_pSrchDlg->SetSrchFlag(); } @@ -350,11 +350,11 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage) } #if HAVE_FEATURE_DESKTOP const sal_uInt16 nChildId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pDlgWrp = (SvxSearchDialogWrapper*)GetViewFrame()->GetChildWindow(nChildId); + SvxSearchDialogWrapper *pDlgWrp = static_cast<SvxSearchDialogWrapper*>(GetViewFrame()->GetChildWindow(nChildId)); if ( pDlgWrp ) { - m_pSrchDlg = (SvxSearchDialog*)(pDlgWrp->GetWindow()); + m_pSrchDlg = static_cast<SvxSearchDialog*>(pDlgWrp->GetWindow()); m_pSrchDlg->SetDocWin( (vcl::Window*)m_pEditWin); m_pSrchDlg->SetSrchFlag(); } @@ -778,7 +778,7 @@ SvxSearchDialog* SwView::GetSearchDialog() { #if HAVE_FEATURE_DESKTOP const sal_uInt16 nId = SvxSearchDialogWrapper::GetChildWindowId(); - SvxSearchDialogWrapper *pWrp = (SvxSearchDialogWrapper*) SfxViewFrame::Current()->GetChildWindow(nId); + SvxSearchDialogWrapper *pWrp = static_cast<SvxSearchDialogWrapper*>( SfxViewFrame::Current()->GetChildWindow(nId) ); m_pSrchDlg = pWrp ? pWrp->getDialog () : 0; return m_pSrchDlg; #else diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index c74260659ab3..161892a276aa 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -33,6 +33,7 @@ #include <sfx2/linkmgr.hxx> #include <editeng/langitem.hxx> #include <editeng/brushitem.hxx> +#include <editeng/tstpitem.hxx> #include <sfx2/htmlmode.hxx> #include <editeng/unolingu.hxx> #include <sfx2/msgpool.hxx> @@ -167,8 +168,8 @@ void SwView::GetState(SfxItemSet &rSet) const sal_uInt16 nCurIdx = m_pWrtShell->GetCurPageDesc(); const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx ); const SwFrmFmt& rMaster = rDesc.GetMaster(); - const SvxBrushItem& rBrush = (const SvxBrushItem&) - rMaster.GetFmtAttr(RES_BACKGROUND, true); + const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( + rMaster.GetFmtAttr(RES_BACKGROUND, true)); rSet.Put(rBrush); } break; @@ -254,25 +255,25 @@ void SwView::GetState(SfxItemSet &rSet) case SID_ATTR_DEFTABSTOP: { const SvxTabStopItem& rDefTabs = - (const SvxTabStopItem&)m_pWrtShell-> - GetDefault(RES_PARATR_TABSTOP); + static_cast<const SvxTabStopItem&>(m_pWrtShell-> + GetDefault(RES_PARATR_TABSTOP)); rSet.Put( SfxUInt16Item( nWhich, (sal_uInt16)::GetTabDist(rDefTabs))); } break; case SID_ATTR_LANGUAGE: { - rSet.Put((const SvxLanguageItem&) - m_pWrtShell->GetDefault(RES_CHRATR_LANGUAGE), SID_ATTR_LANGUAGE); + rSet.Put(static_cast<const SvxLanguageItem&>( + m_pWrtShell->GetDefault(RES_CHRATR_LANGUAGE)), SID_ATTR_LANGUAGE); } break; case RES_CHRATR_CJK_LANGUAGE: - rSet.Put((const SvxLanguageItem&) - m_pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE), RES_CHRATR_CJK_LANGUAGE); + rSet.Put(static_cast<const SvxLanguageItem&>( + m_pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE)), RES_CHRATR_CJK_LANGUAGE); break; case RES_CHRATR_CTL_LANGUAGE: - rSet.Put((const SvxLanguageItem&) - m_pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE), RES_CHRATR_CTL_LANGUAGE); + rSet.Put(static_cast<const SvxLanguageItem&>( + m_pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE)), RES_CHRATR_CTL_LANGUAGE); break; case FN_REDLINE_ON: rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) ); diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 506de8d35a15..d34fd736c3d2 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -256,8 +256,8 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_ATTR_LONG_LRSPACE: if ( pReqArgs ) { - SvxLongLRSpaceItem aLongLR( (const SvxLongLRSpaceItem&)pReqArgs-> - Get( SID_ATTR_LONG_LRSPACE ) ); + SvxLongLRSpaceItem aLongLR( static_cast<const SvxLongLRSpaceItem&>(pReqArgs-> + Get( SID_ATTR_LONG_LRSPACE )) ); SvxLRSpaceItem aLR(RES_LR_SPACE); if ( !bSect && (bFrmSelection || nFrmType & FRMTYPE_FLY_ANY) ) { @@ -415,8 +415,8 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_ATTR_LONG_ULSPACE: if ( pReqArgs ) { - SvxLongULSpaceItem aLongULSpace( (const SvxLongULSpaceItem&)pReqArgs-> - Get( SID_ATTR_LONG_ULSPACE )); + SvxLongULSpaceItem aLongULSpace( static_cast<const SvxLongULSpaceItem&>(pReqArgs-> + Get( SID_ATTR_LONG_ULSPACE ))); if( bFrmSelection || nFrmType & FRMTYPE_FLY_ANY ) { @@ -556,7 +556,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_ATTR_PAGE_COLUMN: if ( pReqArgs ) { - const SfxInt16Item aColumnItem( (const SfxInt16Item&)pReqArgs->Get(nSlot) ); + const SfxInt16Item aColumnItem( static_cast<const SfxInt16Item&>(pReqArgs->Get(nSlot)) ); const sal_uInt16 nPageColumnType = aColumnItem.GetValue(); // nPageColumnType = @@ -617,16 +617,16 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if (pReqArgs) { const sal_uInt16 nWhich = GetPool().GetWhich(nSlot); - SvxTabStopItem aTabStops( (const SvxTabStopItem&)pReqArgs-> - Get( nWhich )); + SvxTabStopItem aTabStops( static_cast<const SvxTabStopItem&>(pReqArgs-> + Get( nWhich ))); aTabStops.SetWhich(RES_PARATR_TABSTOP); const SvxTabStopItem& rDefTabs = - (const SvxTabStopItem&)rSh.GetDefault(RES_PARATR_TABSTOP); + static_cast<const SvxTabStopItem&>(rSh.GetDefault(RES_PARATR_TABSTOP)); // Default tab at pos 0 SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE ); rSh.GetCurAttr( aSet ); - const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)aSet.Get(RES_LR_SPACE); + const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE)); if ( rLR.GetTxtFirstLineOfst() < 0 ) { @@ -653,7 +653,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_ATTR_PARA_LRSPACE: if ( pReqArgs ) { - SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)pReqArgs->Get(nSlot)); + SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(pReqArgs->Get(nSlot))); aParaMargin.SetRight( aParaMargin.GetRight() - m_nRightBorderDistance ); aParaMargin.SetTxtLeft(aParaMargin.GetTxtLeft() - m_nLeftBorderDistance ); @@ -692,7 +692,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SfxItemSet aSet( GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP ); rSh.GetCurAttr( aSet ); - const SvxTabStopItem& rTabStops = (const SvxTabStopItem&)aSet.Get(RES_PARATR_TABSTOP); + const SvxTabStopItem& rTabStops = static_cast<const SvxTabStopItem&>(aSet.Get(RES_PARATR_TABSTOP)); // Do we have a tab at position zero? sal_uInt16 i; @@ -713,7 +713,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) aTabStops.Insert(aSwTabStop); const SvxTabStopItem& rDefTabs = - (const SvxTabStopItem&)rSh.GetDefault(RES_PARATR_TABSTOP); + static_cast<const SvxTabStopItem&>(rSh.GetDefault(RES_PARATR_TABSTOP)); ::MakeDefTabs( ::GetTabDist(rDefTabs), aTabStops ); if( pColl && pColl->IsAutoUpdateFmt()) @@ -732,7 +732,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_ATTR_PARA_ULSPACE: if ( pReqArgs ) { - SvxULSpaceItem aParaMargin((const SvxULSpaceItem&)pReqArgs->Get(nSlot)); + SvxULSpaceItem aParaMargin(static_cast<const SvxULSpaceItem&>(pReqArgs->Get(nSlot))); long nUDist = 0; long nLDist = 0; @@ -756,13 +756,13 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_RULER_BORDERS: if ( pReqArgs ) { - SvxColumnItem aColItem((const SvxColumnItem&)pReqArgs->Get(nSlot)); + SvxColumnItem aColItem(static_cast<const SvxColumnItem&>(pReqArgs->Get(nSlot))); if( m_bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) ) { OSL_ENSURE(aColItem.Count(), "ColDesc is empty!!"); - const bool bSingleLine = ((const SfxBoolItem&)rReq. + const bool bSingleLine = static_cast<const SfxBoolItem&>(rReq. GetArgs()->Get(SID_RULER_ACT_LINE_ONLY)).GetValue(); SwTabCols aTabCols; @@ -840,7 +840,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SwFmtCol aCols( bSect ? pSectFmt->GetCol() : - (const SwFmtCol&)aSet.Get( RES_COL, false )); + static_cast<const SwFmtCol&>(aSet.Get( RES_COL, false ))); SwRect aCurRect = rSh.GetAnyCurRect(bSect ? RECT_SECTION_PRT : RECT_FLY_PRT_EMBEDDED); const long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width(); ::lcl_ConvertToCols( aColItem, lWidth, aCols ); @@ -881,7 +881,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_RULER_ROWS_VERTICAL: if (pReqArgs) { - SvxColumnItem aColItem((const SvxColumnItem&)pReqArgs->Get(nSlot)); + SvxColumnItem aColItem(static_cast<const SvxColumnItem&>(pReqArgs->Get(nSlot))); if( m_bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) ) { @@ -927,7 +927,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) bool bSingleLine = false; const SfxPoolItem* pSingleLine; if( SfxItemState::SET == rReq.GetArgs()->GetItemState(SID_RULER_ACT_LINE_ONLY, false, &pSingleLine)) - bSingleLine = ((const SfxBoolItem*)pSingleLine)->GetValue(); + bSingleLine = static_cast<const SfxBoolItem*>(pSingleLine)->GetValue(); if ( m_bSetTabRowFromDoc ) { if( !rSh.IsViewLocked() ) @@ -1196,11 +1196,11 @@ void SwView::StateTabWin(SfxItemSet& rSet) rSet.DisableItem( nWhich ); else { - SvxTabStopItem aTabStops((const SvxTabStopItem&) - aCoreSet.Get( RES_PARATR_TABSTOP )); + SvxTabStopItem aTabStops(static_cast<const SvxTabStopItem&>( + aCoreSet.Get( RES_PARATR_TABSTOP ))); - const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&) - rSh.GetDefault(RES_PARATR_TABSTOP); + const SvxTabStopItem& rDefTabs = static_cast<const SvxTabStopItem&>( + rSh.GetDefault(RES_PARATR_TABSTOP)); OSL_ENSURE(m_pHRuler, "why is there no ruler?"); const long nDefTabDist = ::GetTabDist(rDefTabs); @@ -1230,7 +1230,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxLRSpaceItem aLR( RES_LR_SPACE ); if ( !IsTabColFromDoc() ) { - aLR = (const SvxLRSpaceItem&)aCoreSet.Get(RES_LR_SPACE); + aLR = static_cast<const SvxLRSpaceItem&>(aCoreSet.Get(RES_LR_SPACE)); // #i23726# if (m_pNumRuleNodeFromDoc) @@ -1254,7 +1254,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) case SID_ATTR_PARA_ULSPACE: { - SvxULSpaceItem aUL = (const SvxULSpaceItem&)aCoreSet.Get(RES_UL_SPACE); + SvxULSpaceItem aUL = static_cast<const SvxULSpaceItem&>(aCoreSet.Get(RES_UL_SPACE)); aUL.SetWhich(nWhich); SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE); @@ -1293,7 +1293,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put( aBoxInfo ); rSh.GetFlyFrmAttr( aCoreSet ); - const SvxBoxItem& rBox = (const SvxBoxItem&)aCoreSet.Get(RES_BOX); + const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aCoreSet.Get(RES_BOX)); aDistLR.SetLeft(rBox.GetDistance(BOX_LINE_LEFT)); aDistLR.SetRight(rBox.GetDistance(BOX_LINE_RIGHT)); @@ -1302,7 +1302,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) RES_BOX, RES_BOX, 0 ); rSh.GetCurAttr( aCoreSet1 ); - const SvxBoxItem& rParaBox = (const SvxBoxItem&)aCoreSet1.Get(RES_BOX); + const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX)); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(BOX_LINE_LEFT)); aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(BOX_LINE_RIGHT)); } @@ -1322,14 +1322,14 @@ void SwView::StateTabWin(SfxItemSet& rSet) aBoxInfo.SetDist(true); aCoreSet2.Put(aBoxInfo); rSh.GetTabBorders( aCoreSet2 ); - const SvxBoxItem& rBox = (const SvxBoxItem&)aCoreSet2.Get(RES_BOX); + const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aCoreSet2.Get(RES_BOX)); aDistLR.SetLeft(rBox.GetDistance(BOX_LINE_LEFT)); aDistLR.SetRight(rBox.GetDistance(BOX_LINE_RIGHT)); //add the border distance of the paragraph SfxItemSet aCoreSet1( GetPool(), RES_BOX, RES_BOX ); rSh.GetCurAttr( aCoreSet1 ); - const SvxBoxItem& rParaBox = (const SvxBoxItem&)aCoreSet1.Get(RES_BOX); + const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX)); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(BOX_LINE_LEFT)); aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(BOX_LINE_RIGHT)); rSet.Put(aDistLR); @@ -1340,7 +1340,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) { //get the page/header/footer border distance const SwFrmFmt& rMaster = rDesc.GetMaster(); - const SvxBoxItem& rBox = (const SvxBoxItem&)rMaster.GetAttrSet().Get(RES_BOX); + const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rMaster.GetAttrSet().Get(RES_BOX)); aDistLR.SetLeft(rBox.GetDistance(BOX_LINE_LEFT)); aDistLR.SetRight(rBox.GetDistance(BOX_LINE_RIGHT)); @@ -1371,7 +1371,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) RES_BOX, RES_BOX, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 ); rSh.GetCurAttr( aCoreSetTmp ); - const SvxBoxItem& rParaBox = (const SvxBoxItem&)aCoreSetTmp.Get(RES_BOX); + const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSetTmp.Get(RES_BOX)); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(BOX_LINE_LEFT)); aDistLR.SetRight(aDistLR.GetRight() + rParaBox.GetDistance(BOX_LINE_RIGHT)); rSet.Put(aDistLR); @@ -1599,7 +1599,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxColumnItem aColItem(nNum); const SwRect aPrtRect = rSh.GetAnyCurRect(RECT_PAGE_PRT, pPt); - const SvxBoxItem& rBox = (const SvxBoxItem&)rMaster.GetFmtAttr(RES_BOX); + const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(rMaster.GetFmtAttr(RES_BOX)); long nDist = rBox.GetDistance(); lcl_FillSvxColumn( diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 4687312d9a7b..39627971b482 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -387,7 +387,7 @@ SwXMailMerge::SwXMailMerge() : xDocSh = new SwDocShell( SFX_CREATE_MODE_STANDARD ); xDocSh->DoInitNew( 0 ); SfxViewFrame *pFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); - SwView *pView = (SwView*) pFrame->GetViewShell(); + SwView *pView = static_cast<SwView*>( pFrame->GetViewShell() ); pView->AttrChangedNotify( &pView->GetWrtShell() ); //So that SelectShell is called. xModel = xDocSh->GetModel(); } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index e6a5f9b6b9b2..551f76750bf1 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -535,10 +535,10 @@ Reference< XInterface > SwXTextDocument::getCurrentSelection() throw( RuntimeEx { const TypeId aTypeId = TYPE(SwView); - SwView* pView = (SwView*)SfxViewShell::GetFirst(&aTypeId); + SwView* pView = static_cast<SwView*>(SfxViewShell::GetFirst(&aTypeId)); while(pView && pView->GetObjectShell() != pDocShell) { - pView = (SwView*)SfxViewShell::GetNext(*pView, &aTypeId); + pView = static_cast<SwView*>(SfxViewShell::GetNext(*pView, &aTypeId)); } if(pView) { @@ -707,7 +707,7 @@ SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xC { getText(); XText *const pText = xBodyText.get(); - SwXBodyText* pBText = (SwXBodyText*)pText; + SwXBodyText* pBText = static_cast<SwXBodyText*>(pText); SwXTextCursor *const pXTextCursor = pBText->CreateTextCursor(true); xCrsr.set( static_cast<text::XWordCursor*>(pXTextCursor) ); diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 2379cb273602..91bbfadc6b67 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -655,7 +655,7 @@ SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc() pTempDoc->SetClipBoard(true); rOldSh.FillPrtDoc(pTempDoc, pPrt); SfxViewFrame* pDocFrame = SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 ); - SwView* pDocView = (SwView*) pDocFrame->GetViewShell(); + SwView* pDocView = static_cast<SwView*>( pDocFrame->GetViewShell() ); pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//So that SelectShell is called. SwWrtShell* pSh = pDocView->GetWrtShellPtr(); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 7567a201ef48..d05e2a39a4cf 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -506,7 +506,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) // old one is compared with the new OutlinePos. // cast for Win16 if(nOldMemberCount > (int)nPos && - ((SwOutlineContent*)(*pOldMember)[nPos])->GetOutlineLevel() != nLevel) + static_cast<SwOutlineContent*>((*pOldMember)[nPos])->GetOutlineLevel() != nLevel) *pbLevelOrVisibilityChanged = true; nPos++; @@ -563,7 +563,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) if(CONTENT_TYPE_GRAPHIC == nContentType) { OUString sLink; - pWrtShell->GetGrfNms( &sLink, 0, (SwFlyFrmFmt*) pFrmFmt); + pWrtShell->GetGrfNms( &sLink, 0, static_cast<const SwFlyFrmFmt*>( pFrmFmt)); pCnt = new SwGraphicContent(this, sFrmName, INetURLObject::decode( sLink, '%', INetURLObject::DECODE_UNAMBIGUOUS, @@ -754,7 +754,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) // #i51726# - all drawing objects can be named now if (!pTemp->GetName().isEmpty()) { - SwContact* pContact = (SwContact*)pTemp->GetUserCall(); + SwContact* pContact = static_cast<SwContact*>(pTemp->GetUserCall()); long nYPos = 0; const Point aNullPt; if(pContact && pContact->GetFmt()) @@ -1292,9 +1292,9 @@ sal_IntPtr SwContentTree::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab) if(pCnt && 0 != (pParent = pCnt->GetParent())) { if(pParent->GetType() == CONTENT_TYPE_OUTLINE) - nLevel = nLevel + ((SwOutlineContent*)pCnt)->GetOutlineLevel(); + nLevel = nLevel + static_cast<SwOutlineContent*>(pCnt)->GetOutlineLevel(); else if(pParent->GetType() == CONTENT_TYPE_REGION) - nLevel = nLevel + ((SwRegionContent*)pCnt)->GetRegionLevel(); + nLevel = nLevel + static_cast<SwRegionContent*>(pCnt)->GetRegionLevel(); } } sal_uInt16 nBasis = bIsRoot ? 0 : 5; @@ -1323,7 +1323,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) const SwContent* pCnt = pCntType->GetMember(i); if(pCnt) { - const sal_uInt16 nLevel = ((SwOutlineContent*)pCnt)->GetOutlineLevel(); + const sal_uInt16 nLevel = static_cast<const SwOutlineContent*>(pCnt)->GetOutlineLevel(); OUString sEntry = pCnt->GetName(); if(sEntry.isEmpty()) sEntry = sSpace; @@ -1333,7 +1333,7 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) else { //back search parent. - if(((SwOutlineContent*)pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel) + if(static_cast<const SwOutlineContent*>(pCntType->GetMember(i-1))->GetOutlineLevel() < nLevel) pChild = InsertEntry(sEntry, pChild, false, TREELIST_APPEND, (void*)pCnt); else @@ -1788,7 +1788,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, { case CONTENT_TYPE_OUTLINE: { - const sal_uInt16 nPos = ((SwOutlineContent*)pCnt)->GetPos(); + const sal_uInt16 nPos = static_cast<SwOutlineContent*>(pCnt)->GetPos(); OSL_ENSURE(nPos < pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount(), "outlinecnt changed"); @@ -1813,7 +1813,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, } sEntry += pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineText(nPos, false); sOutlineText = pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineText(nPos, true); - bIsOutlineMoveable = ((SwOutlineContent*)pCnt)->IsMoveable(); + bIsOutlineMoveable = static_cast<SwOutlineContent*>(pCnt)->IsMoveable(); bOutline = true; } } @@ -1824,7 +1824,7 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, // cannot inserted as URL or as koennen weder als URL noch als region break; case CONTENT_TYPE_URLFIELD: - sUrl = ((SwURLFieldContent*)pCnt)->GetURL(); + sUrl = static_cast<SwURLFieldContent*>(pCnt)->GetURL(); // no break; case CONTENT_TYPE_OLE: case CONTENT_TYPE_GRAPHIC: @@ -3205,7 +3205,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell(); if(nMode == EDIT_MODE_DELETE) { - if (((SwPostItContent*)pCnt)->IsPostIt()) + if (static_cast<SwPostItContent*>(pCnt)->IsPostIt()) { pActiveShell->GetView().GetPostItMgr()->SetActiveSidebarWin(0); pActiveShell->DelRight(); @@ -3213,7 +3213,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) } else { - if (((SwPostItContent*)pCnt)->IsPostIt()) + if (static_cast<SwPostItContent*>(pCnt)->IsPostIt()) nSlot = FN_POSTIT; else nSlot = FN_REDLINE_COMMENT; @@ -3221,7 +3221,7 @@ void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) break; case CONTENT_TYPE_INDEX: { - const SwTOXBase* pBase = ((SwTOXBaseContent*)pCnt)->GetTOXBase(); + const SwTOXBase* pBase = static_cast<SwTOXBaseContent*>(pCnt)->GetTOXBase(); switch(nMode) { case EDIT_MODE_EDIT: @@ -3307,7 +3307,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) { case CONTENT_TYPE_OUTLINE : { - pActiveShell->GotoOutline(((SwOutlineContent*)pCnt)->GetPos()); + pActiveShell->GotoOutline(static_cast<SwOutlineContent*>(pCnt)->GetPos()); } break; case CONTENT_TYPE_TABLE : @@ -3336,7 +3336,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) case CONTENT_TYPE_URLFIELD: { if(pActiveShell->GotoINetAttr( - *((SwURLFieldContent*)pCnt)->GetINetAttr() )) + *static_cast<SwURLFieldContent*>(pCnt)->GetINetAttr() )) { pActiveShell->Right( CRSR_SKIP_CHARS, true, 1, false); pActiveShell->SwCrsrShell::SelectTxtAttr( RES_TXTATR_INETFMT, true ); @@ -3358,11 +3358,11 @@ void SwContentTree::GotoContent(SwContent* pCnt) break; case CONTENT_TYPE_POSTIT: pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell(); - if (((SwPostItContent*)pCnt)->IsPostIt()) - pActiveShell->GotoFld(*((SwPostItContent*)pCnt)->GetPostIt()); + if (static_cast<SwPostItContent*>(pCnt)->IsPostIt()) + pActiveShell->GotoFld(*static_cast<SwPostItContent*>(pCnt)->GetPostIt()); else pActiveShell->GetView().GetDocShell()->GetWrtShell()->GotoRedline( - pActiveShell->GetView().GetDocShell()->GetWrtShell()->FindRedlineOfData(((SwPostItContent*)pCnt)->GetRedline()->GetRedlineData())); + pActiveShell->GetView().GetDocShell()->GetWrtShell()->FindRedlineOfData(static_cast<SwPostItContent*>(pCnt)->GetRedline()->GetRedlineData())); break; case CONTENT_TYPE_DRAWOBJECT: @@ -3419,7 +3419,7 @@ NaviContentBookmark::NaviContentBookmark( const OUString &rUrl, const SwDocShell* pDocSh ) : aUrl( rUrl ), aDescr(rDesc), - nDocSh((sal_IntPtr)pDocSh), + nDocSh(reinterpret_cast<sal_IntPtr>(pDocSh)), nDefDrag( nDragType ) { } @@ -3467,7 +3467,7 @@ void SwContentTree::InitEntry(SvTreeListEntry* pEntry, { const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); - SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); + SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite )); SwContentLBoxString* pStr = new SwContentLBoxString( pEntry, 0, pCol->GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 1176dd372f51..eb4ffa36c866 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -920,18 +920,18 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry SfxStringItem aFactory(SID_NEWDOCDIRECT, SwDocShell::Factory().GetFilterContainer()->GetName()); - const SfxFrameItem* pItem = (SfxFrameItem*) + const SfxFrameItem* pItem = static_cast<const SfxFrameItem*>( rDispatch.Execute(SID_NEWDOCDIRECT, - SfxCallMode::SYNCHRON, &aFactory, 0L); + SfxCallMode::SYNCHRON, &aFactory, 0L)); // save at SfxFrame* pFrm = pItem ? pItem->GetFrame() : 0; SfxViewFrame* pFrame = pFrm ? pFrm->GetCurrentViewFrame() : 0; if( pFrame ) { - const SfxBoolItem* pBool = (const SfxBoolItem*) + const SfxBoolItem* pBool = static_cast<const SfxBoolItem*>( pFrame->GetDispatcher()->Execute( - SID_SAVEASDOC, SfxCallMode::SYNCHRON ); + SID_SAVEASDOC, SfxCallMode::SYNCHRON )); SfxObjectShell& rObj = *pFrame->GetObjectShell(); const SfxMedium* pMedium = rObj.GetMedium(); OUString sNewFile(pMedium->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI)); @@ -1219,7 +1219,7 @@ void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry, { const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); - SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); + SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite )); SwLBoxString* pStr = new SwLBoxString( pEntry, 0, pCol->GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 29093856cf28..8411776f1e59 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -951,7 +951,7 @@ void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/, NumEditAction& SwNavigationPI::GetPageEdit() { - return *(NumEditAction*)aContentToolBox.GetItemWindow(FN_PAGENUMBER); + return *static_cast<NumEditAction*>(aContentToolBox.GetItemWindow(FN_PAGENUMBER)); } SfxChildAlignment SwNavigationPI::CheckAlignment diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index d7eb8d662716..fc1b7d5c2990 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -242,7 +242,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType) nFormat != nSysLongDateFmt) { const sal_Int32 nPos = InsertEntry( sValue ); - SetEntryData( nPos, (void*)nFormat ); + SetEntryData( nPos, reinterpret_cast<void*>(nFormat) ); if( nFormat == pFormatter->GetStandardFormat( nFormatType, eCurLanguage ) ) @@ -292,7 +292,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) for (sal_Int32 i = 0; i < GetEntryCount(); i++) { - if (nFormat == (sal_uLong)GetEntryData(i)) + if (nFormat == reinterpret_cast<sal_uLong>(GetEntryData(i))) { SelectEntryPos(i); nStdEntry = i; @@ -316,7 +316,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) } sal_Int32 nPos = 0; - while ((sal_uLong)GetEntryData(nPos) == ULONG_MAX) + while (reinterpret_cast<sal_uLong>(GetEntryData(nPos)) == ULONG_MAX) nPos++; sal_uLong nSysNumFmt = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, eCurLanguage); @@ -347,7 +347,7 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) } nPos = InsertEntry(sValue, nPos); // Insert as first numeric entry - SetEntryData(nPos, (void*)nDefFmt); + SetEntryData(nPos, reinterpret_cast<void*>(nDefFmt)); SelectEntryPos(nPos); nDefFormat = GetFormat(); } @@ -356,7 +356,7 @@ sal_uLong NumFormatListBox::GetFormat() const { sal_Int32 nPos = GetSelectEntryPos(); - return (sal_uLong)GetEntryData(nPos); + return reinterpret_cast<sal_uLong>(GetEntryData(nPos)); } IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) @@ -406,11 +406,11 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) const SfxPoolItem* pItem = pView->GetDocShell()-> GetItem( SID_ATTR_NUMBERFORMAT_INFO ); - if( pItem && 0 != ((SvxNumberInfoItem*)pItem)->GetDelCount() ) + if( pItem && 0 != static_cast<const SvxNumberInfoItem*>(pItem)->GetDelCount() ) { - const sal_uInt32* pDelArr = ((SvxNumberInfoItem*)pItem)->GetDelArray(); + const sal_uInt32* pDelArr = static_cast<const SvxNumberInfoItem*>(pItem)->GetDelArray(); - for ( sal_uInt32 i = 0; i < ((SvxNumberInfoItem*)pItem)->GetDelCount(); i++ ) + for ( sal_uInt32 i = 0; i < static_cast<const SvxNumberInfoItem*>(pItem)->GetDelCount(); i++ ) pFormatter->DeleteEntry( pDelArr[i] ); } @@ -418,7 +418,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox *, pBox ) if( SfxItemState::SET == pOutSet->GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, false, &pItem )) { - sal_uInt32 nNumberFormat = ((SfxUInt32Item*)pItem)->GetValue(); + sal_uInt32 nNumberFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue(); // oj #105473# change order of calls const SvNumberformat* pFmt = pFormatter->GetEntry(nNumberFormat); if( pFmt ) diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx index cdede9c7f270..087dd8a13b85 100644 --- a/sw/source/uibase/utlui/uiitems.cxx +++ b/sw/source/uibase/utlui/uiitems.cxx @@ -215,7 +215,7 @@ SfxPoolItem* SwPtrItem::Clone( SfxItemPool * /*pPool*/ ) const bool SwPtrItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); - const SwPtrItem& rItem = (SwPtrItem&)rAttr; + const SwPtrItem& rItem = static_cast<const SwPtrItem&>(rAttr); return ( pMisc == rItem.pMisc ); } @@ -299,7 +299,7 @@ SfxPoolItem* SwPaMItem::Clone( SfxItemPool * /*pPool*/ ) const bool SwPaMItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); - const SwPaMItem& rItem = (SwPaMItem&)rAttr; + const SwPaMItem& rItem = static_cast<const SwPaMItem&>(rAttr); return ( m_pPaM == rItem.m_pPaM ); } diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 2b8c718e5976..86a9cb190772 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -103,7 +103,7 @@ void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh) const SfxPoolItem *pBoxInfo; if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, true, &pBoxInfo)) - aBoxInfo = *(SvxBoxInfoItem*)pBoxInfo; + aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo); // Table variant: If more than one table cells are selected rSh.GetCrsr(); //So that GetCrsrCnt() returns the right thing @@ -127,7 +127,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode) const SfxPoolItem *pTmpBrush; if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, true, &pTmpBrush ) ) { - SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) ); + SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) ); aTmpBrush.SetWhich( RES_BACKGROUND ); rSet.Put( aTmpBrush ); } @@ -141,7 +141,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode) const SfxPoolItem *pTmpItem; if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BOX, true, &pTmpItem ) ) { - SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpItem) ); + SvxBoxItem aTmpBox( *static_cast<const SvxBoxItem*>(pTmpItem) ); aTmpBox.SetWhich( RES_BOX ); rSet.Put( aTmpBox ); } @@ -151,7 +151,7 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode) // Border shadow if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_SHADOW, false, &pTmpItem ) ) { - SvxShadowItem aTmpShadow( *((SvxShadowItem*)pTmpItem) ); + SvxShadowItem aTmpShadow( *static_cast<const SvxShadowItem*>(pTmpItem) ); aTmpShadow.SetWhich( RES_SHADOW ); rSet.Put( aTmpShadow ); } @@ -167,7 +167,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const sal_uInt8 nMode) const SfxPoolItem *pTmpBrush; if( SfxItemState::SET == rSet.GetItemState( RES_BACKGROUND, false, &pTmpBrush ) ) { - SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) ); + SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) ); aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); rSet.Put( aTmpBrush ); } @@ -180,7 +180,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const sal_uInt8 nMode) const SfxPoolItem *pTmpItem; if( SfxItemState::SET == rSet.GetItemState( RES_BOX, false, &pTmpItem ) ) { - SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpItem) ); + SvxBoxItem aTmpBox( *static_cast<const SvxBoxItem*>(pTmpItem) ); aTmpBox.SetWhich( RES_CHRATR_BOX ); rSet.Put( aTmpBox ); } @@ -189,7 +189,7 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const sal_uInt8 nMode) // Border shadow if( SfxItemState::SET == rSet.GetItemState( RES_SHADOW, false, &pTmpItem ) ) { - SvxShadowItem aTmpShadow( *((SvxShadowItem*)pTmpItem) ); + SvxShadowItem aTmpShadow( *static_cast<const SvxShadowItem*>(pTmpItem) ); aTmpShadow.SetWhich( RES_CHRATR_SHADOW ); rSet.Put( aTmpShadow ); } @@ -204,8 +204,8 @@ void FillHdFt(SwFrmFmt* pFmt, const SfxItemSet& rSet) SwAttrSet aSet(pFmt->GetAttrSet()); aSet.Put(rSet); - const SvxSizeItem& rSize = (const SvxSizeItem&)rSet.Get(SID_ATTR_PAGE_SIZE); - const SfxBoolItem& rDynamic = (const SfxBoolItem&)rSet.Get(SID_ATTR_PAGE_DYNAMIC); + const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get(SID_ATTR_PAGE_SIZE)); + const SfxBoolItem& rDynamic = static_cast<const SfxBoolItem&>(rSet.Get(SID_ATTR_PAGE_DYNAMIC)); // Convert size SwFmtFrmSize aFrmSize(rDynamic.GetValue() ? ATT_MIN_SIZE : ATT_FIX_SIZE, @@ -258,7 +258,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) // PageData if(rSet.GetItemState(SID_ATTR_PAGE) == SfxItemState::SET) { - const SvxPageItem& rPageItem = (const SvxPageItem&)rSet.Get(SID_ATTR_PAGE); + const SvxPageItem& rPageItem = static_cast<const SvxPageItem&>(rSet.Get(SID_ATTR_PAGE)); const sal_uInt16 nUse = rPageItem.GetPageUsage(); if(nUse) @@ -271,7 +271,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) // Size if(rSet.GetItemState(SID_ATTR_PAGE_SIZE) == SfxItemState::SET) { - const SvxSizeItem& rSizeItem = (const SvxSizeItem&)rSet.Get(SID_ATTR_PAGE_SIZE); + const SvxSizeItem& rSizeItem = static_cast<const SvxSizeItem&>(rSet.Get(SID_ATTR_PAGE_SIZE)); SwFmtFrmSize aSize(ATT_FIX_SIZE); aSize.SetSize(rSizeItem.GetSize()); rMaster.SetFmtAttr(aSize); @@ -281,8 +281,8 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_HEADERSET, false, &pItem ) ) { - const SfxItemSet& rHeaderSet = ((SvxSetItem*)pItem)->GetItemSet(); - const SfxBoolItem& rHeaderOn = (const SfxBoolItem&)rHeaderSet.Get(SID_ATTR_PAGE_ON); + const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); + const SfxBoolItem& rHeaderOn = static_cast<const SfxBoolItem&>(rHeaderSet.Get(SID_ATTR_PAGE_ON)); if(rHeaderOn.GetValue()) { @@ -321,8 +321,8 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_FOOTERSET, false, &pItem ) ) { - const SfxItemSet& rFooterSet = ((SvxSetItem*)pItem)->GetItemSet(); - const SfxBoolItem& rFooterOn = (const SfxBoolItem&)rFooterSet.Get(SID_ATTR_PAGE_ON); + const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet(); + const SfxBoolItem& rFooterOn = static_cast<const SfxBoolItem&>(rFooterSet.Get(SID_ATTR_PAGE_ON)); if(rFooterOn.GetValue()) { @@ -361,7 +361,7 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc ) if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_FTN_INFO, false, &pItem ) ) - rPageDesc.SetFtnInfo( ((SwPageFtnInfoItem*)pItem)->GetPageFtnInfo() ); + rPageDesc.SetFtnInfo( static_cast<const SwPageFtnInfoItem*>(pItem)->GetPageFtnInfo() ); // Columns @@ -423,7 +423,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) const SfxPoolItem *pBoxInfo; if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, true, &pBoxInfo) ) - aBoxInfo = *(SvxBoxInfoItem*)pBoxInfo; + aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo); aBoxInfo.SetTable( false ); // Show always the distance field @@ -587,12 +587,12 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) // Page number if(SfxItemState::SET == rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, &pItem)) { - aPgDesc.SetNumOffset(((SfxUInt16Item*)pItem)->GetValue()); + aPgDesc.SetNumOffset(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); bChanged = true; } if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PARA_MODEL, false, &pItem )) { - const OUString& rDescName = ((SvxPageModelItem*)pItem)->GetValue(); + const OUString& rDescName = static_cast<const SvxPageModelItem*>(pItem)->GetValue(); if( !rDescName.isEmpty() ) // No name -> disable PageDesc! { // Delete only, if PageDesc will be enabled! @@ -611,9 +611,9 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) rShell.GetCurAttr( aCoreSet ); if(SfxItemState::SET == aCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) ) { - if( ((SwFmtPageDesc*)pItem)->GetPageDesc() ) + if( static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc() ) { - aPgDesc.RegisterToPageDesc( *((SwFmtPageDesc*)pItem)->GetPageDesc() ); + aPgDesc.RegisterToPageDesc( *const_cast<SwFmtPageDesc*>(static_cast<const SwFmtPageDesc*>(pItem))->GetPageDesc() ); } } } @@ -633,10 +633,10 @@ void SwToSfxPageDescAttr( SfxItemSet& rCoreSet ) { case SfxItemState::SET: { - if( ((SwFmtPageDesc*)pItem)->GetPageDesc() ) + if( static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc() ) { - aName = ((SwFmtPageDesc*)pItem)->GetPageDesc()->GetName(); - oNumOffset = ((SwFmtPageDesc*)pItem)->GetNumOffset(); + aName = static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc()->GetName(); + oNumOffset = static_cast<const SwFmtPageDesc*>(pItem)->GetNumOffset(); } rCoreSet.ClearItem( RES_PAGEDESC ); // Page number @@ -704,7 +704,7 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, bool bSorted, bo ? InsertStringSorted(pBase->GetName(), rToFill, nOffset ) : rToFill.InsertEntry(pBase->GetName()); sal_IntPtr nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( pBase->GetName(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); - rToFill.SetEntryData( nPos, (void*) (nPoolId)); + rToFill.SetEntryData( nPos, reinterpret_cast<void*>(nPoolId)); } pBase = pPool->Next(); } @@ -722,7 +722,7 @@ void FillCharStyleListBox(ListBox& rToFill, SwDocShell* pDocSh, bool bSorted, bo ? InsertStringSorted(rName, rToFill, nOffset ) : rToFill.InsertEntry(rName); sal_IntPtr nPoolId = USHRT_MAX; - rToFill.SetEntryData( nPos, (void*) (nPoolId)); + rToFill.SetEntryData( nPos, reinterpret_cast<void*>(nPoolId)); } } }; |