riched20: make EM_LINELENGTH work correctly for non-final paragraphs
containing exactly one screen line
Krzysztof Foltman
wdev at foltman.com
Thu Aug 3 13:37:45 CDT 2006
This is also needed for line-level text access in Delphi applications
(and in other applications that use EM_LINELENGTH for anything).
Krzysztof
-------------- next part --------------
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index a07d8cd..e0c3f21 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2154,8 +2154,8 @@ LRESULT WINAPI RichEditANSIWndProc(HWND
item = ME_FindItemAtOffset(editor, diRun, wParam, NULL);
item = ME_RowStart(item);
nThisLineOfs = ME_CharOfsFromRunOfs(editor, ME_FindItemFwd(item, diRun), 0);
- item_end = ME_FindItemFwd(item, diStartRow);
- if (item_end)
+ item_end = ME_FindItemFwd(item, diStartRowOrParagraphOrEnd);
+ if (item_end->type == diStartRow)
nNextLineOfs = ME_CharOfsFromRunOfs(editor, ME_FindItemFwd(item_end, diRun), 0);
else
nNextLineOfs = ME_FindItemFwd(item, diParagraphOrEnd)->member.para.nCharOfs
More information about the wine-patches
mailing list