[RICHED20] Sync with Wine Staging 1.7.37. CORE-9246

svn path=/trunk/; revision=67072
This commit is contained in:
Amine Khaldi 2015-04-06 17:44:48 +00:00
parent 9ad74ea48e
commit b7d82956a3
6 changed files with 1730 additions and 92 deletions

View file

@ -1192,7 +1192,7 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm
if (!info->lpRichEditOle)
{
CreateIRichEditOle(info->editor, (VOID**)&info->lpRichEditOle);
CreateIRichEditOle(NULL, info->editor, (VOID**)&info->lpRichEditOle);
}
if (OleCreateDefaultHandler(&CLSID_NULL, NULL, &IID_IOleObject, (void**)&lpObject) == S_OK &&
@ -2116,7 +2116,7 @@ static BOOL ME_Copy(ME_TextEditor *editor, const ME_Cursor *start, int nChars)
hr = OleSetClipboard(dataObj);
IDataObject_Release(dataObj);
}
return SUCCEEDED(hr) != 0;
return SUCCEEDED(hr);
}
/* helper to send a msg filter notification */
@ -2861,7 +2861,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
return ed;
}
static void ME_DestroyEditor(ME_TextEditor *editor)
void ME_DestroyEditor(ME_TextEditor *editor)
{
ME_DisplayItem *pFirst = editor->pBuffer->pFirst;
ME_DisplayItem *p = pFirst, *pNext = NULL;
@ -4472,7 +4472,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
case EM_GETOLEINTERFACE:
{
if (!editor->reOle)
if (!CreateIRichEditOle(editor, (LPVOID *)&editor->reOle))
if (!CreateIRichEditOle(NULL, editor, (LPVOID *)&editor->reOle))
return 0;
*(LPVOID *)lParam = editor->reOle;
IRichEditOle_AddRef(editor->reOle);
@ -4816,7 +4816,7 @@ static BOOL ME_RegisterEditorClass(HINSTANCE hInstance)
wcW.cbWndExtra = sizeof(ME_TextEditor *);
wcW.hInstance = NULL; /* hInstance would register DLL-local class */
wcW.hIcon = NULL;
wcW.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
wcW.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_IBEAM);
wcW.hbrBackground = GetStockObject(NULL_BRUSH);
wcW.lpszMenuName = NULL;
@ -4842,7 +4842,7 @@ static BOOL ME_RegisterEditorClass(HINSTANCE hInstance)
wcA.cbWndExtra = sizeof(ME_TextEditor *);
wcA.hInstance = NULL; /* hInstance would register DLL-local class */
wcA.hIcon = NULL;
wcA.hCursor = LoadCursorW(NULL, MAKEINTRESOURCEW(IDC_IBEAM));
wcA.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_IBEAM);
wcA.hbrBackground = GetStockObject(NULL_BRUSH);
wcA.lpszMenuName = NULL;
wcA.lpszClassName = RICHEDIT_CLASS20A;

View file

@ -47,6 +47,7 @@
#include <richole.h>
#include <imm.h>
#include <textserv.h>
#include <tom.h>
#include <usp10.h>
#include <wine/debug.h>
@ -274,14 +275,16 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) DECLSPEC_HIDDEN;
int ME_GetParaBorderWidth(const ME_Context *c, int flags) DECLSPEC_HIDDEN;
/* richole.c */
LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *) DECLSPEC_HIDDEN;
LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj) DECLSPEC_HIDDEN;
void ME_DrawOLE(ME_Context *c, int x, int y, ME_Run* run, ME_Paragraph *para, BOOL selected) DECLSPEC_HIDDEN;
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN;
void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src) DECLSPEC_HIDDEN;
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) 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;
void ME_SendOldNotify(ME_TextEditor *editor, int nCode) DECLSPEC_HIDDEN;

File diff suppressed because it is too large Load diff

View file

@ -181,9 +181,10 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor,
int *pOfs)
{
ME_DisplayItem *item, *next_item;
int endOfs = nCharOfs, len = ME_GetTextLength(editor);
nCharOfs = max(nCharOfs, 0);
nCharOfs = min(nCharOfs, ME_GetTextLength(editor));
nCharOfs = min(nCharOfs, len);
/* Find the paragraph at the offset. */
next_item = editor->pBuffer->pFirst->member.para.next_para;
@ -206,7 +207,11 @@ void ME_RunOfsFromCharOfs(ME_TextEditor *editor,
nCharOfs -= item->member.run.nCharOfs;
if (ppRun) *ppRun = item;
if (pOfs) *pOfs = nCharOfs;
if (pOfs) {
if (((*ppRun)->member.run.nFlags & MERF_ENDPARA) && endOfs > len)
*pOfs = (*ppRun)->member.run.len;
else *pOfs = nCharOfs;
}
}
/******************************************************************************

View file

@ -20,6 +20,7 @@
#include "editor.h"
#ifdef __i386__ /* thiscall functions are i386-specific */
#define THISCALL(func) __thiscall_ ## func
@ -65,7 +66,15 @@ static HRESULT WINAPI ITextServicesImpl_QueryInterface(IUnknown *iface, REFIID r
*ppv = &This->IUnknown_inner;
else if (IsEqualIID(riid, &IID_ITextServices))
*ppv = &This->ITextServices_iface;
else {
else if (IsEqualIID(riid, &IID_IRichEditOle) || IsEqualIID(riid, &IID_ITextDocument)) {
if (!This->editor->reOle)
if (!CreateIRichEditOle(This->outer_unk, This->editor, (void **)(&This->editor->reOle)))
return E_OUTOFMEMORY;
if (IsEqualIID(riid, &IID_ITextDocument))
ME_GetITextDocumentInterface(This->editor->reOle, ppv);
else
*ppv = This->editor->reOle;
} else {
*ppv = NULL;
FIXME("Unknown interface: %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
@ -94,7 +103,7 @@ static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface)
if (!ref)
{
ITextHost_Release(This->pMyHost);
ME_DestroyEditor(This->editor);
This->csTxtSrv.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csTxtSrv);
CoTaskMemFree(This);

View file

@ -170,7 +170,7 @@ reactos/dll/win32/qmgrprxy # Synced to Wine-1.7.27
reactos/dll/win32/query # Synced to Wine-1.7.27
reactos/dll/win32/rasapi32 # Synced to Wine-1.7.27
reactos/dll/win32/resutils # Synced to Wine-1.7.27
reactos/dll/win32/riched20 # Synced to Wine-1.7.27
reactos/dll/win32/riched20 # Synced to WineStaging-1.7.37
reactos/dll/win32/riched32 # Synced to Wine-1.7.27
reactos/dll/win32/rpcrt4 # Synced to Wine-1.7.17
reactos/dll/win32/rsabase # Synced to Wine-1.7.27