Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BugFix: try and prevent crashing during highlighting
It seems that one of the tests in `(void) TTextEdit::highlightSelection()` was being done too late - with the result that out of range indexing was being attempted on the `(std::deque<std::deque<TChar>) TBuffer::buffer` member. Specifically the test for `currentY >= totaly` should have been done before `currentY` was used to select one from the outer `std::deque` container so as to establish the size of it (to be stored as `maxX`). The revised code replaces both the highlight and un-highlight code nested loops with components that are more conventionally used, i.e. with the test being based on a less than condition only with the limit being determined within the top parts of the for loops and no additional tests to break from the loop within the body thereof... Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
- Loading branch information