From 9af8f190ed1bf3f76897ad0c078db16451d6fb69 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 22 Jan 2018 13:11:34 +0100 Subject: More loplugin:cstylecast on Windows Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862 Reviewed-on: https://gerrit.libreoffice.org/48317 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- winaccessibility/source/UAccCOM/AccComponentBase.cxx | 4 ++-- winaccessibility/source/UAccCOM/AccEditableText.cxx | 18 +++++++++--------- winaccessibility/source/UAccCOM/EnumVariant.cxx | 2 +- winaccessibility/source/service/AccObject.cxx | 2 +- .../source/service/AccObjectWinManager.cxx | 2 +- .../source/service/AccTopWindowListener.cxx | 2 +- winaccessibility/source/service/msaaservice_impl.cxx | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) (limited to 'winaccessibility') diff --git a/winaccessibility/source/UAccCOM/AccComponentBase.cxx b/winaccessibility/source/UAccCOM/AccComponentBase.cxx index 68f800f2c20d..e41123ea33e9 100644 --- a/winaccessibility/source/UAccCOM/AccComponentBase.cxx +++ b/winaccessibility/source/UAccCOM/AccComponentBase.cxx @@ -142,7 +142,7 @@ STDMETHODIMP CAccComponentBase::get_foreground(IA2Color * foreground) { return E_FAIL; } - *foreground = (long)GetXInterface()->getForeground(); + *foreground = static_cast(GetXInterface()->getForeground()); return S_OK; @@ -167,7 +167,7 @@ STDMETHODIMP CAccComponentBase::get_background(IA2Color * background) { return E_FAIL; } - *background = (long)GetXInterface()->getBackground(); + *background = static_cast(GetXInterface()->getBackground()); return S_OK; diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx index 7c5b87171fc7..a53d99b0a935 100644 --- a/winaccessibility/source/UAccCOM/AccEditableText.cxx +++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx @@ -295,7 +295,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const : ouName == "CharFontPitch" ) { // Convert to short. - short nValue = (short)ouValue.toInt32(); + short nValue = static_cast(ouValue.toInt32()); rAny.setValue(&nValue, cppu::UnoType::get()); } else if(ouName == "CharHeight" || @@ -313,7 +313,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const : else if(ouName == "CharPosture" ) { // Convert to FontSlant. - css::awt::FontSlant fontSlant = (css::awt::FontSlant)ouValue.toInt32(); + css::awt::FontSlant fontSlant = static_cast(ouValue.toInt32()); rAny.setValue(&fontSlant, cppu::UnoType::get()); } else if(ouName == "ParaTabStops" ) @@ -346,7 +346,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const : if(posComma != -1) { ouSubValue = ouValue.copy(pos + 9, posComma - pos - 9); - tabStop.Alignment = (css::style::TabAlign)ouSubValue.toInt32(); + tabStop.Alignment = static_cast(ouSubValue.toInt32()); pos = posComma + 1; // DecimalChar. @@ -439,30 +439,30 @@ void CAccEditableText::get_AnyFromOLECHAR(const ::rtl::OUString &ouName, const : if(posComma != -1) { ouSubValue = ouValue.copy(pos + 5, posComma - pos - 5); - lineSpacing.Mode = (sal_Int16)ouSubValue.toInt32(); + lineSpacing.Mode = static_cast(ouSubValue.toInt32()); pos = posComma + 1; pos = ouValue.indexOf("Height=", pos); if(pos != -1) { ouSubValue = ouValue.copy(pos + 7); - lineSpacing.Height = (sal_Int16)ouSubValue.toInt32(); + lineSpacing.Height = static_cast(ouSubValue.toInt32()); } else { - lineSpacing.Height = (sal_Int16)100; // Default height. + lineSpacing.Height = sal_Int16(100); // Default height. } } else { - lineSpacing.Height = (sal_Int16)100; // Default height. + lineSpacing.Height = sal_Int16(100); // Default height. } } else { // Default Mode and Height. - lineSpacing.Mode = (sal_Int16)0; - lineSpacing.Height = (sal_Int16)100; // Default height. + lineSpacing.Mode = sal_Int16(0); + lineSpacing.Height = sal_Int16(100); // Default height. } // Convert to Any object. diff --git a/winaccessibility/source/UAccCOM/EnumVariant.cxx b/winaccessibility/source/UAccCOM/EnumVariant.cxx index ba2d443ca91f..ec21526e2d19 100644 --- a/winaccessibility/source/UAccCOM/EnumVariant.cxx +++ b/winaccessibility/source/UAccCOM/EnumVariant.cxx @@ -103,7 +103,7 @@ HRESULT STDMETHODCALLTYPE CEnumVariant::Skip(ULONG cElements) SolarMutexGuard g; m_lCurrent += cElements; - if (m_lCurrent > (long)(m_lLBound+m_pXAccessibleSelection->getSelectedAccessibleChildCount())) + if (m_lCurrent > static_cast(m_lLBound+m_pXAccessibleSelection->getSelectedAccessibleChildCount())) { m_lCurrent = m_lLBound+m_pXAccessibleSelection->getSelectedAccessibleChildCount(); return E_FAIL; diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx index c72b41c7fa6f..ed0ac90eebb7 100644 --- a/winaccessibility/source/service/AccObject.cxx +++ b/winaccessibility/source/service/AccObject.cxx @@ -367,7 +367,7 @@ void AccObject::UpdateDefaultAction( ) case CHECK_BOX: case TREE_ITEM: case BUTTON_DROPDOWN: - m_pIMAcc->Put_ActionDescription( o3tl::toW(m_xAccActionRef->getAccessibleActionDescription((sal_Int32)0).getStr()) ); + m_pIMAcc->Put_ActionDescription( o3tl::toW(m_xAccActionRef->getAccessibleActionDescription(sal_Int32(0)).getStr()) ); return; } } diff --git a/winaccessibility/source/service/AccObjectWinManager.cxx b/winaccessibility/source/service/AccObjectWinManager.cxx index 4298dff3d4d1..d5557d685539 100644 --- a/winaccessibility/source/service/AccObjectWinManager.cxx +++ b/winaccessibility/source/service/AccObjectWinManager.cxx @@ -1015,7 +1015,7 @@ void AccObjectWinManager::SetRole( XAccessible* pXAcc, long Role ) { AccObject* pAccObj = GetAccObjByXAcc( pXAcc ); if( pAccObj ) - pAccObj->SetRole( (short)Role ); + pAccObj->SetRole( static_cast(Role) ); } /** diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx index 5ddb8deffb9a..65b95c6e7bbe 100644 --- a/winaccessibility/source/service/AccTopWindowListener.cxx +++ b/winaccessibility/source/service/AccTopWindowListener.cxx @@ -77,7 +77,7 @@ void AccTopWindowListener::HandleWindowOpened( css::accessibility::XAccessible* AddAllListeners(pAccessible,nullptr,systemdata->hWnd); if( window->GetStyle() & WB_MOVEABLE ) - accManagerAgent.IncreaseState( pAccessible, (unsigned short) -1 /* U_MOVEBLE */ ); + accManagerAgent.IncreaseState( pAccessible, static_cast(-1) /* U_MOVEBLE */ ); short role = pAccessibleContext->getAccessibleRole(); diff --git a/winaccessibility/source/service/msaaservice_impl.cxx b/winaccessibility/source/service/msaaservice_impl.cxx index cc3b92116fdc..95968c4d65ad 100644 --- a/winaccessibility/source/service/msaaservice_impl.cxx +++ b/winaccessibility/source/service/msaaservice_impl.cxx @@ -216,7 +216,7 @@ static void AccessBridgeHandleExistingWindow(const Reference< XMSAAService > &xA */ static void AccessBridgeUpdateOldTopWindows( const Reference< XMSAAService > &xAccMgr ) { - sal_uInt16 nTopWindowCount = (sal_uInt16)Application::GetTopWindowCount(); + sal_uInt16 nTopWindowCount = static_cast(Application::GetTopWindowCount()); for ( sal_uInt16 i = 0; i < nTopWindowCount; i++ ) { -- cgit