Author: akhaldi Date: Sun Sep 17 22:57:18 2017 New Revision: 75896 URL: http://svn.reactos.org/svn/reactos?rev=75896&view=rev Log: [RICHED20] Sync with Wine Staging 2.16. CORE-13762
58cac9c riched20: Remove the separate implementation of IOleWindow as IOleInPlaceSite inherits from IOleWindow. adf53a9 riched20: Add support for pasting EMFs. bbf34a4 riched20: Use the implementation of EM_PASTESPECIAL for EM_CANPASTE. 46fef3d riched20: Use the implementation of EM_PASTESPECIAL for WM_PASTE. 9bec53f riched20: Add support for EM_PASTESPECIAL. 417c80d riched20: Don't create a special richedit ole instance for the RTF parser. 1bc48be riched20: Initialize ME_TextEditor members in ME_MakeEditor(). 5cc8c9f riched20: Retrieve the default paragraph alignment from the text host. 4cb7578 riched20: Move the editor initialization out of CreateTextHost(). 2d91663 riched20: New high resolution cursor generated from SVG. 17b7cde riched20: The background colour is set using \highlight. Modified: trunk/reactos/dll/win32/riched20/editor.c trunk/reactos/dll/win32/riched20/editor.h trunk/reactos/dll/win32/riched20/editstr.h trunk/reactos/dll/win32/riched20/ocr_reverse.cur trunk/reactos/dll/win32/riched20/para.c trunk/reactos/dll/win32/riched20/reader.c trunk/reactos/dll/win32/riched20/richole.c trunk/reactos/dll/win32/riched20/rtf.h trunk/reactos/dll/win32/riched20/txthost.c trunk/reactos/dll/win32/riched20/txtsrv.c trunk/reactos/dll/win32/riched20/writer.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/riched20/editor.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.c?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -1119,8 +1119,8 @@ } } -static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbmp, - const SIZEL* sz) +static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HBITMAP hbmp, + const SIZEL* sz) { LPOLEOBJECT lpObject = NULL; LPSTORAGE lpStorage = NULL; @@ -1130,7 +1130,7 @@ STGMEDIUM stgm; FORMATETC fm; CLSID clsid; - BOOL ret = FALSE; + HRESULT hr = E_FAIL; DWORD conn; if (hemf) @@ -1152,13 +1152,14 @@ fm.lindex = -1; fm.tymed = stgm.tymed; - if (!info->lpRichEditOle) - { - CreateIRichEditOle(NULL, info->editor, (VOID**)&info->lpRichEditOle); + if (!editor->reOle) + { + if (!CreateIRichEditOle(NULL, editor, (LPVOID *)&editor->reOle)) + return hr; } if (OleCreateDefaultHandler(&CLSID_NULL, NULL, &IID_IOleObject, (void**)&lpObject) == S_OK && - IRichEditOle_GetClientSite(info->lpRichEditOle, &lpClientSite) == S_OK && + IRichEditOle_GetClientSite(editor->reOle, &lpClientSite) == S_OK && IOleObject_SetClientSite(lpObject, lpClientSite) == S_OK && IOleObject_GetUserClassID(lpObject, &clsid) == S_OK && IOleObject_QueryInterface(lpObject, &IID_IOleCache, (void**)&lpOleCache) == S_OK && @@ -1181,8 +1182,8 @@ reobject.dwFlags = 0; /* FIXME */ reobject.dwUser = 0; - ME_InsertOLEFromCursor(info->editor, &reobject, 0); - ret = TRUE; + ME_InsertOLEFromCursor(editor, &reobject, 0); + hr = S_OK; } if (lpObject) IOleObject_Release(lpObject); @@ -1191,7 +1192,7 @@ if (lpDataObject) IDataObject_Release(lpDataObject); if (lpOleCache) IOleCache_Release(lpOleCache); - return ret; + return hr; } static void ME_RTFReadShpPictGroup( RTF_Info *info ) @@ -1350,11 +1351,11 @@ { case gfx_enhmetafile: if ((hemf = SetEnhMetaFileBits( size, buffer ))) - ME_RTFInsertOleObject( info, hemf, NULL, &sz ); + insert_static_object( info->editor, hemf, NULL, &sz ); break; case gfx_metafile: if ((hemf = SetWinMetaFileBits( size, buffer, NULL, &mfp ))) - ME_RTFInsertOleObject( info, hemf, NULL, &sz ); + insert_static_object( info->editor, hemf, NULL, &sz ); break; case gfx_dib: { @@ -1368,7 +1369,7 @@ if ((hbmp = CreateDIBitmap( hdc, &bi->bmiHeader, CBM_INIT, (char*)(bi + 1) + nc * sizeof(RGBQUAD), bi, DIB_RGB_COLORS)) ) - ME_RTFInsertOleObject( info, NULL, hbmp, &sz ); + insert_static_object( info->editor, NULL, hbmp, &sz ); ReleaseDC( 0, hdc ); break; } @@ -1724,8 +1725,6 @@ } ME_CheckTablesForCorruption(editor); RTFDestroy(&parser); - if (parser.lpRichEditOle) - IRichEditOle_Release(parser.lpRichEditOle); if (parser.stackTop > 0) { @@ -2207,31 +2206,122 @@ return 0; } -static BOOL ME_Paste(ME_TextEditor *editor) -{ - DWORD dwFormat = 0; - EDITSTREAM es; - ME_GlobalDestStruct gds; - UINT nRTFFormat = RegisterClipboardFormatA("Rich Text Format"); - UINT cf = 0; - - if (IsClipboardFormatAvailable(nRTFFormat)) - cf = nRTFFormat, dwFormat = SF_RTF; - else if (IsClipboardFormatAvailable(CF_UNICODETEXT)) - cf = CF_UNICODETEXT, dwFormat = SF_TEXT|SF_UNICODE; - else - return FALSE; - - if (!OpenClipboard(editor->hWnd)) - return FALSE; - gds.hData = GetClipboardData(cf); - gds.nLength = 0; - es.dwCookie = (DWORD_PTR)&gds; - es.pfnCallback = dwFormat == SF_RTF ? ME_ReadFromHGLOBALRTF : ME_ReadFromHGLOBALUnicode; - ME_StreamIn(editor, dwFormat|SFF_SELECTION, &es, FALSE); - - CloseClipboard(); - return TRUE; +static const WCHAR rtfW[] = {'R','i','c','h',' ','T','e','x','t',' ','F','o','r','m','a','t',0}; + +static HRESULT paste_rtf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) +{ + EDITSTREAM es; + ME_GlobalDestStruct gds; + HRESULT hr; + + gds.hData = med->u.hGlobal; + gds.nLength = 0; + es.dwCookie = (DWORD_PTR)&gds; + es.pfnCallback = ME_ReadFromHGLOBALRTF; + hr = ME_StreamIn( editor, SF_RTF | SFF_SELECTION, &es, FALSE ) == 0 ? E_FAIL : S_OK; + ReleaseStgMedium( med ); + return hr; +} + +static HRESULT paste_text(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) +{ + EDITSTREAM es; + ME_GlobalDestStruct gds; + HRESULT hr; + + gds.hData = med->u.hGlobal; + gds.nLength = 0; + es.dwCookie = (DWORD_PTR)&gds; + es.pfnCallback = ME_ReadFromHGLOBALUnicode; + hr = ME_StreamIn( editor, SF_TEXT | SF_UNICODE | SFF_SELECTION, &es, FALSE ) == 0 ? E_FAIL : S_OK; + ReleaseStgMedium( med ); + return hr; +} + +static HRESULT paste_emf(ME_TextEditor *editor, FORMATETC *fmt, STGMEDIUM *med) +{ + HRESULT hr; + SIZEL sz = {0, 0}; + + hr = insert_static_object( editor, med->u.hEnhMetaFile, NULL, &sz ); + if (SUCCEEDED(hr)) + { + ME_CommitUndo( editor ); + ME_UpdateRepaint( editor, FALSE ); + } + else + ReleaseStgMedium( med ); + + return hr; +} + +static struct paste_format +{ + FORMATETC fmt; + HRESULT (*paste)(ME_TextEditor *, FORMATETC *, STGMEDIUM *); + const WCHAR *name; +} paste_formats[] = +{ + {{ -1, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, paste_rtf, rtfW }, + {{ CF_UNICODETEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }, paste_text }, + {{ CF_ENHMETAFILE, NULL, DVASPECT_CONTENT, -1, TYMED_ENHMF }, paste_emf }, + {{ 0 }} +}; + +static void init_paste_formats(void) +{ + struct paste_format *format; + static int done; + + if (!done) + { + for (format = paste_formats; format->fmt.cfFormat; format++) + { + if (format->name) + format->fmt.cfFormat = RegisterClipboardFormatW( format->name ); + } + done = 1; + } +} + +static BOOL paste_special(ME_TextEditor *editor, UINT cf, REPASTESPECIAL *ps, BOOL check_only) +{ + HRESULT hr; + STGMEDIUM med; + struct paste_format *format; + IDataObject *data; + + init_paste_formats(); + + if (ps && ps->dwAspect != DVASPECT_CONTENT) + FIXME("Ignoring aspect %x\n", ps->dwAspect); + + hr = OleGetClipboard( &data ); + if (hr != S_OK) return FALSE; + + if (cf == CF_TEXT) cf = CF_UNICODETEXT; + + hr = S_FALSE; + for (format = paste_formats; format->fmt.cfFormat; format++) + { + if (cf && cf != format->fmt.cfFormat) continue; + hr = IDataObject_QueryGetData( data, &format->fmt ); + if (hr == S_OK) + { + if (!check_only) + { + hr = IDataObject_GetData( data, &format->fmt, &med ); + if (hr != S_OK) goto done; + hr = format->paste( editor, &format->fmt, &med ); + } + break; + } + } + +done: + IDataObject_Release( data ); + + return hr == S_OK; } static BOOL ME_Copy(ME_TextEditor *editor, const ME_Cursor *start, int nChars) @@ -2547,7 +2637,7 @@ break; case 'V': if (ctrl_is_down) - return ME_Paste(editor); + return paste_special( editor, 0, NULL, FALSE ); break; case 'C': case 'X': @@ -2881,7 +2971,7 @@ return TRUE; } -ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD csStyle) +ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) { ME_TextEditor *ed = ALLOC_OBJ(ME_TextEditor); int i; @@ -2895,11 +2985,7 @@ ed->reOle = NULL; ed->bEmulateVersion10 = bEmulateVersion10; ed->styleFlags = 0; - ed->alignStyle = PFA_LEFT; - if (csStyle & ES_RIGHT) - ed->alignStyle = PFA_RIGHT; - if (csStyle & ES_CENTER) - ed->alignStyle = PFA_CENTER; + ed->exStyleFlags = 0; ITextHost_TxGetPropertyBits(texthost, (TXTBIT_RICHTEXT|TXTBIT_MULTILINE| TXTBIT_READONLY|TXTBIT_USEPASSWORD| @@ -2960,6 +3046,7 @@ } ME_CheckCharOffsets(ed); + SetRectEmpty(&ed->rcFormat); ed->bDefaultFormatRect = TRUE; ITextHost_TxGetSelectionBarWidth(ed->texthost, &selbarwidth); if (selbarwidth) { @@ -3411,7 +3498,6 @@ UNSUPPORTED_MSG(EM_GETTYPOGRAPHYOPTIONS) UNSUPPORTED_MSG(EM_GETUNDONAME) UNSUPPORTED_MSG(EM_GETWORDBREAKPROCEX) - UNSUPPORTED_MSG(EM_PASTESPECIAL) UNSUPPORTED_MSG(EM_SELECTIONTYPE) UNSUPPORTED_MSG(EM_SETBIDIOPTIONS) UNSUPPORTED_MSG(EM_SETEDITSTYLE) @@ -3968,17 +4054,14 @@ return 1; } case EM_CANPASTE: - { - UINT nRTFFormat = RegisterClipboardFormatA("Rich Text Format"); - if (IsClipboardFormatAvailable(nRTFFormat)) - return TRUE; - if (IsClipboardFormatAvailable(CF_UNICODETEXT)) - return TRUE; - return FALSE; - } + return paste_special( editor, 0, NULL, TRUE ); case WM_PASTE: case WM_MBUTTONDOWN: - ME_Paste(editor); + wParam = 0; + lParam = 0; + /* fall through */ + case EM_PASTESPECIAL: + paste_special( editor, wParam, (REPASTESPECIAL *)lParam, FALSE ); return 0; case WM_CUT: case WM_COPY: @@ -4789,6 +4872,30 @@ return 0L; } +static BOOL create_windowed_editor(HWND hwnd, CREATESTRUCTW *create, BOOL emulate_10) +{ + ITextHost *host = ME_CreateTextHost( hwnd, create, emulate_10 ); + ME_TextEditor *editor; + + if (!host) return FALSE; + + editor = ME_MakeEditor( host, emulate_10 ); + if (!editor) + { + ITextHost_Release( host ); + return FALSE; + } + + editor->exStyleFlags = GetWindowLongW( hwnd, GWL_EXSTYLE ); + editor->styleFlags |= GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN; + editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ + editor->hwndParent = create->hwndParent; + + SetWindowLongPtrW( hwnd, 0, (LONG_PTR)editor ); + + return TRUE; +} + static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode) { @@ -4805,11 +4912,9 @@ if (msg == WM_NCCREATE) { CREATESTRUCTW *pcs = (CREATESTRUCTW *)lParam; - ITextHost *texthost; TRACE("WM_NCCREATE: hWnd %p style 0x%08x\n", hWnd, pcs->style); - texthost = ME_CreateTextHost(hWnd, pcs, FALSE); - return texthost != NULL; + return create_windowed_editor( hWnd, pcs, FALSE ); } else { @@ -4935,12 +5040,10 @@ { if (msg == WM_NCCREATE && !GetWindowLongPtrW(hWnd, 0)) { - ITextHost *texthost; CREATESTRUCTW *pcs = (CREATESTRUCTW *)lParam; TRACE("WM_NCCREATE: hWnd %p style 0x%08x\n", hWnd, pcs->style); - texthost = ME_CreateTextHost(hWnd, pcs, TRUE); - return texthost != NULL; + return create_windowed_editor( hWnd, pcs, TRUE ); } return RichEditANSIWndProc(hWnd, msg, wParam, lParam); } Modified: trunk/reactos/dll/win32/riched20/editor.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editor.h?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editor.h [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -290,7 +290,7 @@ void ME_GetITextDocumentInterface(IRichEditOle *iface, LPVOID *ppvObj) DECLSPEC_HIDDEN; /* editor.c */ -ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD csStyle) DECLSPEC_HIDDEN; +ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN; void ME_DestroyEditor(ME_TextEditor *editor) DECLSPEC_HIDDEN; LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode, HRESULT* phresult) DECLSPEC_HIDDEN; Modified: trunk/reactos/dll/win32/riched20/editstr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/editstr.h?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/editstr.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/editstr.h [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -353,7 +353,6 @@ ME_TextBuffer *pBuffer; ME_Cursor *pCursors; DWORD styleFlags; - DWORD alignStyle; DWORD exStyleFlags; int nCursors; SIZE sizeWindow; Modified: trunk/reactos/dll/win32/riched20/ocr_reverse.cur URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/ocr_reverse.cur?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== Binary files - no diff available. Modified: trunk/reactos/dll/win32/riched20/para.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/para.c?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/para.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/para.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -863,10 +863,22 @@ void ME_SetDefaultParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) { + const PARAFORMAT2 *host_fmt; + HRESULT hr; + ZeroMemory(pFmt, sizeof(PARAFORMAT2)); pFmt->cbSize = sizeof(PARAFORMAT2); pFmt->dwMask = PFM_ALL2; - pFmt->wAlignment = editor->alignStyle; + pFmt->wAlignment = PFA_LEFT; pFmt->sStyle = -1; pFmt->bOutlineLevel = TRUE; -} + + hr = ITextHost_TxGetParaFormat( editor->texthost, (const PARAFORMAT **)&host_fmt ); + if (SUCCEEDED(hr)) + { + /* Just use the alignment for now */ + if (host_fmt->dwMask & PFM_ALIGNMENT) + pFmt->wAlignment = host_fmt->wAlignment; + ITextHost_OnTxParaFormatChange( editor->texthost, (PARAFORMAT *)pFmt ); + } +} Modified: trunk/reactos/dll/win32/riched20/reader.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/reader.c?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/reader.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/reader.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -1366,7 +1366,7 @@ { rtfCharAttr, rtfSuperScrShrink, "super", 0 }, { rtfCharAttr, rtfInvisible, "v", 0 }, { rtfCharAttr, rtfForeColor, "cf", 0 }, - { rtfCharAttr, rtfBackColor, "cb", 0 }, + { rtfCharAttr, rtfBackColor, "highlight", 0 }, { rtfCharAttr, rtfRTLChar, "rtlch", 0 }, { rtfCharAttr, rtfLTRChar, "ltrch", 0 }, { rtfCharAttr, rtfCharStyleNum, "cs", 0 }, Modified: trunk/reactos/dll/win32/riched20/richole.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/richole.c?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/richole.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -244,7 +244,6 @@ struct IOleClientSiteImpl { struct reole_child child; IOleClientSite IOleClientSite_iface; - IOleWindow IOleWindow_iface; IOleInPlaceSite IOleInPlaceSite_iface; LONG ref; }; @@ -262,11 +261,6 @@ static inline IRichEditOleImpl *impl_from_IUnknown(IUnknown *iface) { return CONTAINING_RECORD(iface, IRichEditOleImpl, IUnknown_inner); -} - -static inline IOleClientSiteImpl *impl_from_IOleWindow(IOleWindow *iface) -{ - return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleWindow_iface); } static inline IOleClientSiteImpl *impl_from_IOleInPlaceSite(IOleInPlaceSite *iface) @@ -1062,9 +1056,8 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IOleClientSite)) *ppvObj = me; - else if (IsEqualGUID(riid, &IID_IOleWindow)) - *ppvObj = &This->IOleWindow_iface; - else if (IsEqualGUID(riid, &IID_IOleInPlaceSite)) + else if (IsEqualGUID(riid, &IID_IOleWindow) || + IsEqualGUID(riid, &IID_IOleInPlaceSite)) *ppvObj = &This->IOleInPlaceSite_iface; if (*ppvObj) { @@ -1175,35 +1168,28 @@ IOleClientSite_fnRequestNewObjectLayout }; -/* IOleWindow interface */ -static HRESULT WINAPI IOleWindow_fnQueryInterface(IOleWindow *iface, REFIID riid, void **ppvObj) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +/* IOleInPlaceSite interface */ +static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppvObj) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj); } -static ULONG WINAPI IOleWindow_fnAddRef(IOleWindow *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnAddRef(IOleInPlaceSite *iface) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_AddRef(&This->IOleClientSite_iface); } -static ULONG WINAPI IOleWindow_fnRelease(IOleWindow *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); return IOleClientSite_Release(&This->IOleClientSite_iface); } -static HRESULT WINAPI IOleWindow_fnContextSensitiveHelp(IOleWindow *iface, BOOL fEnterMode) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); - FIXME("not implemented: (%p)->(%d)\n", This, fEnterMode); - return E_NOTIMPL; -} - -static HRESULT WINAPI IOleWindow_fnGetWindow(IOleWindow *iface, HWND *phwnd) -{ - IOleClientSiteImpl *This = impl_from_IOleWindow(iface); +static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *phwnd) +{ + IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); TRACE("(%p)->(%p)\n", This, phwnd); @@ -1217,43 +1203,11 @@ return S_OK; } -static const IOleWindowVtbl olewinvt = { - IOleWindow_fnQueryInterface, - IOleWindow_fnAddRef, - IOleWindow_fnRelease, - IOleWindow_fnGetWindow, - IOleWindow_fnContextSensitiveHelp -}; - -/* IOleInPlaceSite interface */ -static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppvObj) +static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode) { IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj); -} - -static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnAddRef(IOleInPlaceSite *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleClientSite_AddRef(&This->IOleClientSite_iface); -} - -static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleClientSite_Release(&This->IOleClientSite_iface); -} - -static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *phwnd) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleWindow_GetWindow(&This->IOleWindow_iface, phwnd); -} - -static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode) -{ - IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface); - return IOleWindow_ContextSensitiveHelp(&This->IOleWindow_iface, fEnterMode); + FIXME("not implemented: (%p)->(%d)\n", This, fEnterMode); + return E_NOTIMPL; } static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnCanInPlaceActivate(IOleInPlaceSite *iface) @@ -1355,7 +1309,6 @@ return E_OUTOFMEMORY; clientSite->IOleClientSite_iface.lpVtbl = &ocst; - clientSite->IOleWindow_iface.lpVtbl = &olewinvt; clientSite->IOleInPlaceSite_iface.lpVtbl = &olestvt; clientSite->ref = 1; clientSite->child.reole = reOle; Modified: trunk/reactos/dll/win32/riched20/rtf.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/rtf.h?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/rtf.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/rtf.h [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -1165,7 +1165,6 @@ RTFState stack[maxStack]; int stackTop; BOOL styleChanged; - LPRICHEDITOLE lpRichEditOle; RTFTable *tableDef; int nestingLevel; Modified: trunk/reactos/dll/win32/riched20/txthost.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/txthost.c?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/txthost.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/txthost.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -27,6 +27,7 @@ LONG ref; HWND hWnd; BOOL bEmulateVersion10; + PARAFORMAT2 para_fmt; } ITextHostImpl; static const ITextHostVtbl textHostVtbl; @@ -34,23 +35,22 @@ ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10) { ITextHostImpl *texthost; + texthost = CoTaskMemAlloc(sizeof(*texthost)); - if (texthost) - { - ME_TextEditor *editor; - - texthost->ITextHost_iface.lpVtbl = &textHostVtbl; - texthost->ref = 1; - texthost->hWnd = hwnd; - texthost->bEmulateVersion10 = bEmulateVersion10; - - editor = ME_MakeEditor(&texthost->ITextHost_iface, bEmulateVersion10, cs->style); - editor->exStyleFlags = GetWindowLongW(hwnd, GWL_EXSTYLE); - editor->styleFlags |= GetWindowLongW(hwnd, GWL_STYLE) & ES_WANTRETURN; - editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ - editor->hwndParent = cs->hwndParent; - SetWindowLongPtrW(hwnd, 0, (LONG_PTR)editor); - } + if (!texthost) return NULL; + + texthost->ITextHost_iface.lpVtbl = &textHostVtbl; + texthost->ref = 1; + texthost->hWnd = hwnd; + texthost->bEmulateVersion10 = bEmulateVersion10; + memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) ); + texthost->para_fmt.cbSize = sizeof(texthost->para_fmt); + texthost->para_fmt.dwMask = PFM_ALIGNMENT; + texthost->para_fmt.wAlignment = PFA_LEFT; + if (cs->style & ES_RIGHT) + texthost->para_fmt.wAlignment = PFA_RIGHT; + if (cs->style & ES_CENTER) + texthost->para_fmt.wAlignment = PFA_CENTER; return &texthost->ITextHost_iface; } @@ -258,9 +258,11 @@ } DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface, - const PARAFORMAT **ppPF) -{ - return E_NOTIMPL; + const PARAFORMAT **fmt) +{ + ITextHostImpl *This = impl_from_ITextHost(iface); + *fmt = (const PARAFORMAT *)&This->para_fmt; + return S_OK; } DECLSPEC_HIDDEN COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface, Modified: trunk/reactos/dll/win32/riched20/txtsrv.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/txtsrv.c?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/txtsrv.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -401,9 +401,7 @@ ITextImpl->pMyHost = pITextHost; ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl; - ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE, ES_LEFT); - ITextImpl->editor->exStyleFlags = 0; - SetRectEmpty(&ITextImpl->editor->rcFormat); + ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE); if (pUnkOuter) ITextImpl->outer_unk = pUnkOuter; Modified: trunk/reactos/dll/win32/riched20/writer.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/riched20/writer.c?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/dll/win32/riched20/writer.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/riched20/writer.c [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -770,7 +770,7 @@ { if (fmt->dwEffects & CFE_AUTOBACKCOLOR) i = 0; else find_color_in_colortbl( pStream, fmt->crBackColor, &i ); - sprintf(props + strlen(props), "\\cb%u", i); + sprintf(props + strlen(props), "\\highlight%u", i); } if ((old_fmt->dwEffects ^ fmt->dwEffects) & CFE_AUTOCOLOR || (!(fmt->dwEffects & CFE_AUTOCOLOR) && old_fmt->crTextColor != fmt->crTextColor)) Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=75896&r1=75895&r2=75896&view=diff ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun Sep 17 22:57:18 2017 @@ -158,7 +158,7 @@ reactos/dll/win32/query # Synced to WineStaging-2.9 reactos/dll/win32/rasapi32 # Synced to WineStaging-2.9 reactos/dll/win32/resutils # Synced to WineStaging-2.9 -reactos/dll/win32/riched20 # Synced to WineStaging-2.9 +reactos/dll/win32/riched20 # Synced to WineStaging-2.16 reactos/dll/win32/riched32 # Synced to WineStaging-2.9 reactos/dll/win32/rpcrt4 # Synced to WineStaging-2.9 reactos/dll/win32/rsabase # Synced to WineStaging-2.9