Kaydet (Commit) 243d89dd authored tarafından Matteo Casalin's avatar Matteo Casalin

Simplify DelLeadingBlanks interface

Change-Id: I79d29272e8665404d08674c9853d87bba7b68694
üst 9e888629
...@@ -169,7 +169,7 @@ class SwAutoFormat ...@@ -169,7 +169,7 @@ class SwAutoFormat
sal_Int32 GetBigIndent( sal_Int32& rAktSpacePos ) const; sal_Int32 GetBigIndent( sal_Int32& rAktSpacePos ) const;
OUString DelLeadingBlanks(const OUString& rStr) 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 GetLeadingBlanks( const OUString& rStr ) const;
sal_Int32 GetTrailingBlanks( const OUString& rStr ) const; sal_Int32 GetTrailingBlanks( const OUString& rStr ) const;
...@@ -671,7 +671,7 @@ OUString SwAutoFormat::DelLeadingBlanks( const OUString& rStr ) const ...@@ -671,7 +671,7 @@ OUString SwAutoFormat::DelLeadingBlanks( const OUString& rStr ) const
return rStr; return rStr;
} }
OUString& SwAutoFormat::DelTrailingBlanks( OUString& rStr ) const OUString SwAutoFormat::DelTrailingBlanks( const OUString& rStr ) const
{ {
sal_Int32 nL = rStr.getLength(), n = nL; sal_Int32 nL = rStr.getLength(), n = nL;
if( !nL ) if( !nL )
...@@ -680,7 +680,7 @@ OUString& SwAutoFormat::DelTrailingBlanks( OUString& rStr ) const ...@@ -680,7 +680,7 @@ OUString& SwAutoFormat::DelTrailingBlanks( OUString& rStr ) const
while( --n && IsSpace( rStr[ n ] ) ) while( --n && IsSpace( rStr[ n ] ) )
; ;
if( n+1 != nL ) // no Spaces if( n+1 != nL ) // no Spaces
rStr = rStr.copy( 0, n+1 ); return rStr.copy( 0, n+1 );
return rStr; return rStr;
} }
...@@ -2303,7 +2303,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, ...@@ -2303,7 +2303,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
if( !bReplaceStyles ) if( !bReplaceStyles )
break; break;
OUString sClrStr( DelLeadingBlanks(m_pCurTxtNd->GetTxt()) ); const OUString sClrStr( DelLeadingBlanks(m_pCurTxtNd->GetTxt()) );
if( sClrStr.isEmpty() ) if( sClrStr.isEmpty() )
{ {
...@@ -2318,8 +2318,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, ...@@ -2318,8 +2318,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
break; break;
m_bEmptyLine = false; m_bEmptyLine = false;
OUString sEndClrStr( sClrStr ); const OUString sEndClrStr( DelTrailingBlanks(sClrStr) );
sal_Int32 nLen = DelTrailingBlanks( sEndClrStr ).getLength(); const sal_Int32 nLen = sEndClrStr.getLength();
// not, then check if headline // not, then check if headline
if( ':' == sEndClrStr[ nLen - 1 ] ) if( ':' == sEndClrStr[ nLen - 1 ] )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment