mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 21:13:30 +08:00
[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.
svn path=/trunk/; revision=75896
This commit is contained in:
parent
ac45094d68
commit
ec29185ee5
@ -1119,7 +1119,7 @@ void ME_RTFSpecialCharHook(RTF_Info *info)
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbmp,
|
||||
static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HBITMAP hbmp,
|
||||
const SIZEL* sz)
|
||||
{
|
||||
LPOLEOBJECT lpObject = NULL;
|
||||
@ -1130,7 +1130,7 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm
|
||||
STGMEDIUM stgm;
|
||||
FORMATETC fm;
|
||||
CLSID clsid;
|
||||
BOOL ret = FALSE;
|
||||
HRESULT hr = E_FAIL;
|
||||
DWORD conn;
|
||||
|
||||
if (hemf)
|
||||
@ -1152,13 +1152,14 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm
|
||||
fm.lindex = -1;
|
||||
fm.tymed = stgm.tymed;
|
||||
|
||||
if (!info->lpRichEditOle)
|
||||
if (!editor->reOle)
|
||||
{
|
||||
CreateIRichEditOle(NULL, info->editor, (VOID**)&info->lpRichEditOle);
|
||||
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 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm
|
||||
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 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm
|
||||
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 @@ static void ME_RTFReadPictGroup(RTF_Info *info)
|
||||
{
|
||||
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 @@ static void ME_RTFReadPictGroup(RTF_Info *info)
|
||||
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 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
|
||||
}
|
||||
ME_CheckTablesForCorruption(editor);
|
||||
RTFDestroy(&parser);
|
||||
if (parser.lpRichEditOle)
|
||||
IRichEditOle_Release(parser.lpRichEditOle);
|
||||
|
||||
if (parser.stackTop > 0)
|
||||
{
|
||||
@ -2207,31 +2206,122 @@ static DWORD CALLBACK ME_ReadFromHGLOBALRTF(DWORD_PTR dwCookie, LPBYTE lpBuff, L
|
||||
return 0;
|
||||
}
|
||||
|
||||
static BOOL ME_Paste(ME_TextEditor *editor)
|
||||
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)
|
||||
{
|
||||
DWORD dwFormat = 0;
|
||||
EDITSTREAM es;
|
||||
ME_GlobalDestStruct gds;
|
||||
UINT nRTFFormat = RegisterClipboardFormatA("Rich Text Format");
|
||||
UINT cf = 0;
|
||||
HRESULT hr;
|
||||
|
||||
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.hData = med->u.hGlobal;
|
||||
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);
|
||||
es.pfnCallback = ME_ReadFromHGLOBALRTF;
|
||||
hr = ME_StreamIn( editor, SF_RTF | SFF_SELECTION, &es, FALSE ) == 0 ? E_FAIL : S_OK;
|
||||
ReleaseStgMedium( med );
|
||||
return hr;
|
||||
}
|
||||
|
||||
CloseClipboard();
|
||||
return TRUE;
|
||||
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 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
|
||||
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 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
|
||||
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 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD
|
||||
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_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD
|
||||
}
|
||||
|
||||
ME_CheckCharOffsets(ed);
|
||||
SetRectEmpty(&ed->rcFormat);
|
||||
ed->bDefaultFormatRect = TRUE;
|
||||
ITextHost_TxGetSelectionBarWidth(ed->texthost, &selbarwidth);
|
||||
if (selbarwidth) {
|
||||
@ -3411,7 +3498,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
|
||||
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 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
|
||||
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 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
|
||||
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 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
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 @@ LRESULT WINAPI RichEdit10ANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ void ME_DeleteReObject(REOBJECT* reo) DECLSPEC_HIDDEN;
|
||||
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;
|
||||
|
@ -353,7 +353,6 @@ typedef struct tagME_TextEditor
|
||||
ME_TextBuffer *pBuffer;
|
||||
ME_Cursor *pCursors;
|
||||
DWORD styleFlags;
|
||||
DWORD alignStyle;
|
||||
DWORD exStyleFlags;
|
||||
int nCursors;
|
||||
SIZE sizeWindow;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 32 KiB |
@ -863,10 +863,22 @@ void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt)
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
@ -1366,7 +1366,7 @@ static RTFKey rtfKey[] =
|
||||
{ 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 },
|
||||
|
@ -244,7 +244,6 @@ typedef struct ITextParaImpl {
|
||||
struct IOleClientSiteImpl {
|
||||
struct reole_child child;
|
||||
IOleClientSite IOleClientSite_iface;
|
||||
IOleWindow IOleWindow_iface;
|
||||
IOleInPlaceSite IOleInPlaceSite_iface;
|
||||
LONG ref;
|
||||
};
|
||||
@ -264,11 +263,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)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleInPlaceSite_iface);
|
||||
@ -1062,9 +1056,8 @@ IOleClientSite_fnQueryInterface(IOleClientSite *me, REFIID riid, LPVOID *ppvObj)
|
||||
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,56 +1168,6 @@ static const IOleClientSiteVtbl ocst = {
|
||||
IOleClientSite_fnRequestNewObjectLayout
|
||||
};
|
||||
|
||||
/* IOleWindow interface */
|
||||
static HRESULT WINAPI IOleWindow_fnQueryInterface(IOleWindow *iface, REFIID riid, void **ppvObj)
|
||||
{
|
||||
IOleClientSiteImpl *This = impl_from_IOleWindow(iface);
|
||||
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IOleWindow_fnAddRef(IOleWindow *iface)
|
||||
{
|
||||
IOleClientSiteImpl *This = impl_from_IOleWindow(iface);
|
||||
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IOleWindow_fnRelease(IOleWindow *iface)
|
||||
{
|
||||
IOleClientSiteImpl *This = impl_from_IOleWindow(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);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, phwnd);
|
||||
|
||||
if (!This->child.reole)
|
||||
return CO_E_RELEASED;
|
||||
|
||||
if (!phwnd)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*phwnd = This->child.reole->editor->hWnd;
|
||||
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)
|
||||
{
|
||||
@ -1247,13 +1190,24 @@ static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface)
|
||||
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *phwnd)
|
||||
{
|
||||
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
||||
return IOleWindow_GetWindow(&This->IOleWindow_iface, phwnd);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, phwnd);
|
||||
|
||||
if (!This->child.reole)
|
||||
return CO_E_RELEASED;
|
||||
|
||||
if (!phwnd)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*phwnd = This->child.reole->editor->hWnd;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
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 @@ static HRESULT CreateOleClientSite(IRichEditOleImpl *reOle, IOleClientSite **ret
|
||||
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;
|
||||
|
@ -1165,7 +1165,6 @@ struct _RTF_Info {
|
||||
RTFState stack[maxStack];
|
||||
int stackTop;
|
||||
BOOL styleChanged;
|
||||
LPRICHEDITOLE lpRichEditOle;
|
||||
|
||||
RTFTable *tableDef;
|
||||
int nestingLevel;
|
||||
|
@ -27,6 +27,7 @@ typedef struct ITextHostImpl {
|
||||
LONG ref;
|
||||
HWND hWnd;
|
||||
BOOL bEmulateVersion10;
|
||||
PARAFORMAT2 para_fmt;
|
||||
} ITextHostImpl;
|
||||
|
||||
static const ITextHostVtbl textHostVtbl;
|
||||
@ -34,23 +35,22 @@ static const ITextHostVtbl textHostVtbl;
|
||||
ITextHost *ME_CreateTextHost(HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10)
|
||||
{
|
||||
ITextHostImpl *texthost;
|
||||
|
||||
texthost = CoTaskMemAlloc(sizeof(*texthost));
|
||||
if (texthost)
|
||||
{
|
||||
ME_TextEditor *editor;
|
||||
if (!texthost) return NULL;
|
||||
|
||||
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);
|
||||
}
|
||||
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_TxGetCharFormat(ITextHost *iface,
|
||||
}
|
||||
|
||||
DECLSPEC_HIDDEN HRESULT WINAPI ITextHostImpl_TxGetParaFormat(ITextHost *iface,
|
||||
const PARAFORMAT **ppPF)
|
||||
const PARAFORMAT **fmt)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
ITextHostImpl *This = impl_from_ITextHost(iface);
|
||||
*fmt = (const PARAFORMAT *)&This->para_fmt;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
DECLSPEC_HIDDEN COLORREF WINAPI ITextHostImpl_TxGetSysColor(ITextHost *iface,
|
||||
|
@ -401,9 +401,7 @@ HRESULT WINAPI CreateTextServices(IUnknown *pUnkOuter, ITextHost *pITextHost, I
|
||||
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;
|
||||
|
@ -770,7 +770,7 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
|
||||
{
|
||||
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))
|
||||
|
@ -158,7 +158,7 @@ reactos/dll/win32/qmgrprxy # Synced to WineStaging-2.9
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user