summaryrefslogtreecommitdiff
path: root/svtools
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
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')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx3
-rw-r--r--svtools/source/graphic/grfcache.cxx2
-rw-r--r--svtools/source/graphic/grfmgr.cxx8
-rw-r--r--svtools/source/graphic/grfmgr2.cxx13
-rw-r--r--svtools/source/misc/templatefoldercache.cxx2
-rw-r--r--svtools/source/misc/transfer2.cxx3
-rw-r--r--svtools/source/uno/unoevent.cxx6
7 files changed, 17 insertions, 20 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index a1dfe8588dbe..5b6229d6d33a 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -505,7 +505,6 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const OUString& rTitle )
BrowserColumn *pCol = (*pCols)[ nItemPos ];
if ( pCol->Title() != rTitle )
{
- OUString sNew(rTitle);
OUString sOld(pCol->Title());
pCol->Title() = rTitle;
@@ -524,7 +523,7 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const OUString& rTitle )
if ( isAccessibleAlive() )
{
commitTableEvent( TABLE_COLUMN_DESCRIPTION_CHANGED,
- makeAny( sNew ),
+ makeAny( rTitle ),
makeAny( sOld )
);
}
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
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 7157e0933885..b9ca359dd8ea 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -637,7 +637,7 @@ namespace svt
// the template directories from the config
const SvtPathOptions aPathOptions;
- OUString aDirs = aPathOptions.GetTemplatePath();
+ const OUString& aDirs = aPathOptions.GetTemplatePath();
// loop through all the root-level template folders
sal_Int32 nIndex = 0;
diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx
index 6288f8ef808e..263f8e253d5a 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -491,8 +491,7 @@ void TransferDataContainer::CopyString( SotClipboardFormatId nFmt, const OUStrin
{
TDataCntnrEntry_Impl aEntry;
aEntry.nId = nFmt;
- OUString aStr( rStr );
- aEntry.aAny <<= aStr;
+ aEntry.aAny <<= rStr;
pImpl->aFmtList.push_back( aEntry );
AddFormat( aEntry.nId );
}
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 4b62d2d98655..7cc356abd861 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -70,7 +70,7 @@ void getAnyFromMacro(Any& rAny, const SvxMacro& rMacro)
// macro name
PropertyValue aNameValue;
aNameValue.Name = sMacroName;
- OUString sNameTmp(rMacro.GetMacName());
+ const OUString& sNameTmp(rMacro.GetMacName());
aTmp <<= sNameTmp;
aNameValue.Value = aTmp;
aSequence[1] = aNameValue;
@@ -78,7 +78,7 @@ void getAnyFromMacro(Any& rAny, const SvxMacro& rMacro)
// library name
PropertyValue aLibValue;
aLibValue.Name = sLibrary;
- OUString sLibTmp(rMacro.GetLibName());
+ const OUString& sLibTmp(rMacro.GetLibName());
aTmp <<= sLibTmp;
aLibValue.Value = aTmp;
aSequence[2] = aLibValue;
@@ -103,7 +103,7 @@ void getAnyFromMacro(Any& rAny, const SvxMacro& rMacro)
// macro name
PropertyValue aNameValue;
aNameValue.Name = sScript;
- OUString sNameTmp(rMacro.GetMacName());
+ const OUString& sNameTmp(rMacro.GetMacName());
aTmp <<= sNameTmp;
aNameValue.Value = aTmp;
aSequence[1] = aNameValue;