From: Charlotte Pabst cpabst@codeweavers.com
According to microsoft documentation, ScrollWindowEx, SetScrollPos and SetScrollRange may only be called while the control is in-place active.
This fixes a segmentation fault in an application. --- dlls/riched20/paint.c | 2 ++ dlls/riched20/tests/txtsrv.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 8bc1b8bcd2f..54b7ffd82bc 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -1212,6 +1212,8 @@ void editor_ensure_visible( ME_TextEditor *editor, ME_Cursor *cursor ) ME_Paragraph *para = cursor->para; int x, y, yheight;
+ if (!editor->in_place_active) + return;
if (editor->scrollbars & ES_AUTOHSCROLL) { diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index db24aaa9867..d1770ad532d 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -1445,7 +1445,6 @@ static void test_inplace_active( BOOL active ) CHECK_CALLED(ITextHostImpl_TxScrollWindowEx); CHECK_CALLED(ITextHostImpl_TxGetClientRect); } else { - todo_wine CHECK_NOT_CALLED(ITextHostImpl_TxScrollWindowEx); todo_wine CHECK_NOT_CALLED(ITextHostImpl_TxGetClientRect);