Module: wine Branch: master Commit: 0691af08c6645aede26028fd44f2be8802e256f0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0691af08c6645aede26028fd44...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon Feb 1 14:59:13 2016 +0300
dwrite: Implement GetTextBeforePosition() for layout analysis source.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dwrite/layout.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 8847c97..86eab09 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -4130,8 +4130,20 @@ static HRESULT WINAPI dwritetextlayout_source_GetTextAtPosition(IDWriteTextAnaly static HRESULT WINAPI dwritetextlayout_source_GetTextBeforePosition(IDWriteTextAnalysisSource1 *iface, UINT32 position, WCHAR const** text, UINT32* text_len) { - FIXME("%u %p %p: stub\n", position, text, text_len); - return E_NOTIMPL; + struct dwrite_textlayout *layout = impl_from_IDWriteTextAnalysisSource1(iface); + + TRACE("(%p)->(%u %p %p)\n", layout, position, text, text_len); + + if (position > 0 && position < layout->len) { + *text = layout->str; + *text_len = position; + } + else { + *text = NULL; + *text_len = 0; + } + + return S_OK; }
static DWRITE_READING_DIRECTION WINAPI dwritetextlayout_source_GetParagraphReadingDirection(IDWriteTextAnalysisSource1 *iface)