Canceling an input method now removes the complete inline from the text.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19118 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-10-25 12:25:41 +00:00
parent d32e5bae5e
commit f0cd9e9d87
+10 -3
View File
@@ -4438,14 +4438,21 @@ BTextView::CancelInputMethod()
{
if (!fInline)
return;
BMessage message(B_INPUT_METHOD_EVENT);
message.AddInt32("be:opcode", B_INPUT_METHOD_STOPPED);
fInline->Method()->SendMessage(&message);
// Delete the previously inserted text (if any)
if (fInline->IsActive()) {
int32 oldOffset = fInline->Offset();
DeleteText(oldOffset, oldOffset + fInline->Length());
fClickOffset = fSelStart = fSelEnd = oldOffset;
}
delete fInline;
fInline = NULL;
if (Window())
Refresh(0, fText->Length(), true, false);
}