summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-03 12:28:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-03 12:28:01 +0200
commit187017ee35386018ac4bf249d30c863dd839df07 (patch)
tree42cc8536b7908d24b42265e74c838a618ee4e788
parentc95e3eeeb9950c48e32948e14d3081dff8fd709e (diff)
clang-tidy clang-analyzer-deadcode.DeadStores
...given that setting bCalcPortion to false is always followed by a break out of the while loop ever since the code's inception in 8ab086b6cc054501bfbf7ef6fa509c393691e860 "initial import," bCalcPortion is apparently always true when read Change-Id: I83ba29a78512360500a0c9c8c1baf1ccbad87951
-rw-r--r--vcl/source/edit/texteng.cxx9
1 files changed, 2 insertions, 7 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index abacae29b8ed..bc9bc3fb3f3a 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -2210,8 +2210,6 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
vcl::Font aFont;
- bool bCalcPortion = true;
-
while ( nIndex < pNode->GetText().getLength() )
{
bool bEOL = false;
@@ -2255,8 +2253,7 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
else
{
- if ( bCalcPortion || !pPortion->HasValidSize() )
- pPortion->GetWidth() = CalcTextWidth( nPara, nTmpPos, pPortion->GetLen() );
+ pPortion->GetWidth() = CalcTextWidth( nPara, nTmpPos, pPortion->GetLen() );
nTmpWidth += pPortion->GetWidth();
pPortion->SetRightToLeft( ImpGetRightToLeft( nPara, nTmpPos+1 ) );
@@ -2361,9 +2358,8 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
( ( nEnd-nInvalidDiff ) == aSaveLine.GetEnd() ) )
{
pLine->SetValid();
- if ( bCalcPortion && bQuickFormat )
+ if ( bQuickFormat )
{
- bCalcPortion = false;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}
@@ -2376,7 +2372,6 @@ bool TextEngine::CreateLines( sal_uInt32 nPara )
// the text width does not have to be recalculated.
if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) )
{
- bCalcPortion = false;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}