summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-02-02 13:55:07 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-02-03 22:56:53 +0100
commit3228cb2094d3013822534d0ce894c5097e4869f9 (patch)
tree4313293c45f4c3b1858a7a2bdb52d24c50e96b05 /sw
parent49cda4d780bba717dae0e4c20181ef0d3974bf7b (diff)
Remove redundant checks and unnecessary variables
Change-Id: I8552102550898e63468d64f8c2b93577b4f420b4
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/itrpaint.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 92a7ed2a5540..85c84e00124b 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -512,33 +512,22 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor,
if( HasHints() )
{
- bool bUnder = false;
-
for ( MSHORT nTmp = 0; nTmp < pHints->GetStartCount(); ++nTmp )
{
SwTxtAttr* const pTxtAttr = pHints->GetStart( nTmp );
- bool bUnderSelect = false;
const SvxUnderlineItem* pItem =
static_cast<const SvxUnderlineItem*>(CharFmt::GetItem( *pTxtAttr, RES_CHRATR_UNDERLINE ));
if ( pItem )
{
- bUnder = true;
- bUnderSelect = pFnt->GetUnderline() == pItem->GetLineStyle();
- }
-
- if( bUnder )
- {
- sal_Int32 nSt = *pTxtAttr->GetStart();
- sal_Int32 nEnd = *pTxtAttr->GetEnd();
+ const sal_Int32 nSt = *pTxtAttr->GetStart();
+ const sal_Int32 nEnd = *pTxtAttr->GetEnd();
if( nEnd > nSt )
{
- Range aTmp( nSt, nEnd - 1 );
- if( bUnder )
- aUnderMulti.Select( aTmp, bUnderSelect );
+ const bool bUnderSelect = pFnt->GetUnderline() == pItem->GetLineStyle();
+ aUnderMulti.Select( Range( nSt, nEnd - 1 ), bUnderSelect );
}
- bUnder = false;
}
}
}