summaryrefslogtreecommitdiff
path: root/chart2/source/view
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view')
-rw-r--r--chart2/source/view/axes/VAxisProperties.cxx5
-rw-r--r--chart2/source/view/axes/VPolarAngleAxis.cxx7
-rw-r--r--chart2/source/view/axes/VPolarGrid.cxx2
-rw-r--r--chart2/source/view/charttypes/BubbleChart.cxx5
-rw-r--r--chart2/source/view/charttypes/CandleStickChart.cxx3
-rw-r--r--chart2/source/view/charttypes/NetChart.cxx2
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx3
-rw-r--r--chart2/source/view/main/ChartView.cxx12
-rw-r--r--chart2/source/view/main/OpenglShapeFactory.cxx14
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx30
-rw-r--r--chart2/source/view/main/VDataSeries.cxx6
-rw-r--r--chart2/source/view/main/VLegend.cxx3
12 files changed, 32 insertions, 60 deletions
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