summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-06 08:50:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-06 09:54:25 +0200
commit24eae7bd702f3f6dd790be7ac38ac16e9fe6a375 (patch)
tree56398264184709e84517c2e843aa3a0894cc1c51 /vcl
parentfad919eb0d30b2303193e1c00ba765514957652c (diff)
clang-tidy performance-unnecessary-value-param
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/backendtest/VisualBackendTest.cxx3
-rw-r--r--vcl/inc/opengl/LineRenderUtils.hxx9
-rw-r--r--vcl/inc/unx/cpdmgr.hxx4
-rw-r--r--vcl/opengl/LineRenderUtils.cxx9
-rw-r--r--vcl/source/app/salvtables.cxx3
-rw-r--r--vcl/source/control/listctrl.cxx2
-rw-r--r--vcl/source/font/Feature.cxx5
-rw-r--r--vcl/source/gdi/gdimtf.cxx6
-rw-r--r--vcl/source/gdi/print3.cxx2
-rw-r--r--vcl/unx/generic/printer/cpdmgr.cxx6
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx24
11 files changed, 42 insertions, 31 deletions
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx
index c8a029474ae1..c2231b66a2ad 100644
--- a/vcl/backendtest/VisualBackendTest.cxx
+++ b/vcl/backendtest/VisualBackendTest.cxx
@@ -51,7 +51,8 @@
using namespace css;
-void drawBitmapCentered(tools::Rectangle const & rRect, Bitmap aBitmap, vcl::RenderContext& rRenderContext)
+void drawBitmapCentered(tools::Rectangle const& rRect, const Bitmap& aBitmap,
+ vcl::RenderContext& rRenderContext)
{
long nWidth = rRect.GetWidth();
long nHeight = rRect.GetHeight();
diff --git a/vcl/inc/opengl/LineRenderUtils.hxx b/vcl/inc/opengl/LineRenderUtils.hxx
index 1fa4e785d5fe..eec665f68edb 100644
--- a/vcl/inc/opengl/LineRenderUtils.hxx
+++ b/vcl/inc/opengl/LineRenderUtils.hxx
@@ -39,9 +39,12 @@ public:
void appendAndConnectLinePoint(const glm::vec2& rPoint, const glm::vec2& aNormal, GLfloat aExtrusion);
- void appendMiterJoint(glm::vec2 const & point, glm::vec2 prevLineVector, glm::vec2 const & nextLineVector);
- void appendBevelJoint(glm::vec2 const & point, glm::vec2 prevLineVector, glm::vec2 nextLineVector);
- void appendRoundJoint(glm::vec2 const & point, glm::vec2 prevLineVector, glm::vec2 nextLineVector);
+ void appendMiterJoint(glm::vec2 const& point, const glm::vec2& prevLineVector,
+ glm::vec2 const& nextLineVector);
+ void appendBevelJoint(glm::vec2 const& point, const glm::vec2& prevLineVector,
+ const glm::vec2& nextLineVector);
+ void appendRoundJoint(glm::vec2 const& point, const glm::vec2& prevLineVector,
+ const glm::vec2& nextLineVector);
void appendRoundLineCapVertices(const glm::vec2& rPoint1, const glm::vec2& rPoint2);
void appendSquareLineCapVertices(const glm::vec2& rPoint1, const glm::vec2& rPoint2);
};
diff --git a/vcl/inc/unx/cpdmgr.hxx b/vcl/inc/unx/cpdmgr.hxx
index 12d6603bfc09..a9caaead9942 100644
--- a/vcl/inc/unx/cpdmgr.hxx
+++ b/vcl/inc/unx/cpdmgr.hxx
@@ -96,9 +96,9 @@ class CPDManager : public PrinterInfoManager
public:
#if ENABLE_DBUS && ENABLE_GIO
// Functions involved in initialization
- GDBusProxy * getProxy( std::string target );
+ GDBusProxy* getProxy(const std::string& target);
void addBackend( std::pair< std::string, GDBusProxy * > pair );
- void addTempBackend( std::pair< std::string, gchar* > pair );
+ void addTempBackend(const std::pair<std::string, gchar*>& pair);
std::vector<std::pair<std::string, gchar*>> const & getTempBackends();
void addNewPrinter( const OUString&, const OUString&, CPDPrinter * );
#endif
diff --git a/vcl/opengl/LineRenderUtils.cxx b/vcl/opengl/LineRenderUtils.cxx
index 6ba78048b9e0..e62d884b3b6e 100644
--- a/vcl/opengl/LineRenderUtils.cxx
+++ b/vcl/opengl/LineRenderUtils.cxx
@@ -93,7 +93,8 @@ void LineBuilder::appendAndConnectLinePoint(const glm::vec2& rPoint, const glm::
}
}
-void LineBuilder::appendMiterJoint(glm::vec2 const & point, glm::vec2 prevLineVector, glm::vec2 const & nextLineVector)
+void LineBuilder::appendMiterJoint(glm::vec2 const& point, const glm::vec2& prevLineVector,
+ glm::vec2 const& nextLineVector)
{
// With miter join we calculate the extrusion vector by adding normals of
// previous and next line segment. The vector shows the way but we also
@@ -111,7 +112,8 @@ void LineBuilder::appendMiterJoint(glm::vec2 const & point, glm::vec2 prevLineVe
appendAndConnectLinePoint(point, extrusionVector, length);
}
-void LineBuilder::appendBevelJoint(glm::vec2 const & point, glm::vec2 prevLineVector, glm::vec2 nextLineVector)
+void LineBuilder::appendBevelJoint(glm::vec2 const& point, const glm::vec2& prevLineVector,
+ const glm::vec2& nextLineVector)
{
// For bevel join we just add 2 additional vertices and use previous
// line segment normal and next line segment normal as extrusion vector.
@@ -125,7 +127,8 @@ void LineBuilder::appendBevelJoint(glm::vec2 const & point, glm::vec2 prevLineVe
appendAndConnectLinePoint(point, nextNormal, 1.0f);
}
-void LineBuilder::appendRoundJoint(glm::vec2 const & point, glm::vec2 prevLineVector, glm::vec2 nextLineVector)
+void LineBuilder::appendRoundJoint(glm::vec2 const& point, const glm::vec2& prevLineVector,
+ const glm::vec2& nextLineVector)
{
// For round join we do a similar thing as in bevel, we add more intermediate
// vertices and add normals to get extrusion vectors in the between the
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index a65a973958dc..2d7b54bfbdca 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -32,6 +32,7 @@
#include <svdata.hxx>
#include <messagedialog.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
+#include <utility>
#include <vcl/builder.hxx>
#include <vcl/combobox.hxx>
#include <vcl/lstbox.hxx>
@@ -1875,7 +1876,7 @@ public:
, m_xDrawingArea(pDrawingArea)
{
m_xDrawingArea->SetAccessible(rAlly);
- m_xDrawingArea->SetUITestFactory(pUITestFactoryFunction, pUserData);
+ m_xDrawingArea->SetUITestFactory(std::move(pUITestFactoryFunction), pUserData);
m_xDrawingArea->SetPaintHdl(LINK(this, SalInstanceDrawingArea, PaintHdl));
m_xDrawingArea->SetResizeHdl(LINK(this, SalInstanceDrawingArea, ResizeHdl));
m_xDrawingArea->SetMousePressHdl(LINK(this, SalInstanceDrawingArea, MousePressHdl));
diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx
index 97c16db80492..73c6b43c555d 100644
--- a/vcl/source/control/listctrl.cxx
+++ b/vcl/source/control/listctrl.cxx
@@ -124,7 +124,7 @@ IMPL_LINK_NOARG( ListControl, ScrollHdl, ScrollBar*, void )
DoScroll(mpScrollBar->GetDelta());
}
-void ListControl::addEntry(VclPtr<Window> xEntry, sal_uInt32 nPos)
+void ListControl::addEntry(const VclPtr<Window>& xEntry, sal_uInt32 nPos)
{
xEntry->Show();
if (nPos < maEntries.size())
diff --git a/vcl/source/font/Feature.cxx b/vcl/source/font/Feature.cxx
index 7569467704ad..07810c1b011b 100644
--- a/vcl/source/font/Feature.cxx
+++ b/vcl/source/font/Feature.cxx
@@ -8,6 +8,7 @@
*
*/
+#include <utility>
#include <vcl/font/Feature.hxx>
#include <strings.hrc>
#include <svdata.hxx>
@@ -44,7 +45,7 @@ Feature::Feature(FeatureID const& rID, FeatureType eType)
FeatureParameter::FeatureParameter(sal_uInt32 nCode, OUString aDescription)
: m_nCode(nCode)
- , m_sDescription(aDescription)
+ , m_sDescription(std::move(aDescription))
, m_pDescriptionID(nullptr)
{
}
@@ -103,7 +104,7 @@ FeatureDefinition::FeatureDefinition(sal_uInt32 nCode, const char* pDescriptionI
: m_nCode(nCode)
, m_pDescriptionID(pDescriptionID)
, m_eType(FeatureParameterType::ENUM)
- , m_aEnumParameters(aEnumParameters)
+ , m_aEnumParameters(std::move(aEnumParameters))
{
}
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 2c6a981d1542..046f0b888bc4 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -543,7 +543,7 @@ void GDIMetaFile::WindPrev()
--m_nCurrentActionElement;
}
-void GDIMetaFile::AddAction( rtl::Reference<MetaAction> pAction )
+void GDIMetaFile::AddAction(const rtl::Reference<MetaAction>& pAction)
{
m_aList.push_back( pAction );
@@ -553,7 +553,7 @@ void GDIMetaFile::AddAction( rtl::Reference<MetaAction> pAction )
}
}
-void GDIMetaFile::AddAction( rtl::Reference<MetaAction> pAction, size_t nPos )
+void GDIMetaFile::AddAction(const rtl::Reference<MetaAction>& pAction, size_t nPos)
{
if ( nPos < m_aList.size() )
{
@@ -570,7 +570,7 @@ void GDIMetaFile::AddAction( rtl::Reference<MetaAction> pAction, size_t nPos )
}
}
-void GDIMetaFile::push_back( rtl::Reference<MetaAction> pAction )
+void GDIMetaFile::push_back(const rtl::Reference<MetaAction>& pAction)
{
m_aList.push_back( pAction );
}
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index bcffc811fc67..4a7da7d9e7d3 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -507,7 +507,7 @@ bool Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
return true;
}
-bool Printer::ExecutePrintJob(std::shared_ptr<PrinterController> xController)
+bool Printer::ExecutePrintJob(const std::shared_ptr<PrinterController>& xController)
{
OUString aJobName;
css::beans::PropertyValue* pJobNameVal = xController->getValue( OUString( "JobName" ) );
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx
index d69b0bea726e..356f943b62dc 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -170,7 +170,8 @@ void CPDManager::printerRemoved (GDBusConnection *,
pManager->m_aPrinters.erase(printersIt);
}
-GDBusProxy * CPDManager::getProxy(std::string target) {
+GDBusProxy* CPDManager::getProxy(const std::string& target)
+{
std::unordered_map<std::string, GDBusProxy *>::const_iterator it = m_pBackends.find(target);
if (it == m_pBackends.end()) {
return nullptr;
@@ -182,7 +183,8 @@ void CPDManager::addBackend(std::pair<std::string, GDBusProxy *> pair) {
m_pBackends.insert(pair);
}
-void CPDManager::addTempBackend(std::pair<std::string, gchar*> pair) {
+void CPDManager::addTempBackend(const std::pair<std::string, gchar*>& pair)
+{
m_tBackends.push_back(pair);
}
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index c453f3dc91fc..dd259fdf3e8b 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -585,18 +585,18 @@ const PPDParser* PPDParser::getParser( const OUString& rFile )
return pNewParser;
}
-PPDParser::PPDParser( const OUString& rFile, std::vector<PPDKey*> keys) :
- m_aFile( rFile ),
- m_bColorDevice( false ),
- m_bType42Capable( false ),
- m_nLanguageLevel( 0 ),
- m_aFileEncoding( RTL_TEXTENCODING_MS_1252 ),
- m_pImageableAreas( nullptr ),
- m_pDefaultPaperDimension( nullptr ),
- m_pPaperDimensions( nullptr ),
- m_pDefaultInputSlot( nullptr ),
- m_pDefaultResolution( nullptr ),
- m_pTranslator( new PPDTranslator() )
+PPDParser::PPDParser(const OUString& rFile, const std::vector<PPDKey*>& keys)
+ : m_aFile(rFile)
+ , m_bColorDevice(false)
+ , m_bType42Capable(false)
+ , m_nLanguageLevel(0)
+ , m_aFileEncoding(RTL_TEXTENCODING_MS_1252)
+ , m_pImageableAreas(nullptr)
+ , m_pDefaultPaperDimension(nullptr)
+ , m_pPaperDimensions(nullptr)
+ , m_pDefaultInputSlot(nullptr)
+ , m_pDefaultResolution(nullptr)
+ , m_pTranslator(new PPDTranslator())
{
for (auto & key: keys)
{