From 820fca753b0bfed6078b9cde09430177d6a193ca Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 24 Apr 2015 12:25:01 +0200 Subject: loplugin:simplifybool Change-Id: Ie7b1a6c7e60d888e2f070b817d3c34814e5835ae --- chart2/source/controller/dialogs/res_ErrorBar.cxx | 4 ++-- chart2/source/controller/dialogs/res_LegendPosition.cxx | 4 ++-- chart2/source/controller/dialogs/tp_DataSource.cxx | 4 ++-- chart2/source/controller/dialogs/tp_RangeChooser.cxx | 4 ++-- chart2/source/tools/ExplicitCategoriesProvider.cxx | 2 +- chart2/source/view/main/GL3DRenderer.cxx | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index b43578b8e6a8..60d590177c52 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -41,8 +41,8 @@ void lcl_enableRangeChoosing( bool bEnable, Dialog * pDialog ) { if( pDialog ) { - pDialog->Show( bEnable ? false : true ); - pDialog->SetModalInputMode( bEnable ? false : true ); + pDialog->Show( !bEnable ); + pDialog->SetModalInputMode( !bEnable ); } } diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx index 95088398d9b7..fe05befe5fa1 100644 --- a/chart2/source/controller/dialogs/res_LegendPosition.cxx +++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx @@ -167,7 +167,7 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen IMPL_LINK_NOARG(LegendPositionResources, PositionEnableHdl) { - bool bEnable = m_pCbxShow ? m_pCbxShow->IsChecked() : true; + bool bEnable = m_pCbxShow == nullptr || m_pCbxShow->IsChecked(); m_pRbtLeft->Enable( bEnable ); m_pRbtTop->Enable( bEnable ); @@ -224,7 +224,7 @@ void LegendPositionResources::writeToItemSet( SfxItemSet& rOutAttrs ) const nLegendPosition = chart2::LegendPosition_PAGE_END; rOutAttrs.Put(SfxInt32Item(SCHATTR_LEGEND_POS, nLegendPosition )); - rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_pCbxShow ? m_pCbxShow->IsChecked() : true) ); + rOutAttrs.Put( SfxBoolItem(SCHATTR_LEGEND_SHOW, m_pCbxShow == nullptr || m_pCbxShow->IsChecked()) ); } IMPL_LINK( LegendPositionResources, PositionChangeHdl, RadioButton*, pRadio ) diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index f106decc7878..d265e8ab7859 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -136,8 +136,8 @@ void lcl_enableRangeChoosing( bool bEnable, Dialog * pDialog ) { if( pDialog ) { - pDialog->Show( bEnable ? false : true ); - pDialog->SetModalInputMode( bEnable ? false : true ); + pDialog->Show( !bEnable ); + pDialog->SetModalInputMode( !bEnable ); } } diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx index 7541f6726a19..a5b498661fed 100644 --- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx +++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx @@ -46,8 +46,8 @@ namespace { if( pDialog ) { - pDialog->Show( bEnable ? false : true ); - pDialog->SetModalInputMode( bEnable ? false : true ); + pDialog->Show( !bEnable ); + pDialog->SetModalInputMode( !bEnable ); } } diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index a57607178d75..8684e08fe52a 100644 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -449,7 +449,7 @@ bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataS if( bIsAutoDate ) { if( bOwnData ) - bIsDate = bOwnDataAnddAxisHasAnyFormat ? bOwnDataAnddAxisHasDateFormat : true; + bIsDate = !bOwnDataAnddAxisHasAnyFormat || bOwnDataAnddAxisHasDateFormat; else bIsDate = DiagramHelper::isDateNumberFormat( xDataSequence->getNumberFormatKeyByIndex( nN ), xNumberFormats ); } diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index 0abfa5860d5b..29cdb5ca8f43 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -261,7 +261,7 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders() m_BatchTextVertexID = glGetAttribLocation(m_BatchTextProID, "vPosition"); m_BatchTextTexCoordID = glGetAttribLocation(m_BatchTextProID, "texCoord"); } - mbTexBatchSupport = m_BatchTextProID ? true : false; + mbTexBatchSupport = m_BatchTextProID != 0; CHECK_GL_ERROR(); } else @@ -2455,7 +2455,7 @@ void OpenGL3DRenderer::CalcScrollMoveMatrix(bool bNewScene) m_fCurDistance = -m_fScrollSpeed; m_fCurDistance += m_fCurDistance >= m_fScrollDistance ? 0.0f : m_fScrollSpeed; m_ScrollMoveMatrix = glm::translate(glm::vec3(-m_fCurDistance * 0.01, 0.0f, 0.0f)); - m_bUndrawFlag = m_fCurDistance >= m_fScrollDistance ? true : false; + m_bUndrawFlag = m_fCurDistance >= m_fScrollDistance; } glm::mat4 OpenGL3DRenderer::GetDiffOfTwoCameras(const glm::vec3& rBeginPos, const glm::vec3& rEndPos, const glm::vec3& rBeginDirection, const glm::vec3& rEndDirection) -- cgit