summaryrefslogtreecommitdiff
path: root/svtools/source/graphic
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 /svtools/source/graphic
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 'svtools/source/graphic')
-rw-r--r--svtools/source/graphic/grfcache.cxx2
-rw-r--r--svtools/source/graphic/grfmgr.cxx8
-rw-r--r--svtools/source/graphic/grfmgr2.cxx13
3 files changed, 11 insertions, 12 deletions
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index a9fd3386460b..10432aff3e6e 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -516,7 +516,7 @@ bool GraphicDisplayCacheEntry::IsCacheableAsBitmap( const GDIMetaFile& rMtf,
bool bNonBitmapActionEncountered(false);
if( aNewSize.Width() && aNewSize.Height() && rSz.Width() && rSz.Height() )
{
- const MapMode rPrefMapMode( rMtf.GetPrefMapMode() );
+ const MapMode& rPrefMapMode( rMtf.GetPrefMapMode() );
const Size rSizePix( pOut->LogicToPixel( aNewSize, rPrefMapMode ) );
sal_uInt32 nCurPos;
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index c148e8b86b7a..064b77a15666 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -1092,8 +1092,8 @@ IMPL_LINK_NOARG_TYPED(GraphicObject, ImplAutoSwapOutHdl, Timer *, void)
GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL )
{
- const OUString aURL( rURL ), aPrefix( UNO_NAME_GRAPHOBJ_URLPREFIX );
- if( aURL.startsWith( aPrefix ) )
+ const OUString aPrefix( UNO_NAME_GRAPHOBJ_URLPREFIX );
+ if( rURL.startsWith( aPrefix ) )
{
// graphic manager url
OString aUniqueID(OUStringToOString(rURL.copy(sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX) - 1), RTL_TEXTENCODING_UTF8));
@@ -1102,9 +1102,9 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const OUString &rURL )
else
{
Graphic aGraphic;
- if ( !aURL.isEmpty() )
+ if ( !rURL.isEmpty() )
{
- std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aURL, StreamMode::READ ));
+ std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( rURL, StreamMode::READ ));
if( pStream )
GraphicConverter::Import( *pStream, aGraphic );
}
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 8e3dd65c4e42..dca98660e3bb 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -902,7 +902,6 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
if( aUnrotatedSizePix.Width() && aUnrotatedSizePix.Height() )
{
- BitmapEx aBmpEx( rBitmapEx );
BitmapEx aOutBmpEx;
Point aOutPoint;
Size aOutSize;
@@ -961,14 +960,14 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
{
if( bSimple )
{
- bRet = ( aOutBmpEx = aBmpEx ).Scale( aUnrotatedSizePix );
+ bRet = ( aOutBmpEx = rBitmapEx ).Scale( aUnrotatedSizePix );
if( bRet )
aOutBmpEx.Rotate( nRot10, COL_TRANSPARENT );
}
else
{
- bRet = ImplCreateRotatedScaled( aBmpEx, rAttributes,
+ bRet = ImplCreateRotatedScaled( rBitmapEx, rAttributes,
nRot10, aUnrotatedSizePix,
nStartX, nEndX, nStartY, nEndY,
aOutBmpEx );
@@ -980,18 +979,18 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOutputDevice,
{
aOutPoint = pOutputDevice->PixelToLogic( aOutputPointPix );
aOutSize = pOutputDevice->PixelToLogic( aOutputSizePix );
- aOutBmpEx = aBmpEx;
+ aOutBmpEx = rBitmapEx;
bRet = true;
}
else
{
if( bSimple )
{
- bRet = ( aOutBmpEx = aBmpEx ).Scale( Size( nEndX - nStartX + 1, nEndY - nStartY + 1 ) );
+ bRet = ( aOutBmpEx = rBitmapEx ).Scale( Size( nEndX - nStartX + 1, nEndY - nStartY + 1 ) );
}
else
{
- bRet = ImplCreateRotatedScaled( aBmpEx, rAttributes,
+ bRet = ImplCreateRotatedScaled( rBitmapEx, rAttributes,
nRot10, aUnrotatedSizePix,
nStartX, nEndX, nStartY, nEndY,
aOutBmpEx );
@@ -1111,7 +1110,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
const double fScaleX = fOutWH / fGrfWH;
const double fScaleY = 1.0;
- const MapMode rPrefMapMode( rMtf.GetPrefMapMode() );
+ const MapMode& rPrefMapMode( rMtf.GetPrefMapMode() );
const Size rSizePix( pOut->LogicToPixel( aNewSize, rPrefMapMode ) );
// NOTE: If you do changes in this function, check GraphicDisplayCacheEntry::IsCacheableAsBitmap