[Libreoffice-commits] core.git: canvas/source chart2/qa chart2/source
Noel Grandin
noel.grandin at collabora.co.uk
Tue Jun 20 05:51:47 UTC 2017
canvas/source/vcl/spritehelper.cxx | 55 +++-----
chart2/qa/extras/PivotChartTest.cxx | 40 ++---
chart2/qa/extras/chart2export.cxx | 2
chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx | 2
chart2/source/controller/dialogs/tp_DataSource.cxx | 4
chart2/source/controller/drawinglayer/DrawViewWrapper.cxx | 7 -
chart2/source/controller/main/ChartController_Properties.cxx | 5
chart2/source/controller/main/ChartDropTargetHelper.cxx | 74 +++++------
chart2/source/controller/main/ChartFrameloader.cxx | 3
chart2/source/controller/main/ControllerCommandDispatch.cxx | 6
chart2/source/controller/main/DrawCommandDispatch.cxx | 4
chart2/source/controller/main/ObjectHierarchy.cxx | 3
chart2/source/controller/sidebar/Chart2PanelFactory.cxx | 3
chart2/source/controller/sidebar/ChartElementsPanel.cxx | 3
chart2/source/model/filter/XMLFilter.cxx | 7 -
chart2/source/model/main/ChartModel.cxx | 22 ---
chart2/source/model/template/ChartTypeTemplate.cxx | 3
chart2/source/model/template/PieChartTypeTemplate.cxx | 7 -
chart2/source/tools/AxisHelper.cxx | 3
chart2/source/tools/DiagramHelper.cxx | 9 -
chart2/source/tools/InternalDataProvider.cxx | 3
chart2/source/tools/NumberFormatterWrapper.cxx | 3
chart2/source/tools/RangeHighlighter.cxx | 6
chart2/source/tools/TitleHelper.cxx | 3
chart2/source/view/axes/VAxisProperties.cxx | 5
chart2/source/view/axes/VPolarAngleAxis.cxx | 7 -
chart2/source/view/axes/VPolarGrid.cxx | 2
chart2/source/view/charttypes/BubbleChart.cxx | 5
chart2/source/view/charttypes/CandleStickChart.cxx | 3
chart2/source/view/charttypes/NetChart.cxx | 2
chart2/source/view/charttypes/PieChart.cxx | 3
chart2/source/view/main/ChartView.cxx | 12 -
chart2/source/view/main/OpenglShapeFactory.cxx | 14 --
chart2/source/view/main/ShapeFactory.cxx | 30 +---
chart2/source/view/main/VDataSeries.cxx | 6
chart2/source/view/main/VLegend.cxx | 3
36 files changed, 141 insertions(+), 228 deletions(-)
New commits:
commit 19f3b88c1ee2ab546a92c28f155f4d65e0c464df
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Jun 19 16:03:21 2017 +0200
loplugin:oncevar chart2
Change-Id: I2dd0939db440b5357225395e88680dd0b0fdbf43
Reviewed-on: https://gerrit.libreoffice.org/38970
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index ee70b21425aa..d45adc84cd87 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -226,10 +226,6 @@ namespace vclcanvas
// scales.
if( !!(*maContent) )
{
- // when true, fast path for slide transition has
- // already redrawn the sprite.
- bool bSpriteRedrawn( false );
-
rTargetSurface.Push( PushFlags::CLIPREGION );
// apply clip (if any)
@@ -260,35 +256,32 @@ namespace vclcanvas
}
}
- if( !bSpriteRedrawn )
+ if( ::rtl::math::approxEqual(fAlpha, 1.0) )
{
- if( ::rtl::math::approxEqual(fAlpha, 1.0) )
- {
- // no alpha modulation -> just copy to output
- if( maContent->IsTransparent() )
- rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize, *maContent );
- else
- rTargetSurface.DrawBitmap( aOutPos, aOutputSize, maContent->GetBitmap() );
- }
+ // no alpha modulation -> just copy to output
+ if( maContent->IsTransparent() )
+ rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize, *maContent );
else
- {
- // TODO(P3): Switch to OutputDevice::DrawTransparent()
- // here
-
- // draw semi-transparent
- sal_uInt8 nColor( static_cast<sal_uInt8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
- AlphaMask aAlpha( maContent->GetSizePixel(),
- &nColor );
-
- // mask out fully transparent areas
- if( maContent->IsTransparent() )
- aAlpha.Replace( maContent->GetMask(), 255 );
-
- // alpha-blend to output
- rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize,
- BitmapEx( maContent->GetBitmap(),
- aAlpha ) );
- }
+ rTargetSurface.DrawBitmap( aOutPos, aOutputSize, maContent->GetBitmap() );
+ }
+ else
+ {
+ // TODO(P3): Switch to OutputDevice::DrawTransparent()
+ // here
+
+ // draw semi-transparent
+ sal_uInt8 nColor( static_cast<sal_uInt8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
+ AlphaMask aAlpha( maContent->GetSizePixel(),
+ &nColor );
+
+ // mask out fully transparent areas
+ if( maContent->IsTransparent() )
+ aAlpha.Replace( maContent->GetMask(), 255 );
+
+ // alpha-blend to output
+ rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize,
+ BitmapEx( maContent->GetBitmap(),
+ aAlpha ) );
}
rTargetSurface.Pop();
diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx
index d03afda37b2e..f853c44871e8 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -298,10 +298,10 @@ void PivotChartTest::testRoundtrip()
Reference<chart2::XChartDocument> xChartDoc;
std::vector<double> aReference1 { 10162.033139, 16614.523063, 27944.146101 };
- OUString aExpectedLabel1("Exp.");
+ OUString const aExpectedLabel1("Exp.");
std::vector<double> aReference2 { 101879.458079, 178636.929704, 314626.484864 };
- OUString aExpectedLabel2("Rev.");
+ OUString const aExpectedLabel2("Rev.");
load("/chart2/qa/extras/data/ods/", "PivotChartRoundTrip.ods");
@@ -384,7 +384,7 @@ void PivotChartTest::testChangePivotTable()
// Check first data series
{
std::vector<double> aReference { 10162.033139, 16614.523063, 27944.146101 };
- OUString aExpectedLabel("Exp.");
+ OUString const aExpectedLabel("Exp.");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -395,7 +395,7 @@ void PivotChartTest::testChangePivotTable()
// Check second data series
{
std::vector<double> aReference { 101879.458079, 178636.929704, 314626.484864 };
- OUString aExpectedLabel("Rev.");
+ OUString const aExpectedLabel("Rev.");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -420,7 +420,7 @@ void PivotChartTest::testChangePivotTable()
// Check the first data series
{
std::vector<double> aReference { 2855.559, 1780.326, 2208.713, 2130.064, 1187.371 };
- OUString aExpectedLabel("Big");
+ OUString const aExpectedLabel("Big");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
@@ -431,7 +431,7 @@ void PivotChartTest::testChangePivotTable()
// Check the second data series
{
std::vector<double> aReference { 4098.908, 2527.286, 4299.716, 2362.225, 3326.389 };
- OUString aExpectedLabel("Medium");
+ OUString const aExpectedLabel("Medium");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
@@ -442,7 +442,7 @@ void PivotChartTest::testChangePivotTable()
// Check the third data series
{
std::vector<double> aReference { 4926.303, 5684.060, 4201.398, 7290.795, 5841.591 };
- OUString aExpectedLabel("Small");
+ OUString const aExpectedLabel("Small");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 2)->getData();
lclCheckSequence(aReference, xSequence, 1E-3);
@@ -525,13 +525,12 @@ void PivotChartTest::testPivotChartWithOneColumnField()
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- sal_Int32 nSheetIndex = 0;
OUString sPivotTableName("DataPilotTable");
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(nSheetIndex, xSheetDoc);
+ xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
@@ -571,7 +570,7 @@ void PivotChartTest::testPivotChartWithOneColumnField()
// Check data series 1
{
std::vector<double> aReference { 1738.0 };
- OUString aExpectedLabel("DE");
+ OUString const aExpectedLabel("DE");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -582,7 +581,7 @@ void PivotChartTest::testPivotChartWithOneColumnField()
// Check data series 2
{
std::vector<double> aReference { 2003.0 };
- OUString aExpectedLabel("EN");
+ OUString const aExpectedLabel("EN");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 1)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -592,7 +591,7 @@ void PivotChartTest::testPivotChartWithOneColumnField()
// Check data series 3
{
std::vector<double> aReference { 1936.0 };
- OUString aExpectedLabel("FR");
+ OUString const aExpectedLabel("FR");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 2)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -613,13 +612,12 @@ void PivotChartTest::testPivotChartWithOneRowField()
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- sal_Int32 nSheetIndex = 0;
OUString sPivotTableName("DataPilotTable");
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(nSheetIndex, xSheetDoc);
+ xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
@@ -659,7 +657,7 @@ void PivotChartTest::testPivotChartWithOneRowField()
// Check data series 1
{
std::vector<double> aReference { 1738.0, 2003.0, 1936.0 };
- OUString aExpectedLabel("Total");
+ OUString const aExpectedLabel("Total");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -677,13 +675,12 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- sal_Int32 nSheetIndex = 0;
OUString sPivotTableName("DataPilotTable");
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(nSheetIndex, xSheetDoc);
+ xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
@@ -788,13 +785,12 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
uno::Reference<sheet::XSpreadsheetDocument> xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
- sal_Int32 nSheetIndex = 0;
OUString sPivotTableName("DataPilotTable");
table::CellRangeAddress sCellRangeAdress = lclCreateTestData(xSheetDoc);
uno::Reference<sheet::XDataPilotTables> xDataPilotTables;
- xDataPilotTables = lclGetDataPilotTables(nSheetIndex, xSheetDoc);
+ xDataPilotTables = lclGetDataPilotTables(0, xSheetDoc);
uno::Reference<sheet::XDataPilotDescriptor> xDataPilotDescriptor;
xDataPilotDescriptor = xDataPilotTables->createDataPilotDescriptor();
@@ -837,7 +833,7 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc));
{
std::vector<double> aReference { 1116.0, 622.0, 298.0, 562.0, 1143.0, 1168.0, 768.0 };
- OUString aExpectedLabel("Total");
+ OUString const aExpectedLabel("Total");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -870,7 +866,7 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc));
{
std::vector<double> aReference { 1116.0, 622.0, 298.0, 562.0, 1143.0, 1168.0, 768.0 };
- OUString aExpectedLabel("Total");
+ OUString const aExpectedLabel("Total");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
@@ -900,7 +896,7 @@ void PivotChartTest::testPivotChartRowFieldInOutlineMode()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getNumberOfDataSeries(xChartDoc));
{
std::vector<double> aReference { 1116.0, 622.0, 298.0, 562.0, 1143.0, 1168.0, 768.0 };
- OUString aExpectedLabel("Total");
+ OUString const aExpectedLabel("Total");
xSequence = getDataSequenceFromDocByRole(xChartDoc, "values-y", 0)->getData();
lclCheckSequence(aReference, xSequence, 1E-4);
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 5975c7a3cfa2..89ae67d570d6 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -799,7 +799,7 @@ void Chart2ExportTest::testDataLabelBordersDOCX()
{ 2, css::drawing::LineStyle_SOLID, 0x00FF0000 } // solid red
};
- for (size_t i = 0, n = SAL_N_ELEMENTS(aDataPoints); i < n; ++i)
+ for (size_t i = 0; i < SAL_N_ELEMENTS(aDataPoints); ++i)
{
xPropSet = xDataSeries->getDataPointByIndex(aDataPoints[i].mnIndex);
CPPUNIT_ASSERT(xPropSet.is());
diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
index 1f9b6b50aec3..a0f0987bf130 100644
--- a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
@@ -57,7 +57,7 @@ void ShapeParagraphDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
if (nId == m_nTabPageId)
{
SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
- TabulatorDisableFlags nFlags(( TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft ) |
+ TabulatorDisableFlags const nFlags(( TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft ) |
( TabulatorDisableFlags::FillMask &~TabulatorDisableFlags::FillNone ));
aSet.Put( SfxUInt16Item( SID_SVXTABULATORTABPAGE_DISABLEFLAGS, (sal_uInt16)nFlags) );
rPage.PageCreated( aSet );
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index c7bc939a0e07..102832e8300d 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -252,8 +252,8 @@ DataSourceTabPage::DataSourceTabPage(
m_pBTN_DOWN->SetControlFont( aSymbolFont );
// set button text
- sal_Unicode cBlackUpPointingTriangle( 0x25b2 );
- sal_Unicode cBlackDownPointingTriangle( 0x25bc );
+ sal_Unicode const cBlackUpPointingTriangle( 0x25b2 );
+ sal_Unicode const cBlackDownPointingTriangle( 0x25bc );
m_pBTN_UP->SetText( OUString( cBlackUpPointingTriangle ));
m_pBTN_DOWN->SetText( OUString( cBlackDownPointingTriangle ));
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index ff550d587ac1..a683b2892368 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -175,10 +175,9 @@ void DrawViewWrapper::SetMarkHandles(SfxViewShell* pOtherShell)
SdrObject* DrawViewWrapper::getHitObject( const Point& rPnt ) const
{
- SdrSearchOptions nOptions = SdrSearchOptions::DEEP | SdrSearchOptions::TESTMARKABLE;
-
- SdrPageView* pSdrPageView = this->GetPageView();
- SdrObject* pRet = this->SdrView::PickObj(rPnt, lcl_getHitTolerance( this->GetFirstOutputDevice() ), pSdrPageView, nOptions);
+ SdrPageView* pSdrPageView = GetPageView();
+ SdrObject* pRet = SdrView::PickObj(rPnt, lcl_getHitTolerance( GetFirstOutputDevice() ), pSdrPageView,
+ SdrSearchOptions::DEEP | SdrSearchOptions::TESTMARKABLE);
if( pRet )
{
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index ed48e382f06d..880dbe6e1d7d 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -422,8 +422,7 @@ OUString lcl_getGridCIDForCommand( const OString& rDispatchCommand, const uno::R
nDimensionIndex=2; bMainGrid=false;
}
- bool bMainAxis = true;
- uno::Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) );
+ uno::Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, true/*bMainAxis*/, xDiagram ) );
sal_Int32 nSubGridIndex= bMainGrid ? (-1) : 0;
OUString aCID( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGridIndex ) );
@@ -779,7 +778,7 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
pSymbolShapeProperties = new SfxItemSet( aSymbolItemConverter.CreateEmptyItemSet() );
aSymbolItemConverter.FillItemSet( *pSymbolShapeProperties );
- sal_Int32 nStandardSymbol=0;//@todo get from somewhere
+ sal_Int32 const nStandardSymbol=0;//@todo get from somewhere
Graphic* pAutoSymbolGraphic = new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, pSymbolShapeProperties ) );
// note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic
aDlg->setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic );
diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx b/chart2/source/controller/main/ChartDropTargetHelper.cxx
index deb3c2db2b04..9cd4f9a57a9c 100644
--- a/chart2/source/controller/main/ChartDropTargetHelper.cxx
+++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx
@@ -117,54 +117,50 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt )
if( xParentModel.is() &&
m_xChartDocument.is())
{
- bool bDataComesFromParent = true;
// @todo: get the title somehow and compare it to
// aDocName if successful (the document is the
// parent)
- if( bDataComesFromParent )
+ Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
+ Reference< chart2::data::XDataProvider > xDataProvider( m_xChartDocument->getDataProvider());
+ if( xDataProvider.is() && xDiagram.is() &&
+ DataSourceHelper::allArgumentsForRectRangeDetected( m_xChartDocument ))
{
- Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
- Reference< chart2::data::XDataProvider > xDataProvider( m_xChartDocument->getDataProvider());
- if( xDataProvider.is() && xDiagram.is() &&
- DataSourceHelper::allArgumentsForRectRangeDetected( m_xChartDocument ))
+ Reference< chart2::data::XDataSource > xDataSource(
+ DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
+ Sequence< beans::PropertyValue > aArguments(
+ xDataProvider->detectArguments( xDataSource ));
+
+ OUString aOldRange;
+ beans::PropertyValue * pCellRange = nullptr;
+ for( sal_Int32 i=0; i<aArguments.getLength(); ++i )
{
- Reference< chart2::data::XDataSource > xDataSource(
- DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
- Sequence< beans::PropertyValue > aArguments(
- xDataProvider->detectArguments( xDataSource ));
-
- OUString aOldRange;
- beans::PropertyValue * pCellRange = nullptr;
- for( sal_Int32 i=0; i<aArguments.getLength(); ++i )
+ if ( aArguments[i].Name == "CellRangeRepresentation" )
{
- if ( aArguments[i].Name == "CellRangeRepresentation" )
- {
- pCellRange = (aArguments.getArray() + i);
- aArguments[i].Value >>= aOldRange;
- break;
- }
+ pCellRange = (aArguments.getArray() + i);
+ aArguments[i].Value >>= aOldRange;
+ break;
}
- if( pCellRange )
+ }
+ if( pCellRange )
+ {
+ // copy means add ranges, move means replace
+ if( rEvt.mnAction == DND_ACTION_COPY )
+ {
+ // @todo: using implicit knowledge that ranges can be
+ // merged with ";". This should be done more general
+ pCellRange->Value <<= (aOldRange + ";" + aRangeString );
+ }
+ // move means replace range
+ else
{
- // copy means add ranges, move means replace
- if( rEvt.mnAction == DND_ACTION_COPY )
- {
- // @todo: using implicit knowledge that ranges can be
- // merged with ";". This should be done more general
- pCellRange->Value <<= (aOldRange + ";" + aRangeString );
- }
- // move means replace range
- else
- {
- pCellRange->Value <<= aRangeString;
- }
-
- xDataSource.set( xDataProvider->createDataSource( aArguments ));
- xDiagram->setDiagramData( xDataSource, aArguments );
-
- // always return copy state to avoid deletion of the dragged range
- nResult = DND_ACTION_COPY;
+ pCellRange->Value <<= aRangeString;
}
+
+ xDataSource.set( xDataProvider->createDataSource( aArguments ));
+ xDiagram->setDiagramData( xDataSource, aArguments );
+
+ // always return copy state to avoid deletion of the dragged range
+ nResult = DND_ACTION_COPY;
}
}
}
diff --git a/chart2/source/controller/main/ChartFrameloader.cxx b/chart2/source/controller/main/ChartFrameloader.cxx
index 8d153a1e07fe..8c48feddb2e7 100644
--- a/chart2/source/controller/main/ChartFrameloader.cxx
+++ b/chart2/source/controller/main/ChartFrameloader.cxx
@@ -169,8 +169,7 @@ sal_Bool SAL_CALL ChartFrameLoader::load( const uno::Sequence< beans::PropertyVa
if( xComponentWindow.is() && aMDHelper.ISSET_FilterName && aMDHelper.FilterName == "StarChart 5.0" )
{
awt::Rectangle aRect( xComponentWindow->getPosSize() );
- sal_Int16 nFlags=0;
- xComponentWindow->setPosSize( aRect.X, aRect.Y, aRect.Width, aRect.Height, nFlags );
+ xComponentWindow->setPosSize( aRect.X, aRect.Y, aRect.Width, aRect.Height, 0 );
}
}
}
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 4cfbd3a0f4a9..16c97974dcfb 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -527,10 +527,6 @@ void ControllerCommandDispatch::updateCommandAvailability()
// read-only
bool bIsWritable = bModelStateIsValid && (! m_apModelState->bIsReadOnly);
- // paste is available
- // @todo: determine correctly
- bool bHasSuitableClipboardContent = true;
-
bool bShapeContext = m_xChartController.is() && m_xChartController->isShapeContext();
bool bEnableDataTableDialog = false;
@@ -553,7 +549,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
// edit commands
m_aCommandAvailability[ ".uno:Cut" ] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsDeleteableObjectSelected;
m_aCommandAvailability[ ".uno:Copy" ] = bControllerStateIsValid && m_apControllerState->bHasSelectedObject;
- m_aCommandAvailability[ ".uno:Paste" ] = bIsWritable && bHasSuitableClipboardContent;
+ m_aCommandAvailability[ ".uno:Paste" ] = bIsWritable;
// toolbar commands
m_aCommandAvailability[ ".uno:ToggleGridHorizontal" ] = bIsWritable;
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 53929d720a81..9c328a0887de 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -443,9 +443,7 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
pDrawViewWrapper->GetCurrentObjIdentifier(), pPage );
if ( pObj )
{
- long nDefaultObjectSizeWidth = 4000;
- long nDefaultObjectSizeHeight = 2500;
- Size aObjectSize( nDefaultObjectSizeWidth, nDefaultObjectSizeHeight );
+ Size aObjectSize( 4000, 2500 );
tools::Rectangle aPageRect( tools::Rectangle( Point( 0, 0 ), pPage->GetSize() ) );
Point aObjectPos = aPageRect.Center();
aObjectPos.X() -= aObjectSize.Width() / 2;
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index b65e990841da..7889d679b107 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -410,7 +410,6 @@ void ImplObjectHierarchy::createDataSeriesTree(
try
{
- sal_Int32 nDiagramIndex = 0;
sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
Sequence< Reference< XCoordinateSystem > > aCooSysSeq(
xCooSysCnt->getCoordinateSystems());
@@ -430,7 +429,7 @@ void ImplObjectHierarchy::createDataSeriesTree(
{
OUString aSeriesParticle(
ObjectIdentifier::createParticleForSeries(
- nDiagramIndex, nCooSysIdx, nCTIdx, nSeriesIdx ));
+ 0, nCooSysIdx, nCTIdx, nSeriesIdx ));
ObjectIdentifier aSeriesOID(
ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForParticle( aSeriesParticle ) ) );
rOutDiagramSubContainer.push_back( aSeriesOID );
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 596e08fa8474..2ca53544e673 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -84,7 +84,6 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
"ChartPanelFactory::createUIElement called without valid ChartController",
nullptr);
- sal_Int32 nMinimumSize = -1;
VclPtr<vcl::Window> pPanel;
if (rsResourceURL.endsWith("/ElementsPanel"))
pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pController );
@@ -104,7 +103,7 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
rsResourceURL,
xFrame,
pPanel,
- css::ui::LayoutSize(nMinimumSize,-1,-1));
+ css::ui::LayoutSize(-1,-1,-1));
}
catch (const css::uno::RuntimeException &)
{
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 6ee81319f591..36241b580be8 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -132,11 +132,10 @@ bool isGridVisible(const css::uno::Reference<css::frame::XModel>& xModel, GridTy
sal_Int32 nDimensionIndex = 0;
if (eType == GridType::HOR_MAJOR || eType == GridType::HOR_MINOR)
nDimensionIndex = 1;
- sal_Int32 nCooSysIndex = 0;
bool bMajor = (eType == GridType::HOR_MAJOR || eType == GridType::VERT_MAJOR);
- bool bHasGrid = AxisHelper::isGridShown(nDimensionIndex, nCooSysIndex, bMajor, xDiagram);
+ bool bHasGrid = AxisHelper::isGridShown(nDimensionIndex, 0, bMajor, xDiagram);
return bHasGrid;
}
return false;
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index 1aaef1f5b1c2..a8edb72827bc 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -593,9 +593,8 @@ sal_Int32 XMLFilter::impl_Export(
comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) );
SvtSaveOptions aSaveOpt;
- OUString sUsePrettyPrinting( "UsePrettyPrinting" );
bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() );
- xInfoSet->setPropertyValue( sUsePrettyPrinting, uno::Any( bUsePrettyPrinting ) );
+ xInfoSet->setPropertyValue( "UsePrettyPrinting", uno::Any( bUsePrettyPrinting ) );
if( ! bOasis )
xInfoSet->setPropertyValue( "ExportTableNumberList", uno::Any( true ));
@@ -663,8 +662,6 @@ sal_Int32 XMLFilter::impl_ExportStream(
const Reference< lang::XMultiServiceFactory >& xServiceFactory,
const Sequence< uno::Any > & rFilterProperties )
{
- sal_Int32 nWarning = 0;
-
try
{
if( !xServiceFactory.is() )
@@ -723,7 +720,7 @@ sal_Int32 XMLFilter::impl_ExportStream(
{
ASSERT_EXCEPTION( rEx );
}
- return nWarning;
+ return 0;
}
void XMLFilter::isOasisFormat(const Sequence< beans::PropertyValue >& _rMediaDescriptor, bool & rOutOASIS )
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index bef84f2006b3..9aaf10fdd46e 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -632,26 +632,8 @@ void SAL_CALL ChartModel::close( sal_Bool bDeliverOwnership )
if( m_aLifeTimeManager.g_close_isNeedToCancelLongLastingCalls( bDeliverOwnership, aVetoException ) )
{
- ////you can empty this block, if you never start longlasting calls or
- ////if your longlasting calls are per default not cancelable (check how you have constructed your LifeTimeManager)
-
- bool bLongLastingCallsAreCanceled = false;
- try
- {
- //try to cancel running longlasting calls
- //// @todo
- }
- catch (const uno::Exception&)
- {
- //// @todo
- //do not throw anything here!! (without endTryClose)
- }
- //if not successful canceled
- if(!bLongLastingCallsAreCanceled)
- {
- m_aLifeTimeManager.g_close_endTryClose( bDeliverOwnership );
- throw aVetoException;
- }
+ m_aLifeTimeManager.g_close_endTryClose( bDeliverOwnership );
+ throw aVetoException;
}
}
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 7e42baa89628..8e9e02dfa2c1 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -683,8 +683,7 @@ void ChartTypeTemplate::createAxes(
//create missing axes
if( rCoordSys.getLength() > 0 )
{
- sal_Int32 nCooSysIdx = 0;
- Reference< XCoordinateSystem > xCooSys( rCoordSys[nCooSysIdx] );
+ Reference< XCoordinateSystem > xCooSys( rCoordSys[0] );
if(!xCooSys.is())
return;
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index 1c61f0004347..4cf0c415e207 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -326,8 +326,8 @@ sal_Bool SAL_CALL PieChartTypeTemplate::matchesTemplate(
//check offset of outer series
if( !aSeriesVec.empty() )
{
- sal_Int32 nOuterSeriesIndex = 0; //@todo in future this will depend on Orientation of the radius axis scale
- Reference< chart2::XDataSeries > xSeries( aSeriesVec[nOuterSeriesIndex] );
+ //@todo in future this will depend on Orientation of the radius axis scale
+ Reference< chart2::XDataSeries > xSeries( aSeriesVec[0] );
Reference< beans::XPropertySet > xProp( xSeries, uno::UNO_QUERY_THROW );
xProp->getPropertyValue( "Offset") >>= fOffset;
@@ -454,8 +454,7 @@ void SAL_CALL PieChartTypeTemplate::applyStyle(
bool bTemplateUsesRings = false;
getFastPropertyValue( PROP_PIE_TEMPLATE_USE_RINGS ) >>= bTemplateUsesRings;
- sal_Int32 nOuterSeriesIndex = 0; //@todo in future this will depend on Orientation of the radius axis scale
- if( nSeriesIndex == nOuterSeriesIndex )
+ if( nSeriesIndex == 0 ) //@todo in future this will depend on Orientation of the radius axis scale
{
const OUString aOffsetPropName( "Offset" );
// get offset mode
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index 0af1f26bb832..81c788846241 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -414,8 +414,7 @@ Reference< XAxis > AxisHelper::createAxis( sal_Int32 nDimensionIndex, bool bMain
return nullptr;
sal_Int32 nAxisIndex = bMainAxis ? MAIN_AXIS_INDEX : SECONDARY_AXIS_INDEX;
- sal_Int32 nCooSysIndex = 0;
- Reference< XCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, nCooSysIndex );
+ Reference< XCoordinateSystem > xCooSys = AxisHelper::getCoordinateSystemByIndex( xDiagram, 0 );
// create axis
return AxisHelper::createAxis(
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index d0d29a1c324e..ff2004b8c899 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -1049,9 +1049,8 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c
if( !( nType & util::NumberFormat::DATE ) )
{
//set a date format to the axis
- bool bCreate = true;
const LocaleDataWrapper& rLocaleDataWrapper = Application::GetSettings().GetLocaleDataWrapper();
- Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE, rLocaleDataWrapper.getLanguageTag().getLocale(), bCreate );
+ Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE, rLocaleDataWrapper.getLanguageTag().getLocale(), true/*bCreate*/ );
if( aKeySeq.getLength() )
{
xAxisProps->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any(aKeySeq[0]));
@@ -1154,9 +1153,8 @@ sal_Int32 DiagramHelper::getDateNumberFormat( const Reference< util::XNumberForm
Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
if( xNumberFormats.is() )
{
- bool bCreate = true;
Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE,
- rLanguageTag.getLocale(), bCreate );
+ rLanguageTag.getLocale(), true/*bCreate */);
if( aKeySeq.getLength() )
{
nRet = aKeySeq[0];
@@ -1201,9 +1199,8 @@ sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberF
Reference< util::XNumberFormats > xNumberFormats( xNumberFormatsSupplier->getNumberFormats() );
if( xNumberFormats.is() )
{
- bool bCreate = true;
Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::PERCENT,
- rLanguageTag.getLocale(), bCreate );
+ rLanguageTag.getLocale(), true/*bCreate*/ );
if( aKeySeq.getLength() )
{
nRet = aKeySeq[0];
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index fa77624adc44..dad11d5d573f 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -902,8 +902,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
if( nLevelCount == 1 )
{
- sal_Int32 nL=0;
- aResult = this->getDataByRangeRepresentation( lcl_aCategoriesLevelRangeNamePrefix + OUString::number( nL ) );
+ aResult = this->getDataByRangeRepresentation( lcl_aCategoriesLevelRangeNamePrefix + OUString::number( 0 ) );
}
else
{
diff --git a/chart2/source/tools/NumberFormatterWrapper.cxx b/chart2/source/tools/NumberFormatterWrapper.cxx
index 1151aa4aeaab..ead2d47e4cb4 100644
--- a/chart2/source/tools/NumberFormatterWrapper.cxx
+++ b/chart2/source/tools/NumberFormatterWrapper.cxx
@@ -70,8 +70,7 @@ NumberFormatterWrapper::~NumberFormatterWrapper()
Date NumberFormatterWrapper::getNullDate() const
{
- sal_uInt16 nYear = 1899,nDay = 30,nMonth = 12;
- Date aRet(nDay,nMonth,nYear);
+ Date aRet(30,12,1899);
util::Date aUtilDate;
if( m_aNullDate.hasValue() && (m_aNullDate >>= aUtilDate) )
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index 318cd63d71e7..203037658cd8 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -207,10 +207,9 @@ void RangeHighlighter::fillRangesForDataSeries( const uno::Reference< chart2::XD
Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
if( xSource.is())
{
- sal_Int32 nPreferredColor = defaultPreferredColor;
lcl_fillRanges( m_aSelectedRanges,
::chart::DataSourceHelper::getRangesFromDataSource( xSource ),
- nPreferredColor );
+ defaultPreferredColor );
}
}
@@ -238,10 +237,9 @@ void RangeHighlighter::fillRangesForErrorBars(
Reference< chart2::data::XDataSource > xSource( xErrorBar, uno::UNO_QUERY );
if( xSource.is())
{
- sal_Int32 nPreferredColor = defaultPreferredColor;
lcl_fillRanges( m_aSelectedRanges,
::chart::DataSourceHelper::getRangesFromDataSource( xSource ),
- nPreferredColor );
+ defaultPreferredColor );
}
}
else
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index e235c5a8e701..fc985293ea20 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -283,8 +283,7 @@ uno::Reference< XTitle > TitleHelper::createTitle(
|| (!bIsVertical && eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE)
|| (bIsVertical && eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE) )
{
- double fNewAngleDegree = 90.0;
- xTitleProps->setPropertyValue( "TextRotation", uno::Any( fNewAngleDegree ));
+ xTitleProps->setPropertyValue( "TextRotation", uno::Any( 90.0 ));
}
}
}
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx
index 35a9855a472f..f791d065a126 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -42,7 +42,7 @@ AxisLabelAlignment::AxisLabelAlignment() :
sal_Int32 lcl_calcTickLengthForDepth(sal_Int32 nDepth,sal_Int32 nTickmarkStyle)
{
- sal_Int32 nWidth = AXIS2D_TICKLENGTH; //@maybefuturetodo this length could be offered by the model
+ sal_Int32 const nWidth = AXIS2D_TICKLENGTH; //@maybefuturetodo this length could be offered by the model
double fPercent = 1.0;
switch(nDepth)
{
@@ -145,9 +145,8 @@ TickmarkProperties AxisProperties::makeTickmarkPropertiesForComplexCategories(
TickmarkProperties AxisProperties::getBiggestTickmarkProperties()
{
TickmarkProperties aTickmarkProperties;
- sal_Int32 nDepth = 0;
sal_Int32 nTickmarkStyle = 3;//inner and outer tickmarks
- aTickmarkProperties.Length = lcl_calcTickLengthForDepth( nDepth,nTickmarkStyle );
+ aTickmarkProperties.Length = lcl_calcTickLengthForDepth( 0/*nDepth*/,nTickmarkStyle );
aTickmarkProperties.RelativePos = static_cast<sal_Int32>( lcl_getTickOffset( aTickmarkProperties.Length, nTickmarkStyle ) );
return aTickmarkProperties;
}
diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx
index 9186a4643c6b..8d58afb19212 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.cxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.cxx
@@ -53,7 +53,6 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
, double fLogicRadius
, double fLogicZ )
{
- sal_Int32 nDimensionCount = 2;
AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory);
FixedNumberFormatter aFixedNumberFormatter(
@@ -116,7 +115,7 @@ bool VPolarAngleAxis::createTextShapes_ForAngleAxis(
double fLogicAngle = pTickInfo->getUnscaledTickValue();
LabelAlignment eLabelAlignment(LABEL_ALIGN_CENTER);
- PolarLabelPositionHelper aPolarLabelPositionHelper(m_pPosHelper.get(), nDimensionCount, xTarget, pShapeFactory);
+ PolarLabelPositionHelper aPolarLabelPositionHelper(m_pPosHelper.get(), 2/*nDimensionCount*/, xTarget, pShapeFactory);
sal_Int32 nScreenValueOffsetInRadiusDirection = m_aAxisLabelProperties.m_aMaximumSpaceForLabels.Height/15;
awt::Point aAnchorScreenPosition2D( aPolarLabelPositionHelper.getLabelScreenPositionAndAlignmentForLogicValues(
eLabelAlignment, fLogicAngle, fLogicRadius, fLogicZ, nScreenValueOffsetInRadiusDirection ));
@@ -177,7 +176,7 @@ void VPolarAngleAxis::createLabels()
AxisLabelProperties aAxisLabelProperties( m_aAxisLabelProperties );
aAxisLabelProperties.bOverlapAllowed = true;
- double fLogicZ = 1.0;//as defined
+ double const fLogicZ = 1.0;//as defined
while( !createTextShapes_ForAngleAxis( m_xTextTarget, aTickIter
, aAxisLabelProperties
, fLogicRadius, fLogicZ
@@ -195,7 +194,7 @@ void VPolarAngleAxis::createShapes()
return;
double fLogicRadius = m_pPosHelper->getOuterLogicRadius();
- double fLogicZ = 1.0;//as defined
+ double const fLogicZ = 1.0;//as defined
//create axis main lines
drawing::PointSequenceSequence aPoints(1);
diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx
index 856bd3197bd2..54e8f7b357a4 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -201,7 +201,7 @@ void VPolarGrid::create2DRadiusGrid( const Reference< drawing::XShapes >& xLogic
//xxxxx rTickInfo.updateUnscaledValue( xInverseRadiusScaling );
double fLogicRadius = rTickInfo.getUnscaledTickValue();
- double fLogicZ = 1.0;//as defined
+ double const fLogicZ = 1.0;//as defined
drawing::PointSequenceSequence aPoints(1);
VPolarGrid::createLinePointSequence_ForAngleAxis( aPoints, rAngleTickInfos
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
index 6adbe3b51649..c02766421adf 100644
--- a/chart2/source/view/charttypes/BubbleChart.cxx
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -68,9 +68,8 @@ void BubbleChart::calculateMaximumLogicBubbleSize()
{
double fMaxSize = 0.0;
- sal_Int32 nStartIndex = 0;
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
- for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
+ for( sal_Int32 nIndex = 0; nIndex < nEndIndex; nIndex++ )
{
std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
@@ -196,7 +195,7 @@ void BubbleChart::createShapes()
//update/create information for current group
double fLogicZ = 1.0;//as defined
- sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale
+ sal_Int32 const nStartIndex = 0; // inclusive ;..todo get somehow from x scale
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
if(nEndIndex<=0)
nEndIndex=1;
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index 58e0f3aac533..969fcb4550b8 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -133,11 +133,10 @@ void CandleStickChart::createShapes()
}
//(@todo maybe different iteration for breaks in axis ?)
- sal_Int32 nStartIndex = 0;
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
double fLogicZ = 1.5;//as defined
//iterate through all x values per indices
- for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
+ for( sal_Int32 nIndex = 0; nIndex < nEndIndex; nIndex++ )
{
std::vector< std::vector< VDataSeriesGroup > >::iterator aZSlotIter = m_aZSlots.begin();
const std::vector< std::vector< VDataSeriesGroup > >::const_iterator aZSlotEnd = m_aZSlots.end();
diff --git a/chart2/source/view/charttypes/NetChart.cxx b/chart2/source/view/charttypes/NetChart.cxx
index 33e55df482c1..648df7e12dde 100644
--- a/chart2/source/view/charttypes/NetChart.cxx
+++ b/chart2/source/view/charttypes/NetChart.cxx
@@ -359,7 +359,7 @@ void NetChart::createShapes()
//update/create information for current group
double fLogicZ = 1.0;//as defined
- sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale
+ sal_Int32 const nStartIndex = 0; // inclusive ;..todo get somehow from x scale
sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
if(nEndIndex<=0)
nEndIndex=1;
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index b52016fcfe61..2ab8946f28c4 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -132,7 +132,6 @@ bool PiePositionHelper::getInnerAndOuterRadius( double fCategoryX
if( !bUseRings )
fCategoryX = 1.0;
- bool bIsVisible = true;
double fLogicInner = fCategoryX -0.5+m_fRingDistance/2.0;
double fLogicOuter = fCategoryX +0.5-m_fRingDistance/2.0;
@@ -158,7 +157,7 @@ bool PiePositionHelper::getInnerAndOuterRadius( double fCategoryX
fLogicOuterRadius = fLogicOuter;
if( !isMathematicalOrientationRadius() )
std::swap(fLogicInnerRadius,fLogicOuterRadius);
- return bIsVisible;
+ return true;
}
PieChart::PieChart( const uno::Reference<XChartType>& xChartTypeModel
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 7cb1192aa3ff..570dd20f9011 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -446,7 +446,6 @@ VCoordinateSystem* addCooSysToList( std::vector< VCoordinateSystem* >& rVCooSysL
void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
ChartModel& rChartModel )
{
- sal_Int32 nDiagramIndex = 0;//todo if more than one diagram is supported
uno::Reference< XDiagram > xDiagram( rChartModel.getFirstDiagram() );
if( !xDiagram.is())
return;
@@ -580,7 +579,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
pSeries->setMissingValueTreatment( nMissingValueTreatment );
- OUString aSeriesParticle( ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCS, nT, nS ) );
+ OUString aSeriesParticle( ObjectIdentifier::createParticleForSeries( 0, nCS, nT, nS ) );
pSeries->setParticle(aSeriesParticle);
OUString aRole( ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( xChartType ) );
@@ -2366,18 +2365,15 @@ std::shared_ptr<VTitle> lcl_createTitle( TitleHelper::eTitleType eType
sal_Int32 nYDistance = static_cast< sal_Int32 >( rPageSize.Height * fPercentage );
if ( eType == TitleHelper::MAIN_TITLE )
{
- sal_Int32 nYOffset = 135; // 1/100 mm
- nYDistance += nYOffset;
+ nYDistance += 135; // 1/100 mm
}
else if ( eType == TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION )
{
- sal_Int32 nYOffset = 420; // 1/100 mm
- nYDistance = nYOffset;
+ nYDistance = 420; // 1/100 mm
}
else if ( eType == TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION )
{
- sal_Int32 nXOffset = 450; // 1/100 mm
- nXDistance = nXOffset;
+ nXDistance = 450; // 1/100 mm
}
uno::Reference< XTitle > xTitle( TitleHelper::getTitle( eType, rModel ) );
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index cb2cda88d83a..59d25e3989b1 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -426,16 +426,10 @@ uno::Reference< drawing::XShape >
}
//fill some more shape properties into the ValueMap
- {
- drawing::TextHorizontalAdjust eHorizontalAdjust = drawing::TextHorizontalAdjust_CENTER;
- drawing::TextVerticalAdjust eVerticalAdjust = drawing::TextVerticalAdjust_CENTER;
-
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::Any(eHorizontalAdjust) ) ); // drawing::TextHorizontalAdjust
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::Any(eVerticalAdjust) ) ); //drawing::TextVerticalAdjust
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::Any(true) ) ); // sal_Bool
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::Any(true) ) ); // sal_Bool
-
- }
+ aValueMap.insert( { "TextHorizontalAdjust", uno::Any(drawing::TextHorizontalAdjust_CENTER) } );
+ aValueMap.insert( { "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) } );
+ aValueMap.insert( { "TextAutoGrowHeight", uno::Any(true) } );
+ aValueMap.insert( { "TextAutoGrowWidth", uno::Any(true) } );
//set global title properties
tNameSequence aPropNames;
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index 9eeed05c303f..58f62548d6e0 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -640,9 +640,8 @@ uno::Reference<drawing::XShape>
try
{
//PercentDiagonal
- sal_Int16 nPercentDiagonal = 5;
xProp->setPropertyValue( UNO_NAME_3D_PERCENT_DIAGONAL
- , uno::Any( nPercentDiagonal ) );
+ , uno::Any( sal_Int16(5) ) );
//Polygon
sal_Int32 nVerticalSegmentCount = 0;
@@ -938,9 +937,8 @@ uno::Reference< drawing::XShape >
, uno::Any((sal_Int32)fDepth) );
//PercentDiagonal
- sal_Int16 nPercentDiagonal = 0;
xProp->setPropertyValue( UNO_NAME_3D_PERCENT_DIAGONAL
- , uno::Any( nPercentDiagonal ) );
+ , uno::Any( sal_Int16(0) ) );
//Polygon
drawing::PolyPolygonShape3D aPoly( BezierToPoly(aCoords) );
@@ -1063,9 +1061,8 @@ uno::Reference< drawing::XShape >
, uno::Any((sal_Int32)fDepth) );
//PercentDiagonal
- sal_Int16 nPercentDiagonal = 0;
xProp->setPropertyValue( UNO_NAME_3D_PERCENT_DIAGONAL
- , uno::Any( nPercentDiagonal ) );
+ , uno::Any( sal_Int16(0) ) );
//Polygon
xProp->setPropertyValue( UNO_NAME_3D_POLYPOLYGON3D
@@ -1859,9 +1856,7 @@ uno::Reference< drawing::XShape >
{
try
{
- drawing::CircleKind eKind = drawing::CircleKind_FULL;
- xProp->setPropertyValue( UNO_NAME_CIRCKIND
- , uno::Any( eKind ) );
+ xProp->setPropertyValue( UNO_NAME_CIRCKIND, uno::Any( drawing::CircleKind_FULL ) );
}
catch( const uno::Exception& e )
{
@@ -2279,13 +2274,10 @@ uno::Reference< drawing::XShape >
//fill some more shape properties into the ValueMap
{
- drawing::TextHorizontalAdjust eHorizontalAdjust = drawing::TextHorizontalAdjust_CENTER;
- drawing::TextVerticalAdjust eVerticalAdjust = drawing::TextVerticalAdjust_CENTER;
-
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::Any(eHorizontalAdjust) ) ); // drawing::TextHorizontalAdjust
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::Any(eVerticalAdjust) ) ); //drawing::TextVerticalAdjust
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::Any(true) ) ); // sal_Bool
- aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::Any(true) ) ); // sal_Bool
+ aValueMap.insert( { "TextHorizontalAdjust", uno::Any(drawing::TextHorizontalAdjust_CENTER) } ); // drawing::TextHorizontalAdjust
+ aValueMap.insert( { "TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_CENTER) } ); //drawing::TextVerticalAdjust
+ aValueMap.insert( { "TextAutoGrowHeight", uno::Any(true) } ); // sal_Bool
+ aValueMap.insert( { "TextAutoGrowWidth", uno::Any(true) } ); // sal_Bool
//set name/classified ObjectID (CID)
if( !aName.isEmpty() )
@@ -2371,10 +2363,8 @@ uno::Reference< drawing::XShape >
if ( xShapeProp.is() && ( xShapeProp->getPropertyValue( "CharHeight" ) >>= fFontHeight ) )
{
fFontHeight *= ( 2540.0f / 72.0f ); // pt -> 1/100 mm
- float fXFraction = 0.18f;
- sal_Int32 nXDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * fXFraction ) );
- float fYFraction = 0.30f;
- sal_Int32 nYDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * fYFraction ) );
+ sal_Int32 nXDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * 0.18f ) );
+ sal_Int32 nYDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * 0.30f ) );
xShapeProp->setPropertyValue( "TextLeftDistance", uno::Any( nXDistance ) );
xShapeProp->setPropertyValue( "TextRightDistance", uno::Any( nXDistance ) );
xShapeProp->setPropertyValue( "TextUpperDistance", uno::Any( nYDistance ) );
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index a402473dd38a..c6590b4729bf 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -759,8 +759,7 @@ double VDataSeries::getXMeanValue() const
uno::Reference< XRegressionCurveCalculator > xCalculator( RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( "com.sun.star.chart2.MeanValueRegressionCurve" ) );
uno::Sequence< double > aXValuesDummy;
xCalculator->recalculateRegression( aXValuesDummy, getAllX() );
- double fXDummy = 1.0;
- m_fXMeanValue = xCalculator->getCurveValue( fXDummy );
+ m_fXMeanValue = xCalculator->getCurveValue( 1.0 );
}
return m_fXMeanValue;
}
@@ -773,8 +772,7 @@ double VDataSeries::getYMeanValue() const
RegressionCurveHelper::createRegressionCurveCalculatorByServiceName("com.sun.star.chart2.MeanValueRegressionCurve"));
uno::Sequence< double > aXValuesDummy;
xCalculator->recalculateRegression( aXValuesDummy, getAllY() );
- double fXDummy = 1.0;
- m_fYMeanValue = xCalculator->getCurveValue( fXDummy );
+ m_fYMeanValue = xCalculator->getCurveValue( 1.0 );
}
return m_fYMeanValue;
}
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index 4790dec34763..6ded0aae091a 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -111,10 +111,9 @@ void lcl_getProperties(
::chart::tPropertyNameValueMap aTextValueMap;
::chart::PropertyMapper::getValueMap( aTextValueMap, ::chart::PropertyMapper::getPropertyNameMapForCharacterProperties(), xLegendProp );
- drawing::TextHorizontalAdjust eHorizAdjust( drawing::TextHorizontalAdjust_LEFT );
aTextValueMap[ "TextAutoGrowHeight" ] <<= true;
aTextValueMap[ "TextAutoGrowWidth" ] <<= true;
- aTextValueMap[ "TextHorizontalAdjust" ] <<= eHorizAdjust;
+ aTextValueMap[ "TextHorizontalAdjust" ] <<= drawing::TextHorizontalAdjust_LEFT;
aTextValueMap[ "TextMaximumFrameWidth" ] <<= rReferenceSize.Width; //needs to be overwritten by actual available space in the legend
// recalculate font size
More information about the Libreoffice-commits
mailing list