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