Commit 7fa47cd3 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

msctf: Beginning implementation of ITfContext::GetEnd.

parent 6772a07a
......@@ -321,8 +321,31 @@ static HRESULT WINAPI Context_GetEnd (ITfContext *iface,
TfEditCookie ec, ITfRange **ppEnd)
{
Context *This = (Context *)iface;
FIXME("STUB:(%p)\n",This);
return E_NOTIMPL;
EditCookie *cookie;
LONG end;
TRACE("(%p) %i %p\n",This,ec,ppEnd);
if (!ppEnd)
return E_INVALIDARG;
*ppEnd = NULL;
if (!This->connected)
return TF_E_DISCONNECTED;
if (get_Cookie_magic(ec)!=COOKIE_MAGIC_EDITCOOKIE)
return TF_E_NOLOCK;
if (!This->pITextStoreACP)
{
FIXME("Context does not have a ITextStoreACP\n");
return E_NOTIMPL;
}
cookie = get_Cookie_data(ec);
ITextStoreACP_GetEndACP(This->pITextStoreACP,&end);
return Range_Constructor(iface, This->pITextStoreACP, cookie->lockType, end, end, ppEnd);
}
static HRESULT WINAPI Context_GetActiveView (ITfContext *iface,
......
......@@ -57,6 +57,7 @@ static INT test_KEV_OnSetFocus = SINK_UNEXPECTED;
static INT test_ACP_AdviseSink = SINK_UNEXPECTED;
static INT test_ACP_GetStatus = SINK_UNEXPECTED;
static INT test_ACP_RequestLock = SINK_UNEXPECTED;
static INT test_ACP_GetEndACP = SINK_UNEXPECTED;
static INT test_DoEditSession = SINK_UNEXPECTED;
......@@ -269,7 +270,8 @@ static HRESULT WINAPI TextStoreACP_RetrieveRequestedAttrs(ITextStoreACP *iface,
static HRESULT WINAPI TextStoreACP_GetEndACP(ITextStoreACP *iface,
LONG *pacp)
{
trace("\n");
ok(test_ACP_GetEndACP == SINK_EXPECTED,"Unexpected TextStoreACP_GetEndACP\n");
test_ACP_GetEndACP = SINK_FIRED;
return S_OK;
}
static HRESULT WINAPI TextStoreACP_GetActiveView(ITextStoreACP *iface,
......@@ -1398,6 +1400,22 @@ TfEditCookie ec)
ok(range != NULL,"Range set to NULL\n");
ITfRange_Release(range);
hr = ITfContext_GetEnd(cxt,ec,NULL);
ok(hr == E_INVALIDARG,"Unexpected return code %x\n",hr);
range = (ITfRange*)0xdeaddead;
hr = ITfContext_GetEnd(cxt,0xdeadcafe,&range);
ok(hr == TF_E_NOLOCK,"Unexpected return code %x\n",hr);
ok(range == NULL,"Range not set to NULL\n");
test_ACP_GetEndACP = SINK_EXPECTED;
hr = ITfContext_GetEnd(cxt,ec,&range);
ok(SUCCEEDED(hr),"Unexpected return code %x\n",hr);
ok(range != NULL,"Range set to NULL\n");
ok(test_ACP_GetEndACP == SINK_FIRED, "GetEndACP not fired as expected\n");
ITfRange_Release(range);
ITfContext_Release(cxt);
ITfDocumentMgr_Release(dm);
return 0xdeadcafe;
......
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