Kaydet (Commit) 6edb52eb authored tarafından Noel Grandin's avatar Noel Grandin

loplugin: cstylecast

Change-Id: Ib36c0f4f8afa0bcaafa0836182e90a9f1d8aff75
üst dbff5f5c
......@@ -256,8 +256,8 @@ namespace accessibility
OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
if ( pEvent && pEvent->ISA( VclWindowEvent ) )
{
OSL_ENSURE( ( (VclWindowEvent*)pEvent )->GetWindow() && m_pTabListBox, "no event window" );
ProcessWindowEvent( *(VclWindowEvent*)pEvent );
OSL_ENSURE( static_cast<VclWindowEvent*>( pEvent )->GetWindow() && m_pTabListBox, "no event window" );
ProcessWindowEvent( *static_cast<VclWindowEvent*>(pEvent) );
}
return 0;
}
......
......@@ -30,9 +30,9 @@ CharacterAttributesHelper::CharacterAttributesHelper( const vcl::Font& rFont, sa
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharColor" ), makeAny( (sal_Int32) nColor ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontCharSet" ), makeAny( (sal_Int16) rFont.GetCharSet() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontFamily" ), makeAny( (sal_Int16) rFont.GetFamily() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontName" ), makeAny( (OUString) rFont.GetName() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontName" ), makeAny( rFont.GetName() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontPitch" ), makeAny( (sal_Int16) rFont.GetPitch() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontStyleName" ), makeAny( (OUString) rFont.GetStyleName() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontStyleName" ), makeAny( rFont.GetStyleName() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharHeight" ), makeAny( (sal_Int16) rFont.GetSize().Height() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharScaleWidth" ), makeAny( (sal_Int16) rFont.GetSize().Width() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharStrikeout" ), makeAny( (sal_Int16) rFont.GetStrikeout() ) ) );
......
......@@ -571,8 +571,8 @@ IMPL_LINK( OAccessibleMenuBaseComponent, MenuEventListener, VclSimpleEvent*, pEv
OSL_ENSURE( pEvent && pEvent->ISA( VclMenuEvent ), "OAccessibleMenuBaseComponent - Unknown MenuEvent!" );
if ( pEvent && pEvent->ISA( VclMenuEvent ) )
{
OSL_ENSURE( ((VclMenuEvent*)pEvent)->GetMenu(), "OAccessibleMenuBaseComponent - Menu?" );
ProcessMenuEvent( *(VclMenuEvent*)pEvent );
OSL_ENSURE( static_cast<VclMenuEvent*>(pEvent)->GetMenu(), "OAccessibleMenuBaseComponent - Menu?" );
ProcessMenuEvent( *static_cast<VclMenuEvent*>(pEvent) );
}
return 0;
}
......
......@@ -65,7 +65,7 @@ void VCLXAccessibleButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowE
Any aOldValue;
Any aNewValue;
PushButton* pButton = (PushButton*) GetWindow();
PushButton* pButton = static_cast<PushButton*>( GetWindow() );
if ( pButton && pButton->GetState() == TRISTATE_TRUE )
aNewValue <<= AccessibleStateType::CHECKED;
else
......@@ -85,7 +85,7 @@ void VCLXAccessibleButton::FillAccessibleStateSet( utl::AccessibleStateSetHelper
{
VCLXAccessibleTextComponent::FillAccessibleStateSet( rStateSet );
PushButton* pButton = (PushButton*) GetWindow();
PushButton* pButton = static_cast<PushButton*>( GetWindow() );
if ( pButton )
{
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
......@@ -196,7 +196,7 @@ sal_Bool VCLXAccessibleButton::doAccessibleAction ( sal_Int32 nIndex ) throw (In
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
PushButton* pButton = (PushButton*) GetWindow();
PushButton* pButton = static_cast<PushButton*>( GetWindow() );
if ( pButton )
pButton->Click();
......@@ -264,7 +264,7 @@ Any VCLXAccessibleButton::getCurrentValue( ) throw (RuntimeException, std::exce
Any aValue;
PushButton* pButton = (PushButton*) GetWindow();
PushButton* pButton = static_cast<PushButton*>( GetWindow() );
if ( pButton )
aValue <<= (sal_Int32) pButton->IsPressed();
......@@ -279,7 +279,7 @@ sal_Bool VCLXAccessibleButton::setCurrentValue( const Any& aNumber ) throw (Runt
bool bReturn = false;
PushButton* pButton = (PushButton*) GetWindow();
PushButton* pButton = static_cast<PushButton*>( GetWindow() );
if ( pButton )
{
sal_Int32 nValue = 0;
......
......@@ -78,10 +78,10 @@ IMPL_LINK( VCLXAccessibleMenuBar, WindowEventListener, VclSimpleEvent*, pEvent )
OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "VCLXAccessibleMenuBar::WindowEventListener: unknown window event!" );
if ( pEvent && pEvent->ISA( VclWindowEvent ) )
{
OSL_ENSURE( ((VclWindowEvent*)pEvent)->GetWindow(), "VCLXAccessibleMenuBar::WindowEventListener: no window!" );
if ( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
OSL_ENSURE( static_cast<VclWindowEvent*>(pEvent)->GetWindow(), "VCLXAccessibleMenuBar::WindowEventListener: no window!" );
if ( !static_cast<VclWindowEvent*>(pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) )
{
ProcessWindowEvent( *(VclWindowEvent*)pEvent );
ProcessWindowEvent( *static_cast<VclWindowEvent*>(pEvent) );
}
}
return 0;
......
......@@ -160,7 +160,7 @@ void VCLXAccessibleStatusBar::ProcessWindowEvent( const VclWindowEvent& rVclWind
{
if ( m_pStatusBar )
{
sal_uInt16 nItemId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nItemId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
sal_uInt16 nItemPos = m_pStatusBar->GetItemPos( nItemId );
InsertChild( nItemPos );
}
......@@ -170,7 +170,7 @@ void VCLXAccessibleStatusBar::ProcessWindowEvent( const VclWindowEvent& rVclWind
{
if ( m_pStatusBar )
{
sal_uInt16 nItemId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nItemId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
for ( sal_Int32 i = 0, nCount = getAccessibleChildCount(); i < nCount; ++i )
{
Reference< XAccessible > xChild( getAccessibleChild( i ) );
......@@ -198,7 +198,7 @@ void VCLXAccessibleStatusBar::ProcessWindowEvent( const VclWindowEvent& rVclWind
{
if ( m_pStatusBar )
{
sal_uInt16 nItemId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nItemId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
sal_uInt16 nItemPos = m_pStatusBar->GetItemPos( nItemId );
UpdateShowing( nItemPos, rVclWindowEvent.GetId() == VCLEVENT_STATUSBAR_SHOWITEM );
}
......@@ -215,7 +215,7 @@ void VCLXAccessibleStatusBar::ProcessWindowEvent( const VclWindowEvent& rVclWind
{
if ( m_pStatusBar )
{
sal_uInt16 nItemId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nItemId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
sal_uInt16 nItemPos = m_pStatusBar->GetItemPos( nItemId );
UpdateItemName( nItemPos );
}
......@@ -225,7 +225,7 @@ void VCLXAccessibleStatusBar::ProcessWindowEvent( const VclWindowEvent& rVclWind
{
if ( m_pStatusBar )
{
sal_uInt16 nItemId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nItemId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
sal_uInt16 nItemPos = m_pStatusBar->GetItemPos( nItemId );
UpdateItemText( nItemPos );
}
......
......@@ -176,7 +176,7 @@ void VCLXAccessibleTabControl::ProcessWindowEvent( const VclWindowEvent& rVclWin
{
if ( m_pTabControl )
{
sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nPageId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
sal_uInt16 nPagePos = m_pTabControl->GetPagePos( nPageId );
UpdateFocused();
UpdateSelected( nPagePos, rVclWindowEvent.GetId() == VCLEVENT_TABPAGE_ACTIVATE );
......@@ -187,7 +187,7 @@ void VCLXAccessibleTabControl::ProcessWindowEvent( const VclWindowEvent& rVclWin
{
if ( m_pTabControl )
{
sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nPageId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
sal_uInt16 nPagePos = m_pTabControl->GetPagePos( nPageId );
UpdatePageText( nPagePos );
}
......@@ -197,7 +197,7 @@ void VCLXAccessibleTabControl::ProcessWindowEvent( const VclWindowEvent& rVclWin
{
if ( m_pTabControl )
{
sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nPageId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
sal_uInt16 nPagePos = m_pTabControl->GetPagePos( nPageId );
InsertChild( nPagePos );
}
......@@ -207,7 +207,7 @@ void VCLXAccessibleTabControl::ProcessWindowEvent( const VclWindowEvent& rVclWin
{
if ( m_pTabControl )
{
sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
sal_uInt16 nPageId = (sal_uInt16)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
for ( sal_Int32 i = 0, nCount = getAccessibleChildCount(); i < nCount; ++i )
{
Reference< XAccessible > xChild( getAccessibleChild( i ) );
......@@ -278,7 +278,7 @@ void VCLXAccessibleTabControl::ProcessWindowChildEvent( const VclWindowEvent& rV
{
sal_uInt16 nPageId = m_pTabControl->GetPageId( (sal_uInt16)i );
TabPage* pTabPage = m_pTabControl->GetTabPage( nPageId );
if ( pTabPage == (TabPage*) pChild )
if ( pTabPage == static_cast<TabPage*>(pChild) )
UpdateTabPage( i, rVclWindowEvent.GetId() == VCLEVENT_WINDOW_SHOW );
}
}
......
......@@ -530,8 +530,8 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
{
if ( rVclWindowEvent.GetData() )
{
UpdateChecked_Impl( (sal_Int32)(sal_IntPtr)rVclWindowEvent.GetData() );
UpdateIndeterminate_Impl( (sal_Int32)(sal_IntPtr)rVclWindowEvent.GetData() );
UpdateChecked_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) );
UpdateIndeterminate_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) );
}
else if( pToolBox->GetItemPos(pToolBox->GetCurItemId()) != TOOLBOX_ITEM_NOTFOUND )
{
......@@ -562,11 +562,11 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
break;
case VCLEVENT_TOOLBOX_HIGHLIGHTOFF:
ReleaseFocus_Impl( (sal_Int32)(sal_IntPtr)rVclWindowEvent.GetData() );
ReleaseFocus_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) );
break;
case VCLEVENT_TOOLBOX_ITEMADDED :
UpdateItem_Impl( (sal_Int32)(sal_IntPtr)rVclWindowEvent.GetData(), true );
UpdateItem_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()), true );
break;
case VCLEVENT_TOOLBOX_ITEMREMOVED :
......@@ -578,7 +578,7 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
case VCLEVENT_TOOLBOX_ITEMWINDOWCHANGED:
{
sal_Int32 nPos = (sal_Int32)(sal_IntPtr)rVclWindowEvent.GetData();
sal_Int32 nPos = (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData());
ToolBoxItemsMap::iterator aAccessiblePos( m_aAccessibleChildren.find( nPos ) );
if ( m_aAccessibleChildren.end() != aAccessiblePos )
{
......@@ -592,13 +592,13 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
break;
}
case VCLEVENT_TOOLBOX_ITEMTEXTCHANGED :
UpdateItemName_Impl( (sal_Int32)(sal_IntPtr)rVclWindowEvent.GetData() );
UpdateItemName_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) );
break;
case VCLEVENT_TOOLBOX_ITEMENABLED :
case VCLEVENT_TOOLBOX_ITEMDISABLED :
{
UpdateItemEnabled_Impl( (sal_Int32)(sal_IntPtr)rVclWindowEvent.GetData() );
UpdateItemEnabled_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) );
break;
}
......
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