static HRESULT WINAPI IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj) { IRichEditOleImpl *This = impl_from_IRichEditOle(me); CHARRANGE tmpchrg; TRACE("(%p,%p,%d)\n",This, lpchrg, reco); if(!lplpdataobj) return E_INVALIDARG; if(!lpchrg) { ME_GetSelection(This->editor, (int*)&tmpchrg.cpMin, (int*)&tmpchrg.cpMax); lpchrg = &tmpchrg; } return ME_GetDataObject(This->editor, lpchrg, lplpdataobj); }
static HRESULT WINAPI IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg, DWORD reco, LPDATAOBJECT *lplpdataobj) { IRichEditOleImpl *This = impl_from_IRichEditOle(me); ME_Cursor start; int nChars; TRACE("(%p,%p,%d)\n",This, lpchrg, reco); if(!lplpdataobj) return E_INVALIDARG; if(!lpchrg) { int nFrom, nTo, nStartCur = ME_GetSelectionOfs(This->editor, &nFrom, &nTo); start = This->editor->pCursors[nStartCur]; nChars = nTo - nFrom; } else { ME_CursorFromCharOfs(This->editor, lpchrg->cpMin, &start); nChars = lpchrg->cpMax - lpchrg->cpMin; } return ME_GetDataObject(This->editor, &start, nChars, lplpdataobj); }