Kaydet (Commit) 830193d1 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin: cstylecast

Change-Id: I1ca8f2c4a2a6a2729fc736222055417427c72177
üst 9409b2eb
...@@ -228,7 +228,7 @@ Reference< XPropertySet > SwXModule::getViewSettings(void) throw( uno::RuntimeE ...@@ -228,7 +228,7 @@ Reference< XPropertySet > SwXModule::getViewSettings(void) throw( uno::RuntimeE
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if(!pxViewSettings) if(!pxViewSettings)
{ {
((SwXModule*)this)->pxViewSettings = new Reference< XPropertySet > ; static_cast<SwXModule*>(this)->pxViewSettings = new Reference< XPropertySet > ;
OSL_FAIL("Web or Text?"); OSL_FAIL("Web or Text?");
*pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( false, 0 ) ); *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( false, 0 ) );
} }
...@@ -240,7 +240,7 @@ Reference< XPropertySet > SwXModule::getPrintSettings(void) throw( uno::Runtime ...@@ -240,7 +240,7 @@ Reference< XPropertySet > SwXModule::getPrintSettings(void) throw( uno::Runtime
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if(!pxPrintSettings) if(!pxPrintSettings)
{ {
((SwXModule*)this)->pxPrintSettings = new Reference< XPropertySet > ; static_cast<SwXModule*>(this)->pxPrintSettings = new Reference< XPropertySet > ;
OSL_FAIL("Web or Text?"); OSL_FAIL("Web or Text?");
*pxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) ); *pxPrintSettings = static_cast < HelperBaseNoState * > ( new SwXPrintSettings ( PRINT_SETTINGS_MODULE ) );
} }
......
...@@ -114,7 +114,7 @@ void SwXTextView::Invalidate() ...@@ -114,7 +114,7 @@ void SwXTextView::Invalidate()
if(pxTextViewCursor) if(pxTextViewCursor)
{ {
text::XTextViewCursor* pCrsr = pxTextViewCursor->get(); text::XTextViewCursor* pCrsr = pxTextViewCursor->get();
((SwXTextViewCursor*)pCrsr)->Invalidate(); static_cast<SwXTextViewCursor*>(pCrsr)->Invalidate();
DELETEZ(pxTextViewCursor); DELETEZ(pxTextViewCursor);
} }
...@@ -502,7 +502,7 @@ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw( ...@@ -502,7 +502,7 @@ uno::Reference< text::XTextViewCursor > SwXTextView::getViewCursor(void) throw(
{ {
if(!pxTextViewCursor) if(!pxTextViewCursor)
{ {
((SwXTextView*)this)->pxTextViewCursor = new uno::Reference< text::XTextViewCursor > ; static_cast<SwXTextView*>(this)->pxTextViewCursor = new uno::Reference< text::XTextViewCursor > ;
*pxTextViewCursor = new SwXTextViewCursor(GetView()); *pxTextViewCursor = new SwXTextViewCursor(GetView());
} }
return *pxTextViewCursor; return *pxTextViewCursor;
...@@ -518,7 +518,7 @@ uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw( ...@@ -518,7 +518,7 @@ uno::Reference< beans::XPropertySet > SwXTextView::getViewSettings(void) throw(
{ {
if(!pxViewSettings) if(!pxViewSettings)
{ {
((SwXTextView*)this)->pxViewSettings = new uno::Reference< beans::XPropertySet > ; static_cast<SwXTextView*>(this)->pxViewSettings = new uno::Reference< beans::XPropertySet > ;
*pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( false, m_pView ) ); *pxViewSettings = static_cast < HelperBaseNoState * > ( new SwXViewSettings( false, m_pView ) );
} }
} }
......
...@@ -78,12 +78,12 @@ void SwBookmarkControl::StateChanged( ...@@ -78,12 +78,12 @@ void SwBookmarkControl::StateChanged(
GetStatusBar().SetItemText( GetId(), OUString() ); GetStatusBar().SetItemText( GetId(), OUString() );
else if ( pState->ISA( SfxStringItem ) ) else if ( pState->ISA( SfxStringItem ) )
{ {
sPageNumber = ((SfxStringItem*)pState)->GetValue(); sPageNumber = static_cast<const SfxStringItem*>(pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sPageNumber ); GetStatusBar().SetItemText( GetId(), sPageNumber );
} }
else if ( pState->ISA( SfxBoolItem ) ) else if ( pState->ISA( SfxBoolItem ) )
{ {
if (((SfxBoolItem*)pState)->GetValue()) // Indicates whether to show extended tooltip if (static_cast<const SfxBoolItem*>(pState)->GetValue()) // Indicates whether to show extended tooltip
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT_EXTENDED)); GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT_EXTENDED));
else else
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT)); GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT));
......
...@@ -431,10 +431,10 @@ sal_uInt16 SwGlobalTree::GetEnableFlags() const ...@@ -431,10 +431,10 @@ sal_uInt16 SwGlobalTree::GetEnableFlags() const
if(nSelCount == 1) if(nSelCount == 1)
{ {
nRet |= ENABLE_EDIT; nRet |= ENABLE_EDIT;
if (pEntry && ((SwGlblDocContent*)pEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN && if (pEntry && static_cast<SwGlblDocContent*>(pEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN &&
(!pPrevEntry || ((SwGlblDocContent*)pPrevEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN)) (!pPrevEntry || static_cast<SwGlblDocContent*>(pPrevEntry->GetUserData())->GetType() != GLBLDOC_UNKNOWN))
nRet |= ENABLE_INSERT_TEXT; nRet |= ENABLE_INSERT_TEXT;
if (pEntry && GLBLDOC_SECTION == ((SwGlblDocContent*)pEntry->GetUserData())->GetType()) if (pEntry && GLBLDOC_SECTION == static_cast<SwGlblDocContent*>(pEntry->GetUserData())->GetType())
nRet |= ENABLE_EDIT_LINK; nRet |= ENABLE_EDIT_LINK;
} }
else if(!nEntryCount) else if(!nEntryCount)
...@@ -792,7 +792,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ...@@ -792,7 +792,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry
if(GLBLDOC_SECTION == pContent->GetType() && if(GLBLDOC_SECTION == pContent->GetType() &&
pContent->GetSection()->IsConnected()) pContent->GetSection()->IsConnected())
{ {
((SwSection*)pContent->GetSection())->UpdateNow(); const_cast<SwSection*>(pContent->GetSection())->UpdateNow();
} }
pSelEntry = NextSelected(pSelEntry); pSelEntry = NextSelected(pSelEntry);
......
...@@ -423,7 +423,7 @@ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) ...@@ -423,7 +423,7 @@ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
if(rEvt.GetButtons() == MOUSE_LEFT && if(rEvt.GetButtons() == MOUSE_LEFT &&
FN_CREATE_NAVIGATION == GetItemId(rEvt.GetPosPixel())) FN_CREATE_NAVIGATION == GetItemId(rEvt.GetPosPixel()))
{ {
((SwNavigationPI*)GetParent())->CreateNavigationTool(GetItemRect(FN_CREATE_NAVIGATION), false, this); static_cast<SwNavigationPI*>(GetParent())->CreateNavigationTool(GetItemRect(FN_CREATE_NAVIGATION), false, this);
} }
else else
SwHelpToolBox::MouseButtonDown(rEvt); SwHelpToolBox::MouseButtonDown(rEvt);
...@@ -547,8 +547,8 @@ void SwNavigationPI::_ZoomOut() ...@@ -547,8 +547,8 @@ void SwNavigationPI::_ZoomOut()
bIsZoomedIn = false; bIsZoomedIn = false;
Size aSz(GetOutputSizePixel()); Size aSz(GetOutputSizePixel());
aSz.Height() = nZoomOut; aSz.Height() = nZoomOut;
Size aMinOutSizePixel = ((SfxDockingWindow*)GetParent())->GetMinOutputSizePixel(); Size aMinOutSizePixel = static_cast<SfxDockingWindow*>(GetParent())->GetMinOutputSizePixel();
((SfxDockingWindow*)GetParent())->SetMinOutputSizePixel(Size( static_cast<SfxDockingWindow*>(GetParent())->SetMinOutputSizePixel(Size(
aMinOutSizePixel.Width(),nZoomOutInit)); aMinOutSizePixel.Width(),nZoomOutInit));
if (pFloat != NULL) if (pFloat != NULL)
pFloat->SetOutputSizePixel(aSz); pFloat->SetOutputSizePixel(aSz);
...@@ -587,8 +587,8 @@ void SwNavigationPI::_ZoomIn() ...@@ -587,8 +587,8 @@ void SwNavigationPI::_ZoomIn()
nZoomOut = ( short ) aSz.Height(); nZoomOut = ( short ) aSz.Height();
aSz.Height() = nZoomIn; aSz.Height() = nZoomIn;
Size aMinOutSizePixel = ((SfxDockingWindow*)GetParent())->GetMinOutputSizePixel(); Size aMinOutSizePixel = static_cast<SfxDockingWindow*>(GetParent())->GetMinOutputSizePixel();
((SfxDockingWindow*)GetParent())->SetMinOutputSizePixel(Size( static_cast<SfxDockingWindow*>(GetParent())->SetMinOutputSizePixel(Size(
aMinOutSizePixel.Width(), aSz.Height())); aMinOutSizePixel.Width(), aSz.Height()));
pFloat->SetOutputSizePixel(aSz); pFloat->SetOutputSizePixel(aSz);
SvTreeListEntry* pFirst = aContentTree.FirstSelected(); SvTreeListEntry* pFirst = aContentTree.FirstSelected();
...@@ -999,7 +999,7 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint ) ...@@ -999,7 +999,7 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
{ {
if(&rBrdc == pCreateView) if(&rBrdc == pCreateView)
{ {
if(dynamic_cast<const SfxSimpleHint*>(&rHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING) if(dynamic_cast<const SfxSimpleHint*>(&rHint) && static_cast<const SfxSimpleHint&>(rHint).GetId() == SFX_HINT_DYING)
{ {
pCreateView = 0; pCreateView = 0;
} }
...@@ -1009,11 +1009,11 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint ) ...@@ -1009,11 +1009,11 @@ void SwNavigationPI::Notify( SfxBroadcaster& rBrdc, const SfxHint& rHint )
if(dynamic_cast<const SfxEventHint*>(&rHint)) if(dynamic_cast<const SfxEventHint*>(&rHint))
{ {
if( pxObjectShell && if( pxObjectShell &&
((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_CLOSEAPP) static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_CLOSEAPP)
{ {
DELETEZ(pxObjectShell); DELETEZ(pxObjectShell);
} }
else if(((SfxEventHint&) rHint).GetEventId() == SFX_EVENT_OPENDOC) else if(static_cast<const SfxEventHint&>( rHint).GetEventId() == SFX_EVENT_OPENDOC)
{ {
SwView *pActView = GetCreateView(); SwView *pActView = GetCreateView();
...@@ -1310,8 +1310,8 @@ SwView* SwNavigationPI::GetCreateView() const ...@@ -1310,8 +1310,8 @@ SwView* SwNavigationPI::GetCreateView() const
{ {
if(&pView->GetViewFrame()->GetBindings() == &rBindings) if(&pView->GetViewFrame()->GetBindings() == &rBindings)
{ {
((SwNavigationPI*)this)->pCreateView = pView; const_cast<SwNavigationPI*>(this)->pCreateView = pView;
((SwNavigationPI*)this)->StartListening(*pCreateView); const_cast<SwNavigationPI*>(this)->StartListening(*pCreateView);
break; break;
} }
pView = SwModule::GetNextView(pView); pView = SwModule::GetNextView(pView);
......
...@@ -78,7 +78,7 @@ void SwTemplateControl::StateChanged( ...@@ -78,7 +78,7 @@ void SwTemplateControl::StateChanged(
GetStatusBar().SetItemText( GetId(), OUString() ); GetStatusBar().SetItemText( GetId(), OUString() );
else if ( pState->ISA( SfxStringItem ) ) else if ( pState->ISA( SfxStringItem ) )
{ {
sTemplate = ((SfxStringItem*)pState)->GetValue(); sTemplate = static_cast<const SfxStringItem*>(pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sTemplate ); GetStatusBar().SetItemText( GetId(), sTemplate );
} }
} }
......
...@@ -56,7 +56,7 @@ SfxPoolItem* SwPageFtnInfoItem::Clone( SfxItemPool * /*pPool*/ ) const ...@@ -56,7 +56,7 @@ SfxPoolItem* SwPageFtnInfoItem::Clone( SfxItemPool * /*pPool*/ ) const
bool SwPageFtnInfoItem::operator==( const SfxPoolItem& rAttr ) const bool SwPageFtnInfoItem::operator==( const SfxPoolItem& rAttr ) const
{ {
OSL_ENSURE( Which() == rAttr.Which(), "no equal attributes" ); OSL_ENSURE( Which() == rAttr.Which(), "no equal attributes" );
return ( aFtnInfo == ((SwPageFtnInfoItem&)rAttr).GetPageFtnInfo()); return ( aFtnInfo == static_cast<const SwPageFtnInfoItem&>(rAttr).GetPageFtnInfo());
} }
bool SwPageFtnInfoItem::GetPresentation bool SwPageFtnInfoItem::GetPresentation
...@@ -245,7 +245,7 @@ SfxPoolItem* SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const ...@@ -245,7 +245,7 @@ SfxPoolItem* SwUINumRuleItem::Clone( SfxItemPool * /*pPool*/ ) const
bool SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const bool SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const
{ {
assert(SfxPoolItem::operator==(rAttr)); assert(SfxPoolItem::operator==(rAttr));
return *pRule == *((SwUINumRuleItem&)rAttr).pRule; return *pRule == *static_cast<const SwUINumRuleItem&>(rAttr).pRule;
} }
bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
......
...@@ -30,7 +30,7 @@ void SwWordCountStatusBarControl::StateChanged( ...@@ -30,7 +30,7 @@ void SwWordCountStatusBarControl::StateChanged(
sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
{ {
if (eState == SfxItemState::DEFAULT) // Can access pState if (eState == SfxItemState::DEFAULT) // Can access pState
GetStatusBar().SetItemText( GetId(), ((SfxStringItem*)pState)->GetValue() ); GetStatusBar().SetItemText( GetId(), static_cast<const SfxStringItem*>(pState)->GetValue() );
GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_WORDCOUNT_HINT)); GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_WORDCOUNT_HINT));
} }
......
...@@ -579,12 +579,12 @@ void SwWrtShell::LaunchOLEObj( long nVerb ) ...@@ -579,12 +579,12 @@ void SwWrtShell::LaunchOLEObj( long nVerb )
if ( !pCli ) if ( !pCli )
pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef ); pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
((SwOleClient*)pCli)->SetInDoVerb( true ); static_cast<SwOleClient*>(pCli)->SetInDoVerb( true );
CalcAndSetScale( xRef ); CalcAndSetScale( xRef );
pCli->DoVerb( nVerb ); pCli->DoVerb( nVerb );
((SwOleClient*)pCli)->SetInDoVerb( false ); static_cast<SwOleClient*>(pCli)->SetInDoVerb( false );
CalcAndSetScale( xRef ); CalcAndSetScale( xRef );
} }
} }
...@@ -1351,7 +1351,7 @@ SelectionType SwWrtShell::GetSelectionType() const ...@@ -1351,7 +1351,7 @@ SelectionType SwWrtShell::GetSelectionType() const
if ( BasicActionPend() ) if ( BasicActionPend() )
return IsSelFrmMode() ? nsSelectionType::SEL_FRM : nsSelectionType::SEL_TXT; return IsSelFrmMode() ? nsSelectionType::SEL_FRM : nsSelectionType::SEL_TXT;
SwView &_rView = ((SwView&)GetView()); SwView &_rView = const_cast<SwView&>(GetView());
if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() ) if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() )
return nsSelectionType::SEL_POSTIT; return nsSelectionType::SEL_POSTIT;
......
...@@ -357,8 +357,8 @@ void SwWrtShell::ClickToField( const SwField& rFld ) ...@@ -357,8 +357,8 @@ void SwWrtShell::ClickToField( const SwField& rFld )
if( sRet != sText ) if( sRet != sText )
{ {
StartAllAction(); StartAllAction();
((SwField&)rFld).SetPar2( sRet ); const_cast<SwField&>(rFld).SetPar2( sRet );
((SwField&)rFld).GetTyp()->UpdateFlds(); const_cast<SwField&>(rFld).GetTyp()->UpdateFlds();
EndAllAction(); EndAllAction();
} }
} }
...@@ -366,9 +366,9 @@ void SwWrtShell::ClickToField( const SwField& rFld ) ...@@ -366,9 +366,9 @@ void SwWrtShell::ClickToField( const SwField& rFld )
case RES_GETREFFLD: case RES_GETREFFLD:
StartAllAction(); StartAllAction();
SwCrsrShell::GotoRefMark( ((SwGetRefField&)rFld).GetSetRefName(), SwCrsrShell::GotoRefMark( static_cast<const SwGetRefField&>(rFld).GetSetRefName(),
((SwGetRefField&)rFld).GetSubType(), static_cast<const SwGetRefField&>(rFld).GetSubType(),
((SwGetRefField&)rFld).GetSeqNo() ); static_cast<const SwGetRefField&>(rFld).GetSeqNo() );
EndAllAction(); EndAllAction();
break; break;
...@@ -383,7 +383,7 @@ void SwWrtShell::ClickToField( const SwField& rFld ) ...@@ -383,7 +383,7 @@ void SwWrtShell::ClickToField( const SwField& rFld )
break; break;
case RES_SETEXPFLD: case RES_SETEXPFLD:
if( ((SwSetExpField&)rFld).GetInputFlag() ) if( static_cast<const SwSetExpField&>(rFld).GetInputFlag() )
StartInputFldDlg( (SwField*)&rFld, false ); StartInputFldDlg( (SwField*)&rFld, false );
break; break;
case RES_DROPDOWN : case RES_DROPDOWN :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment