summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-05-23 23:36:07 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-05-24 22:09:11 +0200
commit554d7bf0d1fe6a0019074a4f68c3205449bf9b7f (patch)
tree54a336a8a359d53b5dcc3478a0ca11d2f3d35939 /sw
parenta2724474fb5b3a4918074c30640c3353354d012f (diff)
OUString: constify and avoid temporaries
Change-Id: I20f049ba275225b6429b630dbff07d0eba5522a3
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unosett.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index e249db8ea5b9..29d50f94e6f7 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -453,12 +453,12 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName)
{
case WID_PREFIX:
{
- aRet <<= OUString(rFtnInfo.GetPrefix());
+ aRet <<= rFtnInfo.GetPrefix();
}
break;
case WID_SUFFIX:
{
- aRet <<= OUString(rFtnInfo.GetSuffix());
+ aRet <<= rFtnInfo.GetSuffix();
}
break;
case WID_NUMBERING_TYPE :
@@ -544,10 +544,10 @@ uno::Any SwXFootnoteProperties::getPropertyValue(const OUString& rPropertyName)
}
break;
case WID_END_NOTICE :
- aRet <<= OUString(rFtnInfo.aQuoVadis);
+ aRet <<= rFtnInfo.aQuoVadis;
break;
case WID_BEGIN_NOTICE :
- aRet <<= OUString(rFtnInfo.aErgoSum);
+ aRet <<= rFtnInfo.aErgoSum;
break;
}
}
@@ -1575,7 +1575,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
static PropValData* lcl_FindProperty(const char* cName, PropValDataArr& rPropertyValues)
{
- OUString sCmp = OUString::createFromAscii(cName);
+ const OUString sCmp = OUString::createFromAscii(cName);
for(size_t i = 0; i < rPropertyValues.size(); ++i)
{
PropValData* pTemp = rPropertyValues[i];
@@ -1959,7 +1959,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
{
aFmt.SetBulletChar(aChar.toChar());
}
- else if(aChar.getLength() == 0)
+ else if(aChar.isEmpty())
{
// If w:lvlText's value is null - set bullet char to zero
aFmt.SetBulletChar(sal_Unicode(0x0));
@@ -2224,7 +2224,7 @@ Any SwXNumberingRules::getPropertyValue( const OUString& rPropertyName )
aRet.setValue(&bVal, ::getBooleanCppuType());
}
else if(rPropertyName == UNO_NAME_NAME)
- aRet <<= OUString(pRule->GetName());
+ aRet <<= pRule->GetName();
else if(rPropertyName == UNO_NAME_IS_ABSOLUTE_MARGINS)
{
sal_Bool bVal = pRule->IsAbsSpaces();
@@ -2272,15 +2272,16 @@ void SwXNumberingRules::removeVetoableChangeListener(
OUString SwXNumberingRules::getName() throw( RuntimeException, std::exception )
{
- OUString aString;
if(pNumRule)
{
+ OUString aString;
SwStyleNameMapper::FillProgName(pNumRule->GetName(), aString, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, true );
return aString;
}
// consider chapter numbering <SwXNumberingRules>
if ( pDocShell )
{
+ OUString aString;
SwStyleNameMapper::FillProgName( pDocShell->GetDoc()->GetOutlineNumRule()->GetName(),
aString, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, true );
return aString;