mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 960871 part.1 Rename WidgetTextEvent::theText to WidgetTextEvent::mData r=smaug
This commit is contained in:
parent
38d0b6e5f6
commit
7806a4ddb7
@ -137,7 +137,7 @@ CompositionStringSynthesizer::DispatchEvent(bool* aDefaultPrevented)
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, widget);
|
||||
textEvent.time = PR_IntervalNow();
|
||||
textEvent.theText = mString;
|
||||
textEvent.mData = mString;
|
||||
if (!mClauses->IsEmpty()) {
|
||||
textEvent.mRanges = mClauses;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ TextComposition::MaybeDispatchCompositionUpdate(const WidgetTextEvent* aEvent)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mLastData == aEvent->theText) {
|
||||
if (mLastData == aEvent->mData) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ TextComposition::MaybeDispatchCompositionUpdate(const WidgetTextEvent* aEvent)
|
||||
aEvent->widget);
|
||||
compositionUpdate.time = aEvent->time;
|
||||
compositionUpdate.timeStamp = aEvent->timeStamp;
|
||||
compositionUpdate.data = aEvent->theText;
|
||||
compositionUpdate.data = aEvent->mData;
|
||||
compositionUpdate.mFlags.mIsSynthesizedForTests =
|
||||
aEvent->mFlags.mIsSynthesizedForTests;
|
||||
|
||||
@ -149,7 +149,7 @@ TextComposition::DispatchEvent(WidgetGUIEvent* aEvent,
|
||||
committingData = &aEvent->AsCompositionEvent()->data;
|
||||
break;
|
||||
case NS_TEXT_TEXT:
|
||||
committingData = &aEvent->AsTextEvent()->theText;
|
||||
committingData = &aEvent->AsTextEvent()->mData;
|
||||
break;
|
||||
default:
|
||||
NS_WARNING("Unexpected event comes during committing or "
|
||||
@ -287,7 +287,7 @@ TextComposition::RequestToCommit(nsIWidget* aWidget, bool aDiscard)
|
||||
bool changingData = lastData != commitData;
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, widget);
|
||||
textEvent.theText = commitData;
|
||||
textEvent.mData = commitData;
|
||||
textEvent.mFlags.mIsSynthesizedForTests = true;
|
||||
|
||||
MaybeDispatchCompositionUpdate(&textEvent);
|
||||
@ -346,7 +346,7 @@ TextComposition::EditorWillHandleTextEvent(const WidgetTextEvent* aTextEvent)
|
||||
mRanges = aTextEvent->mRanges;
|
||||
mIsEditorHandlingEvent = true;
|
||||
|
||||
MOZ_ASSERT(mLastData == aTextEvent->theText,
|
||||
MOZ_ASSERT(mLastData == aTextEvent->mData,
|
||||
"The text of a text event must be same as previous data attribute value "
|
||||
"of the latest compositionupdate event");
|
||||
}
|
||||
@ -455,7 +455,7 @@ TextComposition::CompositionEventDispatcher::Run()
|
||||
}
|
||||
case NS_TEXT_TEXT: {
|
||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, widget);
|
||||
textEvent.theText = mData;
|
||||
textEvent.mData = mData;
|
||||
textEvent.mFlags.mIsSynthesizedForTests =
|
||||
mTextComposition->IsSynthesizedForTests();
|
||||
IMEStateManager::DispatchCompositionEvent(mEventTarget, presContext,
|
||||
|
@ -1588,7 +1588,7 @@ TabParent::SendTextEvent(WidgetTextEvent& event)
|
||||
return false;
|
||||
}
|
||||
if (mIMECompositionEnding) {
|
||||
mIMECompositionText = event.theText;
|
||||
mIMECompositionText = event.mData;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1598,7 +1598,7 @@ TabParent::SendTextEvent(WidgetTextEvent& event)
|
||||
mIMECompositionStart = std::min(mIMESelectionAnchor, mIMESelectionFocus);
|
||||
}
|
||||
mIMESelectionAnchor = mIMESelectionFocus =
|
||||
mIMECompositionStart + event.theText.Length();
|
||||
mIMECompositionStart + event.mData.Length();
|
||||
|
||||
event.mSeqno = ++mIMESeqno;
|
||||
return PBrowserParent::SendTextEvent(event);
|
||||
|
@ -879,7 +879,7 @@ nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
|
||||
{
|
||||
nsAutoPlaceHolderBatch batch(this, nsGkAtoms::IMETxnName);
|
||||
|
||||
rv = InsertText(widgetTextEvent->theText);
|
||||
rv = InsertText(widgetTextEvent->mData);
|
||||
|
||||
if (caretP) {
|
||||
caretP->SetSelection(selection);
|
||||
|
@ -242,7 +242,7 @@ public:
|
||||
}
|
||||
|
||||
// The composition string or the commit string.
|
||||
nsString theText;
|
||||
nsString mData;
|
||||
// Indicates whether the event signifies printable text.
|
||||
// XXX This is not a standard, and most platforms don't set this properly.
|
||||
// So, perhaps, we can get rid of this.
|
||||
|
@ -685,7 +685,7 @@ nsWindow::DispatchEvent(WidgetGUIEvent* aEvent)
|
||||
break;
|
||||
case NS_TEXT_TEXT:
|
||||
MOZ_ASSERT(mIMEComposing);
|
||||
mIMEComposingText = aEvent->AsTextEvent()->theText;
|
||||
mIMEComposingText = aEvent->AsTextEvent()->mData;
|
||||
break;
|
||||
}
|
||||
return status;
|
||||
@ -1709,7 +1709,7 @@ nsWindow::RemoveIMEComposition()
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, this);
|
||||
InitEvent(textEvent, nullptr);
|
||||
textEvent.theText = mIMEComposingText;
|
||||
textEvent.mData = mIMEComposingText;
|
||||
DispatchEvent(&textEvent);
|
||||
|
||||
WidgetCompositionEvent event(true, NS_COMPOSITION_END, this);
|
||||
@ -1847,14 +1847,14 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
||||
{
|
||||
WidgetTextEvent event(true, NS_TEXT_TEXT, this);
|
||||
InitEvent(event, nullptr);
|
||||
event.theText = ae->Characters();
|
||||
event.mData = ae->Characters();
|
||||
|
||||
if (ae->Action() == AndroidGeckoEvent::IME_COMPOSE_TEXT) {
|
||||
// Because we're leaving the composition open, we need to
|
||||
// include proper text ranges to make the editor happy.
|
||||
TextRange range;
|
||||
range.mStartOffset = 0;
|
||||
range.mEndOffset = event.theText.Length();
|
||||
range.mEndOffset = event.mData.Length();
|
||||
range.mRangeType = NS_TEXTRANGE_RAWINPUT;
|
||||
event.mRanges = new TextRangeArray();
|
||||
event.mRanges->AppendElement(range);
|
||||
@ -1986,7 +1986,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
||||
InitEvent(queryEvent, nullptr);
|
||||
DispatchEvent(&queryEvent);
|
||||
MOZ_ASSERT(queryEvent.mSucceeded && !queryEvent.mWasAsync);
|
||||
event.theText = queryEvent.mReply.mString;
|
||||
event.mData = queryEvent.mReply.mString;
|
||||
|
||||
mIMEComposingStart = queryEvent.mReply.mOffset;
|
||||
}
|
||||
@ -2001,14 +2001,14 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
||||
} else {
|
||||
// If the new composition matches the existing composition,
|
||||
// reuse the old composition.
|
||||
event.theText = mIMEComposingText;
|
||||
event.mData = mIMEComposingText;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ANDROID_IME
|
||||
const NS_ConvertUTF16toUTF8 theText8(event.theText);
|
||||
const char* text = theText8.get();
|
||||
const NS_ConvertUTF16toUTF8 data(event.mData);
|
||||
const char* text = data.get();
|
||||
ALOGIME("IME: IME_SET_TEXT: text=\"%s\", length=%u, range=%u",
|
||||
text, event.theText.Length(), event.mRanges->Length());
|
||||
text, event.mData.Length(), event.mRanges->Length());
|
||||
#endif // DEBUG_ANDROID_IME
|
||||
|
||||
DispatchEvent(&event);
|
||||
|
@ -2718,11 +2718,11 @@ IMEInputHandler::DispatchTextEvent(const nsString& aText,
|
||||
|
||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
|
||||
textEvent.time = PR_IntervalNow();
|
||||
textEvent.theText = aText;
|
||||
textEvent.mData = aText;
|
||||
if (!aDoCommit) {
|
||||
textEvent.mRanges = CreateTextRangeArray(aAttrString, aSelectedRange);
|
||||
}
|
||||
mLastDispatchedCompositionString = textEvent.theText;
|
||||
mLastDispatchedCompositionString = textEvent.mData;
|
||||
return DispatchEvent(textEvent);
|
||||
}
|
||||
|
||||
|
@ -1111,7 +1111,7 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString,
|
||||
|
||||
uint32_t targetOffset = mCompositionStart;
|
||||
|
||||
textEvent.theText = mDispatchedCompositionString = aCompositionString;
|
||||
textEvent.mData = mDispatchedCompositionString = aCompositionString;
|
||||
|
||||
if (!aIsCommit) {
|
||||
// NOTE: SetTextRangeList() assumes that mDispatchedCompositionString
|
||||
|
@ -3050,7 +3050,7 @@ nsWindow::OnKeyPressEvent(GdkEventKey *aEvent)
|
||||
textString[0] = H_SURROGATE(event.charCode);
|
||||
textString[1] = L_SURROGATE(event.charCode);
|
||||
textString[2] = 0;
|
||||
textEvent.theText = textString;
|
||||
textEvent.mData = textString;
|
||||
textEvent.time = event.time;
|
||||
DispatchEvent(&textEvent, status);
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ struct ParamTraits<mozilla::WidgetTextEvent>
|
||||
{
|
||||
WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
|
||||
WriteParam(aMsg, aParam.mSeqno);
|
||||
WriteParam(aMsg, aParam.theText);
|
||||
WriteParam(aMsg, aParam.mData);
|
||||
WriteParam(aMsg, aParam.isChar);
|
||||
bool hasRanges = !!aParam.mRanges;
|
||||
WriteParam(aMsg, hasRanges);
|
||||
@ -465,7 +465,7 @@ struct ParamTraits<mozilla::WidgetTextEvent>
|
||||
if (!ReadParam(aMsg, aIter,
|
||||
static_cast<mozilla::WidgetGUIEvent*>(aResult)) ||
|
||||
!ReadParam(aMsg, aIter, &aResult->mSeqno) ||
|
||||
!ReadParam(aMsg, aIter, &aResult->theText) ||
|
||||
!ReadParam(aMsg, aIter, &aResult->mData) ||
|
||||
!ReadParam(aMsg, aIter, &aResult->isChar) ||
|
||||
!ReadParam(aMsg, aIter, &hasRanges)) {
|
||||
return false;
|
||||
|
@ -1598,7 +1598,7 @@ nsIMM32Handler::DispatchTextEvent(nsWindow* aWindow,
|
||||
event.mRanges = CreateTextRangeArray();
|
||||
}
|
||||
|
||||
event.theText = mLastDispatchedCompositionString = mCompositionString;
|
||||
event.mData = mLastDispatchedCompositionString = mCompositionString;
|
||||
|
||||
aWindow->DispatchWindowEvent(&event);
|
||||
|
||||
|
@ -1652,11 +1652,11 @@ nsTextStore::FlushPendingActions()
|
||||
"dispatching text event...", this));
|
||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
|
||||
mWidget->InitEvent(textEvent);
|
||||
textEvent.theText = action.mData;
|
||||
textEvent.mData = action.mData;
|
||||
if (action.mRanges->IsEmpty()) {
|
||||
TextRange wholeRange;
|
||||
wholeRange.mStartOffset = 0;
|
||||
wholeRange.mEndOffset = textEvent.theText.Length();
|
||||
wholeRange.mEndOffset = textEvent.mData.Length();
|
||||
wholeRange.mRangeType = NS_TEXTRANGE_RAWINPUT;
|
||||
action.mRanges->AppendElement(wholeRange);
|
||||
}
|
||||
@ -1679,7 +1679,7 @@ nsTextStore::FlushPendingActions()
|
||||
"dispatching text event...", this));
|
||||
WidgetTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
|
||||
mWidget->InitEvent(textEvent);
|
||||
textEvent.theText = action.mData;
|
||||
textEvent.mData = action.mData;
|
||||
mWidget->DispatchWindowEvent(&textEvent);
|
||||
if (!mWidget || mWidget->Destroyed()) {
|
||||
break;
|
||||
@ -1690,7 +1690,7 @@ nsTextStore::FlushPendingActions()
|
||||
"dispatching compositionend event...", this));
|
||||
WidgetCompositionEvent compositionEnd(true, NS_COMPOSITION_END,
|
||||
mWidget);
|
||||
compositionEnd.data = textEvent.theText;
|
||||
compositionEnd.data = textEvent.mData;
|
||||
mWidget->InitEvent(compositionEnd);
|
||||
mWidget->DispatchWindowEvent(&compositionEnd);
|
||||
if (!mWidget || mWidget->Destroyed()) {
|
||||
|
@ -388,7 +388,7 @@ PuppetWidget::IMEEndComposition(bool aCancel)
|
||||
// SendEndIMEComposition is always called since ResetInputState
|
||||
// should always be called even if we aren't composing something.
|
||||
if (!mTabChild ||
|
||||
!mTabChild->SendEndIMEComposition(aCancel, &textEvent.theText)) {
|
||||
!mTabChild->SendEndIMEComposition(aCancel, &textEvent.mData)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user