No longer ignores the text that comes with a confirmed B_INPUT_METHOD_CHANGED

event; it now only deactivates the inline in that case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19115 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-10-24 23:20:20 +00:00
parent 79372d08b0
commit 3956f772e1

View File

@ -4348,18 +4348,18 @@ BTextView::HandleInputMethodChanged(BMessage *message)
// it means it's over for now, so the current _BInlineInput_ object
// should become inactive. We will probably receive a B_INPUT_METHOD_STOPPED
// message after this one.
bool confirmed = false;
if (message->FindBool("be:confirmed", &confirmed) == B_OK && confirmed) {
fInline->SetActive(false);
Refresh(0, fInline->Offset() + fInline->Length(), true, false);
return;
}
bool confirmed;
if (message->FindBool("be:confirmed", &confirmed) != B_OK)
confirmed = false;
// Delete the previously inserted text (if any)
if (fInline->IsActive()) {
int32 oldOffset = fInline->Offset();
DeleteText(oldOffset, oldOffset + fInline->Length());
fClickOffset = fSelStart = fSelEnd = oldOffset;
if (confirmed)
fInline->SetActive(false);
}
int32 stringLen = strlen(string);
@ -4394,7 +4394,7 @@ BTextView::HandleInputMethodChanged(BMessage *message)
fSelStart += stringLen;
fClickOffset = fSelEnd = fSelStart;
if (!fInline->IsActive())
if (!confirmed && !fInline->IsActive())
fInline->SetActive(true);
Refresh(fInline->Offset(), fSelEnd, true, false);