summaryrefslogtreecommitdiff
path: root/svl/source
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 /svl/source
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 'svl/source')
-rw-r--r--svl/source/numbers/zformat.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 8238315111c2..00f7b4bd6c14 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1649,36 +1649,35 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
bool bQuoteSymbol )
{
OUString aTmp;
- OUString aSource(rStr);
sal_Int32 nStartPos, nPos, nLen;
- nLen = aSource.getLength();
+ nLen = rStr.getLength();
nStartPos = 0;
- while ( (nPos = aSource.indexOf( "[$", nStartPos )) >= 0 )
+ while ( (nPos = rStr.indexOf( "[$", nStartPos )) >= 0 )
{
sal_Int32 nEnd;
- if ( (nEnd = GetQuoteEnd( aSource, nPos )) >= 0 )
+ if ( (nEnd = GetQuoteEnd( rStr, nPos )) >= 0 )
{
- aTmp += aSource.copy( nStartPos, ++nEnd - nStartPos );
+ aTmp += rStr.copy( nStartPos, ++nEnd - nStartPos );
nStartPos = nEnd;
}
else
{
- aTmp += aSource.copy( nStartPos, nPos - nStartPos );
+ aTmp += rStr.copy( nStartPos, nPos - nStartPos );
nStartPos = nPos + 2;
sal_Int32 nDash;
nEnd = nStartPos - 1;
do
{
- nDash = aSource.indexOf( '-', ++nEnd );
+ nDash = rStr.indexOf( '-', ++nEnd );
}
- while ( (nEnd = GetQuoteEnd( aSource, nDash )) >= 0 );
+ while ( (nEnd = GetQuoteEnd( rStr, nDash )) >= 0 );
sal_Int32 nClose;
nEnd = nStartPos - 1;
do
{
- nClose = aSource.indexOf( ']', ++nEnd );
+ nClose = rStr.indexOf( ']', ++nEnd );
}
- while ( (nEnd = GetQuoteEnd( aSource, nClose )) >= 0 );
+ while ( (nEnd = GetQuoteEnd( rStr, nClose )) >= 0 );
if(nClose < 0)
{
@@ -1694,14 +1693,14 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
{
nPos = nDash;
}
- if ( !bQuoteSymbol || aSource[ nStartPos ] == '"' )
+ if ( !bQuoteSymbol || rStr[ nStartPos ] == '"' )
{
- aTmp += aSource.copy( nStartPos, nPos - nStartPos );
+ aTmp += rStr.copy( nStartPos, nPos - nStartPos );
}
else
{
aTmp += "\"";
- aTmp += aSource.copy( nStartPos, nPos - nStartPos );
+ aTmp += rStr.copy( nStartPos, nPos - nStartPos );
aTmp += "\"";
}
nStartPos = nClose + 1;
@@ -1709,7 +1708,7 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr,
}
if ( nLen > nStartPos )
{
- aTmp += aSource.copy( nStartPos, nLen - nStartPos );
+ aTmp += rStr.copy( nStartPos, nLen - nStartPos );
}
return aTmp;
}