summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-02-19 09:24:29 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-19 09:56:29 +0100
commit6e619198cbd132300a9219c1de64a4750ca5a092 (patch)
tree2322e558932c16e87db75b0861584d1442fd85d0 /editeng
parent18138417485aeba6c52d935c616dba829b24ffd8 (diff)
Simplify ranges overlapping condition
Using conjuction and disjuction distributivity and assuming that for each range r: r.mnStart <= r.mnEnd. Change-Id: Ifbd156426617ebf225b1b1139e17e4967a228cd6 Reviewed-on: https://gerrit.libreoffice.org/68003 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/edtspell.cxx7
1 files changed, 1 insertions, 6 deletions
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 63b402ffad53..81143ce33b5a 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -508,12 +508,7 @@ bool WrongList::DbgIsBuggy() const
{
for (WrongList::const_iterator j = i + 1; !bError && (j != maRanges.end()); ++j)
{
- // 1) Start before, End after the second Start
- if (i->mnStart <= j->mnStart && i->mnEnd >= j->mnStart)
- bError = true;
- // 2) Start after the second Start, but still before the second End
- else if (i->mnStart >= j->mnStart && i->mnStart <= j->mnEnd)
- bError = true;
+ bError = i->mnStart <= j->mnEnd && j->mnStart <= i->mnEnd;
}
}
return bError;