summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-04-06 13:24:13 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-04-12 22:36:23 +0200
commitc860df99d26061588f428f75e3881f755a72811b (patch)
tree986be90da8d3abb744d71464fbfb036d6de7419a
parent243d89dd04c696a5d7b9e42199964d966a9258e6 (diff)
Evaluate expression just once
Change-Id: I7557234d31dcf73c784c98cb046e40c9b11fe486
-rw-r--r--sw/source/core/edit/autofmt.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 45a6f892af1e..6a1de5b508f8 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2319,19 +2319,16 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags,
m_bEmptyLine = false;
const OUString sEndClrStr( DelTrailingBlanks(sClrStr) );
- const sal_Int32 nLen = sEndClrStr.getLength();
+ const sal_Unicode cLast = sEndClrStr[sEndClrStr.getLength() - 1];
// not, then check if headline
- if( ':' == sEndClrStr[ nLen - 1 ] )
+ if( ':' == cLast )
{
- {
- BuildHeadLine( 2 );
- m_eStat = READ_NEXT_PARA;
- break;
- }
+ BuildHeadLine( 2 );
+ m_eStat = READ_NEXT_PARA;
+ break;
}
- else if( 256 <= sEndClrStr[ nLen-1 ] ||
- !strchr( ",.;", sEndClrStr[ nLen-1 ]) )
+ else if( 256 <= cLast || !strchr( ",.;", cLast ) )
{
if( bNxtEmpty || bNxtAlpha
|| ( pNxtNd && IsEnumericChar( *pNxtNd ))