diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-22 15:55:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-30 08:50:31 +0200 |
commit | 2ccde70d60d3a5074faf49260e8fe0ccdb91ff26 (patch) | |
tree | 82555c2aac7ca37c30e1084a7a8069c71fc11fbc /framework | |
parent | 61ff1d919e317947c769e61eeda7f1bb8132f273 (diff) |
teach redundantcast plugin about functional casts
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0
Reviewed-on: https://gerrit.libreoffice.org/37910
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
7 files changed, 19 insertions, 20 deletions
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index a897906009fb..9ef5503210fa 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -182,7 +182,7 @@ void ToolbarLayoutManager::implts_setDockingAreaWindowSizes( const awt::Rectangl { // Left docking area window // We also have to change our right docking area window if the top or bottom area has changed. They have a higher priority! - sal_Int32 nHeight = std::max( sal_Int32( 0 ), sal_Int32( nLeftRightDockingAreaHeight )); + sal_Int32 nHeight = std::max<sal_Int32>( 0, nLeftRightDockingAreaHeight ); xLeftDockAreaWindow->setPosSize( 0, rBorderSpace.Y, rBorderSpace.X, nHeight, awt::PosSize::POSSIZE ); xLeftDockAreaWindow->setVisible( true ); @@ -191,8 +191,8 @@ void ToolbarLayoutManager::implts_setDockingAreaWindowSizes( const awt::Rectangl { // Right docking area window // We also have to change our right docking area window if the top or bottom area has changed. They have a higher priority! - sal_Int32 nLeftPos = std::max( sal_Int32( 0 ), sal_Int32( aContainerClientSize.Width - rBorderSpace.Width )); - sal_Int32 nHeight = std::max( sal_Int32( 0 ), sal_Int32( nLeftRightDockingAreaHeight )); + sal_Int32 nLeftPos = std::max<sal_Int32>( 0, aContainerClientSize.Width - rBorderSpace.Width ); + sal_Int32 nHeight = std::max<sal_Int32>( 0, nLeftRightDockingAreaHeight ); sal_Int32 nWidth = ( nLeftPos == 0 ) ? 0 : rBorderSpace.Width; xRightDockAreaWindow->setPosSize( nLeftPos, rBorderSpace.Y, nWidth, nHeight, awt::PosSize::POSSIZE ); @@ -2921,12 +2921,12 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( } else { - sal_Int32 nMaxDockingAreaHeight = std::max( sal_Int32( 0 ), sal_Int32( nMaxLeftRightDockAreaSize )); - sal_Int32 nPosY( std::max( sal_Int32( aTrackingRect.Top()), sal_Int32( nTopDockingAreaSize ))); + sal_Int32 nMaxDockingAreaHeight = std::max<sal_Int32>( 0, nMaxLeftRightDockAreaSize ); + sal_Int32 nPosY( std::max<sal_Int32>( aTrackingRect.Top(), nTopDockingAreaSize )); if (( nPosY + aTrackingRect.getHeight()) > ( nTopDockingAreaSize + nMaxDockingAreaHeight )) nPosY = std::min( nPosY, - std::max( sal_Int32( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() )), - sal_Int32( nTopDockingAreaSize ))); + std::max<sal_Int32>( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ), + nTopDockingAreaSize )); sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast<sal_Int32>(aTrackingRect.getHeight()) ); sal_Int32 nDockWidth = std::max( static_cast<sal_Int32>(aDockingAreaRect.getWidth()), sal_Int32( 0 )); @@ -3051,14 +3051,13 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d } else { - sal_Int32 nMaxDockingAreaHeight = std::max( sal_Int32( 0 ), - sal_Int32( nMaxLeftRightDockAreaSize )); + sal_Int32 nMaxDockingAreaHeight = std::max<sal_Int32>( 0, nMaxLeftRightDockAreaSize ); - sal_Int32 nPosY( std::max( sal_Int32( aTrackingRect.Top()), sal_Int32( nTopDockingAreaSize ))); + sal_Int32 nPosY( std::max<sal_Int32>( aTrackingRect.Top(), nTopDockingAreaSize )); if (( nPosY + aTrackingRect.getHeight()) > ( nTopDockingAreaSize + nMaxDockingAreaHeight )) nPosY = std::min( nPosY, - std::max( sal_Int32( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() )), - sal_Int32( nTopDockingAreaSize ))); + std::max<sal_Int32>( nTopDockingAreaSize + ( nMaxDockingAreaHeight - aTrackingRect.getHeight() ), + nTopDockingAreaSize )); sal_Int32 nSize = std::min( nMaxDockingAreaHeight, static_cast<sal_Int32>(aTrackingRect.getHeight()) ); diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx index d249ec2fb45b..56007e6ed91e 100644 --- a/framework/source/tabwin/tabwindow.cxx +++ b/framework/source/tabwin/tabwindow.cxx @@ -600,7 +600,7 @@ void SAL_CALL TabWindow::removeTab( ::sal_Int32 ID ) implts_SendNotification( NOTIFY_REMOVED, ID ); // activate new tab if old tab was active! - nPos = pTabControl->GetPagePos( sal_uInt16( nCurTabId )); + nPos = pTabControl->GetPagePos( nCurTabId ); if ( nPos != TAB_PAGE_NOTFOUND && nCurTabId != ID ) activateTab( nCurTabId ); } diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index a26eca969db6..a9946b55fd3d 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -1100,7 +1100,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL ModuleUIConfigurationManager::get if ( ElementType == css::ui::UIElementType::UNKNOWN ) { for ( sal_Int16 i = 0; i < css::ui::UIElementType::COUNT; i++ ) - impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, sal_Int16( i ) ); + impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, i ); } else impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, ElementType ); diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index d38377387376..c8714f2d4275 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -860,7 +860,7 @@ Sequence< Sequence< PropertyValue > > SAL_CALL UIConfigurationManager::getUIElem if ( ElementType == css::ui::UIElementType::UNKNOWN ) { for ( sal_Int16 i = 0; i < css::ui::UIElementType::COUNT; i++ ) - impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, sal_Int16( i ) ); + impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, i ); } else impl_fillSequenceWithElementTypeInfo( aUIElementInfoCollection, ElementType ); diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index d6d42b1fb75a..b8c671edb931 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -294,7 +294,7 @@ void ComboboxToolbarController::executeControlCommand( const css::frame::Control if ( rControlCommand.Arguments[i].Value >>= nTmpPos ) { if (( nTmpPos >= 0 ) && - ( nTmpPos < sal_Int32( m_pComboBox->GetEntryCount() ))) + ( nTmpPos < m_pComboBox->GetEntryCount() )) nPos = nTmpPos; } } @@ -313,7 +313,7 @@ void ComboboxToolbarController::executeControlCommand( const css::frame::Control sal_Int32 nPos( -1 ); if ( rControlCommand.Arguments[i].Value >>= nPos ) { - if ( 0 <= nPos && nPos < sal_Int32( m_pComboBox->GetEntryCount() )) + if ( 0 <= nPos && nPos < m_pComboBox->GetEntryCount() ) m_pComboBox->RemoveEntryAt(nPos); } break; diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index 89ebd484886e..348d0634f4dd 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -238,7 +238,7 @@ void DropdownToolbarController::executeControlCommand( const css::frame::Control if ( rControlCommand.Arguments[i].Value >>= nTmpPos ) { if (( nTmpPos >= 0 ) && - ( nTmpPos < sal_Int32( m_pListBoxControl->GetEntryCount() ))) + ( nTmpPos < m_pListBoxControl->GetEntryCount() )) nPos = nTmpPos; } } @@ -257,7 +257,7 @@ void DropdownToolbarController::executeControlCommand( const css::frame::Control sal_Int32 nPos( -1 ); if ( rControlCommand.Arguments[i].Value >>= nPos ) { - if ( 0 <= nPos && nPos < sal_Int32( m_pListBoxControl->GetEntryCount() )) + if ( 0 <= nPos && nPos < m_pListBoxControl->GetEntryCount() ) m_pListBoxControl->RemoveEntry( nPos ); } break; diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx index f1341f56f821..d8f95a6c7e86 100644 --- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx @@ -194,7 +194,7 @@ void ToggleButtonToolbarController::executeControlCommand( const css::frame::Con sal_Int32 nTmpPos = 0; if ( rControlCommand.Arguments[i].Value >>= nTmpPos ) { - if (( nTmpPos >= 0 ) && ( nTmpPos < sal_Int32( nSize ))) + if (( nTmpPos >= 0 ) && ( nTmpPos < nSize )) nPos = nTmpPos; } } |