mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 960871 part.2 Rename WidgetCompositionEvent::data to WidgetCompositionEvent::mData r=smaug
This commit is contained in:
parent
ea79d5919e
commit
aafe327f6d
@ -2132,7 +2132,7 @@ nsDOMWindowUtils::SendCompositionEvent(const nsAString& aType,
|
||||
WidgetCompositionEvent compositionEvent(true, msg, widget);
|
||||
InitEvent(compositionEvent);
|
||||
if (msg != NS_COMPOSITION_START) {
|
||||
compositionEvent.data = aData;
|
||||
compositionEvent.mData = aData;
|
||||
}
|
||||
|
||||
compositionEvent.mFlags.mIsSynthesizedForTests = true;
|
||||
|
@ -32,7 +32,8 @@ CompositionEvent::CompositionEvent(EventTarget* aOwner,
|
||||
mEvent->mFlags.mCancelable = false;
|
||||
}
|
||||
|
||||
mData = mEvent->AsCompositionEvent()->data;
|
||||
// XXX Do we really need to duplicate the data value?
|
||||
mData = mEvent->AsCompositionEvent()->mData;
|
||||
// TODO: Native event should have locale information.
|
||||
}
|
||||
|
||||
|
@ -817,7 +817,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
compositionEvent->widget);
|
||||
DoQuerySelectedText(&selectedText);
|
||||
NS_ASSERTION(selectedText.mSucceeded, "Failed to get selected text");
|
||||
compositionEvent->data = selectedText.mReply.mString;
|
||||
compositionEvent->mData = selectedText.mReply.mString;
|
||||
}
|
||||
// through to compositionend handling
|
||||
case NS_COMPOSITION_END:
|
||||
|
@ -76,12 +76,12 @@ TextComposition::MaybeDispatchCompositionUpdate(const WidgetTextEvent* aEvent)
|
||||
aEvent->widget);
|
||||
compositionUpdate.time = aEvent->time;
|
||||
compositionUpdate.timeStamp = aEvent->timeStamp;
|
||||
compositionUpdate.data = aEvent->mData;
|
||||
compositionUpdate.mData = aEvent->mData;
|
||||
compositionUpdate.mFlags.mIsSynthesizedForTests =
|
||||
aEvent->mFlags.mIsSynthesizedForTests;
|
||||
|
||||
nsEventStatus status = nsEventStatus_eConsumeNoDefault;
|
||||
mLastData = compositionUpdate.data;
|
||||
mLastData = compositionUpdate.mData;
|
||||
EventDispatcher::Dispatch(mNode, mPresContext,
|
||||
&compositionUpdate, nullptr, &status, nullptr);
|
||||
return !Destroyed();
|
||||
@ -146,7 +146,7 @@ TextComposition::DispatchEvent(WidgetGUIEvent* aEvent,
|
||||
nsString* committingData = nullptr;
|
||||
switch (aEvent->message) {
|
||||
case NS_COMPOSITION_END:
|
||||
committingData = &aEvent->AsCompositionEvent()->data;
|
||||
committingData = &aEvent->AsCompositionEvent()->mData;
|
||||
break;
|
||||
case NS_TEXT_TEXT:
|
||||
committingData = &aEvent->AsTextEvent()->mData;
|
||||
@ -304,7 +304,7 @@ TextComposition::RequestToCommit(nsIWidget* aWidget, bool aDiscard)
|
||||
if (!Destroyed() && !widget->Destroyed()) {
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
WidgetCompositionEvent endEvent(true, NS_COMPOSITION_END, widget);
|
||||
endEvent.data = commitData;
|
||||
endEvent.mData = commitData;
|
||||
endEvent.mFlags.mIsSynthesizedForTests = true;
|
||||
widget->DispatchEvent(&endEvent, status);
|
||||
}
|
||||
@ -435,7 +435,7 @@ TextComposition::CompositionEventDispatcher::Run()
|
||||
ContentEventHandler handler(presContext);
|
||||
handler.OnQuerySelectedText(&selectedText);
|
||||
NS_ASSERTION(selectedText.mSucceeded, "Failed to get selected text");
|
||||
compStart.data = selectedText.mReply.mString;
|
||||
compStart.mData = selectedText.mReply.mString;
|
||||
compStart.mFlags.mIsSynthesizedForTests =
|
||||
mTextComposition->IsSynthesizedForTests();
|
||||
IMEStateManager::DispatchCompositionEvent(mEventTarget, presContext,
|
||||
@ -445,7 +445,7 @@ TextComposition::CompositionEventDispatcher::Run()
|
||||
}
|
||||
case NS_COMPOSITION_END: {
|
||||
WidgetCompositionEvent compEvent(true, mEventMessage, widget);
|
||||
compEvent.data = mData;
|
||||
compEvent.mData = mData;
|
||||
compEvent.mFlags.mIsSynthesizedForTests =
|
||||
mTextComposition->IsSynthesizedForTests();
|
||||
IMEStateManager::DispatchCompositionEvent(mEventTarget, presContext,
|
||||
|
@ -326,14 +326,14 @@ public:
|
||||
// The composition string or the commit string. If the instance is a
|
||||
// compositionstart event, this is initialized with selected text by
|
||||
// TextComposition automatically.
|
||||
nsString data;
|
||||
nsString mData;
|
||||
|
||||
void AssignCompositionEventData(const WidgetCompositionEvent& aEvent,
|
||||
bool aCopyTargets)
|
||||
{
|
||||
AssignGUIEventData(aEvent, aCopyTargets);
|
||||
|
||||
data = aEvent.data;
|
||||
mData = aEvent.mData;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1868,7 +1868,7 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
|
||||
{
|
||||
WidgetCompositionEvent event(true, NS_COMPOSITION_END, this);
|
||||
InitEvent(event, nullptr);
|
||||
event.data = ae->Characters();
|
||||
event.mData = ae->Characters();
|
||||
DispatchEvent(&event);
|
||||
}
|
||||
|
||||
|
@ -2820,7 +2820,7 @@ IMEInputHandler::InsertTextAsCommittingComposition(
|
||||
|
||||
WidgetCompositionEvent compEnd(true, NS_COMPOSITION_END, mWidget);
|
||||
InitCompositionEvent(compEnd);
|
||||
compEnd.data = mLastDispatchedCompositionString;
|
||||
compEnd.mData = mLastDispatchedCompositionString;
|
||||
DispatchEvent(compEnd);
|
||||
if (Destroyed()) {
|
||||
PR_LOG(gLog, PR_LOG_ALWAYS,
|
||||
@ -2929,7 +2929,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString,
|
||||
if (doCommit) {
|
||||
WidgetCompositionEvent compEnd(true, NS_COMPOSITION_END, mWidget);
|
||||
InitCompositionEvent(compEnd);
|
||||
compEnd.data = mLastDispatchedCompositionString;
|
||||
compEnd.mData = mLastDispatchedCompositionString;
|
||||
DispatchEvent(compEnd);
|
||||
if (Destroyed()) {
|
||||
PR_LOG(gLog, PR_LOG_ALWAYS,
|
||||
|
@ -1048,7 +1048,7 @@ nsGtkIMModule::DispatchCompositionEnd()
|
||||
WidgetCompositionEvent compEvent(true, NS_COMPOSITION_END,
|
||||
mLastFocusedWindow);
|
||||
InitEvent(compEvent);
|
||||
compEvent.data = mDispatchedCompositionString;
|
||||
compEvent.mData = mDispatchedCompositionString;
|
||||
nsEventStatus status;
|
||||
nsCOMPtr<nsIWidget> kungFuDeathGrip = mLastFocusedWindow;
|
||||
mLastFocusedWindow->DispatchEvent(&compEvent, status);
|
||||
|
@ -495,7 +495,7 @@ struct ParamTraits<mozilla::WidgetCompositionEvent>
|
||||
{
|
||||
WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
|
||||
WriteParam(aMsg, aParam.mSeqno);
|
||||
WriteParam(aMsg, aParam.data);
|
||||
WriteParam(aMsg, aParam.mData);
|
||||
}
|
||||
|
||||
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
||||
@ -503,7 +503,7 @@ struct ParamTraits<mozilla::WidgetCompositionEvent>
|
||||
return ReadParam(aMsg, aIter,
|
||||
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mSeqno) &&
|
||||
ReadParam(aMsg, aIter, &aResult->data);
|
||||
ReadParam(aMsg, aIter, &aResult->mData);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1227,7 +1227,7 @@ nsIMM32Handler::HandleEndComposition(nsWindow* aWindow)
|
||||
|
||||
aWindow->InitEvent(event, &point);
|
||||
// The last dispatched composition string must be the committed string.
|
||||
event.data = mLastDispatchedCompositionString;
|
||||
event.mData = mLastDispatchedCompositionString;
|
||||
aWindow->DispatchWindowEvent(&event);
|
||||
mIsComposing = false;
|
||||
mComposingWindow = nullptr;
|
||||
|
@ -1690,7 +1690,7 @@ nsTextStore::FlushPendingActions()
|
||||
"dispatching compositionend event...", this));
|
||||
WidgetCompositionEvent compositionEnd(true, NS_COMPOSITION_END,
|
||||
mWidget);
|
||||
compositionEnd.data = textEvent.mData;
|
||||
compositionEnd.mData = textEvent.mData;
|
||||
mWidget->InitEvent(compositionEnd);
|
||||
mWidget->DispatchWindowEvent(&compositionEnd);
|
||||
if (!mWidget || mWidget->Destroyed()) {
|
||||
|
Loading…
Reference in New Issue
Block a user