* textviews that aren't editable no longer perform cut or paste actions (again

reported by kirilla, thanks!)
* when tracking the mouse in order to detect drags, it is not necessary to
  check if the pointer is within the selection, as that causes problems when
  you e.g. click on the border of the selection and then move the mouse outside
  of it (we'd still want to initiate a drag in that case)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30519 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2009-04-30 20:19:43 +00:00
parent c27ffb3a23
commit 435455abc1
1 changed files with 5 additions and 5 deletions

View File

@ -1342,6 +1342,8 @@ void
BTextView::Cut(BClipboard *clipboard)
{
_CancelInputMethod();
if (!fEditable)
return;
if (fUndo) {
delete fUndo;
fUndo = new CutUndoBuffer(this);
@ -1391,7 +1393,7 @@ BTextView::Paste(BClipboard *clipboard)
CALLED();
_CancelInputMethod();
if (!clipboard->Lock())
if (!fEditable || !clipboard->Lock())
return;
BMessage *clip = clipboard->Data();
@ -4439,8 +4441,7 @@ BTextView::_PerformMouseUp(BPoint where)
if (fTrackingMouse == NULL)
return false;
if (fTrackingMouse->selectionRect.IsValid()
&& fTrackingMouse->selectionRect.Contains(where))
if (fTrackingMouse->selectionRect.IsValid())
Select(fTrackingMouse->clickOffset, fTrackingMouse->clickOffset);
_StopMouseTracking();
@ -4460,8 +4461,7 @@ BTextView::_PerformMouseMoved(BPoint where, uint32 code)
return false;
int32 currentOffset = OffsetAt(where);
if (fTrackingMouse->selectionRect.IsValid()
&& fTrackingMouse->selectionRect.Contains(where)) {
if (fTrackingMouse->selectionRect.IsValid()) {
// we are tracking the mouse for drag action, if the mouse has moved
// from where it was clicked, we initiate a drag now:
if (currentOffset != fTrackingMouse->clickOffset) {