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:
@@ -4438,14 +4438,21 @@ BTextView::CancelInputMethod()
|
|||||||
{
|
{
|
||||||
if (!fInline)
|
if (!fInline)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BMessage message(B_INPUT_METHOD_EVENT);
|
BMessage message(B_INPUT_METHOD_EVENT);
|
||||||
message.AddInt32("be:opcode", B_INPUT_METHOD_STOPPED);
|
message.AddInt32("be:opcode", B_INPUT_METHOD_STOPPED);
|
||||||
fInline->Method()->SendMessage(&message);
|
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;
|
delete fInline;
|
||||||
fInline = NULL;
|
fInline = NULL;
|
||||||
|
|
||||||
if (Window())
|
if (Window())
|
||||||
Refresh(0, fText->Length(), true, false);
|
Refresh(0, fText->Length(), true, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user