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/srchuno.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/srchuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/srchuno.cxx | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index 1ad31eb41f5e..eb17c17af103 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -142,23 +142,22 @@ void SAL_CALL ScCellSearchObj::setPropertyValue( uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - OUString aString(aPropertyName); - - if (aString == SC_UNO_SRCHBACK) pSearchItem->SetBackward( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHBYROW) pSearchItem->SetRowDirection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHCASE) pSearchItem->SetExact( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHREGEXP) pSearchItem->SetRegExp( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHWILDCARD) pSearchItem->SetWildcard( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHSIM) pSearchItem->SetLevenshtein( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHSIMREL) pSearchItem->SetLEVRelaxed( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHSTYLES) pSearchItem->SetPattern( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHWORDS) pSearchItem->SetWordOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); - else if (aString == SC_UNO_SRCHSIMADD) pSearchItem->SetLEVLonger( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); - else if (aString == SC_UNO_SRCHSIMEX) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); - else if (aString == SC_UNO_SRCHSIMREM) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); - else if (aString == SC_UNO_SRCHTYPE) pSearchItem->SetCellType( static_cast<SvxSearchCellType>(ScUnoHelpFunctions::GetInt16FromAny( aValue )) ); - else if (aString == SC_UNO_SRCHFILTERED) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) ); - else if (aString == SC_UNO_SRCHFORMATTED) pSearchItem->SetSearchFormatted( ScUnoHelpFunctions::GetBoolFromAny(aValue) ); + + if (aPropertyName == SC_UNO_SRCHBACK) pSearchItem->SetBackward( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHBYROW) pSearchItem->SetRowDirection( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHCASE) pSearchItem->SetExact( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHREGEXP) pSearchItem->SetRegExp( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHWILDCARD) pSearchItem->SetWildcard( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHSIM) pSearchItem->SetLevenshtein( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHSIMREL) pSearchItem->SetLEVRelaxed( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHSTYLES) pSearchItem->SetPattern( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHWORDS) pSearchItem->SetWordOnly( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHSIMADD) pSearchItem->SetLEVLonger( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHSIMEX) pSearchItem->SetLEVOther( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHSIMREM) pSearchItem->SetLEVShorter( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ); + else if (aPropertyName == SC_UNO_SRCHTYPE) pSearchItem->SetCellType( static_cast<SvxSearchCellType>(ScUnoHelpFunctions::GetInt16FromAny( aValue )) ); + else if (aPropertyName == SC_UNO_SRCHFILTERED) pSearchItem->SetSearchFiltered( ScUnoHelpFunctions::GetBoolFromAny(aValue) ); + else if (aPropertyName == SC_UNO_SRCHFORMATTED) pSearchItem->SetSearchFormatted( ScUnoHelpFunctions::GetBoolFromAny(aValue) ); } uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const OUString& aPropertyName ) @@ -166,24 +165,23 @@ uno::Any SAL_CALL ScCellSearchObj::getPropertyValue( const OUString& aPropertyNa uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - OUString aString(aPropertyName); uno::Any aRet; - if (aString == SC_UNO_SRCHBACK) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetBackward() ); - else if (aString == SC_UNO_SRCHBYROW) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRowDirection() ); - else if (aString == SC_UNO_SRCHCASE) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetExact() ); - else if (aString == SC_UNO_SRCHREGEXP) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRegExp() ); - else if (aString == SC_UNO_SRCHWILDCARD) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWildcard() ); - else if (aString == SC_UNO_SRCHSIM) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLevenshtein() ); - else if (aString == SC_UNO_SRCHSIMREL) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLEVRelaxed() ); - else if (aString == SC_UNO_SRCHSTYLES) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetPattern() ); - else if (aString == SC_UNO_SRCHWORDS) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWordOnly() ); - else if (aString == SC_UNO_SRCHSIMADD) aRet <<= (sal_Int16) pSearchItem->GetLEVLonger(); - else if (aString == SC_UNO_SRCHSIMEX) aRet <<= (sal_Int16) pSearchItem->GetLEVOther(); - else if (aString == SC_UNO_SRCHSIMREM) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter(); - else if (aString == SC_UNO_SRCHTYPE) aRet <<= (sal_Int16) pSearchItem->GetCellType(); - else if (aString == SC_UNO_SRCHFILTERED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() ); - else if (aString == SC_UNO_SRCHFORMATTED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFormatted() ); + if (aPropertyName == SC_UNO_SRCHBACK) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetBackward() ); + else if (aPropertyName == SC_UNO_SRCHBYROW) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRowDirection() ); + else if (aPropertyName == SC_UNO_SRCHCASE) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetExact() ); + else if (aPropertyName == SC_UNO_SRCHREGEXP) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetRegExp() ); + else if (aPropertyName == SC_UNO_SRCHWILDCARD) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWildcard() ); + else if (aPropertyName == SC_UNO_SRCHSIM) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLevenshtein() ); + else if (aPropertyName == SC_UNO_SRCHSIMREL) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsLEVRelaxed() ); + else if (aPropertyName == SC_UNO_SRCHSTYLES) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetPattern() ); + else if (aPropertyName == SC_UNO_SRCHWORDS) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->GetWordOnly() ); + else if (aPropertyName == SC_UNO_SRCHSIMADD) aRet <<= (sal_Int16) pSearchItem->GetLEVLonger(); + else if (aPropertyName == SC_UNO_SRCHSIMEX) aRet <<= (sal_Int16) pSearchItem->GetLEVOther(); + else if (aPropertyName == SC_UNO_SRCHSIMREM) aRet <<= (sal_Int16) pSearchItem->GetLEVShorter(); + else if (aPropertyName == SC_UNO_SRCHTYPE) aRet <<= (sal_Int16) pSearchItem->GetCellType(); + else if (aPropertyName == SC_UNO_SRCHFILTERED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFiltered() ); + else if (aPropertyName == SC_UNO_SRCHFORMATTED) ScUnoHelpFunctions::SetBoolInAny( aRet, pSearchItem->IsSearchFormatted() ); return aRet; } |