From da4c7e7ed675c3bf405668739c3012d140856109 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:42 +0200 Subject: Adding upstream version 126.0. Signed-off-by: Daniel Baumann --- widget/uikit/TextInputHandler.mm | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'widget/uikit/TextInputHandler.mm') diff --git a/widget/uikit/TextInputHandler.mm b/widget/uikit/TextInputHandler.mm index 9a4a6ae226..3ee3573b83 100644 --- a/widget/uikit/TextInputHandler.mm +++ b/widget/uikit/TextInputHandler.mm @@ -10,6 +10,7 @@ #include "mozilla/EventForwards.h" #include "mozilla/Logging.h" +#include "mozilla/MacStringHelpers.h" #include "mozilla/MiscEvents.h" #include "mozilla/TextEventDispatcher.h" #include "mozilla/TextEvents.h" @@ -23,21 +24,6 @@ mozilla::LazyLogModule gIMELog("TextInputHandler"); namespace mozilla::widget { -static void GetStringForNSString(const NSString* aSrc, nsAString& aDist) { - NS_OBJC_BEGIN_TRY_IGNORE_BLOCK; - - if (!aSrc) { - aDist.Truncate(); - return; - } - - aDist.SetLength([aSrc length]); - [aSrc getCharacters:reinterpret_cast(aDist.BeginWriting()) - range:NSMakeRange(0, [aSrc length])]; - - NS_OBJC_END_TRY_IGNORE_BLOCK; -} - NS_IMPL_ISUPPORTS(TextInputHandler, TextEventDispatcherListener, nsISupportsWeakReference) @@ -63,7 +49,7 @@ void TextInputHandler::WillDispatchKeyboardEvent( bool TextInputHandler::InsertText(NSString* aText) { nsString str; - GetStringForNSString(aText, str); + CopyNSStringToXPCOMString(aText, str); MOZ_LOG(gIMELog, LogLevel::Info, ("%p TextInputHandler::InsertText(aText=%s)", this, -- cgit v1.2.3