mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 604860: Stop doing silly leaky stuff with nsDataObjs. r=jimm a=joe
This commit is contained in:
parent
9b468f97d9
commit
6f188e4a26
@ -756,15 +756,11 @@ STDMETHODIMP nsDataObj::EndOperation(HRESULT hResult,
|
||||
DWORD dwEffects)
|
||||
{
|
||||
mIsInOperation = FALSE;
|
||||
Release();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP nsDataObj::GetAsyncMode(BOOL *pfIsOpAsync)
|
||||
{
|
||||
if (!pfIsOpAsync)
|
||||
return E_FAIL;
|
||||
|
||||
*pfIsOpAsync = mIsAsyncMode;
|
||||
|
||||
return S_OK;
|
||||
@ -772,9 +768,6 @@ STDMETHODIMP nsDataObj::GetAsyncMode(BOOL *pfIsOpAsync)
|
||||
|
||||
STDMETHODIMP nsDataObj::InOperation(BOOL *pfInAsyncOp)
|
||||
{
|
||||
if (!pfInAsyncOp)
|
||||
return E_FAIL;
|
||||
|
||||
*pfInAsyncOp = mIsInOperation;
|
||||
|
||||
return S_OK;
|
||||
|
@ -257,48 +257,6 @@ void nsDataObjCollection::AddDataObject(IDataObject * aDataObj)
|
||||
mDataObjects.AppendElement(dataObj);
|
||||
}
|
||||
|
||||
// IAsyncOperation methods
|
||||
STDMETHODIMP nsDataObjCollection::EndOperation(HRESULT hResult,
|
||||
IBindCtx *pbcReserved,
|
||||
DWORD dwEffects)
|
||||
{
|
||||
mIsInOperation = FALSE;
|
||||
Release();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP nsDataObjCollection::GetAsyncMode(BOOL *pfIsOpAsync)
|
||||
{
|
||||
if (!pfIsOpAsync)
|
||||
return E_FAIL;
|
||||
|
||||
*pfIsOpAsync = mIsAsyncMode;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP nsDataObjCollection::InOperation(BOOL *pfInAsyncOp)
|
||||
{
|
||||
if (!pfInAsyncOp)
|
||||
return E_FAIL;
|
||||
|
||||
*pfInAsyncOp = mIsInOperation;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP nsDataObjCollection::SetAsyncMode(BOOL fDoOpAsync)
|
||||
{
|
||||
mIsAsyncMode = fDoOpAsync;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP nsDataObjCollection::StartOperation(IBindCtx *pbcReserved)
|
||||
{
|
||||
mIsInOperation = TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Methods for getting data
|
||||
HRESULT nsDataObjCollection::GetFile(LPFORMATETC pFE, LPSTGMEDIUM pSTM)
|
||||
{
|
||||
|
@ -155,14 +155,6 @@ class nsDataObjCollection : public nsIDataObjCollection, public nsDataObj
|
||||
// Return the adapter
|
||||
//CfDragDrop& GetDragDrop() const;
|
||||
|
||||
// IAsyncOperation methods
|
||||
STDMETHOD(EndOperation)(HRESULT hResult, IBindCtx *pbcReserved,
|
||||
DWORD dwEffects);
|
||||
STDMETHOD(GetAsyncMode)(BOOL *pfIsOpAsync);
|
||||
STDMETHOD(InOperation)(BOOL *pfInAsyncOp);
|
||||
STDMETHOD(SetAsyncMode)(BOOL fDoOpAsync);
|
||||
STDMETHOD(StartOperation)(IBindCtx *pbcReserved);
|
||||
|
||||
protected:
|
||||
BOOL FormatsMatch(const FORMATETC& source, const FORMATETC& target) const;
|
||||
|
||||
|
@ -303,34 +303,18 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj,
|
||||
// Start dragging
|
||||
StartDragSession();
|
||||
|
||||
// check shell32.dll version and do async drag if it is >= 5.0
|
||||
PRUint64 lShellVersion = GetShellVersion();
|
||||
IAsyncOperation *pAsyncOp = NULL;
|
||||
PRBool isAsyncAvailable = LL_UCMP(lShellVersion, >=, LL_INIT(5, 0));
|
||||
if (isAsyncAvailable)
|
||||
{
|
||||
// do async drag
|
||||
nsRefPtr<IAsyncOperation> pAsyncOp;
|
||||
// Offer to do an async drag
|
||||
if (SUCCEEDED(aDataObj->QueryInterface(IID_IAsyncOperation,
|
||||
(void**)&pAsyncOp)))
|
||||
getter_AddRefs(pAsyncOp)))) {
|
||||
pAsyncOp->SetAsyncMode(VARIANT_TRUE);
|
||||
} else {
|
||||
NS_NOTREACHED("When did our data object stop being async");
|
||||
}
|
||||
|
||||
// Call the native D&D method
|
||||
HRESULT res = ::DoDragDrop(aDataObj, mNativeDragSrc, effects, &winDropRes);
|
||||
|
||||
if (isAsyncAvailable)
|
||||
{
|
||||
// if dragging async
|
||||
// check for async operation
|
||||
BOOL isAsync = FALSE;
|
||||
if (pAsyncOp)
|
||||
{
|
||||
pAsyncOp->InOperation(&isAsync);
|
||||
if (!isAsync)
|
||||
aDataObj->Release();
|
||||
}
|
||||
}
|
||||
|
||||
// In cases where the drop operation completed outside the application, update
|
||||
// the source node's nsIDOMNSDataTransfer dropEffect value so it is up to date.
|
||||
if (!mSentLocalDropEvent) {
|
||||
|
Loading…
Reference in New Issue
Block a user