summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2017-08-13 17:52:12 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2017-08-27 14:05:29 +0200
commitfecee11583098eead1fd16383fcedf72cb42f32a (patch)
treeda9cc61d747a1ec42b13150ab77851207f8d7b02 /svx
parentc2f3f7566464fb291697172a96cb3ea39f51e86f (diff)
OUString: reduce temporaries and constify
Change-Id: I8d806f1efb090a2e8dd42db228e7f07600816b2b
Diffstat (limited to 'svx')
-rw-r--r--svx/source/xoutdev/xattr.cxx40
1 files changed, 13 insertions, 27 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index bad9f41cb71d..8a61e81781e7 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -151,8 +151,7 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u
if (aUniqueName.isEmpty())
{
sal_Int32 nUserIndex = 1;
- OUString aUser(SvxResId(pPrefixResId));
- aUser += " ";
+ const OUString aUser(SvxResId(pPrefixResId)) + " ";
if( pDefaults.get() )
{
@@ -199,7 +198,7 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u
}
else
{
- OUString aEntryName = pEntry->GetName();
+ const OUString aEntryName = pEntry->GetName();
if(aEntryName.getLength() >= aUser.getLength())
{
sal_Int32 nThisIndex = aEntryName.copy( aUser.getLength() ).toInt32();
@@ -232,8 +231,7 @@ OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_u
}
}
}
- aUniqueName = aUser;
- aUniqueName += OUString::number( nUserIndex );
+ aUniqueName = aUser + OUString::number( nUserIndex );
}
}
@@ -624,9 +622,8 @@ bool XLineDashItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
aLineDash.DashLen = rXD.GetDashLen();
aLineDash.Distance = rXD.GetDistance();
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
aPropSeq[0].Name = "Name";
- aPropSeq[0].Value <<= aApiName;
+ aPropSeq[0].Value <<= SvxUnogetApiNameForItem(Which(), GetName());
aPropSeq[1].Name = "LineDash";
aPropSeq[1].Value <<= aLineDash;
rVal <<= aPropSeq;
@@ -635,8 +632,7 @@ bool XLineDashItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_NAME:
{
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
- rVal <<= aApiName;
+ rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
break;
}
@@ -1017,8 +1013,7 @@ bool XLineStartItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons
nMemberId &= ~CONVERT_TWIPS;
if( nMemberId == MID_NAME )
{
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
- rVal <<= aApiName;
+ rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
}
else
{
@@ -1256,9 +1251,7 @@ XLineStartItem* XLineStartItem::checkForUniqueItem( SdrModel* pModel ) const
if( !bFoundExisting )
{
- aUniqueName = aUser;
- aUniqueName += " ";
- aUniqueName += OUString::number( nUserIndex );
+ aUniqueName = aUser + " " + OUString::number( nUserIndex );
}
}
@@ -1512,9 +1505,7 @@ XLineEndItem* XLineEndItem::checkForUniqueItem( SdrModel* pModel ) const
if( !bFoundExisting )
{
- aUniqueName = aUser;
- aUniqueName += " ";
- aUniqueName += OUString::number( nUserIndex );
+ aUniqueName = aUser + " " + OUString::number( nUserIndex );
}
}
@@ -1553,8 +1544,7 @@ bool XLineEndItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
nMemberId &= ~CONVERT_TWIPS;
if( nMemberId == MID_NAME )
{
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
- rVal <<= aApiName;
+ rVal <<= SvxUnogetApiNameForItem(Which(), GetName();
}
else
{
@@ -2066,9 +2056,8 @@ bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) c
aGradient2.EndIntensity = aXGradient.GetEndIntens();
aGradient2.StepCount = aXGradient.GetSteps();
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
aPropSeq[0].Name = "Name";
- aPropSeq[0].Value <<= aApiName;
+ aPropSeq[0].Value <<= SvxUnogetApiNameForItem(Which(), GetName());
aPropSeq[1].Name = "FillGradient";
aPropSeq[1].Value <<= aGradient2;
rVal <<= aPropSeq;
@@ -2097,8 +2086,7 @@ bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) c
case MID_NAME:
{
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
- rVal <<= aApiName;
+ rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
break;
}
@@ -2479,9 +2467,8 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons
aUnoHatch.Distance = aHatch.GetDistance();
aUnoHatch.Angle = aHatch.GetAngle();
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
aPropSeq[0].Name = "Name";
- aPropSeq[0].Value <<= aApiName;
+ aPropSeq[0].Value <<= SvxUnogetApiNameForItem(Which(), GetName());
aPropSeq[1].Name = "FillHatch";
aPropSeq[1].Value <<= aUnoHatch;
rVal <<= aPropSeq;
@@ -2502,8 +2489,7 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons
case MID_NAME:
{
- OUString aApiName = SvxUnogetApiNameForItem(Which(), GetName());
- rVal <<= aApiName;
+ rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
break;
}