summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 15:26:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-01 07:13:02 +0100
commit1a284d1f98069f55d5211882431f516691c2a6f0 (patch)
treee1f8d14a6499c928f1612361a3f296542f670f80
parent8c9b5a901dcbb430bbf225ed0a2d7a286b1d5185 (diff)
loplugin:constantparam in c*
Change-Id: I10c7b62e6458062324367b94b207f776af79f598 Reviewed-on: https://gerrit.libreoffice.org/44129 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--canvas/source/opengl/ogl_spritedevicehelper.cxx8
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx13
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx26
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx2
-rw-r--r--chart2/source/inc/TitleHelper.hxx3
-rw-r--r--chart2/source/tools/StatisticsHelper.cxx12
-rw-r--r--chart2/source/tools/TitleHelper.cxx5
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx11
-rw-r--r--codemaker/source/codemaker/global.cxx8
-rw-r--r--include/codemaker/global.hxx3
10 files changed, 29 insertions, 62 deletions
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index 1c2a0525c9f4..46535fc9a409 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -52,7 +52,7 @@ static void initContext()
glShadeModel(GL_FLAT);
}
-static void initTransformation(const ::Size& rSize, bool bMirror)
+static void initTransformation(const ::Size& rSize)
{
// use whole window
glViewport( 0,0,
@@ -62,9 +62,9 @@ static void initTransformation(const ::Size& rSize, bool bMirror)
// model coordinate system is already in device pixel
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glTranslated(-1.0, (bMirror ? -1.0 : 1.0), 0.0);
+ glTranslated(-1.0, 1.0, 0.0);
glScaled( 2.0 / rSize.Width(),
- (bMirror ? 2.0 : -2.0) / rSize.Height(),
+ -2.0 / rSize.Height(),
1.0 );
// clear to black
@@ -281,7 +281,7 @@ namespace oglcanvas
SystemChildWindow* pChildWindow = mxContext->getChildWindow();
const ::Size& rOutputSize = pChildWindow->GetSizePixel();
- initTransformation(rOutputSize, false);
+ initTransformation(rOutputSize);
// render the actual spritecanvas content
mpSpriteCanvas->renderRecordedActions();
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 0452aca5fcd9..631f0f154458 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -488,9 +488,8 @@ namespace vclcanvas
const ::canvas::ParametricPolyPolygon::Values& rValues,
const std::vector< ::Color >& rColors,
const ::basegfx::B2DHomMatrix& rTextureTransform,
- const ::tools::Rectangle& rBounds,
- unsigned int nStepCount,
- bool bFillNonOverlapping )
+ const ::tools::Rectangle& rBounds,
+ unsigned int nStepCount )
{
switch( rValues.meType )
{
@@ -510,7 +509,7 @@ namespace vclcanvas
rTextureTransform,
rBounds,
nStepCount,
- bFillNonOverlapping,
+ false/*bFillNonOverlapping*/,
rValues,
rColors );
break;
@@ -585,8 +584,7 @@ namespace vclcanvas
rColors,
aTotalTransform,
aPolygonDeviceRectOrig,
- nStepCount,
- false );
+ nStepCount );
rOutDev.Pop();
if( p2ndOutDev && nTransparency < 253 )
@@ -611,8 +609,7 @@ namespace vclcanvas
rColors,
aTotalTransform,
aPolygonDeviceRectOrig,
- nStepCount,
- false );
+ nStepCount );
rOutDev.Pop();
if( p2ndOutDev && nTransparency < 253 )
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index 2efc9f77db44..752908ec9c89 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -67,7 +67,7 @@ struct lcl_ChartTypeToSeriesCnt
}
};
-OUString lcl_ConvertRole( const OUString & rRoleString, bool bFromInternalToUI )
+OUString lcl_ConvertRole( const OUString & rRoleString )
{
OUString aResult( rRoleString );
@@ -95,27 +95,11 @@ OUString lcl_ConvertRole( const OUString & rRoleString, bool bFromInternalToUI )
aTranslationMap[ "BorderColor" ] = ::chart::SchResId( STR_PROPERTY_ROLE_BORDERCOLOR );
}
- if( bFromInternalToUI )
+ tTranslationMap::const_iterator aIt( aTranslationMap.find( rRoleString ));
+ if( aIt != aTranslationMap.end())
{
- tTranslationMap::const_iterator aIt( aTranslationMap.find( rRoleString ));
- if( aIt != aTranslationMap.end())
- {
- aResult = (*aIt).second;
- }
- }
- else
- {
- tTranslationMap::const_iterator aIt(
- std::find_if( aTranslationMap.begin(), aTranslationMap.end(),
- [&rRoleString]
- ( const tTranslationMap::value_type& cp )
- { return rRoleString == cp.second; } )
- );
-
- if( aIt != aTranslationMap.end())
- aResult = (*aIt).first;
+ aResult = (*aIt).second;
}
-
return aResult;
}
@@ -750,7 +734,7 @@ void DialogModel::setTimeBasedRange( bool bTimeBased, sal_Int32 nStart, sal_Int3
OUString DialogModel::ConvertRoleFromInternalToUI( const OUString & rRoleString )
{
- return lcl_ConvertRole( rRoleString, true );
+ return lcl_ConvertRole( rRoleString );
}
OUString DialogModel::GetRoleDataLabel()
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 9863b538c073..7f2a471ce0f7 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -589,7 +589,7 @@ void ChartElementsPanel::setTitleVisible(TitleHelper::eTitleType eTitle, bool bV
if (bVisible)
{
OUString aText = eTitle == TitleHelper::SUB_TITLE ? maTextSubTitle : maTextTitle;
- TitleHelper::createOrShowTitle(eTitle, aText, mxModel, comphelper::getProcessComponentContext(), nullptr);
+ TitleHelper::createOrShowTitle(eTitle, aText, mxModel, comphelper::getProcessComponentContext());
}
else
{
diff --git a/chart2/source/inc/TitleHelper.hxx b/chart2/source/inc/TitleHelper.hxx
index 933e13a0e986..17f89136d609 100644
--- a/chart2/source/inc/TitleHelper.hxx
+++ b/chart2/source/inc/TitleHelper.hxx
@@ -71,8 +71,7 @@ public:
createOrShowTitle( eTitleType nTitleIndex
, const OUString& rTitleText
, const css::uno::Reference< css::frame::XModel >& xModel
- , const css::uno::Reference< css::uno::XComponentContext > & xContext
- , ReferenceSizeProvider * pRefSizeProvider );
+ , const css::uno::Reference< css::uno::XComponentContext > & xContex );
static void removeTitle( eTitleType nTitleIndex
, const css::uno::Reference< css::frame::XModel >& xModel );
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 52c11cd539c6..bef8c11a49e7 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -39,8 +39,7 @@ using namespace ::com::sun::star;
namespace
{
-double lcl_getVariance( const Sequence< double > & rData, sal_Int32 & rOutValidCount,
- bool bUnbiasedEstimator )
+double lcl_getVariance( const Sequence< double > & rData, sal_Int32 & rOutValidCount )
{
const sal_Int32 nCount = rData.getLength();
rOutValidCount = nCount;
@@ -66,10 +65,7 @@ double lcl_getVariance( const Sequence< double > & rData, sal_Int32 & rOutValidC
else
{
const double fN = static_cast< double >( rOutValidCount );
- if( bUnbiasedEstimator )
- fResult = (fQuadSum - fSum*fSum/fN) / (fN - 1);
- else
- fResult = (fQuadSum - fSum*fSum/fN) / fN;
+ fResult = (fQuadSum - fSum*fSum/fN) / fN;
}
return fResult;
@@ -170,7 +166,7 @@ double StatisticsHelper::getVariance(
const Sequence< double > & rData )
{
sal_Int32 nValCount;
- return lcl_getVariance( rData, nValCount, false/*bUnbiasedEstimator*/ );
+ return lcl_getVariance( rData, nValCount );
}
double StatisticsHelper::getStandardDeviation( const Sequence< double > & rData )
@@ -185,7 +181,7 @@ double StatisticsHelper::getStandardDeviation( const Sequence< double > & rData
double StatisticsHelper::getStandardError( const Sequence< double > & rData )
{
sal_Int32 nValCount;
- double fVar = lcl_getVariance( rData, nValCount, false );
+ double fVar = lcl_getVariance( rData, nValCount );
double fResult;
if( nValCount == 0 ||
diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx
index 8becf46b9473..1720c50da77d 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -174,8 +174,7 @@ uno::Reference< XTitle > TitleHelper::createOrShowTitle(
TitleHelper::eTitleType eTitleType
, const OUString& rTitleText
, const uno::Reference< frame::XModel >& xModel
- , const uno::Reference< uno::XComponentContext > & xContext
- , ReferenceSizeProvider * pRefSizeProvider )
+ , const uno::Reference< uno::XComponentContext > & xContext )
{
uno::Reference< chart2::XTitle > xTitled( TitleHelper::getTitle( eTitleType, xModel ) );
if( xTitled.is())
@@ -186,7 +185,7 @@ uno::Reference< XTitle > TitleHelper::createOrShowTitle(
}
else
{
- return createTitle(eTitleType, rTitleText, xModel, xContext, pRefSizeProvider);
+ return createTitle(eTitleType, rTitleText, xModel, xContext, nullptr/*pRefSizeProvider*/);
}
}
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 5487365c5f79..c35e3cb262c6 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -844,13 +844,12 @@ void lcl_AddErrorBottomLine( const drawing::Position3D& rPosition, ::basegfx::B2
}
drawing::Position3D lcl_transformMixedToScene( PlottingPositionHelper const * pPosHelper
- , double fX /*scaled*/, double fY /*unscaled*/, double fZ /*unscaled*/, bool bClip )
+ , double fX /*scaled*/, double fY /*unscaled*/, double fZ /*unscaled*/ )
{
if(!pPosHelper)
return drawing::Position3D(0,0,0);
pPosHelper->doLogicScaling( nullptr,&fY,&fZ );
- if(bClip)
- pPosHelper->clipScaledLogicValues( &fX,&fY,&fZ );
+ pPosHelper->clipScaledLogicValues( &fX,&fY,&fZ );
return pPosHelper->transformScaledLogicToScene( fX, fY, fZ, false );
}
@@ -912,7 +911,7 @@ void VSeriesPlotter::createErrorBar(
else
m_pPosHelper->doLogicScaling( &fScaledX, nullptr, nullptr );
- aMiddle = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fY, fZ, true );
+ aMiddle = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fY, fZ );
drawing::Position3D aNegative(aMiddle);
drawing::Position3D aPositive(aMiddle);
@@ -929,7 +928,7 @@ void VSeriesPlotter::createErrorBar(
if( bYError )
{
fLocalY+=fLength;
- aPositive = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ, true );
+ aPositive = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ );
}
else
{
@@ -952,7 +951,7 @@ void VSeriesPlotter::createErrorBar(
if( bYError )
{
fLocalY-=fLength;
- aNegative = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ, true );
+ aNegative = lcl_transformMixedToScene( m_pPosHelper, fScaledX, fLocalY, fZ );
}
else
{
diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx
index 5529dc08308d..a2da02595b9b 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -62,16 +62,10 @@ OString getTempDir(const OString& sFileName)
OString createFileNameFromType( const OString& destination,
const OString& typeName,
- const OString& postfix,
- bool bLowerCase )
+ const OString& postfix )
{
OString type(typeName.replace('.', '/'));
- if (bLowerCase)
- {
- type = typeName.toAsciiLowerCase();
- }
-
sal_uInt32 length = destination.getLength();
bool bWithPoint = false;
diff --git a/include/codemaker/global.hxx b/include/codemaker/global.hxx
index e26fba3d97d4..d453a0e0b59c 100644
--- a/include/codemaker/global.hxx
+++ b/include/codemaker/global.hxx
@@ -73,8 +73,7 @@ private:
::rtl::OString createFileNameFromType(const ::rtl::OString& destination,
const ::rtl::OString& type,
- const ::rtl::OString& postfix,
- bool bLowerCase=false);
+ const ::rtl::OString& postfix);
bool fileExists(const ::rtl::OString& fileName);
bool makeValidTypeFile(const ::rtl::OString& targetFileName,