summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/RichEdit.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-10-11 13:42:51 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-10-11 13:42:51 +0000
commit879b94d26b59990d5cc980decbfc51a71c9883f4 (patch)
treed7200329de750bbcc5357e0e2f1bbfe256dd9892 /plugins/SpellChecker/src/RichEdit.cpp
parent7e67728d3ea7790e4aa7a8197fc458e672922051 (diff)
SpellChecker: minor bugfixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15533 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src/RichEdit.cpp')
-rw-r--r--plugins/SpellChecker/src/RichEdit.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/plugins/SpellChecker/src/RichEdit.cpp b/plugins/SpellChecker/src/RichEdit.cpp
index 0fdcf62e36..b93d74718d 100644
--- a/plugins/SpellChecker/src/RichEdit.cpp
+++ b/plugins/SpellChecker/src/RichEdit.cpp
@@ -296,17 +296,12 @@ int RichEdit::FixSel(CHARRANGE *to_fix, CHARRANGE sel_changed, int new_len)
return dif;
int newMax = sel_changed.cpMax + dif;
- int newMin = sel_changed.cpMin + dif;
- if (to_fix->cpMin >= sel_changed.cpMin)
- to_fix->cpMin += dif;
- else if (to_fix->cpMin >= newMin) // For dif < 0, pos beetween sel_changed.cpMax + dif and sel_changed.cpMax
- to_fix->cpMin = newMin;
+ if (to_fix->cpMin >= sel_changed.cpMax) to_fix->cpMin += dif;
+ else if (to_fix->cpMin >= newMax) to_fix->cpMin = newMax;
- if (to_fix->cpMax >= sel_changed.cpMax)
- to_fix->cpMax += dif;
- else if (to_fix->cpMax >= newMax) // For dif < 0, pos beetween sel_changed.cpMax + dif and sel_changed.cpMax
- to_fix->cpMax = newMax;
+ if (to_fix->cpMax >= sel_changed.cpMax) to_fix->cpMax += dif;
+ else if (to_fix->cpMax >= newMax) to_fix->cpMax = newMax;
return dif;
}