Kaydet (Commit) 1a284d1f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constantparam in c*

Change-Id: I10c7b62e6458062324367b94b207f776af79f598
Reviewed-on: https://gerrit.libreoffice.org/44129Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 8c9b5a90
......@@ -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();
......
......@@ -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 )
......
......@@ -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()
......
......@@ -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
{
......
......@@ -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 );
......
......@@ -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 ||
......
......@@ -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*/);
}
}
......
......@@ -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
{
......
......@@ -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;
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment