summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-09 10:11:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-09 12:41:09 +0000
commit5a308b1239a09417507b0d05090ff2d3418d5133 (patch)
tree990fa9015a4107e4916691eb4dee80fa5713e96b /chart2
parentc1a227600d0b16df283162d24f1a31f5c9cee474 (diff)
V801: Decreased performance
Change-Id: Iba139ede7bd72e23c0b7a28a8a4ff38ea816725a
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/Splines.cxx12
-rw-r--r--chart2/source/view/inc/VLegendSymbolFactory.hxx2
-rw-r--r--chart2/source/view/main/VLegend.cxx16
-rw-r--r--chart2/source/view/main/VLegendSymbolFactory.cxx6
4 files changed, 18 insertions, 18 deletions
diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx
index 9cba39150873..c8427a58970b 100644
--- a/chart2/source/view/charttypes/Splines.cxx
+++ b/chart2/source/view/charttypes/Splines.cxx
@@ -407,11 +407,11 @@ double lcl_SplineCalculation::GetInterpolatedValue( double x )
// helper methods for B-spline
// Create parameter t_0 to t_n using the centripetal method with a power of 0.5
-bool createParameterT(const tPointVecType aUniquePoints, double* t)
+bool createParameterT(const tPointVecType& rUniquePoints, double* t)
{ // precondition: no adjacent identical points
// postcondition: 0 = t_0 < t_1 < ... < t_n = 1
bool bIsSuccessful = true;
- const lcl_tSizeType n = aUniquePoints.size() - 1;
+ const lcl_tSizeType n = rUniquePoints.size() - 1;
t[0]=0.0;
double dx = 0.0;
double dy = 0.0;
@@ -419,8 +419,8 @@ bool createParameterT(const tPointVecType aUniquePoints, double* t)
double fDenominator = 0.0; // initialized for summing up
for (lcl_tSizeType i=1; i<=n ; ++i)
{ // 4th root(dx^2+dy^2)
- dx = aUniquePoints[i].first - aUniquePoints[i-1].first;
- dy = aUniquePoints[i].second - aUniquePoints[i-1].second;
+ dx = rUniquePoints[i].first - rUniquePoints[i-1].first;
+ dy = rUniquePoints[i].second - rUniquePoints[i-1].second;
// scaling to avoid underflow or overflow
fDiffMax = (fabs(dx)>fabs(dy)) ? fabs(dx) : fabs(dy);
if (fDiffMax == 0.0)
@@ -446,8 +446,8 @@ bool createParameterT(const tPointVecType aUniquePoints, double* t)
double fNumerator = 0.0;
for (lcl_tSizeType i=1; i<=j ; ++i)
{
- dx = aUniquePoints[i].first - aUniquePoints[i-1].first;
- dy = aUniquePoints[i].second - aUniquePoints[i-1].second;
+ dx = rUniquePoints[i].first - rUniquePoints[i-1].first;
+ dy = rUniquePoints[i].second - rUniquePoints[i-1].second;
fDiffMax = (fabs(dx)>fabs(dy)) ? fabs(dx) : fabs(dy);
// same as above, so should not be zero
dx /= fDiffMax;
diff --git a/chart2/source/view/inc/VLegendSymbolFactory.hxx b/chart2/source/view/inc/VLegendSymbolFactory.hxx
index 4342d2cf64a0..463b68b8294f 100644
--- a/chart2/source/view/inc/VLegendSymbolFactory.hxx
+++ b/chart2/source/view/inc/VLegendSymbolFactory.hxx
@@ -43,7 +43,7 @@ namespace VLegendSymbolFactory
createSymbol(
const ::com::sun::star::awt::Size& rEntryKeyAspectRatio,
const ::com::sun::star::uno::Reference<
- ::com::sun::star::drawing::XShapes > xSymbolContainer,
+ ::com::sun::star::drawing::XShapes >& rSymbolContainer,
LegendSymbolStyle eStyle,
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory > & xShapeFactory,
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index acf9b48803bd..b7838f422e58 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -194,13 +194,13 @@ awt::Size lcl_createTextShapes(
return aResult;
}
-void lcl_collectColumnWidths( std::vector< sal_Int32 >& rColumnWidths, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns
- , const ::std::vector< Reference< drawing::XShape > > aTextShapes, sal_Int32 nSymbolPlusDistanceWidth )
+void lcl_collectColumnWidths( std::vector< sal_Int32 >& rColumnWidths, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns,
+ const ::std::vector< Reference< drawing::XShape > >& rTextShapes, sal_Int32 nSymbolPlusDistanceWidth )
{
rColumnWidths.clear();
sal_Int32 nRow = 0;
sal_Int32 nColumn = 0;
- sal_Int32 nNumberOfEntries = aTextShapes.size();
+ sal_Int32 nNumberOfEntries = rTextShapes.size();
for( ; nRow < nNumberOfRows; ++nRow )
{
for( nColumn = 0; nColumn < nNumberOfColumns; ++nColumn )
@@ -208,7 +208,7 @@ void lcl_collectColumnWidths( std::vector< sal_Int32 >& rColumnWidths, const sal
sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
if( nEntry < nNumberOfEntries )
{
- awt::Size aTextSize( aTextShapes[ nEntry ]->getSize() );
+ awt::Size aTextSize( rTextShapes[ nEntry ]->getSize() );
sal_Int32 nWidth = nSymbolPlusDistanceWidth + aTextSize.Width;
if( nRow==0 )
rColumnWidths.push_back( nWidth );
@@ -219,15 +219,15 @@ void lcl_collectColumnWidths( std::vector< sal_Int32 >& rColumnWidths, const sal
}
}
-void lcl_collectRowHeighs( std::vector< sal_Int32 >& rRowHeights, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns
- , const ::std::vector< Reference< drawing::XShape > > aTextShapes )
+void lcl_collectRowHeighs( std::vector< sal_Int32 >& rRowHeights, const sal_Int32 nNumberOfRows, const sal_Int32 nNumberOfColumns,
+ const ::std::vector< Reference< drawing::XShape > >& rTextShapes )
{
// calculate maximum height for each row
// and collect column widths
rRowHeights.clear();
sal_Int32 nRow = 0;
sal_Int32 nColumn = 0;
- sal_Int32 nNumberOfEntries = aTextShapes.size();
+ sal_Int32 nNumberOfEntries = rTextShapes.size();
for( ; nRow < nNumberOfRows; ++nRow )
{
sal_Int32 nCurrentRowHeight = 0;
@@ -236,7 +236,7 @@ void lcl_collectRowHeighs( std::vector< sal_Int32 >& rRowHeights, const sal_Int3
sal_Int32 nEntry = (nColumn + nRow * nNumberOfColumns);
if( nEntry < nNumberOfEntries )
{
- awt::Size aTextSize( aTextShapes[ nEntry ]->getSize() );
+ awt::Size aTextSize( rTextShapes[ nEntry ]->getSize() );
nCurrentRowHeight = ::std::max( nCurrentRowHeight, aTextSize.Height );
}
}
diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx
index cd3fb817ed93..aff64eb1531a 100644
--- a/chart2/source/view/main/VLegendSymbolFactory.cxx
+++ b/chart2/source/view/main/VLegendSymbolFactory.cxx
@@ -99,7 +99,7 @@ namespace chart
Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
const awt::Size& rEntryKeyAspectRatio,
- const Reference< drawing::XShapes > xSymbolContainer,
+ const Reference< drawing::XShapes >& rSymbolContainer,
LegendSymbolStyle eStyle,
const Reference< lang::XMultiServiceFactory > & xShapeFactory,
const Reference< beans::XPropertySet > & xLegendEntryProperties,
@@ -107,11 +107,11 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol(
{
Reference< drawing::XShape > xResult;
- if( ! (xSymbolContainer.is() && xShapeFactory.is()))
+ if( ! (rSymbolContainer.is() && xShapeFactory.is()))
return xResult;
AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(xShapeFactory);
- xResult.set( pShapeFactory->createGroup2D( xSymbolContainer ), uno::UNO_QUERY );
+ xResult.set( pShapeFactory->createGroup2D( rSymbolContainer ), uno::UNO_QUERY );
Reference< drawing::XShapes > xResultGroup( xResult, uno::UNO_QUERY );
if( ! xResultGroup.is())