Commit 575b0e14 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: Don't set cf_dataobject if we're clearing the clipboard.

parent 1e73a546
...@@ -1729,7 +1729,8 @@ HRESULT WINAPI OleSetClipboard(IDataObject* data) ...@@ -1729,7 +1729,8 @@ HRESULT WINAPI OleSetClipboard(IDataObject* data)
hr = set_src_dataobject(clipbrd, data); hr = set_src_dataobject(clipbrd, data);
if(FAILED(hr)) goto end; if(FAILED(hr)) goto end;
hr = set_dataobject_format(wnd); if(data)
hr = set_dataobject_format(wnd);
end: end:
......
...@@ -595,6 +595,21 @@ static void test_enum_fmtetc(IDataObject *src) ...@@ -595,6 +595,21 @@ static void test_enum_fmtetc(IDataObject *src)
IDataObject_Release(data); IDataObject_Release(data);
} }
static void test_no_cf_dataobject(void)
{
UINT cf_dataobject = RegisterClipboardFormatA("DataObject");
UINT cf_ole_priv_data = RegisterClipboardFormatA("Ole Private Data");
HANDLE h;
OpenClipboard(NULL);
h = GetClipboardData(cf_dataobject);
ok(!h, "got %p\n", h);
h = GetClipboardData(cf_ole_priv_data);
ok(!h, "got %p\n", h);
CloseClipboard();
}
static void test_cf_dataobject(IDataObject *data) static void test_cf_dataobject(IDataObject *data)
{ {
UINT cf = 0; UINT cf = 0;
...@@ -851,6 +866,7 @@ static void test_set_clipboard(void) ...@@ -851,6 +866,7 @@ static void test_set_clipboard(void)
ok(OleSetClipboard(NULL) == S_OK, "failed to clear clipboard, hr = 0x%08x\n", hr); ok(OleSetClipboard(NULL) == S_OK, "failed to clear clipboard, hr = 0x%08x\n", hr);
test_no_cf_dataobject();
test_enum_fmtetc(NULL); test_enum_fmtetc(NULL);
ref = IDataObject_Release(data1); ref = IDataObject_Release(data1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment