diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-12 16:39:03 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-18 07:37:31 +0000 |
commit | 789055bc2acb4c71483fd60ea258d158bd5aec10 (patch) | |
tree | 7849de841a71f667a30b2a971ad0c3d406110396 /sc/source/ui/unoobj/afmtuno.cxx | |
parent | 150ac9cf05ed9da6a2af5bc3f820280fd853e519 (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 'sc/source/ui/unoobj/afmtuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/afmtuno.cxx | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index 0bd1abeb64b3..8f044626cc51 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -191,10 +191,9 @@ ScAutoFormatObj* ScAutoFormatsObj::GetObjectByIndex_Impl(sal_uInt16 nIndex) ScAutoFormatObj* ScAutoFormatsObj::GetObjectByName_Impl(const OUString& aName) { - OUString aString(aName); sal_uInt16 nIndex; if (lcl_FindAutoFormatIndex( - *ScGlobal::GetOrCreateAutoFormat(), aString, nIndex )) + *ScGlobal::GetOrCreateAutoFormat(), aName, nIndex )) return GetObjectByIndex_Impl(nIndex); return nullptr; } @@ -215,14 +214,13 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const OUString& aName, const uno:: ScAutoFormatObj* pFormatObj = ScAutoFormatObj::getImplementation( xInterface ); if ( pFormatObj && !pFormatObj->IsInserted() ) // noch nicht eingefuegt? { - OUString aNameStr(aName); ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat(); sal_uInt16 nDummy; - if (!lcl_FindAutoFormatIndex( *pFormats, aNameStr, nDummy )) + if (!lcl_FindAutoFormatIndex( *pFormats, aName, nDummy )) { ScAutoFormatData* pNew = new ScAutoFormatData(); - pNew->SetName( aNameStr ); + pNew->SetName( aName ); if (pFormats->insert(pNew)) { @@ -230,7 +228,7 @@ void SAL_CALL ScAutoFormatsObj::insertByName( const OUString& aName, const uno:: pFormats->Save(); // sofort speichern sal_uInt16 nNewIndex; - if (lcl_FindAutoFormatIndex( *pFormats, aNameStr, nNewIndex )) + if (lcl_FindAutoFormatIndex( *pFormats, aName, nNewIndex )) { pFormatObj->InitFormat( nNewIndex ); // kann jetzt benutzt werden bDone = true; @@ -359,10 +357,9 @@ sal_Bool SAL_CALL ScAutoFormatsObj::hasByName( const OUString& aName ) throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - OUString aString(aName); sal_uInt16 nDummy; return lcl_FindAutoFormatIndex( - *ScGlobal::GetOrCreateAutoFormat(), aString, nDummy ); + *ScGlobal::GetOrCreateAutoFormat(), aName, nDummy ); } ScAutoFormatObj::ScAutoFormatObj(sal_uInt16 nIndex) : @@ -504,7 +501,6 @@ void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName ) throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - OUString aNewString(aNewName); ScAutoFormat* pFormats = ScGlobal::GetOrCreateAutoFormat(); sal_uInt16 nDummy; @@ -517,7 +513,7 @@ void SAL_CALL ScAutoFormatObj::setName( const OUString& aNewName ) OSL_ENSURE(pData,"AutoFormat Daten nicht da"); ScAutoFormatData* pNew = new ScAutoFormatData(*pData); - pNew->SetName( aNewString ); + pNew->SetName( aNewName ); pFormats->erase(it); if (pFormats->insert(pNew)) @@ -565,19 +561,18 @@ void SAL_CALL ScAutoFormatObj::setPropertyValue( ScAutoFormatData* pData = pFormats->findByIndex(nFormatIndex); OSL_ENSURE(pData,"AutoFormat Daten nicht da"); - OUString aPropString(aPropertyName); bool bBool; - if (aPropString == SC_UNONAME_INCBACK && (aValue >>= bBool)) + if (aPropertyName == SC_UNONAME_INCBACK && (aValue >>= bBool)) pData->SetIncludeBackground( bBool ); - else if (aPropString == SC_UNONAME_INCBORD && (aValue >>= bBool)) + else if (aPropertyName == SC_UNONAME_INCBORD && (aValue >>= bBool)) pData->SetIncludeFrame( bBool ); - else if (aPropString == SC_UNONAME_INCFONT && (aValue >>= bBool)) + else if (aPropertyName == SC_UNONAME_INCFONT && (aValue >>= bBool)) pData->SetIncludeFont( bBool ); - else if (aPropString == SC_UNONAME_INCJUST && (aValue >>= bBool)) + else if (aPropertyName == SC_UNONAME_INCJUST && (aValue >>= bBool)) pData->SetIncludeJustify( bBool ); - else if (aPropString == SC_UNONAME_INCNUM && (aValue >>= bBool)) + else if (aPropertyName == SC_UNONAME_INCNUM && (aValue >>= bBool)) pData->SetIncludeValueFormat( bBool ); - else if (aPropString == SC_UNONAME_INCWIDTH && (aValue >>= bBool)) + else if (aPropertyName == SC_UNONAME_INCWIDTH && (aValue >>= bBool)) pData->SetIncludeWidthHeight( bBool ); // else Fehler |