From 2d7662810ec0f753a959f1aaf9a55d648504c837 Mon Sep 17 00:00:00 2001 From: shatty Date: Wed, 3 Nov 2004 11:12:24 +0000 Subject: [PATCH] abs -> fabs, disable WidthBuffer, patch for confirmation in HandleInputMethodChanged git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9761 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/BTextView/TextView.cpp | 33 ++++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/kits/interface/BTextView/TextView.cpp b/src/kits/interface/BTextView/TextView.cpp index 1d36269940..437abc2665 100644 --- a/src/kits/interface/BTextView/TextView.cpp +++ b/src/kits/interface/BTextView/TextView.cpp @@ -3615,7 +3615,7 @@ BTextView::StyledWidth(int32 fromOffset, int32 length, float *outAscent, maxDescent = max_c(descent, maxDescent); // Use _BWidthBuffer_ if possible - if (sWidths != NULL) { + if (false && (sWidths != NULL)) { LockWidthBuffer(); result += sWidths->StringWidth(*fText, fromOffset, numChars, font); UnlockWidthBuffer(); @@ -4391,6 +4391,16 @@ BTextView::HandleInputMethodChanged(BMessage *message) be_app->ObscureCursor(); + // If we find the "be:confirmed" boolean (and the boolean is true), + // it means it's over for now, so the current _BInlineInput_ object + // should become inactive + bool confirmed = false; + if (message->FindBool("be:confirmed", &confirmed) == B_OK && confirmed) { + fInline->SetActive(false); + Refresh(0, fInline->Offset(), true, false); + return; + } + // Delete the previously inserted text (if any) if (fInline->IsActive()) { int32 oldOffset = fInline->Offset(); @@ -4425,22 +4435,13 @@ BTextView::HandleInputMethodChanged(BMessage *message) fInline->SetSelectionOffset(selectionStart); fInline->SetSelectionLength(selectionEnd - selectionStart); - if (clauseCount > 0) { - // Insert the new text - InsertText(string, stringLen, fSelStart, NULL); - fSelStart += stringLen; - fClickOffset = fSelEnd = fSelStart; - } - - // If we find the "be:confirmed" boolean (and the boolean is true), - // it means it's over for now, so the current _BInlineInput_ object - // should become inactive - bool confirmed = false; - if (message->FindBool("be:confirmed", &confirmed) < B_OK || !confirmed) - fInline->SetActive(true); - else - fInline->SetActive(false); + // Insert the new text + InsertText(string, stringLen, fSelStart, NULL); + fSelStart += stringLen; + fClickOffset = fSelEnd = fSelStart; + fInline->SetActive(true); + Refresh(0, fSelEnd, true, false); }