From 69489e5812344c196947a196895b1ca25c12438a Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Mon, 7 Feb 2022 22:33:34 +0000 Subject: [PATCH] Bug 1746104 - part 3-1: Get rid of `WritingMode` argument of `IMContextWrapper::CollapseTo` r=m_kato It's always overwritten with same value so that it is not necessary at least for now and on Windows, we just do not update it in same situation. Therefore, we should drop it until we become need to use it. Differential Revision: https://phabricator.services.mozilla.com/D137414 --- widget/gtk/IMContextWrapper.cpp | 12 +++++------- widget/gtk/IMContextWrapper.h | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index c15e962e66bb..6391e4c24696 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -2372,8 +2372,7 @@ bool IMContextWrapper::DispatchCompositionCommitEvent( // shouldn't reset IME because the trigger of causing this commit may be an // input for next composition and we shouldn't cancel it. if (mSelection.IsValid()) { - mSelection.CollapseTo(mSelection.mOffset + aCommitString->Length(), - mSelection.mWritingMode); + mSelection.CollapseTo(mSelection.mOffset + aCommitString->Length()); MOZ_LOG(gIMELog, LogLevel::Info, ("0x%p DispatchCompositionCommitEvent(), " "mSelection={ mOffset=%u, mString=\"%s\", mWritingMode=%s }", @@ -2423,11 +2422,10 @@ bool IMContextWrapper::DispatchCompositionCommitEvent( } // Emulate selection until receiving actual selection range. - mSelection.CollapseTo( - mCompositionStart + (aCommitString - ? aCommitString->Length() - : mDispatchedCompositionString.Length()), - mSelection.mWritingMode); + mSelection.CollapseTo(mCompositionStart + + (aCommitString + ? aCommitString->Length() + : mDispatchedCompositionString.Length())); } mCompositionState = eCompositionState_NotComposing; diff --git a/widget/gtk/IMContextWrapper.h b/widget/gtk/IMContextWrapper.h index 9ebb22fc3dab..7e8e678fe16d 100644 --- a/widget/gtk/IMContextWrapper.h +++ b/widget/gtk/IMContextWrapper.h @@ -393,8 +393,7 @@ class IMContextWrapper final : public TextEventDispatcherListener { mOffset = UINT32_MAX; mWritingMode = WritingMode(); } - void CollapseTo(uint32_t aOffset, const WritingMode& aWritingMode) { - mWritingMode = aWritingMode; + void CollapseTo(uint32_t aOffset) { mOffset = aOffset; mString.Truncate(); }