mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 895274 part.116 Rename NS_COPY to eCopy r=smaug
This commit is contained in:
parent
7eac786f6f
commit
11ced9534c
@ -631,7 +631,7 @@ nsCopySupport::FireClipboardEvent(EventMessage aEventMessage,
|
||||
*aActionTaken = false;
|
||||
}
|
||||
|
||||
NS_ASSERTION(aEventMessage == NS_CUT || aEventMessage == NS_COPY ||
|
||||
NS_ASSERTION(aEventMessage == NS_CUT || aEventMessage == eCopy ||
|
||||
aEventMessage == NS_PASTE,
|
||||
"Invalid clipboard event type");
|
||||
|
||||
|
@ -64,7 +64,7 @@ class nsCopySupport
|
||||
|
||||
/**
|
||||
* Fires a cut, copy or paste event, on the given presshell, depending
|
||||
* on the value of aEventMessage, which should be either NS_CUT, NS_COPY or
|
||||
* on the value of aEventMessage, which should be either NS_CUT, eCopy or
|
||||
* NS_PASTE, and perform the default copy action if the event was not
|
||||
* cancelled.
|
||||
*
|
||||
|
@ -520,7 +520,7 @@ nsClipboardCommand::DoCommand(const char *aCommandName, nsISupports *aContext)
|
||||
nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
|
||||
|
||||
EventMessage eventMessage = NS_COPY;
|
||||
EventMessage eventMessage = eCopy;
|
||||
if (strcmp(aCommandName, "cmd_cut") == 0) {
|
||||
eventMessage = NS_CUT;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ ClipboardEvent::Constructor(const GlobalObject& aGlobal,
|
||||
// Always create a clipboardData for the copy event. If this is changed to
|
||||
// support other types of events, make sure that read/write privileges are
|
||||
// checked properly within DataTransfer.
|
||||
clipboardData = new DataTransfer(ToSupports(e), NS_COPY, false, -1);
|
||||
clipboardData = new DataTransfer(ToSupports(e), eCopy, false, -1);
|
||||
clipboardData->SetData(aParam.mDataType, aParam.mData);
|
||||
}
|
||||
}
|
||||
@ -105,7 +105,7 @@ ClipboardEvent::GetClipboardData()
|
||||
if (!event->clipboardData) {
|
||||
if (mEventIsInternal) {
|
||||
event->clipboardData =
|
||||
new DataTransfer(ToSupports(this), NS_COPY, false, -1);
|
||||
new DataTransfer(ToSupports(this), eCopy, false, -1);
|
||||
} else {
|
||||
event->clipboardData =
|
||||
new DataTransfer(ToSupports(this), event->mMessage,
|
||||
|
@ -87,7 +87,7 @@ DataTransfer::DataTransfer(nsISupports* aParent, EventMessage aEventMessage,
|
||||
// clear the readonly state. Otherwise, the data is already present. For
|
||||
// external usage, cache the data from the native clipboard or drag.
|
||||
if (aEventMessage == NS_CUT ||
|
||||
aEventMessage == NS_COPY ||
|
||||
aEventMessage == eCopy ||
|
||||
aEventMessage == eDragStart ||
|
||||
aEventMessage == eLegacyDragGesture) {
|
||||
mReadOnly = false;
|
||||
@ -543,7 +543,7 @@ DataTransfer::MozTypesAt(uint32_t aIndex, ErrorResult& aRv)
|
||||
{
|
||||
// Only the first item is valid for clipboard events
|
||||
if (aIndex > 0 &&
|
||||
(mEventMessage == NS_CUT || mEventMessage == NS_COPY ||
|
||||
(mEventMessage == NS_CUT || mEventMessage == eCopy ||
|
||||
mEventMessage == NS_PASTE)) {
|
||||
aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
||||
return nullptr;
|
||||
@ -584,7 +584,7 @@ DataTransfer::MozGetDataAt(const nsAString& aFormat, uint32_t aIndex,
|
||||
|
||||
// Only the first item is valid for clipboard events
|
||||
if (aIndex > 0 &&
|
||||
(mEventMessage == NS_CUT || mEventMessage == NS_COPY ||
|
||||
(mEventMessage == NS_CUT || mEventMessage == eCopy ||
|
||||
mEventMessage == NS_PASTE)) {
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
@ -696,7 +696,7 @@ DataTransfer::MozSetDataAt(const nsAString& aFormat, nsIVariant* aData,
|
||||
|
||||
// Only the first item is valid for clipboard events
|
||||
if (aIndex > 0 &&
|
||||
(mEventMessage == NS_CUT || mEventMessage == NS_COPY ||
|
||||
(mEventMessage == NS_CUT || mEventMessage == eCopy ||
|
||||
mEventMessage == NS_PASTE)) {
|
||||
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
||||
}
|
||||
@ -742,7 +742,7 @@ DataTransfer::MozClearDataAt(const nsAString& aFormat, uint32_t aIndex,
|
||||
|
||||
// Only the first item is valid for clipboard events
|
||||
if (aIndex > 0 &&
|
||||
(mEventMessage == NS_CUT || mEventMessage == NS_COPY ||
|
||||
(mEventMessage == NS_CUT || mEventMessage == eCopy ||
|
||||
mEventMessage == NS_PASTE)) {
|
||||
aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
||||
return;
|
||||
@ -758,7 +758,7 @@ DataTransfer::MozClearDataAtHelper(const nsAString& aFormat, uint32_t aIndex,
|
||||
MOZ_ASSERT(!mReadOnly);
|
||||
MOZ_ASSERT(aIndex < mItems.Length());
|
||||
MOZ_ASSERT(aIndex == 0 ||
|
||||
(mEventMessage != NS_CUT && mEventMessage != NS_COPY &&
|
||||
(mEventMessage != NS_CUT && mEventMessage != eCopy &&
|
||||
mEventMessage != NS_PASTE));
|
||||
|
||||
nsAutoString format;
|
||||
@ -1300,7 +1300,7 @@ DataTransfer::FillInExternalData(TransferItem& aItem, uint32_t aIndex)
|
||||
}
|
||||
|
||||
// only drag and paste events should be calling FillInExternalData
|
||||
NS_ASSERTION(mEventMessage != NS_CUT && mEventMessage != NS_COPY,
|
||||
NS_ASSERTION(mEventMessage != NS_CUT && mEventMessage != eCopy,
|
||||
"clipboard event with empty data");
|
||||
|
||||
NS_ConvertUTF16toUTF8 utf8format(aItem.mFormat);
|
||||
|
@ -422,7 +422,7 @@ EVENT(wheel,
|
||||
EventNameType_All,
|
||||
eWheelEventClass)
|
||||
EVENT(copy,
|
||||
NS_COPY,
|
||||
eCopy,
|
||||
EventNameType_HTMLXUL,
|
||||
eClipboardEventClass)
|
||||
EVENT(cut,
|
||||
|
@ -1217,7 +1217,7 @@ NS_IMETHODIMP nsPlaintextEditor::CanCut(bool *aCanCut)
|
||||
NS_IMETHODIMP nsPlaintextEditor::Copy()
|
||||
{
|
||||
bool actionTaken = false;
|
||||
FireClipboardEvent(NS_COPY, nsIClipboard::kGlobalClipboard, &actionTaken);
|
||||
FireClipboardEvent(eCopy, nsIClipboard::kGlobalClipboard, &actionTaken);
|
||||
|
||||
return actionTaken ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -2620,7 +2620,8 @@ NS_IMETHODIMP nsDocumentViewer::SelectAll()
|
||||
|
||||
NS_IMETHODIMP nsDocumentViewer::CopySelection()
|
||||
{
|
||||
nsCopySupport::FireClipboardEvent(NS_COPY, nsIClipboard::kGlobalClipboard, mPresShell, nullptr);
|
||||
nsCopySupport::FireClipboardEvent(eCopy, nsIClipboard::kGlobalClipboard,
|
||||
mPresShell, nullptr);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ NS_EVENT_MESSAGE(eXULCommand, eXULCommandEventFirst)
|
||||
|
||||
// Cut, copy, paste events
|
||||
NS_EVENT_MESSAGE(eClipboardEventFirst, 3100)
|
||||
NS_EVENT_MESSAGE(NS_COPY, eClipboardEventFirst)
|
||||
NS_EVENT_MESSAGE(eCopy, eClipboardEventFirst)
|
||||
NS_EVENT_MESSAGE(NS_CUT, eClipboardEventFirst + 1)
|
||||
NS_EVENT_MESSAGE(NS_PASTE, eClipboardEventFirst + 2)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user