summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/shapeuno.cxx
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 /sc/source/ui/unoobj/shapeuno.cxx
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 'sc/source/ui/unoobj/shapeuno.cxx')
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx45
1 files changed, 20 insertions, 25 deletions
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 7b68557c944c..14d399db2015 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -326,9 +326,8 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
- if ( aNameString == SC_UNONAME_ANCHOR )
+ if ( aPropertyName == SC_UNONAME_ANCHOR )
{
uno::Reference<sheet::XCellRangeAddressable> xRangeAdd(aValue, uno::UNO_QUERY);
if (xRangeAdd.is())
@@ -436,7 +435,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
else
throw lang::IllegalArgumentException("only XCell or XSpreadsheet objects allowed", static_cast<cppu::OWeakObject*>(this), 0);
}
- else if ( aNameString == SC_UNONAME_IMAGEMAP )
+ else if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
SdrObject* pObj = GetSdrObject();
if ( pObj )
@@ -460,7 +459,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
}
}
}
- else if ( aNameString == SC_UNONAME_HORIPOS )
+ else if ( aPropertyName == SC_UNONAME_HORIPOS )
{
sal_Int32 nPos = 0;
if (aValue >>= nPos)
@@ -558,7 +557,7 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
}
}
}
- else if ( aNameString == SC_UNONAME_VERTPOS )
+ else if ( aPropertyName == SC_UNONAME_VERTPOS )
{
sal_Int32 nPos = 0;
if (aValue >>= nPos)
@@ -627,15 +626,15 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& aPropertyName, const
}
}
}
- else if ( aNameString == SC_UNONAME_HYPERLINK ||
- aNameString == SC_UNONAME_URL )
+ else if ( aPropertyName == SC_UNONAME_HYPERLINK ||
+ aPropertyName == SC_UNONAME_URL )
{
OUString sHlink;
ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this, true);
if ( ( aValue >>= sHlink ) && pInfo )
pInfo->SetHlink( sHlink );
}
- else if ( aNameString == SC_UNONAME_MOVEPROTECT )
+ else if ( aPropertyName == SC_UNONAME_MOVEPROTECT )
{
if( SdrObject* pObj = this->GetSdrObject() )
{
@@ -657,10 +656,9 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString = aPropertyName;
uno::Any aAny;
- if ( aNameString == SC_UNONAME_ANCHOR )
+ if ( aPropertyName == SC_UNONAME_ANCHOR )
{
SdrObject *pObj = GetSdrObject();
if (pObj)
@@ -691,7 +689,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
}
}
- else if ( aNameString == SC_UNONAME_IMAGEMAP )
+ else if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
uno::Reference< uno::XInterface > xImageMap;
SdrObject* pObj = GetSdrObject();
@@ -708,7 +706,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
aAny <<= uno::Reference< container::XIndexContainer >::query( xImageMap );
}
- else if ( aNameString == SC_UNONAME_HORIPOS )
+ else if ( aPropertyName == SC_UNONAME_HORIPOS )
{
SdrObject *pObj = GetSdrObject();
if (pObj)
@@ -767,7 +765,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
}
}
- else if ( aNameString == SC_UNONAME_VERTPOS )
+ else if ( aPropertyName == SC_UNONAME_VERTPOS )
{
SdrObject *pObj = GetSdrObject();
if (pObj)
@@ -812,15 +810,15 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const OUString& aPropertyName )
}
}
}
- else if ( aNameString == SC_UNONAME_HYPERLINK ||
- aNameString == SC_UNONAME_URL )
+ else if ( aPropertyName == SC_UNONAME_HYPERLINK ||
+ aPropertyName == SC_UNONAME_URL )
{
OUString sHlink;
if ( ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this) )
sHlink = pInfo->GetHlink();
aAny <<= sHlink;
}
- else if ( aNameString == SC_UNONAME_MOVEPROTECT )
+ else if ( aPropertyName == SC_UNONAME_MOVEPROTECT )
{
bool aProt = false;
if ( SdrObject* pObj = this->GetSdrObject() )
@@ -904,22 +902,21 @@ beans::PropertyState SAL_CALL ScShapeObj::getPropertyState( const OUString& aPro
throw(beans::UnknownPropertyException, uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
beans::PropertyState eRet = beans::PropertyState_DIRECT_VALUE;
- if ( aNameString == SC_UNONAME_IMAGEMAP )
+ if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
// ImageMap is always "direct"
}
- else if ( aNameString == SC_UNONAME_ANCHOR )
+ else if ( aPropertyName == SC_UNONAME_ANCHOR )
{
// Anchor is always "direct"
}
- else if ( aNameString == SC_UNONAME_HORIPOS )
+ else if ( aPropertyName == SC_UNONAME_HORIPOS )
{
// HoriPos is always "direct"
}
- else if ( aNameString == SC_UNONAME_VERTPOS )
+ else if ( aPropertyName == SC_UNONAME_VERTPOS )
{
// VertPos is always "direct"
}
@@ -954,9 +951,8 @@ void SAL_CALL ScShapeObj::setPropertyToDefault( const OUString& aPropertyName )
std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString(aPropertyName);
- if ( aNameString == SC_UNONAME_IMAGEMAP )
+ if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
SdrObject* pObj = GetSdrObject();
if ( pObj )
@@ -986,10 +982,9 @@ uno::Any SAL_CALL ScShapeObj::getPropertyDefault( const OUString& aPropertyName
uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- OUString aNameString = aPropertyName;
uno::Any aAny;
- if ( aNameString == SC_UNONAME_IMAGEMAP )
+ if ( aPropertyName == SC_UNONAME_IMAGEMAP )
{
// default: empty ImageMap
uno::Reference< uno::XInterface > xImageMap(SvUnoImageMap_createInstance( GetSupportedMacroItems() ));