summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-08-02 19:13:22 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-08-16 09:10:16 +0200
commitc65d64a56bbc1ea7f0dc9a39b0a5da6e82e347f2 (patch)
treefb8ae616b1000fa65595988baefcaa0c09a4abd2
parentc679bd3c1c3f625aed3ba5a6da7dffad0fba80c8 (diff)
Do not use duplicated variables, and simplify
Change-Id: I5508b6a04a894c747a49ca19f559ff448334d026
-rw-r--r--vcl/source/edit/texteng.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index fc52e014e5ba..754fea7fcc09 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -2162,24 +2162,18 @@ bool TextEngine::CreateLines( sal_uLong nPara )
if ( pTEParaPortion->GetWritingDirectionInfos().empty() )
ImpInitWritingDirections( nPara );
- if ( pTEParaPortion->GetWritingDirectionInfos().size() == 1 )
+ if ( pTEParaPortion->GetWritingDirectionInfos().size() == 1 && pTEParaPortion->IsSimpleInvalid() )
{
- if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) )
- {
- bQuickFormat = true;
- }
- else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) )
+ bQuickFormat = nInvalidDiff != 0;
+ if ( nInvalidDiff < 0 )
{
// check if deleting across Portion border
- sal_uInt16 nStart = nInvalidStart; // duplicate!!!
- sal_uInt16 nEnd = nStart - nInvalidDiff; // neg.
- bQuickFormat = true;
sal_uInt16 nPos = 0;
for ( const auto pTP : pTEParaPortion->GetTextPortions() )
{
// there must be no Start/End in the deleted region
nPos = nPos + pTP->GetLen();
- if ( ( nPos > nStart ) && ( nPos < nEnd ) )
+ if ( nPos > nInvalidStart && nPos < nInvalidEnd )
{
bQuickFormat = false;
break;