From 206e1f28d8064459ebf3a40bbd52816e7571b0be Mon Sep 17 00:00:00 2001
From: Alexander G. M. Smith <agmsmith@ncf.ca>
Date: Sun, 25 Nov 2012 14:57:21 -0500
Subject: [PATCH] Handle BTextView::Select() out of range values better.
Selection ranges with start values out of the valid range aren't
handled the same way BeOS does, which is to peg them to valid numbers.
Currently only end values are clipped, start isn't fully pegged.
* This affects software like TTAnywhere, which uses
Select(1000000000, 1000000000) to position the selection point at
the end before appending text to a log window.
* It also may affect bug #9066, where Select is in the stack crawl.
---
src/kits/interface/TextView.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp
index cb08c8d..1d68631 100644
a
|
b
|
BTextView::Select(int32 startOffset, int32 endOffset)
|
1551 | 1551 | // pin offsets at reasonable values |
1552 | 1552 | if (startOffset < 0) |
1553 | 1553 | startOffset = 0; |
| 1554 | else if (startOffset > fText->Length()) |
| 1555 | startOffset = fText->Length(); |
1554 | 1556 | if (endOffset < 0) |
1555 | 1557 | endOffset = 0; |
1556 | 1558 | else if (endOffset > fText->Length()) |