diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-08 10:03:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-08 10:34:50 +0100 |
commit | 7960ccb41db49a7883afa036b820a7b7ffcb4a89 (patch) | |
tree | d667c41a5dc20fed8ffda0404de4d04dab946e9f /chart2 | |
parent | 352bd98892c1cdf95756a49f38c84212eebffd7b (diff) |
loplugin:constantparam in canvas..comphelper
Change-Id: Ia666cb46c409852a13789389c032f0ce4377c0d5
Reviewed-on: https://gerrit.libreoffice.org/50927
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 44 | ||||
-rw-r--r-- | chart2/source/inc/DataSeriesHelper.hxx | 5 | ||||
-rw-r--r-- | chart2/source/model/main/DataSeries.cxx | 2 | ||||
-rw-r--r-- | chart2/source/model/template/BubbleDataInterpreter.cxx | 2 | ||||
-rw-r--r-- | chart2/source/model/template/XYDataInterpreter.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/AxisHelper.cxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/DataSeriesHelper.cxx | 4 |
7 files changed, 28 insertions, 33 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index d0ab36eb743f..b77aeda6755b 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -340,8 +340,7 @@ void checkNameAndType(Reference<XPropertySet> const & xProperties, const OUStrin void checkLinearTrendline( Reference<chart2::XRegressionCurve> const & xCurve, const OUString& aExpectedName, double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward, - bool aExpectedForceIntercept, double aExpectedInterceptValue, - bool aExpectedShowEquation, bool aExpectedR2) + double aExpectedInterceptValue) { Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY ); CPPUNIT_ASSERT(xProperties.is()); @@ -351,16 +350,15 @@ void checkLinearTrendline( checkCommonTrendline( xCurve, aExpectedExtrapolateForward, aExpectedExtrapolateBackward, - aExpectedForceIntercept, aExpectedInterceptValue, - aExpectedShowEquation, aExpectedR2); + /*aExpectedForceIntercept*/false, aExpectedInterceptValue, + /*aExpectedShowEquation*/true, /*aExpectedR2*/false); } void checkPolynomialTrendline( Reference<chart2::XRegressionCurve> const & xCurve, const OUString& aExpectedName, sal_Int32 aExpectedDegree, double aExpectedExtrapolateForward, double aExpectedExtrapolateBackward, - bool aExpectedForceIntercept, double aExpectedInterceptValue, - bool aExpectedShowEquation, bool aExpectedR2) + double aExpectedInterceptValue) { Reference<XPropertySet> xProperties( xCurve , uno::UNO_QUERY ); CPPUNIT_ASSERT(xProperties.is()); @@ -374,8 +372,8 @@ void checkPolynomialTrendline( checkCommonTrendline( xCurve, aExpectedExtrapolateForward, aExpectedExtrapolateBackward, - aExpectedForceIntercept, aExpectedInterceptValue, - aExpectedShowEquation, aExpectedR2); + /*aExpectedForceIntercept*/true, aExpectedInterceptValue, + /*aExpectedShowEquation*/true, /*aExpectedR2*/true); } void checkMovingAverageTrendline( @@ -408,11 +406,11 @@ void checkTrendlinesInChart(uno::Reference< chart2::XChartDocument > const & xCh xCurve = xRegressionCurveSequence[0]; CPPUNIT_ASSERT(xCurve.is()); - checkPolynomialTrendline(xCurve, "col2_poly", 3, 0.1, -0.1, true, -1.0, true, true); + checkPolynomialTrendline(xCurve, "col2_poly", 3, 0.1, -0.1, -1.0); xCurve = xRegressionCurveSequence[1]; CPPUNIT_ASSERT(xCurve.is()); - checkLinearTrendline(xCurve, "col2_linear", -0.5, -0.5, false, 0.0, true, false); + checkLinearTrendline(xCurve, "col2_linear", -0.5, -0.5, 0.0); xCurve = xRegressionCurveSequence[2]; CPPUNIT_ASSERT(xCurve.is()); @@ -798,23 +796,21 @@ void Chart2ExportTest::testAxisNumberFormatXLS() } } - void change( const Reference<chart2::XChartDocument>& xChartDoc, bool bSetNumFmtLinked, sal_Int16 nNumFmtTypeFlag ) + void change( const Reference<chart2::XChartDocument>& xChartDoc, sal_Int16 nNumFmtTypeFlag ) { Reference<chart2::XAxis> xAxisY = getAxisFromDoc( xChartDoc, 0, 1, 0 ); Reference<beans::XPropertySet> xPS( xAxisY, uno::UNO_QUERY_THROW ); - Any aAny( bSetNumFmtLinked ); + Any aAny( false ); xPS->setPropertyValue( "LinkNumberFormatToSource", aAny ); - if ( !bSetNumFmtLinked ) - { - Reference<util::XNumberFormatsSupplier> xNFS( xChartDoc, uno::UNO_QUERY_THROW ); - Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats(); - CPPUNIT_ASSERT( xNumberFormats.is() ); - lang::Locale aLocale{ "en", "US", "" }; - Sequence<sal_Int32> aNumFmts = xNumberFormats->queryKeys( nNumFmtTypeFlag, aLocale, false ); - CPPUNIT_ASSERT( aNumFmts.hasElements() ); - aAny <<= aNumFmts[0]; - xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny ); - } + + Reference<util::XNumberFormatsSupplier> xNFS( xChartDoc, uno::UNO_QUERY_THROW ); + Reference<util::XNumberFormats> xNumberFormats = xNFS->getNumberFormats(); + CPPUNIT_ASSERT( xNumberFormats.is() ); + lang::Locale aLocale{ "en", "US", "" }; + Sequence<sal_Int32> aNumFmts = xNumberFormats->queryKeys( nNumFmtTypeFlag, aLocale, false ); + CPPUNIT_ASSERT( aNumFmts.hasElements() ); + aAny <<= aNumFmts[0]; + xPS->setPropertyValue( CHART_UNONAME_NUMFMT, aAny ); } } aTest; @@ -824,7 +820,7 @@ void Chart2ExportTest::testAxisNumberFormatXLS() Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet( 0, mxComponent ); aTest.check( xChartDoc, true, util::NumberFormat::PERCENT ); - aTest.change( xChartDoc, false, util::NumberFormat::NUMBER ); + aTest.change( xChartDoc, util::NumberFormat::NUMBER ); // Write the document(xls) with changes made close it, load it and check if changes are intact reload( "MS Excel 97" ); xChartDoc = getChartDocFromSheet( 0, mxComponent ); diff --git a/chart2/source/inc/DataSeriesHelper.hxx b/chart2/source/inc/DataSeriesHelper.hxx index 3c6f369020ee..7f9276dbea3c 100644 --- a/chart2/source/inc/DataSeriesHelper.hxx +++ b/chart2/source/inc/DataSeriesHelper.hxx @@ -57,7 +57,7 @@ OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSeq bool bMatchPrefix = false ); /** Retrieves all data sequences in the given data source that match the given - role. + role prefix. @param aSource The data source containing all data sequences to be searched through. @@ -68,8 +68,7 @@ OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSeq OOO_DLLPUBLIC_CHARTTOOLS std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > getAllDataSequencesByRole( const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & aDataSequences, - const OUString& aRole, - bool bMatchPrefix ); + const OUString& aRole ); OOO_DLLPUBLIC_CHARTTOOLS std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence> > diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index f9179ac9dc4a..4a429e4a8be5 100644 --- a/chart2/source/model/main/DataSeries.cxx +++ b/chart2/source/model/main/DataSeries.cxx @@ -306,7 +306,7 @@ Reference< beans::XPropertySet > } std::vector< Reference< chart2::data::XLabeledDataSequence > > aValuesSeries( - DataSeriesHelper::getAllDataSequencesByRole( aSequences , "values", true ) ); + DataSeriesHelper::getAllDataSequencesByRole( aSequences , "values" ) ); if (aValuesSeries.empty()) throw lang::IndexOutOfBoundsException(); diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx index 364ed3459e38..b509f7fc5126 100644 --- a/chart2/source/model/template/BubbleDataInterpreter.cxx +++ b/chart2/source/model/template/BubbleDataInterpreter.cxx @@ -183,7 +183,7 @@ chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries( { vector< Reference< data::XLabeledDataSequence > > aValueSeqVec( DataSeriesHelper::getAllDataSequencesByRole( - xSeriesSource->getDataSequences(), "values", true )); + xSeriesSource->getDataSequences(), "values" )); if( xValuesX.is()) aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX )); if( xValuesY.is()) diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx index 896b9898ebcb..0e9907138067 100644 --- a/chart2/source/model/template/XYDataInterpreter.cxx +++ b/chart2/source/model/template/XYDataInterpreter.cxx @@ -163,7 +163,7 @@ chart2::InterpretedData SAL_CALL XYDataInterpreter::reinterpretDataSeries( { vector< Reference< data::XLabeledDataSequence > > aValueSeqVec( DataSeriesHelper::getAllDataSequencesByRole( - xSeriesSource->getDataSequences(), "values", true )); + xSeriesSource->getDataSequences(), "values" )); if( xValuesX.is()) aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX )); if( xValuesY.is()) diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 32c7ce3608bc..15d6ae59d9fc 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -197,7 +197,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( if( xSource.is() ) { std::vector< Reference< chart2::data::XLabeledDataSequence > > aXValues( - DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), "values-x", true ) ); + DataSeriesHelper::getAllDataSequencesByRole( xSource->getDataSequences(), "values-x" ) ); if( aXValues.empty() ) { Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) ); diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index e05c014cddce..7a4d4c46a246 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -226,12 +226,12 @@ Reference< chart2::data::XLabeledDataSequence > std::vector< Reference< chart2::data::XLabeledDataSequence > > getAllDataSequencesByRole( const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aDataSequences, - const OUString& aRole, bool bMatchPrefix /* = false */ ) + const OUString& aRole ) { std::vector< Reference< chart2::data::XLabeledDataSequence > > aResultVec; std::copy_if( aDataSequences.begin(), aDataSequences.end(), std::back_inserter( aResultVec ), - lcl_MatchesRole(aRole, bMatchPrefix) ); + lcl_MatchesRole(aRole, /*bMatchPrefix*/true) ); return aResultVec; } |