summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-04-06 13:19:48 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-04-12 22:36:22 +0200
commit243d89dd04c696a5d7b9e42199964d966a9258e6 (patch)
tree89765aecf7122e12c8fabe218d85310f4e66e779
parent9e888629564ef9c32b2b8ee07dee5afba44b5a24 (diff)
Simplify DelLeadingBlanks interface
Change-Id: I79d29272e8665404d08674c9853d87bba7b68694
-rw-r--r--sw/source/core/edit/autofmt.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 72063b332c8f..45a6f892af1e 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -169,7 +169,7 @@ class SwAutoFormat
sal_Int32 GetBigIndent( sal_Int32& rAktSpacePos ) const;
OUString DelLeadingBlanks(const OUString& rStr) const;
- OUString& DelTrailingBlanks( OUString& rStr ) const;
+ OUString DelTrailingBlanks( const OUString& rStr ) const;
sal_Int32 GetLeadingBlanks( const OUString& rStr ) const;
sal_Int32 GetTrailingBlanks( const OUString& rStr ) const;
@@ -671,7 +671,7 @@ OUString SwAutoFormat::DelLeadingBlanks( const OUString& rStr ) const
return rStr;
}
-OUString& SwAutoFormat::DelTrailingBlanks( OUString& rStr ) const
+OUString SwAutoFormat::DelTrailingBlanks( const OUString& rStr ) const
{
sal_Int32 nL = rStr.getLength(), n = nL;
if( !nL )
@@ -680,7 +680,7 @@ OUString& SwAutoFormat::DelTrailingBlanks( OUString& rStr ) const
while( --n && IsSpace( rStr[ n ] ) )
;
if( n+1 != nL ) // no Spaces
- rStr = rStr.copy( 0, n+1 );
+ return rStr.copy( 0, n+1 );
return rStr;
}
@@ -2303,7 +2303,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
if( !bReplaceStyles )
break;
- OUString sClrStr( DelLeadingBlanks(m_pCurTxtNd->GetTxt()) );
+ const OUString sClrStr( DelLeadingBlanks(m_pCurTxtNd->GetTxt()) );
if( sClrStr.isEmpty() )
{
@@ -2318,8 +2318,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
break;
m_bEmptyLine = false;
- OUString sEndClrStr( sClrStr );
- sal_Int32 nLen = DelTrailingBlanks( sEndClrStr ).getLength();
+ const OUString sEndClrStr( DelTrailingBlanks(sClrStr) );
+ const sal_Int32 nLen = sEndClrStr.getLength();
// not, then check if headline
if( ':' == sEndClrStr[ nLen - 1 ] )