summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-12 16:39:03 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-18 07:37:31 +0000
commit789055bc2acb4c71483fd60ea258d158bd5aec10 (patch)
tree7849de841a71f667a30b2a971ad0c3d406110396 /vcl
parent150ac9cf05ed9da6a2af5bc3f820280fd853e519 (diff)
clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/edit.cxx2
-rw-r--r--vcl/source/control/field2.cxx5
-rw-r--r--vcl/source/filter/graphicfilter.cxx9
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx2
-rw-r--r--vcl/source/font/fontcache.cxx2
-rw-r--r--vcl/source/gdi/salgdilayout.cxx12
-rw-r--r--vcl/source/outdev/map.cxx4
-rw-r--r--vcl/source/outdev/mask.cxx2
-rw-r--r--vcl/source/outdev/polygon.cxx2
9 files changed, 17 insertions, 23 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 91f620080269..9fda579dda51 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -402,7 +402,7 @@ void Edit::ApplySettings(vcl::RenderContext& rRenderContext)
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
- vcl::Font aFont = rStyleSettings.GetFieldFont();
+ const vcl::Font& aFont = rStyleSettings.GetFieldFont();
ApplyControlFont(rRenderContext, aFont);
ImplClearLayoutData();
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 24158a92a6e6..b3e7c8fb0534 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -227,7 +227,6 @@ static OUString ImplPatternReformat( const OUString& rStr,
if (rEditMask.isEmpty())
return rStr;
- OUString aStr = rStr;
OUStringBuffer aOutStr = OUString(rLiteralMask);
sal_Unicode cTempChar;
sal_Unicode cChar;
@@ -239,10 +238,10 @@ static OUString ImplPatternReformat( const OUString& rStr,
while ( i < rEditMask.getLength() )
{
- if ( nStrIndex >= aStr.getLength() )
+ if ( nStrIndex >= rStr.getLength() )
break;
- cChar = aStr[nStrIndex];
+ cChar = rStr[nStrIndex];
cLiteral = rLiteralMask[i];
cMask = rEditMask[i];
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index e025f4829aa9..6f0bff7b02a1 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -2039,7 +2039,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString
bool bDone(false);
// do we have a native SVG RenderGraphic, whose data can be written directly?
- const SvgDataPtr aSvgDataPtr(rGraphic.getSvgData());
+ const SvgDataPtr& aSvgDataPtr(rGraphic.getSvgData());
if (aSvgDataPtr.get() && aSvgDataPtr->getSvgDataArrayLength())
{
@@ -2110,12 +2110,11 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString
osl::Module aLibrary( aPhysicalName );
PFilterCall pFunc = nullptr;
- OUString tmpFilterName = aExternalFilterName;
- if (tmpFilterName == "egi")
+ if (aExternalFilterName == "egi")
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("egiGraphicExport"));
- else if (tmpFilterName == "eps")
+ else if (aExternalFilterName == "eps")
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("epsGraphicExport"));
- else if (tmpFilterName == "eti")
+ else if (aExternalFilterName == "eti")
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("etiGraphicExport"));
// Execute dialog in DLL
#else
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 7f33702e1838..6accc01300d8 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -504,7 +504,7 @@ void EMFWriter::ImplCheckTextAttr()
if( mbTextChanged && ImplPrepareHandleSelect( mnTextHandle, TEXT_SELECT ) )
{
const vcl::Font& rFont = maVDev->GetFont();
- OUString aFontName( rFont.GetFamilyName() );
+ const OUString& aFontName( rFont.GetFamilyName() );
sal_Int32 nWeight;
sal_uInt16 i;
sal_uInt8 nPitchAndFamily;
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index b3e8971da2ad..f0e0dbf9ff27 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -109,7 +109,7 @@ ImplFontCache::~ImplFontCache()
LogicalFontInstance* ImplFontCache::GetFontInstance( PhysicalFontCollection* pFontList,
const vcl::Font& rFont, const Size& rSize, float fExactHeight )
{
- OUString aSearchName = rFont.GetFamilyName();
+ const OUString& aSearchName = rFont.GetFamilyName();
// initialize internal font request object
FontSelectPattern aFontSelData( rFont, aSearchName, rSize, fExactHeight );
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index d8abefa6d93c..8244e023c4c2 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -758,15 +758,11 @@ bool SalGraphics::DrawTransformedBitmap(
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
- basegfx::B2DPoint aNull(rNull);
- basegfx::B2DPoint aX(rX);
- basegfx::B2DPoint aY(rY);
+ mirror(rNull, pOutDev);
+ mirror(rX, pOutDev);
+ mirror(rY, pOutDev);
- mirror(aNull, pOutDev);
- mirror(aX, pOutDev);
- mirror(aY, pOutDev);
-
- return drawTransformedBitmap(aNull, aX, aY, rSourceBitmap, pAlphaBitmap);
+ return drawTransformedBitmap(rNull, rX, rY, rSourceBitmap, pAlphaBitmap);
}
else
{
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 6b3ce3e0c6da..950a08898852 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -241,8 +241,8 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
break;
}
- Fraction aScaleX = rMapMode.GetScaleX();
- Fraction aScaleY = rMapMode.GetScaleY();
+ const Fraction& aScaleX = rMapMode.GetScaleX();
+ const Fraction& aScaleY = rMapMode.GetScaleY();
// set offset according to MapMode
Point aOrigin = rMapMode.GetOrigin();
diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx
index 5c8409c4c82c..eaa9ac060fa5 100644
--- a/vcl/source/outdev/mask.cxx
+++ b/vcl/source/outdev/mask.cxx
@@ -106,7 +106,7 @@ void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
{
assert(!is_double_buffered_window());
- std::shared_ptr<ImpBitmap> xImpBmp = rMask.ImplGetImpBitmap();
+ const std::shared_ptr<ImpBitmap>& xImpBmp = rMask.ImplGetImpBitmap();
if (xImpBmp)
{
SalTwoRect aPosAry(rSrcPtPixel.X(), rSrcPtPixel.Y(), rSrcSizePixel.Width(), rSrcSizePixel.Height(),
diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index 1ca1d87b706b..0f36e30a8e00 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -112,7 +112,7 @@ void OutputDevice::DrawPolyPolygon( const tools::PolyPolygon& rPolyPoly )
if ( nPoly == 1 )
{
// #100127# Map to DrawPolygon
- tools::Polygon aPoly = rPolyPoly.GetObject( 0 );
+ const tools::Polygon& aPoly = rPolyPoly.GetObject( 0 );
if( aPoly.GetSize() >= 2 )
{
GDIMetaFile* pOldMF = mpMetaFile;