diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-19 13:10:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-19 14:38:35 +0200 |
commit | 8fced917aa1af58216cbde56720f2f473eed86d9 (patch) | |
tree | 755d0dfba1fe4a5c34860d0d1ea4c6ce01525405 /chart2/source | |
parent | f0110f798cee31ff87651dc2377eacef2ab8a8b7 (diff) |
clang-tidy readability-simplify-boolean-expr in accessibility..cui
Change-Id: Iae27da322c6ede592e6b268fb2210d3525ed22cc
Reviewed-on: https://gerrit.libreoffice.org/36677
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
9 files changed, 16 insertions, 50 deletions
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 6acfc912845f..ff8f8292c085 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -126,9 +126,7 @@ bool ChartTypeDialogController::isSubType( const OUString& rServiceName ) { const tTemplateServiceChartTypeParameterMap& rTemplateMap = this->getTemplateMap(); tTemplateServiceChartTypeParameterMap::const_iterator aIt( rTemplateMap.find( rServiceName )); - if( aIt != rTemplateMap.end()) - return true; - return false; + return aIt != rTemplateMap.end(); } ChartTypeParameter ChartTypeDialogController::getChartTypeParameterForService( const OUString& rServiceName diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 2b049ab616b1..53b7594e412a 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -576,14 +576,9 @@ bool ChartController::isObjectDeleteable( const uno::Any& rSelection ) bool ChartController::isShapeContext() const { - if ( m_aSelection.isAdditionalShapeSelected() || + return m_aSelection.isAdditionalShapeSelected() || ( m_pDrawViewWrapper && m_pDrawViewWrapper->AreObjectsMarked() && - ( m_pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) ) ) - { - return true; - } - - return false; + ( m_pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) ); } void ChartController::impl_ClearSelection() diff --git a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx index 7e4b17fdd45f..b5171cb3d67b 100644 --- a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx +++ b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx @@ -46,11 +46,7 @@ void FeatureCommandDispatchBase::initialize() bool FeatureCommandDispatchBase::isFeatureSupported( const OUString& rCommandURL ) { SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( rCommandURL ); - if ( aIter != m_aSupportedFeatures.end() ) - { - return true; - } - return false; + return aIter != m_aSupportedFeatures.end(); } void FeatureCommandDispatchBase::fireStatusEvent( const OUString& rURL, diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index 4e6375cdd26b..b76a7bfa08ac 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -375,9 +375,7 @@ bool SelectionHelper::isDragableObjectHitTwice( const Point& rMPos return false; SolarMutexGuard aSolarGuard; SdrObject* pObj = rDrawViewWrapper.getNamedSdrObject( rNameOfSelectedObject ); - if( !DrawViewWrapper::IsObjectHit( pObj, rMPos ) ) - return false; - return true; + return DrawViewWrapper::IsObjectHit( pObj, rMPos ); } OUString SelectionHelper::getHitObjectCID( @@ -452,9 +450,7 @@ bool SelectionHelper::isRotateableObject( const OUString& rCID sal_Int32 nDimensionCount = DiagramHelper::getDimension( ChartModelHelper::findDiagram( xChartModel ) ); - if( nDimensionCount == 3 ) - return true; - return false; + return nDimensionCount == 3; } SelectionHelper::SelectionHelper( SdrObject* pSelectedObj ) diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index 5837ea28f872..849612de0e54 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -694,9 +694,7 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque return true; } } - if( xDataSequence->getData().getLength() ) - return true; - return false; + return xDataSequence->getData().getLength(); } } diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 0aa654587b94..604d0be5eb77 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -279,12 +279,8 @@ ObjectIdentifier::ObjectIdentifier( const ObjectIdentifier& rOID ) bool ObjectIdentifier::operator==( const ObjectIdentifier& rOID ) const { - if ( areIdenticalObjects( m_aObjectCID, rOID.m_aObjectCID ) && - ( m_xAdditionalShape == rOID.m_xAdditionalShape ) ) - { - return true; - } - return false; + return areIdenticalObjects( m_aObjectCID, rOID.m_aObjectCID ) && + ( m_xAdditionalShape == rOID.m_xAdditionalShape ); } bool ObjectIdentifier::operator!=( const ObjectIdentifier& rOID ) const @@ -766,10 +762,7 @@ bool ObjectIdentifier::parsePieSegmentDragParameterString( aValueString = rDragParameterString.getToken( 0, ',', nCharacterIndex ); rMaximumPosition.Y = aValueString.toInt32(); - if( nCharacterIndex < 0 ) - return false; - - return true; + return nCharacterIndex >= 0; } OUString ObjectIdentifier::getDragMethodServiceName( const OUString& rCID ) diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx index 10c6edf7e35f..802f86296bb2 100644 --- a/chart2/source/tools/RegressionCurveHelper.cxx +++ b/chart2/source/tools/RegressionCurveHelper.cxx @@ -262,11 +262,9 @@ bool RegressionCurveHelper::isMeanValueLine( const uno::Reference< chart2::XRegressionCurve > & xRegCurve ) { uno::Reference< XServiceName > xServName( xRegCurve, uno::UNO_QUERY ); - if( xServName.is() && + return xServName.is() && xServName->getServiceName() == - "com.sun.star.chart2.MeanValueRegressionCurve" ) - return true; - return false; + "com.sun.star.chart2.MeanValueRegressionCurve"; } uno::Reference< chart2::XRegressionCurve > diff --git a/chart2/source/view/axes/DateHelper.cxx b/chart2/source/view/axes/DateHelper.cxx index 42a77cd045ec..9779ef0a2c4c 100644 --- a/chart2/source/view/axes/DateHelper.cxx +++ b/chart2/source/view/axes/DateHelper.cxx @@ -56,9 +56,7 @@ bool DateHelper::IsLessThanOneMonthAway( const Date& rD1, const Date& rD2 ) Date aDMin( DateHelper::GetDateSomeMonthsAway( rD1, -1 ) ); Date aDMax( DateHelper::GetDateSomeMonthsAway( rD1, 1 ) ); - if( rD2 > aDMin && rD2 < aDMax ) - return true; - return false; + return rD2 > aDMin && rD2 < aDMax; } bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 ) @@ -66,9 +64,7 @@ bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 ) Date aDMin( DateHelper::GetDateSomeYearsAway( rD1, -1 ) ); Date aDMax( DateHelper::GetDateSomeYearsAway( rD1, 1 ) ); - if( rD2 > aDMin && rD2 < aDMax ) - return true; - return false; + return rD2 > aDMin && rD2 < aDMax; } double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution ) diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 0d98ead38381..be0cc9bc7e9f 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -1502,9 +1502,7 @@ namespace // default implementation: true for Y axes, and for value X axis if( nDimensionIndex == 0 ) return !bCategoryXAxis; - if( nDimensionIndex == 1 ) - return true; - return false; + return nDimensionIndex == 1; } } @@ -2103,9 +2101,7 @@ bool VSeriesPlotter::WantToPlotInFrontOfAxisLine() bool VSeriesPlotter::shouldSnapRectToUsedArea() { - if( m_nDimension == 3 ) - return false; - return true; + return m_nDimension != 3; } std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries( |