canvas/source/cairo/cairo_canvashelper.cxx | 2 chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx | 4 chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx | 2 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 6 - chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx | 10 +- chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx | 16 +-- chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx | 4 chart2/source/controller/dialogs/ChartTypeDialogController.cxx | 8 - chart2/source/controller/dialogs/ObjectNameProvider.cxx | 20 ++-- chart2/source/controller/dialogs/dlg_ObjectProperties.cxx | 22 ++-- chart2/source/controller/dialogs/res_DataLabel.cxx | 2 chart2/source/controller/dialogs/tp_AxisPositions.cxx | 8 - chart2/source/controller/dialogs/tp_ChartType.cxx | 24 ++--- chart2/source/controller/dialogs/tp_Scale.cxx | 18 +-- chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx | 10 +- chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx | 26 ++--- chart2/source/controller/itemsetwrapper/ItemConverter.cxx | 2 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | 4 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx | 26 ++--- chart2/source/controller/main/ChartController_Position.cxx | 10 +- chart2/source/controller/main/ChartController_Properties.cxx | 10 +- chart2/source/controller/main/ChartController_Window.cxx | 46 +++++----- chart2/source/controller/main/ControllerCommandDispatch.cxx | 14 +-- chart2/source/controller/main/DrawCommandDispatch.cxx | 2 chart2/source/controller/main/ElementSelector.cxx | 4 chart2/source/controller/main/PositionAndSizeHelper.cxx | 10 +- chart2/source/controller/main/SelectionHelper.cxx | 10 +- chart2/source/model/main/ChartModel.cxx | 4 chart2/source/model/main/Diagram.cxx | 14 +-- chart2/source/model/template/ChartTypeTemplate.cxx | 2 chart2/source/tools/AxisHelper.cxx | 6 - chart2/source/tools/ChartModelHelper.cxx | 2 chart2/source/tools/ChartTypeHelper.cxx | 10 +- chart2/source/tools/LinePropertiesHelper.cxx | 4 chart2/source/tools/ObjectIdentifier.cxx | 4 chart2/source/tools/RangeHighlighter.cxx | 22 ++-- chart2/source/tools/ThreeDHelper.cxx | 2 chart2/source/view/axes/DateScaling.cxx | 4 chart2/source/view/axes/ScaleAutomatism.cxx | 4 chart2/source/view/axes/Tickmarks.cxx | 6 - chart2/source/view/axes/VAxisBase.cxx | 8 - chart2/source/view/axes/VAxisProperties.cxx | 16 +-- chart2/source/view/axes/VCartesianAxis.cxx | 44 ++++----- chart2/source/view/axes/VCartesianCoordinateSystem.cxx | 8 - chart2/source/view/axes/VCartesianGrid.cxx | 26 ++--- chart2/source/view/axes/VCoordinateSystem.cxx | 22 ++-- chart2/source/view/axes/VPolarAxis.cxx | 4 chart2/source/view/axes/VPolarCoordinateSystem.cxx | 6 - chart2/source/view/axes/VPolarGrid.cxx | 2 chart2/source/view/charttypes/AreaChart.cxx | 18 +-- chart2/source/view/charttypes/BarChart.cxx | 20 ++-- chart2/source/view/charttypes/BubbleChart.cxx | 2 chart2/source/view/charttypes/NetChart.cxx | 2 chart2/source/view/charttypes/PieChart.cxx | 4 chart2/source/view/charttypes/VSeriesPlotter.cxx | 34 +++---- chart2/source/view/diagram/VDiagram.cxx | 14 +-- chart2/source/view/main/ChartView.cxx | 22 ++-- chart2/source/view/main/DummyXShape.cxx | 4 chart2/source/view/main/GL3DRenderer.cxx | 4 chart2/source/view/main/LabelPositionHelper.cxx | 8 - chart2/source/view/main/PlottingPositionHelper.cxx | 26 ++--- chart2/source/view/main/PolarLabelPositionHelper.cxx | 2 chart2/source/view/main/VLineProperties.cxx | 2 63 files changed, 351 insertions(+), 351 deletions(-)
New commits: commit 0b2f1292b3504b54e3799cd3d942365058360347 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue May 23 10:04:27 2017 +0200 loplugin:comparisonwithconstant in chart2 Change-Id: I95787007b26cdcf0d5d1617ecd0e55d377b551d7 Reviewed-on: https://gerrit.libreoffice.org/37941 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index a27f69ba1085..5f0d9bd9db07 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -1101,7 +1101,7 @@ namespace cairocanvas cairo_t* pCairo = mpCairo.get(); - if(bNoLineJoin && Stroke == aOperation) + if(bNoLineJoin && aOperation == Stroke) { // emulate rendering::PathJoinType::NONE by painting single edges for(sal_uInt32 a(0); a < rPolyPoly.count(); a++) diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx index 904ec57ce11c..4770c8d1dbf6 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx @@ -197,7 +197,7 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingAxes() const awt::Rectangle aRect(0,0,0,0); uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( m_xChartModel ) ); - if( DiagramPositioningMode_INCLUDING == DiagramHelper::getDiagramPositioningMode( xDiagram ) ) + if( DiagramHelper::getDiagramPositioningMode( xDiagram ) == DiagramPositioningMode_INCLUDING ) aRect = DiagramHelper::getDiagramRectangleFromModel(m_xChartModel); else { @@ -213,7 +213,7 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleExcludingAxes() const awt::Rectangle aRect(0,0,0,0); uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( m_xChartModel ) ); - if( DiagramPositioningMode_EXCLUDING == DiagramHelper::getDiagramPositioningMode( xDiagram ) ) + if( DiagramHelper::getDiagramPositioningMode( xDiagram ) == DiagramPositioningMode_EXCLUDING ) aRect = DiagramHelper::getDiagramRectangleFromModel(m_xChartModel); else { diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx index 4493a48c647d..36b3ea04246a 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx @@ -547,7 +547,7 @@ double SAL_CALL ChartDataWrapper::getNotANumber() sal_Bool SAL_CALL ChartDataWrapper::isNotANumber( double nNumber ) { - return DBL_MIN == nNumber + return nNumber == DBL_MIN || ::rtl::math::isNan( nNumber ) || ::rtl::math::isInf( nNumber ); } diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index c1614607ef00..67f3c256e549 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -870,13 +870,13 @@ Reference< XAxis > SAL_CALL DiagramWrapper::getAxis( sal_Int32 nDimensionIndex ) m_xXAxis = new AxisWrapper( AxisWrapper::X_AXIS, m_spChart2ModelContact ); xAxis = m_xXAxis; } - else if(1==nDimensionIndex) + else if(nDimensionIndex==1) { if( !m_xYAxis.is() ) m_xYAxis = new AxisWrapper( AxisWrapper::Y_AXIS, m_spChart2ModelContact ); xAxis = m_xYAxis; } - else if(2==nDimensionIndex) + else if(nDimensionIndex==2) { if( !m_xZAxis.is() ) m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact ); @@ -894,7 +894,7 @@ Reference< XAxis > SAL_CALL DiagramWrapper::getSecondaryAxis( sal_Int32 nDimensi m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact ); xAxis = m_xSecondXAxis; } - else if(1==nDimensionIndex) + else if(nDimensionIndex==1) { if( !m_xSecondYAxis.is() ) m_xSecondYAxis = new AxisWrapper( AxisWrapper::SECOND_Y_AXIS, m_spChart2ModelContact ); diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx index 6884f4e8e7c5..c7cc2cf856da 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx @@ -267,19 +267,19 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons sal_Int32 nType = 0; if( (rOuterValue >>= nType) ) { - if( css::chart::ChartAxisType::AUTOMATIC == nType ) + if( nType == css::chart::ChartAxisType::AUTOMATIC ) { aScaleData.AutoDateAxis = true; if( aScaleData.AxisType == AxisType::DATE ) aScaleData.AxisType = AxisType::CATEGORY; } - else if( css::chart::ChartAxisType::CATEGORY == nType ) + else if( nType == css::chart::ChartAxisType::CATEGORY ) { aScaleData.AutoDateAxis = false; if( aScaleData.AxisType == AxisType::DATE ) aScaleData.AxisType = AxisType::CATEGORY; } - else if( css::chart::ChartAxisType::DATE == nType ) + else if( nType == css::chart::ChartAxisType::DATE ) { if( aScaleData.AxisType == AxisType::CATEGORY ) aScaleData.AxisType = AxisType::DATE; @@ -321,7 +321,7 @@ void WrappedScaleProperty::setPropertyValue( tScaleProperty eScaleProperty, cons { if( rOuterValue >>= bBool ) { - bool bWasReverse = ( AxisOrientation_REVERSE == aScaleData.Orientation ); + bool bWasReverse = ( aScaleData.Orientation == AxisOrientation_REVERSE ); if( (!bBool) != (!bWasReverse) ) // safe comparison between sal_Bool and bool { aScaleData.Orientation = bBool ? AxisOrientation_REVERSE : AxisOrientation_MATHEMATICAL; @@ -566,7 +566,7 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const } case SCALE_PROP_REVERSEDIRECTION: { - aRet <<= AxisOrientation_REVERSE == aScaleData.Orientation; + aRet <<= aScaleData.Orientation == AxisOrientation_REVERSE; break; } default: diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx index 16070e58d628..9e6a617948b0 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx @@ -227,7 +227,7 @@ double WrappedConstantErrorLowProperty::getValueFromSeries( const Reference< bea uno::Reference< beans::XPropertySet > xErrorBarProperties; if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is()) { - if( css::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE ) xErrorBarProperties->getPropertyValue( "NegativeError" ) >>= aRet; else m_aOuterValue >>= aRet; @@ -241,7 +241,7 @@ void WrappedConstantErrorLowProperty::setValueToSeries( const Reference< beans:: if( xErrorBarProperties.is() ) { m_aOuterValue <<= aNewValue; - if( css::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE ) { xErrorBarProperties->setPropertyValue( "NegativeError", m_aOuterValue ); } @@ -277,7 +277,7 @@ double WrappedConstantErrorHighProperty::getValueFromSeries( const Reference< be uno::Reference< beans::XPropertySet > xErrorBarProperties; if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is()) { - if( css::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE ) xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet; else m_aOuterValue >>= aRet; @@ -291,7 +291,7 @@ void WrappedConstantErrorHighProperty::setValueToSeries( const Reference< beans: if( xErrorBarProperties.is() ) { m_aOuterValue <<= aNewValue; - if( css::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ABSOLUTE ) { xErrorBarProperties->setPropertyValue( "PositiveError" , m_aOuterValue ); } @@ -461,7 +461,7 @@ double WrappedPercentageErrorProperty::getValueFromSeries( const Reference< bean uno::Reference< beans::XPropertySet > xErrorBarProperties; if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is()) { - if( css::chart::ErrorBarStyle::RELATIVE == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::RELATIVE ) xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet; else m_aOuterValue >>= aRet; @@ -474,7 +474,7 @@ void WrappedPercentageErrorProperty::setValueToSeries( const Reference< beans::X if( xErrorBarProperties.is() ) { m_aOuterValue <<= aNewValue; - if( css::chart::ErrorBarStyle::RELATIVE == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::RELATIVE ) { xErrorBarProperties->setPropertyValue( "PositiveError" , m_aOuterValue ); xErrorBarProperties->setPropertyValue( "NegativeError" , m_aOuterValue ); @@ -511,7 +511,7 @@ double WrappedErrorMarginProperty::getValueFromSeries( const Reference< beans::X uno::Reference< beans::XPropertySet > xErrorBarProperties; if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is()) { - if( css::chart::ErrorBarStyle::ERROR_MARGIN == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ERROR_MARGIN ) xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet; else m_aOuterValue >>= aRet; @@ -524,7 +524,7 @@ void WrappedErrorMarginProperty::setValueToSeries( const Reference< beans::XProp if( xErrorBarProperties.is() ) { m_aOuterValue <<= aNewValue; - if( css::chart::ErrorBarStyle::ERROR_MARGIN == lcl_getErrorBarStyle( xErrorBarProperties ) ) + if( lcl_getErrorBarStyle( xErrorBarProperties ) == css::chart::ErrorBarStyle::ERROR_MARGIN ) { xErrorBarProperties->setPropertyValue( "PositiveError" , m_aOuterValue ); xErrorBarProperties->setPropertyValue( "NegativeError" , m_aOuterValue ); diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx index f8bbbffda161..ec1683ba8038 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx @@ -252,7 +252,7 @@ Any WrappedSymbolTypeProperty::getPropertyValue( const Reference< beans::XProper } else { - if( css::chart::ChartSymbolType::NONE == aValue ) + if( aValue == css::chart::ChartSymbolType::NONE ) m_aOuterValue <<= css::chart::ChartSymbolType::NONE; else m_aOuterValue <<= css::chart::ChartSymbolType::AUTO; @@ -456,7 +456,7 @@ beans::PropertyState WrappedSymbolSizeProperty::getPropertyState( const Referenc Reference< beans::XPropertySet > xSeriesPropertySet( xInnerPropertyState, uno::UNO_QUERY ); if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol )) { - if( chart2::SymbolStyle_NONE != aSymbol.Style ) + if( aSymbol.Style != chart2::SymbolStyle_NONE ) return beans::PropertyState_DIRECT_VALUE; } } diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index a61299c1e46b..6bf6c25ef928 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -679,7 +679,7 @@ void LineChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const C { case CurveStyle_CUBIC_SPLINES: case CurveStyle_B_SPLINES: - if( GlobalStackMode_NONE == rParameter.eStackMode || GlobalStackMode_STACK_Z == rParameter.eStackMode ) + if( rParameter.eStackMode == GlobalStackMode_NONE || rParameter.eStackMode == GlobalStackMode_STACK_Z ) { rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_POINTS_XCATEGORY))); rSubTypeList.InsertItem(2, Image(BitmapEx(BMP_LINE_P_XCATEGORY_SMOOTH))); @@ -698,7 +698,7 @@ void LineChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const C case CurveStyle_STEP_END: case CurveStyle_STEP_CENTER_X: case CurveStyle_STEP_CENTER_Y: - if( GlobalStackMode_NONE == rParameter.eStackMode || GlobalStackMode_STACK_Z == rParameter.eStackMode ) + if( rParameter.eStackMode == GlobalStackMode_NONE || rParameter.eStackMode == GlobalStackMode_STACK_Z ) { rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_POINTS_XCATEGORY))); rSubTypeList.InsertItem(2, Image(BitmapEx(BMP_LINE_P_XCATEGORY_STEPPED))); @@ -715,7 +715,7 @@ void LineChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const C break; default: // includes CurveStyle_LINES //direct lines - if( GlobalStackMode_NONE == rParameter.eStackMode || GlobalStackMode_STACK_Z == rParameter.eStackMode ) + if( rParameter.eStackMode == GlobalStackMode_NONE || rParameter.eStackMode == GlobalStackMode_STACK_Z ) { rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_POINTS_XCATEGORY))); rSubTypeList.InsertItem(2, Image(BitmapEx(BMP_LINE_P_XCATEGORY))); @@ -1025,7 +1025,7 @@ void NetChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, const Ch { rSubTypeList.Clear(); - if( GlobalStackMode_NONE == rParameter.eStackMode ) + if( rParameter.eStackMode == GlobalStackMode_NONE ) { rSubTypeList.InsertItem(1, Image(BitmapEx(BMP_NET_SYMB))); rSubTypeList.InsertItem(2, Image(BitmapEx(BMP_NET_LINESYMB))); diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 009e81dc53eb..6ea99ad1f155 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -467,24 +467,24 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const Refe { OUString aRet; ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) ); - if( OBJECTTYPE_AXIS == eObjectType ) + if( eObjectType == OBJECTTYPE_AXIS ) { aRet=ObjectNameProvider::getAxisName( rObjectCID, xChartModel ); } - else if( OBJECTTYPE_GRID == eObjectType - || OBJECTTYPE_SUBGRID == eObjectType ) + else if( eObjectType == OBJECTTYPE_GRID + || eObjectType == OBJECTTYPE_SUBGRID ) { aRet=ObjectNameProvider::getGridName( rObjectCID, xChartModel ); } - else if( OBJECTTYPE_TITLE == eObjectType ) + else if( eObjectType == OBJECTTYPE_TITLE ) { aRet=ObjectNameProvider::getTitleName( rObjectCID, xChartModel ); } - else if( OBJECTTYPE_DATA_SERIES == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_SERIES ) { aRet = lcl_getFullSeriesName( rObjectCID, xChartModel ); } - else if( OBJECTTYPE_DATA_POINT == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_POINT ) { if( bVerbose ) { @@ -543,7 +543,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const Refe aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), lcl_getDataSeriesName( rObjectCID, xChartModel ) ); } } - else if( OBJECTTYPE_DATA_CURVE == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_CURVE ) { if( bVerbose ) { @@ -649,7 +649,7 @@ OUString ObjectNameProvider::getHelpText( const OUString& rObjectCID, const Refe } } } - else if( OBJECTTYPE_DATA_AVERAGE_LINE == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_AVERAGE_LINE ) { if( bVerbose ) { @@ -721,7 +721,7 @@ OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID, ObjectType eObjectType( ObjectIdentifier::getObjectType(rObjectCID) ); Reference< frame::XModel > xChartModel( xChartDocument, uno::UNO_QUERY ); - if( OBJECTTYPE_DATA_POINT == eObjectType ) + if( eObjectType == OBJECTTYPE_DATA_POINT ) { aRet = SchResId( STR_STATUS_DATAPOINT_MARKED ); @@ -755,7 +755,7 @@ OUString ObjectNameProvider::getSelectedObjectText( const OUString & rObjectCID, else { // use the verbose text including the formula for trend lines - const bool bVerbose( OBJECTTYPE_DATA_CURVE == eObjectType || OBJECTTYPE_DATA_AVERAGE_LINE == eObjectType ); + const bool bVerbose( eObjectType == OBJECTTYPE_DATA_CURVE || eObjectType == OBJECTTYPE_DATA_AVERAGE_LINE ); const OUString aHelpText( getHelpText( rObjectCID, xChartModel, bVerbose )); if( !aHelpText.isEmpty()) { diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index 6d7f1b729f88..b1880afb25b4 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -118,8 +118,8 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries ); sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram ); - bool bHasSeriesProperties = (OBJECTTYPE_DATA_SERIES==m_eObjectType); - bool bHasDataPointproperties = (OBJECTTYPE_DATA_POINT==m_eObjectType); + bool bHasSeriesProperties = (m_eObjectType==OBJECTTYPE_DATA_SERIES); + bool bHasDataPointproperties = (m_eObjectType==OBJECTTYPE_DATA_POINT); if( bHasSeriesProperties || bHasDataPointproperties ) { @@ -145,7 +145,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel m_eObjectType == OBJECTTYPE_DATA_ERRORS_Z) m_bHasStatisticProperties = true; - if( OBJECTTYPE_AXIS == m_eObjectType ) + if( m_eObjectType == OBJECTTYPE_AXIS ) { //show scale properties only for a single axis not for multiselection m_bHasScaleProperties = !m_bAffectsMultipleObjects; @@ -157,9 +157,9 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel { //no scale page for series axis ScaleData aData( xAxis->getScaleData() ); - if( chart2::AxisType::SERIES == aData.AxisType ) + if( aData.AxisType == chart2::AxisType::SERIES ) m_bHasScaleProperties = false; - if( chart2::AxisType::SERIES != aData.AxisType ) + if( aData.AxisType != chart2::AxisType::SERIES ) m_bHasNumberProperties = true; sal_Int32 nCooSysIndex=0; @@ -172,7 +172,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel m_bSupportingAxisPositioning = ChartTypeHelper::isSupportingAxisPositioning( xChartType, nDimensionCount, nDimensionIndex ); //show axis origin only for secondary y axis - if( 1==nDimensionIndex && 1==nAxisIndex && ChartTypeHelper::isSupportingBaseValue( xChartType ) ) + if( nDimensionIndex==1 && nAxisIndex==1 && ChartTypeHelper::isSupportingBaseValue( xChartType ) ) m_bShowAxisOrigin = true; } @@ -182,7 +182,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel if( xCrossingMainAxis.is() ) { ScaleData aScale( xCrossingMainAxis->getScaleData() ); - m_bIsCrossingAxisIsCategoryAxis = ( chart2::AxisType::CATEGORY == aScale.AxisType ); + m_bIsCrossingAxisIsCategoryAxis = ( aScale.AxisType == chart2::AxisType::CATEGORY ); if( m_bIsCrossingAxisIsCategoryAxis ) { ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get()); @@ -208,7 +208,7 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel m_bCanAxisLabelsBeStaggered = nDimensionCount==2; } - if( OBJECTTYPE_DATA_CURVE == m_eObjectType ) + if( m_eObjectType == OBJECTTYPE_DATA_CURVE ) { uno::Reference< data::XDataSource > xSource( xSeries, uno::UNO_QUERY ); Sequence< Reference< data::XLabeledDataSequence > > aDataSeqs( xSource->getDataSequences()); @@ -266,15 +266,15 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel //create gui name for this object { - if( !m_bAffectsMultipleObjects && OBJECTTYPE_AXIS == m_eObjectType ) + if( !m_bAffectsMultipleObjects && m_eObjectType == OBJECTTYPE_AXIS ) { m_aLocalizedName = ObjectNameProvider::getAxisName( m_aObjectCID, xChartModel ); } - else if( !m_bAffectsMultipleObjects && ( OBJECTTYPE_GRID == m_eObjectType || OBJECTTYPE_SUBGRID == m_eObjectType ) ) + else if( !m_bAffectsMultipleObjects && ( m_eObjectType == OBJECTTYPE_GRID || m_eObjectType == OBJECTTYPE_SUBGRID ) ) { m_aLocalizedName = ObjectNameProvider::getGridName( m_aObjectCID, xChartModel ); } - else if( !m_bAffectsMultipleObjects && OBJECTTYPE_TITLE == m_eObjectType ) + else if( !m_bAffectsMultipleObjects && m_eObjectType == OBJECTTYPE_TITLE ) { m_aLocalizedName = ObjectNameProvider::getTitleName( m_aObjectCID, xChartModel ); } diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index a132ddf27e40..c75d8c4808c1 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -208,7 +208,7 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, Button *, pButton, void ) ScopedVclPtrInstance< NumberFormatDialog > aDlg(m_pWindow, aNumberSet); if( bPercent ) aDlg->SetText( m_pFT_NumberFormatForPercent->GetText()); - if( RET_OK == aDlg->Execute() ) + if( aDlg->Execute() == RET_OK ) { const SfxItemSet* pResult = aDlg->GetOutputItemSet(); if( pResult ) diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx index 6cee0064cb18..76d86aeb7eec 100644 --- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx +++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx @@ -118,7 +118,7 @@ bool AxisPositionsTabPage::FillItemSet(SfxItemSet* rOutAttrs) // axis line sal_Int32 nPos = m_pLB_CrossesAt->GetSelectEntryPos(); rOutAttrs->Put( SfxInt32Item( SCHATTR_AXIS_POSITION, nPos+1 )); - if( 2==nPos ) + if( nPos==2 ) { double fCrossover = m_pED_CrossesAt->GetValue(); if( m_bCrossingAxisIsCategoryAxis ) @@ -316,12 +316,12 @@ void AxisPositionsTabPage::SupportAxisPositioning( bool bSupportAxisPositioning IMPL_LINK_NOARG(AxisPositionsTabPage, CrossesAtSelectHdl, ListBox&, void) { sal_Int32 nPos = m_pLB_CrossesAt->GetSelectEntryPos(); - m_pED_CrossesAt->Show( (2==nPos) && !m_bCrossingAxisIsCategoryAxis ); - m_pED_CrossesAtCategory->Show( (2==nPos) && m_bCrossingAxisIsCategoryAxis ); + m_pED_CrossesAt->Show( (nPos==2) && !m_bCrossingAxisIsCategoryAxis ); + m_pED_CrossesAtCategory->Show( (nPos==2) && m_bCrossingAxisIsCategoryAxis ); if( m_pED_CrossesAt->GetText().isEmpty() ) m_pED_CrossesAt->SetValue(0.0); - if( 0 == m_pED_CrossesAtCategory->GetSelectEntryCount() ) + if( m_pED_CrossesAtCategory->GetSelectEntryCount() == 0 ) m_pED_CrossesAtCategory->SelectEntryPos(0); PlaceLabelsSelectHdl( *m_pLB_PlaceLabels ); diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 3e33b264ae97..eca76e57e280 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -96,9 +96,9 @@ void Dim3DLookResourceGroup::fillParameter( ChartTypeParameter& rParameter ) { rParameter.b3DLook = m_pCB_3DLook->IsChecked(); const sal_Int32 nPos = m_pLB_Scheme->GetSelectEntryPos(); - if( POS_3DSCHEME_SIMPLE == nPos ) + if( nPos == POS_3DSCHEME_SIMPLE ) rParameter.eThreeDLookScheme = ThreeDLookScheme_Simple; - else if( POS_3DSCHEME_REALISTIC == nPos ) + else if( nPos == POS_3DSCHEME_REALISTIC ) rParameter.eThreeDLookScheme = ThreeDLookScheme_Realistic; else rParameter.eThreeDLookScheme = ThreeDLookScheme_Unknown; @@ -370,16 +370,16 @@ void SplinePropertiesDialog::fillControls( const ChartTypeParameter& rParameter m_pMF_SplineResolution->SetValue( rParameter.nCurveResolution ); //dis/enabling - m_pFT_SplineOrder->Enable(B_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()); - m_pMF_SplineOrder->Enable(B_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()); + m_pFT_SplineOrder->Enable(m_pLB_Spline_Type->GetSelectEntryPos() == B_SPLINE_POS); + m_pMF_SplineOrder->Enable(m_pLB_Spline_Type->GetSelectEntryPos() == B_SPLINE_POS); } void SplinePropertiesDialog::fillParameter( ChartTypeParameter& rParameter, bool bSmoothLines ) { if(!bSmoothLines) rParameter.eCurveStyle=CurveStyle_LINES; - else if(CUBIC_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()) + else if(m_pLB_Spline_Type->GetSelectEntryPos() == CUBIC_SPLINE_POS) rParameter.eCurveStyle=CurveStyle_CUBIC_SPLINES; - else if(B_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()) + else if(m_pLB_Spline_Type->GetSelectEntryPos() == B_SPLINE_POS) rParameter.eCurveStyle=CurveStyle_B_SPLINES; rParameter.nCurveResolution = static_cast< sal_Int32 >( m_pMF_SplineResolution->GetValue()); @@ -387,8 +387,8 @@ void SplinePropertiesDialog::fillParameter( ChartTypeParameter& rParameter, bool } IMPL_LINK_NOARG(SplinePropertiesDialog, SplineTypeListBoxHdl, ListBox&, void) { - m_pFT_SplineOrder->Enable(B_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()); - m_pMF_SplineOrder->Enable(B_SPLINE_POS == m_pLB_Spline_Type->GetSelectEntryPos()); + m_pFT_SplineOrder->Enable(m_pLB_Spline_Type->GetSelectEntryPos() == B_SPLINE_POS); + m_pMF_SplineOrder->Enable(m_pLB_Spline_Type->GetSelectEntryPos() == B_SPLINE_POS); } class SteppedPropertiesDialog : public ModalDialog @@ -577,11 +577,11 @@ IMPL_LINK_NOARG(SplineResourceGroup, SplineDetailsDialogHdl, Button*, void) { ChartTypeParameter aOldParameter; - getSplinePropertiesDialog().fillParameter( aOldParameter, POS_LINETYPE_SMOOTH == m_pLB_LineType->GetSelectEntryPos() ); + getSplinePropertiesDialog().fillParameter( aOldParameter, m_pLB_LineType->GetSelectEntryPos() == POS_LINETYPE_SMOOTH ); const sal_Int32 iOldLineTypePos = m_pLB_LineType->GetSelectEntryPos(); m_pLB_LineType->SelectEntryPos(POS_LINETYPE_SMOOTH); - if( RET_OK == getSplinePropertiesDialog().Execute() ) + if( getSplinePropertiesDialog().Execute() == RET_OK ) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); @@ -597,11 +597,11 @@ IMPL_LINK_NOARG(SplineResourceGroup, SteppedDetailsDialogHdl, Button*, void) { ChartTypeParameter aOldParameter; - getSteppedPropertiesDialog().fillParameter( aOldParameter, POS_LINETYPE_STEPPED == m_pLB_LineType->GetSelectEntryPos() ); + getSteppedPropertiesDialog().fillParameter( aOldParameter, m_pLB_LineType->GetSelectEntryPos() == POS_LINETYPE_STEPPED ); const sal_Int32 iOldLineTypePos = m_pLB_LineType->GetSelectEntryPos(); m_pLB_LineType->SelectEntryPos(POS_LINETYPE_STEPPED); - if( RET_OK == getSteppedPropertiesDialog().Execute() ) + if( getSteppedPropertiesDialog().Execute() == RET_OK ) { if( m_pChangeListener ) m_pChangeListener->stateChanged(this); diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index dcf330395374..d16c5f3de50c 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -166,10 +166,10 @@ IMPL_STATIC_LINK( void ScaleTabPage::EnableControls() { - bool bValueAxis = chart2::AxisType::REALNUMBER == m_nAxisType - || chart2::AxisType::PERCENT == m_nAxisType - || chart2::AxisType::DATE == m_nAxisType; - bool bDateAxis = chart2::AxisType::DATE == m_nAxisType; + bool bValueAxis = m_nAxisType == chart2::AxisType::REALNUMBER + || m_nAxisType == chart2::AxisType::PERCENT + || m_nAxisType == chart2::AxisType::DATE; + bool bDateAxis = m_nAxisType == chart2::AxisType::DATE; m_pBxType->Show(m_bAllowDateAxis); @@ -259,7 +259,7 @@ IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl, ListBox&, void) m_nAxisType = chart2::AxisType::DATE; else m_nAxisType = chart2::AxisType::CATEGORY; - if( chart2::AxisType::DATE == m_nAxisType ) + if( m_nAxisType == chart2::AxisType::DATE ) m_pCbxLogarithm->Check(false); EnableControls(); SetNumFormat(); @@ -276,7 +276,7 @@ bool ScaleTabPage::FillItemSet(SfxItemSet* rOutAttrs) rOutAttrs->Put(SfxInt32Item(SCHATTR_AXISTYPE, m_nAxisType)); if(m_bAllowDateAxis) - rOutAttrs->Put(SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS, TYPE_AUTO==m_pLB_AxisType->GetSelectEntryPos())); + rOutAttrs->Put(SfxBoolItem(SCHATTR_AXIS_AUTO_DATEAXIS, m_pLB_AxisType->GetSelectEntryPos()==TYPE_AUTO)); bool bAutoScale = false; if( m_nAxisType==chart2::AxisType::CATEGORY ) @@ -419,7 +419,7 @@ DeactivateRC ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet) return DeactivateRC::LeavePage; } - bool bDateAxis = chart2::AxisType::DATE == m_nAxisType; + bool bDateAxis = m_nAxisType == chart2::AxisType::DATE; sal_uInt32 nMinMaxOriginFmt = m_pFmtFldMax->GetFormatKey(); if (pNumFormatter->GetType(nMinMaxOriginFmt) == css::util::NumberFormat::TEXT) @@ -442,7 +442,7 @@ DeactivateRC ScaleTabPage::DeactivatePage(SfxItemSet* pItemSet) m_nMainTimeUnit = m_pLB_MainTimeUnit->GetSelectEntryPos(); m_nHelpTimeUnit = m_pLB_HelpTimeUnit->GetSelectEntryPos(); - if( chart2::AxisType::REALNUMBER != m_nAxisType ) + if( m_nAxisType != chart2::AxisType::REALNUMBER ) m_pCbxLogarithm->Show( false ); //check which entries need user action @@ -584,7 +584,7 @@ void ScaleTabPage::SetNumFormat() nFmt = pNumFormatter->GetStandardFormat( css::util::NumberFormat::TIME ); } - if( chart2::AxisType::DATE == m_nAxisType && ( eType != css::util::NumberFormat::DATE && eType != css::util::NumberFormat::DATETIME) ) + if( m_nAxisType == chart2::AxisType::DATE && ( eType != css::util::NumberFormat::DATE && eType != css::util::NumberFormat::DATETIME) ) { const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt ); if( pFormat ) diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index 4ba0b751ed3d..629600d33625 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -168,9 +168,9 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI const chart2::IncrementData& rIncrement( rScale.IncrementData ); const uno::Sequence< chart2::SubIncrement >& rSubIncrements( rScale.IncrementData.SubIncrements ); const TimeIncrement& rTimeIncrement( rScale.TimeIncrement ); - bool bDateAxis = (chart2::AxisType::DATE == rScale.AxisType); + bool bDateAxis = (rScale.AxisType == chart2::AxisType::DATE); if( m_pExplicitScale ) - bDateAxis = (chart2::AxisType::DATE == m_pExplicitScale->AxisType); + bDateAxis = (m_pExplicitScale->AxisType == chart2::AxisType::DATE); switch( nWhichId ) { @@ -214,7 +214,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI break; case SCHATTR_AXIS_REVERSE: - rOutItemSet.Put( SfxBoolItem( nWhichId, (AxisOrientation_REVERSE == rScale.Orientation) )); + rOutItemSet.Put( SfxBoolItem( nWhichId, (rScale.Orientation == AxisOrientation_REVERSE) )); break; // Increment @@ -445,7 +445,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI bool lcl_isDateAxis( const SfxItemSet & rItemSet ) { sal_Int32 nAxisType = static_cast< const SfxInt32Item & >( rItemSet.Get( SCHATTR_AXISTYPE )).GetValue();//css::chart2::AxisType - return (chart2::AxisType::DATE == nAxisType); + return (nAxisType == chart2::AxisType::DATE); } bool lcl_isAutoMajor( const SfxItemSet & rItemSet ) @@ -552,7 +552,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet case SCHATTR_AXIS_REVERSE: { - bool bWasReverse = ( AxisOrientation_REVERSE == aScale.Orientation ); + bool bWasReverse = ( aScale.Orientation == AxisOrientation_REVERSE ); bool bNewReverse = (static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue() ); if( bWasReverse != bNewReverse ) diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index 8f42dba588f6..92ad703e036e 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -98,10 +98,10 @@ bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSe bool bChanged = false; if( !xPropertySet.is() ) return bChanged; - OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); - sal_uInt16 nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; + OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); + sal_uInt16 nSourceWhich = (nWhichId==SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; - if( SfxItemState::SET != rItemSet.GetItemState( nSourceWhich ) ) + if( rItemSet.GetItemState( nSourceWhich ) != SfxItemState::SET ) return bChanged; uno::Any aValue; @@ -145,10 +145,10 @@ bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxIte bool bChanged = false; if( !xPropertySet.is() ) return bChanged; - OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); - sal_uInt16 nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; + OUString aPropertyName = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); + sal_uInt16 nFormatWhich = (nWhichId==SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; - if( SfxItemState::SET != rItemSet.GetItemState( nWhichId ) ) + if( rItemSet.GetItemState( nWhichId ) != SfxItemState::SET ) return bChanged; uno::Any aNewValue; @@ -232,7 +232,7 @@ DataPointItemConverter::DataPointItemConverter( bool bSwapXAndY = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous ); m_aAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements( xChartType, DiagramHelper::getDimension( xDiagram ), bSwapXAndY, xSeries ); - m_bForbidPercentValue = AxisType::CATEGORY != ChartTypeHelper::getAxisType( xChartType, 0 ); + m_bForbidPercentValue = ChartTypeHelper::getAxisType( xChartType, 0 ) != AxisType::CATEGORY; } DataPointItemConverter::~DataPointItemConverter() @@ -304,9 +304,9 @@ bool DataPointItemConverter::ApplySpecialItem( chart2::DataPointLabel aLabel; if( aOldValue >>= aLabel ) { - sal_Bool& rValue = (SCHATTR_DATADESCR_SHOW_NUMBER==nWhichId) ? aLabel.ShowNumber : ( - (SCHATTR_DATADESCR_SHOW_PERCENTAGE==nWhichId) ? aLabel.ShowNumberInPercent : ( - (SCHATTR_DATADESCR_SHOW_CATEGORY==nWhichId) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol )); + sal_Bool& rValue = (nWhichId==SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : ( + (nWhichId==SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : ( + (nWhichId==SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol )); bool bOldValue = rValue; rValue = rItem.GetValue(); if( m_bOverwriteLabelsForAttributedDataPointsAlso ) @@ -558,9 +558,9 @@ void DataPointItemConverter::FillSpecialItem( chart2::DataPointLabel aLabel; if (GetPropertySet()->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel) { - bool bValue = (SCHATTR_DATADESCR_SHOW_NUMBER==nWhichId) ? aLabel.ShowNumber : ( - (SCHATTR_DATADESCR_SHOW_PERCENTAGE==nWhichId) ? aLabel.ShowNumberInPercent : ( - (SCHATTR_DATADESCR_SHOW_CATEGORY==nWhichId) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol )); + bool bValue = (nWhichId==SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : ( + (nWhichId==SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : ( + (nWhichId==SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol )); rOutItemSet.Put( SfxBoolItem( nWhichId, bValue )); diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx index a462d20cf88f..eb66209e1a73 100644 --- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx @@ -230,7 +230,7 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItem { if (rSourceSet.Get(nWhich) != rDestSet.Get(nWhich)) { - if( SID_CHAR_DLG_PREVIEW_STRING != nWhich ) + if( nWhich != SID_CHAR_DLG_PREVIEW_STRING ) { rDestSet.InvalidateItem(nWhich); } diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index 4ce6a9edc544..c09349484b9b 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -206,11 +206,11 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf { if( m_bSupportingOverlapAndGapWidthProperties ) { - sal_Int32& rBarPosition = ( SCHATTR_BAR_OVERLAP == nWhichId ) ? m_nBarOverlap : m_nGapWidth; + sal_Int32& rBarPosition = ( nWhichId == SCHATTR_BAR_OVERLAP ) ? m_nBarOverlap : m_nGapWidth; rBarPosition = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue(); OUString aPropName("GapwidthSequence" ); - if( SCHATTR_BAR_OVERLAP == nWhichId ) + if( nWhichId == SCHATTR_BAR_OVERLAP ) aPropName = "OverlapSequence"; uno::Reference< XDataSeries > xDataSeries( GetPropertySet(), uno::UNO_QUERY ); diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx index cda6691c67a6..3a20a3b9b800 100644 --- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx @@ -90,10 +90,10 @@ bool numberFormatFromItemToPropertySet( if (!xPropertySet.is()) return bChanged; - OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE == nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); - sal_uInt16 nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE == nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; + OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); + sal_uInt16 nSourceWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_VALUE) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; - if (SfxItemState::SET != rItemSet.GetItemState(nSourceWhich)) + if (rItemSet.GetItemState(nSourceWhich) != SfxItemState::SET) return bChanged; uno::Any aValue; @@ -138,10 +138,10 @@ bool useSourceFormatFromItemToPropertySet( bool bChanged = false; if (!xPropertySet.is()) return bChanged; - OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE == nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); - sal_uInt16 nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE == nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; + OUString aPropertyName = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? OUString(CHART_UNONAME_NUMFMT) : OUString("PercentageNumberFormat"); + sal_uInt16 nFormatWhich = (nWhichId == SID_ATTR_NUMBERFORMAT_SOURCE) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; - if (SfxItemState::SET != rItemSet.GetItemState(nWhichId)) + if (rItemSet.GetItemState(nWhichId) != SfxItemState::SET) return bChanged; uno::Any aNewValue; @@ -204,7 +204,7 @@ TextLabelItemConverter::TextLabelItemConverter( bool bSwapXAndY = DiagramHelper::getVertical(xDiagram, bFound, bAmbiguous); maAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements(xChartType, DiagramHelper::getDimension(xDiagram), bSwapXAndY, xSeries); - mbForbidPercentValue = AxisType::CATEGORY != ChartTypeHelper::getAxisType(xChartType, 0); + mbForbidPercentValue = ChartTypeHelper::getAxisType(xChartType, 0) != AxisType::CATEGORY; } TextLabelItemConverter::~TextLabelItemConverter() @@ -267,9 +267,9 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte chart2::DataPointLabel aLabel; if (aOldValue >>= aLabel) { - sal_Bool& rValue = (SCHATTR_DATADESCR_SHOW_NUMBER == nWhichId) ? aLabel.ShowNumber : ( - (SCHATTR_DATADESCR_SHOW_PERCENTAGE == nWhichId) ? aLabel.ShowNumberInPercent : ( - (SCHATTR_DATADESCR_SHOW_CATEGORY == nWhichId) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol)); + sal_Bool& rValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : ( + (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : ( + (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol)); bool bOldValue = rValue; rValue = rItem.GetValue(); if (mbDataSeries) @@ -510,9 +510,9 @@ void TextLabelItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet& r chart2::DataPointLabel aLabel; if (GetPropertySet()->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel) { - bool bValue = (SCHATTR_DATADESCR_SHOW_NUMBER == nWhichId) ? aLabel.ShowNumber : ( - (SCHATTR_DATADESCR_SHOW_PERCENTAGE == nWhichId) ? aLabel.ShowNumberInPercent : ( - (SCHATTR_DATADESCR_SHOW_CATEGORY == nWhichId) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol)); + bool bValue = (nWhichId == SCHATTR_DATADESCR_SHOW_NUMBER) ? aLabel.ShowNumber : ( + (nWhichId == SCHATTR_DATADESCR_SHOW_PERCENTAGE) ? aLabel.ShowNumberInPercent : ( + (nWhichId == SCHATTR_DATADESCR_SHOW_CATEGORY) ? aLabel.ShowCategoryName : aLabel.ShowLegendSymbol)); rOutItemSet.Put(SfxBoolItem(nWhichId, bValue)); diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index a11f21011794..0775d6432d26 100644 --- a/chart2/source/controller/main/ChartController_Position.cxx +++ b/chart2/source/controller/main/ChartController_Position.cxx @@ -58,16 +58,16 @@ void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectang const SfxPoolItem* pPoolItem=nullptr; //read position - if (SfxItemState::SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)) + if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)==SfxItemState::SET) nPosX= static_cast<const SfxInt32Item*>(pPoolItem)->GetValue(); - if (SfxItemState::SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)) + if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)==SfxItemState::SET) nPosY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue(); //read size - if (SfxItemState::SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) + if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)==SfxItemState::SET) nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); - if (SfxItemState::SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) + if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)==SfxItemState::SET) nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); - if (SfxItemState::SET==rItemSet.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT,true,&pPoolItem)) + if (rItemSet.GetItemState(SID_ATTR_TRANSFORM_SIZE_POINT,true,&pPoolItem)==SfxItemState::SET) eRP=(RectPoint)static_cast<const SfxAllEnumItem*>(pPoolItem)->GetValue(); switch( eRP ) diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 1136031073a1..51860ab2f02b 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -78,7 +78,7 @@ wrapper::ItemConverter* createItemConverter( //get type of selected object ObjectType eObjectType = ObjectIdentifier::getObjectType( aObjectCID ); - if( OBJECTTYPE_UNKNOWN==eObjectType ) + if( eObjectType==OBJECTTYPE_UNKNOWN ) { OSL_FAIL("unknown ObjectType"); return nullptr; @@ -681,14 +681,14 @@ OUString lcl_getFormatCIDforSelectedCID( const OUString& rSelectedCID ) ObjectType eObjectType = ObjectIdentifier::getObjectType( aFormatCID ); // some legend entries are handled as if they were data series - if( OBJECTTYPE_LEGEND_ENTRY==eObjectType ) + if( eObjectType==OBJECTTYPE_LEGEND_ENTRY ) { OUString aParentParticle( ObjectIdentifier::getFullParentParticle( rSelectedCID ) ); aFormatCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle ); } // treat diagram as wall - if( OBJECTTYPE_DIAGRAM==eObjectType ) + if( eObjectType==OBJECTTYPE_DIAGRAM ) aFormatCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, OUString() ); return aFormatCID; @@ -723,11 +723,11 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( { //get type of object ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID ); - if( OBJECTTYPE_UNKNOWN==eObjectType ) + if( eObjectType==OBJECTTYPE_UNKNOWN ) { return bRet; } - if( OBJECTTYPE_DIAGRAM_WALL==eObjectType || OBJECTTYPE_DIAGRAM_FLOOR==eObjectType ) + if( eObjectType==OBJECTTYPE_DIAGRAM_WALL || eObjectType==OBJECTTYPE_DIAGRAM_FLOOR ) { if( !DiagramHelper::isSupportingFloorAndWall( ChartModelHelper::findDiagram( getModel() ) ) ) return bRet; diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index a38bb94571f0..5ca9f2012f52 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -575,7 +575,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) } } - if ( MOUSE_LEFT == rMEvt.GetButtons() ) + if ( rMEvt.GetButtons() == MOUSE_LEFT ) { pChartWindow->GrabFocus(); pChartWindow->CaptureMouse(); @@ -671,7 +671,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) //change selection to 3D scene if rotate mode SdrDragMode eDragMode = pDrawViewWrapper->GetDragMode(); - if( SdrDragMode::Rotate==eDragMode ) + if( eDragMode==SdrDragMode::Rotate ) { E3dScene* pScene = SelectionHelper::getSceneToRotate( pDrawViewWrapper->getNamedSdrObject( m_aSelection.getSelectedCID() ) ); if( pScene ) @@ -874,7 +874,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) bool bIsRotateable = m_aSelection.isRotateableObjectSelected( getModel() ); //toggle between move and rotate - if( bIsRotateable && bClickedTwiceOnDragableObject && SdrDragMode::Move==m_eDragMode ) + if( bIsRotateable && bClickedTwiceOnDragableObject && m_eDragMode==SdrDragMode::Move ) m_eDragMode=SdrDragMode::Rotate; else m_eDragMode=SdrDragMode::Move; @@ -917,7 +917,7 @@ void ChartController::execute_DoubleClick( const Point* pMousePixel ) if ( !aCID.isEmpty() ) { ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID ); - if ( OBJECTTYPE_TITLE == eObjectType ) + if ( eObjectType == OBJECTTYPE_TITLE ) { bEditText = true; } @@ -1007,9 +1007,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) //some commands for dataseries and points: - if( OBJECTTYPE_DATA_SERIES == eObjectType || OBJECTTYPE_DATA_POINT == eObjectType ) + if( eObjectType == OBJECTTYPE_DATA_SERIES || eObjectType == OBJECTTYPE_DATA_POINT ) { - bool bIsPoint = ( OBJECTTYPE_DATA_POINT == eObjectType ); + bool bIsPoint = ( eObjectType == OBJECTTYPE_DATA_POINT ); uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ); uno::Reference< chart2::XRegressionCurveContainer > xCurveCnt( xSeries, uno::UNO_QUERY ); Reference< chart2::XRegressionCurve > xTrendline( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xCurveCnt ) ); @@ -1146,7 +1146,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) } ++nUniqueId; } - else if( OBJECTTYPE_DATA_CURVE == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_CURVE ) { lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendline" ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" ); @@ -1156,7 +1156,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" ); } - else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_CURVE_EQUATION ) { lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertR2Value" ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" ); @@ -1164,7 +1164,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) //some commands for axes: and grids - else if( OBJECTTYPE_AXIS == eObjectType || OBJECTTYPE_GRID == eObjectType || OBJECTTYPE_SUBGRID == eObjectType ) + else if( eObjectType == OBJECTTYPE_AXIS || eObjectType == OBJECTTYPE_GRID || eObjectType == OBJECTTYPE_SUBGRID ) { Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getModel() ); if( xAxis.is() && xDiagram.is() ) @@ -1182,20 +1182,20 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) if( xTitled.is()) bHasTitle = !TitleHelper::getCompleteString( xTitled->getTitleObject() ).isEmpty(); - if( OBJECTTYPE_AXIS != eObjectType && bIsAxisVisible ) + if( eObjectType != OBJECTTYPE_AXIS && bIsAxisVisible ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatAxis" ); - if( OBJECTTYPE_GRID != eObjectType && bIsMajorGridVisible && !bIsSecondaryAxis ) + if( eObjectType != OBJECTTYPE_GRID && bIsMajorGridVisible && !bIsSecondaryAxis ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMajorGrid" ); - if( OBJECTTYPE_SUBGRID != eObjectType && bIsMinorGridVisible && !bIsSecondaryAxis ) + if( eObjectType != OBJECTTYPE_SUBGRID && bIsMinorGridVisible && !bIsSecondaryAxis ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatMinorGrid" ); xPopupMenu->insertSeparator( -1 ); - if( OBJECTTYPE_AXIS != eObjectType && !bIsAxisVisible ) + if( eObjectType != OBJECTTYPE_AXIS && !bIsAxisVisible ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertAxis" ); - if( OBJECTTYPE_GRID != eObjectType && !bIsMajorGridVisible && !bIsSecondaryAxis ) + if( eObjectType != OBJECTTYPE_GRID && !bIsMajorGridVisible && !bIsSecondaryAxis ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMajorGrid" ); - if( OBJECTTYPE_SUBGRID != eObjectType && !bIsMinorGridVisible && !bIsSecondaryAxis ) + if( eObjectType != OBJECTTYPE_SUBGRID && !bIsMinorGridVisible && !bIsSecondaryAxis ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMinorGrid" ); if( !bHasTitle ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertAxisTitle" ); @@ -1209,19 +1209,19 @@ void ChartController::execute_Command( const CommandEvent& rCEvt ) } } - if( OBJECTTYPE_DATA_STOCK_LOSS == eObjectType ) + if( eObjectType == OBJECTTYPE_DATA_STOCK_LOSS ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockGain" ); - else if( OBJECTTYPE_DATA_STOCK_GAIN == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_STOCK_GAIN ) lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatStockLoss" ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:TransformDialog" ); - if( OBJECTTYPE_PAGE == eObjectType || OBJECTTYPE_DIAGRAM == eObjectType - || OBJECTTYPE_DIAGRAM_WALL == eObjectType - || OBJECTTYPE_DIAGRAM_FLOOR == eObjectType - || OBJECTTYPE_UNKNOWN == eObjectType ) + if( eObjectType == OBJECTTYPE_PAGE || eObjectType == OBJECTTYPE_DIAGRAM + || eObjectType == OBJECTTYPE_DIAGRAM_WALL + || eObjectType == OBJECTTYPE_DIAGRAM_FLOOR + || eObjectType == OBJECTTYPE_UNKNOWN ) { - if( OBJECTTYPE_UNKNOWN != eObjectType ) + if( eObjectType != OBJECTTYPE_UNKNOWN ) xPopupMenu->insertSeparator( -1 ); bool bHasLegend = LegendHelper::hasLegend( xDiagram ); lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTitles" ); @@ -1506,7 +1506,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) if( ! bReturn && nCode == KEY_F2 ) { - if( OBJECTTYPE_TITLE == eObjectType ) + if( eObjectType == OBJECTTYPE_TITLE ) { executeDispatch_EditText(); bReturn = true; diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index 99c923810b4d..4cfbd3a0f4a9 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -185,12 +185,12 @@ void ControllerState::update( ObjectType aObjectType(ObjectIdentifier::getObjectType( aSelObjCID )); - bIsPositionableObject = (OBJECTTYPE_DATA_POINT != aObjectType) && aSelOID.isDragableObject(); - bIsTextObject = OBJECTTYPE_TITLE == aObjectType; + bIsPositionableObject = (aObjectType != OBJECTTYPE_DATA_POINT) && aSelOID.isDragableObject(); + bIsTextObject = aObjectType == OBJECTTYPE_TITLE; uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel )); bIsFormateableObjectSelected = bHasSelectedObject && aSelOID.isAutoGeneratedObject(); - if( OBJECTTYPE_DIAGRAM==aObjectType || OBJECTTYPE_DIAGRAM_WALL==aObjectType || OBJECTTYPE_DIAGRAM_FLOOR==aObjectType ) + if( aObjectType==OBJECTTYPE_DIAGRAM || aObjectType==OBJECTTYPE_DIAGRAM_WALL || aObjectType==OBJECTTYPE_DIAGRAM_FLOOR ) bIsFormateableObjectSelected = DiagramHelper::isSupportingFloorAndWall( xDiagram ); uno::Reference< chart2::XDataSeries > xGivenDataSeries( @@ -199,12 +199,12 @@ void ControllerState::update( bIsDeleteableObjectSelected = ChartController::isObjectDeleteable( aSelObj ); - bMayMoveSeriesForward = (OBJECTTYPE_DATA_POINT!=aObjectType) && DiagramHelper::isSeriesMoveable( + bMayMoveSeriesForward = (aObjectType!=OBJECTTYPE_DATA_POINT) && DiagramHelper::isSeriesMoveable( ChartModelHelper::findDiagram( xModel ), xGivenDataSeries, MOVE_SERIES_FORWARD ); - bMayMoveSeriesBackward = (OBJECTTYPE_DATA_POINT!=aObjectType) && DiagramHelper::isSeriesMoveable( + bMayMoveSeriesBackward = (aObjectType!=OBJECTTYPE_DATA_POINT) && DiagramHelper::isSeriesMoveable( ChartModelHelper::findDiagram( xModel ), xGivenDataSeries, MOVE_SERIES_BACKWARD ); @@ -237,7 +237,7 @@ void ControllerState::update( DataSeriesHelper::getChartTypeOfSeries( xGivenDataSeries, xDiagram )); // trend lines/mean value line - if( (OBJECTTYPE_DATA_SERIES == aObjectType || OBJECTTYPE_DATA_POINT == aObjectType) + if( (aObjectType == OBJECTTYPE_DATA_SERIES || aObjectType == OBJECTTYPE_DATA_POINT) && ChartTypeHelper::isSupportingRegressionProperties( xFirstChartType, nDimensionCount )) { uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xGivenDataSeries, uno::UNO_QUERY ); @@ -253,7 +253,7 @@ void ControllerState::update( } // error bars - if( (OBJECTTYPE_DATA_SERIES == aObjectType || OBJECTTYPE_DATA_POINT == aObjectType) + if( (aObjectType == OBJECTTYPE_DATA_SERIES || aObjectType == OBJECTTYPE_DATA_POINT) && ChartTypeHelper::isSupportingStatisticProperties( xFirstChartType, nDimensionCount )) { bMayFormatXErrorBars = bMayDeleteXErrorBars = StatisticsHelper::hasErrorBars( xGivenDataSeries, false ); diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index d1e6488c052c..0656572a9ef7 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -519,7 +519,7 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID ) { if ( dynamic_cast<const SdrCaptionObj*>( pObj) != nullptr ) { - bool bIsVertical( COMMAND_ID_DRAW_CAPTION_VERTICAL == nID ); + bool bIsVertical( nID == COMMAND_ID_DRAW_CAPTION_VERTICAL ); SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObj ); if ( pTextObj ) { diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index 0aa6610ba958..f29678e78c90 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -214,7 +214,7 @@ bool SelectorListBox::EventNotify( NotifyEvent& rNEvt ) case KEY_RETURN: case KEY_TAB: { - if ( KEY_TAB == nCode ) + if ( nCode == KEY_TAB ) m_bReleaseFocus = false; else bHandled = true; @@ -228,7 +228,7 @@ bool SelectorListBox::EventNotify( NotifyEvent& rNEvt ) break; } } - else if ( MouseNotifyEvent::LOSEFOCUS == rNEvt.GetType() ) + else if ( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS ) { if ( !HasFocus() ) SelectEntryPos( GetSavedValue() ); diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx index 076789eaa0ca..a3e2e1d9cfde 100644 --- a/chart2/source/controller/main/PositionAndSizeHelper.cxx +++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx @@ -46,7 +46,7 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType tools::Rectangle aObjectRect( Point(rNewPositionAndSize.X,rNewPositionAndSize.Y), Size(rNewPositionAndSize.Width,rNewPositionAndSize.Height) ); tools::Rectangle aPageRect( Point(rPageRectangle.X,rPageRectangle.Y), Size(rPageRectangle.Width,rPageRectangle.Height) ); - if( OBJECTTYPE_TITLE==eObjectType ) + if( eObjectType==OBJECTTYPE_TITLE ) { //@todo decide whether x is primary or secondary chart2::RelativePosition aRelativePosition; @@ -57,7 +57,7 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType aRelativePosition.Secondary = (double(aPos.Y())+double(aObjectRect.getHeight())/2.0)/double(aPageRect.getHeight()); xObjectProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) ); } - else if( OBJECTTYPE_DATA_CURVE_EQUATION==eObjectType ) + else if( eObjectType==OBJECTTYPE_DATA_CURVE_EQUATION ) { //@todo decide whether x is primary or secondary chart2::RelativePosition aRelativePosition; @@ -68,7 +68,7 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType aRelativePosition.Secondary = double(aPos.Y())/double(aPageRect.getHeight()); xObjectProp->setPropertyValue( "RelativePosition", uno::Any(aRelativePosition) ); } - else if(OBJECTTYPE_LEGEND==eObjectType) + else if(eObjectType==OBJECTTYPE_LEGEND) { xObjectProp->setPropertyValue( "AnchorPosition", uno::Any(LegendPosition(LegendPosition_CUSTOM))); xObjectProp->setPropertyValue( "Expansion", uno::Any(css::chart::ChartLegendExpansion_CUSTOM)); @@ -98,7 +98,7 @@ bool PositionAndSizeHelper::moveObject( ObjectType eObjectType xObjectProp->setPropertyValue( "RelativeSize", uno::Any(aRelativeSize) ); } - else if(OBJECTTYPE_DIAGRAM==eObjectType || OBJECTTYPE_DIAGRAM_WALL==eObjectType || OBJECTTYPE_DIAGRAM_FLOOR==eObjectType) + else if(eObjectType==OBJECTTYPE_DIAGRAM || eObjectType==OBJECTTYPE_DIAGRAM_WALL || eObjectType==OBJECTTYPE_DIAGRAM_FLOOR) { //@todo decide whether x is primary or secondary @@ -136,7 +136,7 @@ bool PositionAndSizeHelper::moveObject( const OUString& rObjectCID uno::Reference< beans::XPropertySet > xObjectProp = ObjectIdentifier::getObjectPropertySet( rObjectCID, xChartModel ); ObjectType eObjectType( ObjectIdentifier::getObjectType( rObjectCID ) ); - if(OBJECTTYPE_DIAGRAM==eObjectType || OBJECTTYPE_DIAGRAM_WALL==eObjectType || OBJECTTYPE_DIAGRAM_FLOOR==eObjectType) + if(eObjectType==OBJECTTYPE_DIAGRAM || eObjectType==OBJECTTYPE_DIAGRAM_WALL || eObjectType==OBJECTTYPE_DIAGRAM_FLOOR) { xObjectProp.set( ObjectIdentifier::getDiagramForCID( rObjectCID, xChartModel ), uno::UNO_QUERY ); if(!xObjectProp.is()) diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index b76a7bfa08ac..65b289edf48d 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -622,10 +622,10 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList ) OUString aName( lcl_getObjectName( pObj ) ); ObjectType eObjectType( ObjectIdentifier::getObjectType( aName ) ); - if( OBJECTTYPE_DATA_POINT == eObjectType - || OBJECTTYPE_DATA_LABEL == eObjectType - || OBJECTTYPE_LEGEND_ENTRY == eObjectType - || OBJECTTYPE_AXIS_UNITLABEL == eObjectType ) + if( eObjectType == OBJECTTYPE_DATA_POINT + || eObjectType == OBJECTTYPE_DATA_LABEL + || eObjectType == OBJECTTYPE_LEGEND_ENTRY + || eObjectType == OBJECTTYPE_AXIS_UNITLABEL ) { return false; } @@ -635,7 +635,7 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList ) while (aIterator.IsMore()) { SdrObject* pSubObj = aIterator.Next(); - if( OBJECTTYPE_DATA_SERIES == eObjectType ) + if( eObjectType == OBJECTTYPE_DATA_SERIES ) { OUString aSubName( lcl_getObjectName( pSubObj ) ); ObjectType eSubObjectType( ObjectIdentifier::getObjectType( aSubName ) ); diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 48d38e832850..5a9921dddf56 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -1264,8 +1264,8 @@ Reference< util::XNumberFormatsSupplier > const & ChartModel::getNumberFormatsSu // ____ XUnoTunnel ___ ::sal_Int64 SAL_CALL ChartModel::getSomething( const Sequence< ::sal_Int8 >& aIdentifier ) { - if( aIdentifier.getLength() == 16 && 0 == memcmp( SvNumberFormatsSupplierObj::getUnoTunnelId().getConstArray(), - aIdentifier.getConstArray(), 16 ) ) + if( aIdentifier.getLength() == 16 && memcmp( SvNumberFormatsSupplierObj::getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) == 0 ) { Reference< lang::XUnoTunnel > xTunnel( getNumberFormatsSupplier(), uno::UNO_QUERY ); if( xTunnel.is() ) diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index b55c8e690017..40a40cc75341 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -648,21 +648,21 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL Diagram::getPropertySetInfo() void SAL_CALL Diagram::setFastPropertyValue( sal_Int32 nHandle, const Any& rValue ) { //special treatment for some 3D properties - if( PROP_DIAGRAM_PERSPECTIVE == nHandle ) + if( nHandle == PROP_DIAGRAM_PERSPECTIVE ) { sal_Int32 fPerspective = 20; if( rValue >>=fPerspective ) ThreeDHelper::setCameraDistance( this, ThreeDHelper::PerspectiveToCameraDistance( fPerspective ) ); } - else if( PROP_DIAGRAM_ROTATION_HORIZONTAL == nHandle - || PROP_DIAGRAM_ROTATION_VERTICAL == nHandle ) + else if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL + || nHandle == PROP_DIAGRAM_ROTATION_VERTICAL ) { sal_Int32 nNewAngleDegree = 0; if( rValue >>=nNewAngleDegree ) { sal_Int32 nHorizontal, nVertical; ThreeDHelper::getRotationFromDiagram( this, nHorizontal, nVertical ); - if( PROP_DIAGRAM_ROTATION_HORIZONTAL == nHandle ) + if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL ) nHorizontal = nNewAngleDegree; else nVertical = nNewAngleDegree; @@ -682,13 +682,13 @@ void SAL_CALL Diagram::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) co ThreeDHelper::getCameraDistance( const_cast< Diagram* >( this ) ) ) ); rValue <<= nPerspective; } - else if( PROP_DIAGRAM_ROTATION_HORIZONTAL == nHandle - || PROP_DIAGRAM_ROTATION_VERTICAL == nHandle ) + else if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL + || nHandle == PROP_DIAGRAM_ROTATION_VERTICAL ) { sal_Int32 nHorizontal, nVertical; ThreeDHelper::getRotationFromDiagram( const_cast< Diagram* >( this ), nHorizontal, nVertical ); sal_Int32 nAngleDegree = 0; - if( PROP_DIAGRAM_ROTATION_HORIZONTAL == nHandle ) + if( nHandle == PROP_DIAGRAM_ROTATION_HORIZONTAL ) nAngleDegree = nHorizontal; else nAngleDegree = nVertical; diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index cc7b5b833145..f6039056aea4 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -441,7 +441,7 @@ void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram Sequence< Reference< chart2::XAxis > > aAxisSeq( AxisHelper::getAllAxesOfDiagram( xDiagram ) ); for( sal_Int32 i=0; i<aAxisSeq.getLength(); ++i ) { - if( 1== AxisHelper::getDimensionIndexOfAxis( aAxisSeq[i], xDiagram ) ) + if( AxisHelper::getDimensionIndexOfAxis( aAxisSeq[i], xDiagram )== 1 ) { Reference< beans::XPropertySet > xAxisProp( aAxisSeq[i], uno::UNO_QUERY ); if( xAxisProp.is()) diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 26ea1979e991..0af1f26bb832 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -379,7 +379,7 @@ Reference< XAxis > AxisHelper::createAxis( { css::chart::ChartAxisPosition eMainAxisPos( css::chart::ChartAxisPosition_ZERO ); xMainProp->getPropertyValue("CrossoverPosition") >>= eMainAxisPos; - if( css::chart::ChartAxisPosition_END == eMainAxisPos ) + if( eMainAxisPos == css::chart::ChartAxisPosition_END ) eNewAxisPos = css::chart::ChartAxisPosition_START; } } @@ -636,7 +636,7 @@ Reference< XAxis > AxisHelper::getCrossingMainAxis( const Reference< XAxis >& xA sal_Int32 nDimensionIndex = 0; sal_Int32 nAxisIndex = 0; AxisHelper::getIndicesForAxis( xAxis, xCooSys, nDimensionIndex, nAxisIndex ); - if( 2==nDimensionIndex ) + if( nDimensionIndex==2 ) { nDimensionIndex=1; bool bSwapXY = false; @@ -644,7 +644,7 @@ Reference< XAxis > AxisHelper::getCrossingMainAxis( const Reference< XAxis >& xA if( xCooSysProp.is() && (xCooSysProp->getPropertyValue( "SwapXAndYAxis" ) >>= bSwapXY) && bSwapXY ) nDimensionIndex=0; } - else if( 1==nDimensionIndex ) + else if( nDimensionIndex==1 ) nDimensionIndex=0; else nDimensionIndex=1; diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx index 9928f41e5d75..d21c1e59283a 100644 --- a/chart2/source/tools/ChartModelHelper.cxx +++ b/chart2/source/tools/ChartModelHelper.cxx @@ -73,7 +73,7 @@ uno::Reference< chart2::data::XDataProvider > ChartModelHelper::createInternalDa xProp->getPropertyValue( "DataRowSource" ) >>= aDataRowSource; - bDefaultDataInColumns = (css::chart::ChartDataRowSource_COLUMNS == aDataRowSource); + bDefaultDataInColumns = (aDataRowSource == css::chart::ChartDataRowSource_COLUMNS); } } } diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx index 91dd9792e641..4a473bd6214c 100644 --- a/chart2/source/tools/ChartTypeHelper.cxx +++ b/chart2/source/tools/ChartTypeHelper.cxx @@ -291,7 +291,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const uno::Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY ); chart2::StackingDirection eStacking = chart2::StackingDirection_NO_STACKING; xSeriesProp->getPropertyValue( "StackingDirection" ) >>= eStacking; - bStacked = (chart2::StackingDirection_Y_STACKING == eStacking); + bStacked = (eStacking == chart2::StackingDirection_Y_STACKING); } aRet.realloc( bStacked ? 3 : 6 ); @@ -523,11 +523,11 @@ sal_Int32 ChartTypeHelper::getAxisType( const uno::Reference< return AxisType::CATEGORY; OUString aChartTypeName = xChartType->getChartType(); - if(2==nDimensionIndex)//z-axis + if(nDimensionIndex==2)//z-axis return AxisType::SERIES; - if(1==nDimensionIndex)//y-axis + if(nDimensionIndex==1)//y-axis return AxisType::REALNUMBER; - if(0==nDimensionIndex)//x-axis + if(nDimensionIndex==0)//x-axis { if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) ) @@ -574,7 +574,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments( bool bFound=false; bool bAmbiguous=false; StackMode eStackMode = DiagramHelper::getStackModeFromChartType( xChartType, bFound, bAmbiguous, nullptr ); - bool bStacked = bFound && (StackMode::YStacked == eStackMode); + bool bStacked = bFound && (eStackMode == StackMode::YStacked); OUString aChartTypeName = xChartType->getChartType(); if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) || diff --git a/chart2/source/tools/LinePropertiesHelper.cxx b/chart2/source/tools/LinePropertiesHelper.cxx index e857d2d9a6ae..bba5d22695c5 100644 --- a/chart2/source/tools/LinePropertiesHelper.cxx +++ b/chart2/source/tools/LinePropertiesHelper.cxx @@ -111,7 +111,7 @@ bool LinePropertiesHelper::IsLineVisible( const css::uno::Reference< { sal_Int16 nLineTransparence=0; xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence; - if(100!=nLineTransparence) + if(nLineTransparence!=100) { bRet = true; } @@ -139,7 +139,7 @@ void LinePropertiesHelper::SetLineVisible( const css::uno::Reference< sal_Int16 nLineTransparence=0; xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence; - if(100==nLineTransparence) + if(nLineTransparence==100) xLineProperties->setPropertyValue( "LineTransparence", uno::Any( sal_Int16(0) ) ); } } diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 604d0be5eb77..f24258559f24 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -902,8 +902,8 @@ bool ObjectIdentifier::areSiblings( const OUString& rCID1, const OUString& rCID2 //legend entries are special: if(!bRet) { - if( OBJECTTYPE_LEGEND_ENTRY == getObjectType(rCID1) - && OBJECTTYPE_LEGEND_ENTRY == getObjectType(rCID2) ) + if( getObjectType(rCID1) == OBJECTTYPE_LEGEND_ENTRY + && getObjectType(rCID2) == OBJECTTYPE_LEGEND_ENTRY ) bRet = true; } } diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx index 6c7a5d5ae156..318cd63d71e7 100644 --- a/chart2/source/tools/RangeHighlighter.cxx +++ b/chart2/source/tools/RangeHighlighter.cxx @@ -107,24 +107,24 @@ void RangeHighlighter::determineRanges() ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID ); sal_Int32 nIndex = ObjectIdentifier::getIndexFromParticleOrCID( aCID ); Reference< chart2::XDataSeries > xDataSeries( ObjectIdentifier::getDataSeriesForCID( aCID, xChartModel ) ); - if( OBJECTTYPE_LEGEND_ENTRY == eObjectType ) + if( eObjectType == OBJECTTYPE_LEGEND_ENTRY ) { OUString aParentParticel( ObjectIdentifier::getFullParentParticle( aCID ) ); ObjectType eParentObjectType = ObjectIdentifier::getObjectType( aParentParticel ); eObjectType = eParentObjectType; - if( OBJECTTYPE_DATA_POINT == eObjectType ) + if( eObjectType == OBJECTTYPE_DATA_POINT ) nIndex = ObjectIdentifier::getIndexFromParticleOrCID( aParentParticel ); } - if( OBJECTTYPE_DATA_POINT == eObjectType || OBJECTTYPE_DATA_LABEL == eObjectType ) + if( eObjectType == OBJECTTYPE_DATA_POINT || eObjectType == OBJECTTYPE_DATA_LABEL ) { // Data Point fillRangesForDataPoint( xDataSeries, nIndex ); return; } - else if( OBJECTTYPE_DATA_ERRORS_X == eObjectType || - OBJECTTYPE_DATA_ERRORS_Y == eObjectType || - OBJECTTYPE_DATA_ERRORS_Z == eObjectType ) + else if( eObjectType == OBJECTTYPE_DATA_ERRORS_X || + eObjectType == OBJECTTYPE_DATA_ERRORS_Y || + eObjectType == OBJECTTYPE_DATA_ERRORS_Z ) { // select error bar ranges, or data series, if the style is // not set to FROM_DATA @@ -137,7 +137,7 @@ void RangeHighlighter::determineRanges() fillRangesForDataSeries( xDataSeries ); return; } - else if( OBJECTTYPE_AXIS == eObjectType ) + else if( eObjectType == OBJECTTYPE_AXIS ) { // Axis (Categories) Reference< chart2::XAxis > xAxis( ObjectIdentifier::getObjectPropertySet( aCID, xChartModel ), uno::UNO_QUERY ); @@ -147,10 +147,10 @@ void RangeHighlighter::determineRanges() return; } } - else if( OBJECTTYPE_PAGE == eObjectType - || OBJECTTYPE_DIAGRAM == eObjectType - || OBJECTTYPE_DIAGRAM_WALL == eObjectType - || OBJECTTYPE_DIAGRAM_FLOOR == eObjectType + else if( eObjectType == OBJECTTYPE_PAGE + || eObjectType == OBJECTTYPE_DIAGRAM + || eObjectType == OBJECTTYPE_DIAGRAM_WALL + || eObjectType == OBJECTTYPE_DIAGRAM_FLOOR ) { // Diagram diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx index b7c448eb7124..9062c5541074 100644 --- a/chart2/source/tools/ThreeDHelper.cxx +++ b/chart2/source/tools/ThreeDHelper.cxx @@ -1293,7 +1293,7 @@ void ThreeDHelper::setDefaultIllumination( const uno::Reference< beans::XPropert ASSERT_EXCEPTION( ex ); } - ThreeDLookScheme aScheme = (drawing::ShadeMode_FLAT==aShadeMode) ? ThreeDLookScheme_Simple : ThreeDLookScheme_Realistic; + ThreeDLookScheme aScheme = (aShadeMode==drawing::ShadeMode_FLAT) ? ThreeDLookScheme_Simple : ThreeDLookScheme_Realistic; lcl_setLightsForScheme( xSceneProperties, aScheme ); } diff --git a/chart2/source/view/axes/DateScaling.cxx b/chart2/source/view/axes/DateScaling.cxx index 0a83e792b818..742adc3cb044 100644 --- a/chart2/source/view/axes/DateScaling.cxx +++ b/chart2/source/view/axes/DateScaling.cxx @@ -80,7 +80,7 @@ double SAL_CALL DateScaling::doScaling( double value ) fResult += fDayOfMonth/fDaysInMonth; if(m_bShifted) { - if( YEAR==m_nTimeUnit ) + if( m_nTimeUnit==YEAR ) fResult += 0.5*lcl_fNumberOfMonths; else fResult += 0.5; @@ -147,7 +147,7 @@ double SAL_CALL InverseDateScaling::doScaling( double value ) //Date aDate(m_aNullDate); if(m_bShifted) { - if( YEAR==m_nTimeUnit ) + if( m_nTimeUnit==YEAR ) value -= 0.5*lcl_fNumberOfMonths; else value -= 0.5; diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx index ce1fa1570f27..0ccb61445a32 100644 --- a/chart2/source/view/axes/ScaleAutomatism.cxx +++ b/chart2/source/view/axes/ScaleAutomatism.cxx @@ -639,12 +639,12 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis( long nNumer = 1; long nIntervalDays = nDayCount / nMaxMainIncrementCount; double nDaysPerInterval = 1.0; - if( nIntervalDays>365 || YEAR==rExplicitScale.TimeResolution ) + if( nIntervalDays>365 || rExplicitScale.TimeResolution==YEAR ) { rExplicitIncrement.MajorTimeInterval.TimeUnit = YEAR; nDaysPerInterval = 365.0;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ... } - else if( nIntervalDays>31 || MONTH==rExplicitScale.TimeResolution ) + else if( nIntervalDays>31 || rExplicitScale.TimeResolution==MONTH ) { rExplicitIncrement.MajorTimeInterval.TimeUnit = MONTH; nDaysPerInterval = 31.0;//todo: maybe different for other calendars... get localized calendar according to set number format at axis ... diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx index c3d98df7456c..901242455252 100644 --- a/chart2/source/view/axes/Tickmarks.cxx +++ b/chart2/source/view/axes/Tickmarks.cxx @@ -150,7 +150,7 @@ TickFactory2D::TickFactory2D( , m_fOffset_LogicToScreen(0.0) { double fWidthY = m_fScaledVisibleMax - m_fScaledVisibleMin; - if (chart2::AxisOrientation_MATHEMATICAL == m_rScale.Orientation) + if (m_rScale.Orientation == chart2::AxisOrientation_MATHEMATICAL) { m_fStretch_LogicToScreen = 1.0/fWidthY; m_fOffset_LogicToScreen = -m_fScaledVisibleMin; @@ -233,8 +233,8 @@ void TickFactory2D::addPointSequenceForTickLine( drawing::PointSequenceSequence& B2DVector TickFactory2D::getDistanceAxisTickToText( const AxisProperties& rAxisProperties, bool bIncludeFarAwayDistanceIfSo, bool bIncludeSpaceBetweenTickAndText ) const { bool bFarAwayLabels = false; - if( css::chart::ChartAxisLabelPosition_OUTSIDE_START == rAxisProperties.m_eLabelPos - || css::chart::ChartAxisLabelPosition_OUTSIDE_END == rAxisProperties.m_eLabelPos ) + if( rAxisProperties.m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_START + || rAxisProperties.m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_END ) bFarAwayLabels = true; double fInnerDirectionSign = rAxisProperties.maLabelAlignment.mfInnerTickDirection; diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 886b67e9edc2..59ed66cdc917 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -58,7 +58,7 @@ void VAxisBase::initAxisLabelProperties( const css::awt::Size& rFontReferenceSiz if( !m_aAxisProperties.m_bDisplayLabels ) return; - if( AxisType::SERIES==m_aAxisProperties.m_nAxisType ) + if( m_aAxisProperties.m_nAxisType==AxisType::SERIES ) { if( m_aAxisProperties.m_xAxisTextProvider.is() ) m_aTextLabels = m_aAxisProperties.m_xAxisTextProvider->getTextualData(); @@ -71,7 +71,7 @@ void VAxisBase::initAxisLabelProperties( const css::awt::Size& rFontReferenceSiz return; } } - else if( AxisType::CATEGORY==m_aAxisProperties.m_nAxisType ) + else if( m_aAxisProperties.m_nAxisType==AxisType::CATEGORY ) { if( m_aAxisProperties.m_pExplicitCategoriesProvider ) m_aTextLabels = m_aAxisProperties.m_pExplicitCategoriesProvider->getSimpleCategories(); @@ -81,13 +81,13 @@ void VAxisBase::initAxisLabelProperties( const css::awt::Size& rFontReferenceSiz m_aAxisLabelProperties.nNumberFormatKey = m_aAxisProperties.m_nNumberFormatKey; m_aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel); - if( m_aAxisProperties.m_bComplexCategories && AxisType::CATEGORY == m_aAxisProperties.m_nAxisType ) + if( m_aAxisProperties.m_bComplexCategories && m_aAxisProperties.m_nAxisType == AxisType::CATEGORY ) m_aAxisLabelProperties.eStaggering = SIDE_BY_SIDE; } bool VAxisBase::isDateAxis() const { - return AxisType::DATE == m_aScale.AxisType; + return m_aScale.AxisType == AxisType::DATE; } bool VAxisBase::isComplexCategoryAxis() const { diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 786e8a3d73aa..35a9855a472f 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -241,7 +241,7 @@ void AxisProperties::initAxisPositioning( const uno::Reference< beans::XProperty if( AxisHelper::isAxisPositioningEnabled() ) { xAxisProp->getPropertyValue("CrossoverPosition") >>= m_eCrossoverType; - if( css::chart::ChartAxisPosition_VALUE == m_eCrossoverType ) + if( m_eCrossoverType == css::chart::ChartAxisPosition_VALUE ) { double fValue = 0.0; xAxisProp->getPropertyValue("CrossoverValue") >>= fValue; @@ -250,7 +250,7 @@ void AxisProperties::initAxisPositioning( const uno::Reference< beans::XProperty fValue = ::rtl::math::round(fValue); m_pfMainLinePositionAtOtherAxis.reset(fValue); } - else if( css::chart::ChartAxisPosition_ZERO == m_eCrossoverType ) + else if( m_eCrossoverType == css::chart::ChartAxisPosition_ZERO ) m_pfMainLinePositionAtOtherAxis.reset(0.0); xAxisProp->getPropertyValue("LabelPosition") >>= m_eLabelPos; @@ -292,18 +292,18 @@ void AxisProperties::init( bool bCartesian ) && m_pExplicitCategoriesProvider && m_pExplicitCategoriesProvider->hasComplexCategories() ) m_bComplexCategories = true; - if( css::chart::ChartAxisPosition_END == m_eCrossoverType ) + if( m_eCrossoverType == css::chart::ChartAxisPosition_END ) maLabelAlignment.mfInnerTickDirection = m_bCrossingAxisHasReverseDirection ? 1.0 : -1.0; else maLabelAlignment.mfInnerTickDirection = m_bCrossingAxisHasReverseDirection ? -1.0 : 1.0; - if( css::chart::ChartAxisLabelPosition_NEAR_AXIS == m_eLabelPos ) + if( m_eLabelPos == css::chart::ChartAxisLabelPosition_NEAR_AXIS ) maLabelAlignment.mfLabelDirection = maLabelAlignment.mfInnerTickDirection; - else if( css::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE == m_eLabelPos ) + else if( m_eLabelPos == css::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE ) maLabelAlignment.mfLabelDirection = -maLabelAlignment.mfInnerTickDirection; - else if( css::chart::ChartAxisLabelPosition_OUTSIDE_START == m_eLabelPos ) + else if( m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_START ) maLabelAlignment.mfLabelDirection = m_bCrossingAxisHasReverseDirection ? -1 : 1; - else if( css::chart::ChartAxisLabelPosition_OUTSIDE_END == m_eLabelPos ) + else if( m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_END ) maLabelAlignment.mfLabelDirection = m_bCrossingAxisHasReverseDirection ? 1 : -1; if( m_nDimensionIndex==2 ) @@ -415,7 +415,7 @@ void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel ) bool AxisLabelProperties::isStaggered() const { - return ( STAGGER_ODD == eStaggering || STAGGER_EVEN == eStaggering ); + return ( eStaggering == STAGGER_ODD || eStaggering == STAGGER_EVEN ); } void AxisLabelProperties::autoRotate45() diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 3ff5cd913cfb..057f957a46ad 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -236,9 +236,9 @@ TickInfo* LabelIterator::firstInfo() pTickInfo = m_aPureTickIter.nextInfo(); if(!pTickInfo) return nullptr; - if( (STAGGER_EVEN==m_eAxisLabelStaggering && m_bInnerLine) + if( (m_eAxisLabelStaggering==STAGGER_EVEN && m_bInnerLine) || - (STAGGER_ODD==m_eAxisLabelStaggering && !m_bInnerLine) + (m_eAxisLabelStaggering==STAGGER_ODD && !m_bInnerLine) ) { //skip first label @@ -259,8 +259,8 @@ TickInfo* LabelIterator::nextInfo() pTickInfo = m_aPureTickIter.nextInfo(); while( pTickInfo && !pTickInfo->xTextShape.is() ); - if( STAGGER_EVEN==m_eAxisLabelStaggering - || STAGGER_ODD==m_eAxisLabelStaggering ) + if( m_eAxisLabelStaggering==STAGGER_EVEN + || m_eAxisLabelStaggering==STAGGER_ODD ) { //skip one label do @@ -1016,15 +1016,15 @@ double VCartesianAxis::getAxisIntersectionValue() const double fMin = (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMinX() : m_pPosHelper->getLogicMinY(); double fMax = (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMaxX() : m_pPosHelper->getLogicMaxY(); - return (css::chart::ChartAxisPosition_END == m_aAxisProperties.m_eCrossoverType) ? fMax : fMin; + return (m_aAxisProperties.m_eCrossoverType == css::chart::ChartAxisPosition_END) ? fMax : fMin; } double VCartesianAxis::getLabelLineIntersectionValue() const { - if (css::chart::ChartAxisLabelPosition_OUTSIDE_START == m_aAxisProperties.m_eLabelPos) + if (m_aAxisProperties.m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_START) return (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMinX() : m_pPosHelper->getLogicMinY(); - if (css::chart::ChartAxisLabelPosition_OUTSIDE_END == m_aAxisProperties.m_eLabelPos) + if (m_aAxisProperties.m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_END) return (m_nDimensionIndex==1) ? m_pPosHelper->getLogicMaxX() : m_pPosHelper->getLogicMaxY(); return getAxisIntersectionValue(); @@ -1055,7 +1055,7 @@ B2DVector VCartesianAxis::getScreenPosition( double fLogicX, double fLogicY, dou if( m_pPosHelper ) { drawing::Position3D aScenePos = m_pPosHelper->transformLogicToScene( fLogicX, fLogicY, fLogicZ, true ); - if(3==m_nDimension) + if(m_nDimension==3) { if( m_xLogicTarget.is() && m_pPosHelper && m_pShapeFactory ) { @@ -1126,9 +1126,9 @@ void VCartesianAxis::get2DAxisMainLine( double fXOther = fMaxX; int nDifferentValue = !m_pPosHelper->isMathematicalOrientationX() ? -1 : 1; if( !m_pPosHelper->isSwapXAndY() ) - nDifferentValue *= (CuboidPlanePosition_Left != m_eLeftWallPos) ? -1 : 1; + nDifferentValue *= (m_eLeftWallPos != CuboidPlanePosition_Left) ? -1 : 1; else - nDifferentValue *= (CuboidPlanePosition_Bottom != m_eBottomPos) ? -1 : 1; + nDifferentValue *= (m_eBottomPos != CuboidPlanePosition_Bottom) ? -1 : 1; if( nDifferentValue<0 ) { fXOnXPlane = fMaxX; @@ -1139,9 +1139,9 @@ void VCartesianAxis::get2DAxisMainLine( double fYOther = fMaxY; nDifferentValue = !m_pPosHelper->isMathematicalOrientationY() ? -1 : 1; if( !m_pPosHelper->isSwapXAndY() ) - nDifferentValue *= (CuboidPlanePosition_Bottom != m_eBottomPos) ? -1 : 1; + nDifferentValue *= (m_eBottomPos != CuboidPlanePosition_Bottom) ? -1 : 1; else - nDifferentValue *= (CuboidPlanePosition_Left != m_eLeftWallPos) ? -1 : 1; + nDifferentValue *= (m_eLeftWallPos != CuboidPlanePosition_Left) ? -1 : 1; if( nDifferentValue<0 ) { fYOnYPlane = fMaxY; @@ -1151,7 +1151,7 @@ void VCartesianAxis::get2DAxisMainLine( double fZOnZPlane = fMaxZ; double fZOther = fMinZ; nDifferentValue = !m_pPosHelper->isMathematicalOrientationZ() ? -1 : 1; - nDifferentValue *= (CuboidPlanePosition_Back != m_eBackWallPos) ? -1 : 1; + nDifferentValue *= (m_eBackWallPos != CuboidPlanePosition_Back) ? -1 : 1; if( nDifferentValue<0 ) { fZOnZPlane = fMinZ; @@ -1165,7 +1165,7 @@ void VCartesianAxis::get2DAxisMainLine( double fYEnd; double fZEnd = fZStart; - if( 0==m_nDimensionIndex ) //x-axis + if( m_nDimensionIndex==0 ) //x-axis { if( fCrossesOtherAxis < fMinY ) fCrossesOtherAxis = fMinY; @@ -1175,7 +1175,7 @@ void VCartesianAxis::get2DAxisMainLine( fYStart = fYEnd = fCrossesOtherAxis; fXEnd=m_pPosHelper->getLogicMaxX(); - if(3==m_nDimension) + if(m_nDimension==3) { if( AxisHelper::isAxisPositioningEnabled() ) { @@ -1219,7 +1219,7 @@ void VCartesianAxis::get2DAxisMainLine( } }//end 3D x axis } - else if( 1==m_nDimensionIndex ) //y-axis + else if( m_nDimensionIndex==1 ) //y-axis { if( fCrossesOtherAxis < fMinX ) fCrossesOtherAxis = fMinX; @@ -1229,7 +1229,7 @@ void VCartesianAxis::get2DAxisMainLine( fXStart = fXEnd = fCrossesOtherAxis; fYEnd=m_pPosHelper->getLogicMaxY(); - if(3==m_nDimension) + if(m_nDimension==3) { if( AxisHelper::isAxisPositioningEnabled() ) { @@ -1318,7 +1318,7 @@ void VCartesianAxis::get2DAxisMainLine( fYStart = fYEnd = m_pPosHelper->isMathematicalOrientationY() ? m_pPosHelper->getLogicMaxY() : m_pPosHelper->getLogicMinY(); } - if(3==m_nDimension) + if(m_nDimension==3) { rStart = getScreenPosition( fXStart, fYStart, fZStart ); rEnd = getScreenPosition( fXEnd, fYEnd, fZEnd ); @@ -1363,15 +1363,15 @@ void VCartesianAxis::get2DAxisMainLine( rStart = getScreenPosition( fXStart, fYStart, fZStart ); rEnd = getScreenPosition( fXEnd, fYEnd, fZEnd ); - if(3==m_nDimension && !AxisHelper::isAxisPositioningEnabled() ) + if(m_nDimension==3 && !AxisHelper::isAxisPositioningEnabled() ) rAlignment.mfInnerTickDirection = rAlignment.mfLabelDirection;//to behave like before - if(3==m_nDimension && AxisHelper::isAxisPositioningEnabled() ) + if(m_nDimension==3 && AxisHelper::isAxisPositioningEnabled() ) { double fDeltaX = rEnd.getX() - rStart.getX(); double fDeltaY = rEnd.getY() - rStart.getY(); - if( 2==m_nDimensionIndex ) + if( m_nDimensionIndex==2 ) { if( m_eLeftWallPos != CuboidPlanePosition_Left ) { @@ -1758,7 +1758,7 @@ void VCartesianAxis::createShapes() return; //create line shapes - if(2==m_nDimension) + if(m_nDimension==2) { //create extra long ticks to separate complex categories (create them only there where the labels are) if( isComplexCategoryAxis() ) diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx index 934d17046ea3..d232d78afbac 100644 --- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx +++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits