Skip to content

Commit 6e9d49d

Browse files
committed
Merge in 'release/8.0' changes
2 parents d4a8ecb + ad4cb44 commit 6e9d49d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/System.Windows.Forms.Design/src/System/ComponentModel/Design/MultilineStringEditor.OleCallback.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,23 @@ public HRESULT QueryAcceptData(Com.IDataObject* lpdataobj, ushort* lpcfFormat, R
125125

126126
FORMATETC textFormat = new()
127127
{
128-
cfFormat = (ushort)CLIPBOARD_FORMAT.CF_TEXT
128+
cfFormat = (ushort)CLIPBOARD_FORMAT.CF_TEXT,
129+
dwAspect = (uint)DVASPECT.DVASPECT_CONTENT,
130+
lindex = -1,
131+
tymed = (uint)(TYMED.TYMED_HGLOBAL | TYMED.TYMED_ISTREAM | TYMED.TYMED_GDI)
129132
};
130133

131134
FORMATETC unicodeFormat = new()
132135
{
133-
cfFormat = (ushort)CLIPBOARD_FORMAT.CF_UNICODETEXT
136+
cfFormat = (ushort)CLIPBOARD_FORMAT.CF_UNICODETEXT,
137+
dwAspect = (uint)DVASPECT.DVASPECT_CONTENT,
138+
lindex = -1,
139+
tymed = (uint)(TYMED.TYMED_HGLOBAL | TYMED.TYMED_ISTREAM | TYMED.TYMED_GDI)
134140
};
135141

136-
return lpdataobj->QueryGetData(&textFormat).Succeeded || lpdataobj->QueryGetData(&unicodeFormat).Succeeded
137-
? HRESULT.S_OK
138-
: HRESULT.E_FAIL;
142+
bool success = lpdataobj->QueryGetData(&textFormat).Succeeded || lpdataobj->QueryGetData(&unicodeFormat).Succeeded;
143+
Debug.Assert(success);
144+
return success ? HRESULT.S_OK : HRESULT.E_FAIL;
139145
}
140146

141147
return HRESULT.E_NOTIMPL;

0 commit comments

Comments
 (0)