diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-02 19:13:22 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-08-16 09:10:16 +0200 |
commit | c65d64a56bbc1ea7f0dc9a39b0a5da6e82e347f2 (patch) | |
tree | fb8ae616b1000fa65595988baefcaa0c09a4abd2 /vcl | |
parent | c679bd3c1c3f625aed3ba5a6da7dffad0fba80c8 (diff) |
Do not use duplicated variables, and simplify
Change-Id: I5508b6a04a894c747a49ca19f559ff448334d026
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 14 |
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; |