summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-12 13:54:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-12 20:30:46 +0200
commitf7d8e3318044bb70647424a1eea354bc59e4ced5 (patch)
tree9b276678dfa67101b0bec3d9755c796f8dfae93b /chart2
parent3fe3bd8a90d6dc53b05b9236185af3916fc5375d (diff)
loplugin:sequentialassign in chart2
Change-Id: I211114140afc3f5b32b8b034e63e8d52f78be36a Reviewed-on: https://gerrit.libreoffice.org/70659 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/PivotChartTest.cxx30
-rw-r--r--chart2/qa/extras/chart2export.cxx4
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx3
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx3
-rw-r--r--chart2/source/view/diagram/VDiagram.cxx3
-rw-r--r--chart2/source/view/main/VDataSeries.cxx8
-rw-r--r--chart2/source/view/main/VLegend.cxx3
7 files changed, 17 insertions, 37 deletions
diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx
index 086c4e91bcdb..d5d348c89df5 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -544,11 +544,9 @@ void PivotChartTest::testPivotChartWithOneColumnField()
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
- uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+ uno::Reference<sheet::XDataPilotTables> xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
- uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
- xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+ uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
lclModifyOrientation(xDataPilotDescriptor, "Country", sheet::DataPilotFieldOrientation_COLUMN);
@@ -631,11 +629,9 @@ void PivotChartTest::testPivotChartWithOneRowField()
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
- uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+ uno::Reference<sheet::XDataPilotTables> xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
- uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
- xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+ uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
lclModifyOrientation(xDataPilotDescriptor, "Country", sheet::DataPilotFieldOrientation_ROW);
@@ -694,11 +690,9 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
- uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+ uno::Reference<sheet::XDataPilotTables> xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
- uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
- xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+ uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
lclModifyOrientation(xDataPilotDescriptor, "City", sheet::DataPilotFieldOrientation_ROW);
@@ -804,11 +798,9 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
- uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+ uno::Reference<sheet::XDataPilotTables> xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
- uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
- xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+ uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
lclModifyOrientation(xDataPilotDescriptor, "Country", sheet::DataPilotFieldOrientation_ROW);
@@ -940,11 +932,9 @@ void PivotChartTest::testPivotChartWithDateRowField()
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
- uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
+ uno::Reference<sheet::XDataPilotTables> xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
- uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
- xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
+ uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
xDataPilotDescriptor->setSourceRange(sCellRangeAdress);
lclModifyOrientation(xDataPilotDescriptor, "Date", sheet::DataPilotFieldOrientation_ROW);
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index b0cca5802f22..6dd8d7d9e9c1 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -1205,9 +1205,7 @@ void Chart2ExportTest::testShapeFollowedByChart()
CPPUNIT_ASSERT(pXmlDoc);
OUString aValueOfFirstDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:drawing[1]/wp:inline[1]/wp:docPr[1]", "id");
- OUString aValueOfSecondDocPR;
-
- aValueOfSecondDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:docPr[1]", "id");
+ OUString aValueOfSecondDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:docPr[1]", "id");
CPPUNIT_ASSERT( aValueOfFirstDocPR != aValueOfSecondDocPR );
}
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 6896cd4f208c..ff44fc36f224 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -255,8 +255,7 @@ void ChartController::executeDispatch_Paste()
{
Graphic aGraphic;
// paste location: center of window
- Point aPos;
- aPos = pChartWindow->PixelToLogic( tools::Rectangle( aPos, pChartWindow->GetSizePixel()).Center());
+ Point aPos = pChartWindow->PixelToLogic( tools::Rectangle( aPos, pChartWindow->GetSizePixel()).Center());
// handle different formats
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pChartWindow ));
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index ddc9e039b3ae..2a029f7b89a8 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -269,8 +269,7 @@ void BubbleChart::createShapes()
//create data point
drawing::Direction3D aSymbolSize = transformToScreenBubbleSize( fBubbleSize );
- uno::Reference<drawing::XShape> xShape;
- xShape = m_pShapeFactory->createCircle2D( xPointGroupShape_Shapes
+ uno::Reference<drawing::XShape> xShape = m_pShapeFactory->createCircle2D( xPointGroupShape_Shapes
, aScenePosition, aSymbolSize );
setMappedProperties( xShape
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index feb839be8de2..6069296d7271 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -466,8 +466,7 @@ void VDiagram::createShapes_3d()
//create shape
m_xOuterGroupShape.set( m_pShapeFactory->createGroup3D( m_xTarget, "PlotAreaExcludingAxes" ), uno::UNO_QUERY);
- uno::Reference< drawing::XShapes > xOuterGroup_Shapes =
- uno::Reference<drawing::XShapes>( m_xOuterGroupShape, uno::UNO_QUERY );
+ uno::Reference< drawing::XShapes > xOuterGroup_Shapes( m_xOuterGroupShape, uno::UNO_QUERY );
//create additional group to manipulate the aspect ratio of the whole diagram:
xOuterGroup_Shapes = m_pShapeFactory->createGroup3D( xOuterGroup_Shapes );
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 92abdbaee240..6d9b7d11196c 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -374,16 +374,12 @@ OUString VDataSeries::getLabelsCID() const
}
OUString VDataSeries::getDataCurveCID( sal_Int32 nCurveIndex, bool bAverageLine ) const
{
- OUString aRet;
- aRet = ObjectIdentifier::createDataCurveCID( m_aSeriesParticle, nCurveIndex, bAverageLine );
- return aRet;
+ return ObjectIdentifier::createDataCurveCID( m_aSeriesParticle, nCurveIndex, bAverageLine );
}
OUString VDataSeries::getDataCurveEquationCID( sal_Int32 nCurveIndex ) const
{
- OUString aRet;
- aRet = ObjectIdentifier::createDataCurveEquationCID( m_aSeriesParticle, nCurveIndex );
- return aRet;
+ return ObjectIdentifier::createDataCurveEquationCID( m_aSeriesParticle, nCurveIndex );
}
void VDataSeries::setPageReferenceSize( const awt::Size & rPageRefSize )
{
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index dd534f3b6023..bbb0707f7a0f 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -967,8 +967,7 @@ void VLegend::createShapes(
eLegendPosition != LegendPosition_PAGE_END &&
eExpansion != css::chart::ChartLegendExpansion_WIDE);
- std::vector<std::shared_ptr<VButton>> aButtons;
- aButtons = lcl_createButtons(xLegendContainer, m_xShapeFactory, mrModel, bPlaceButtonsVertically, nUsedButtonHeight);
+ std::vector<std::shared_ptr<VButton>> aButtons = lcl_createButtons(xLegendContainer, m_xShapeFactory, mrModel, bPlaceButtonsVertically, nUsedButtonHeight);
// A custom size includes the size we used for buttons already, so we need to
// subtract that from the size that is available for the legend