Author: gedmurphy
Date: Thu Jun 15 01:47:25 2006
New Revision: 22350
URL:
http://svn.reactos.ru/svn/reactos?rev=22350&view=rev
Log:
Wine 0.9.15 vendor drop
Added:
vendor/wine/dlls/riched20/current/version.rc
Modified:
vendor/wine/dlls/riched20/current/Makefile.in
vendor/wine/dlls/riched20/current/caret.c
vendor/wine/dlls/riched20/current/clipboard.c
vendor/wine/dlls/riched20/current/context.c
vendor/wine/dlls/riched20/current/editor.c
vendor/wine/dlls/riched20/current/editor.h
vendor/wine/dlls/riched20/current/editstr.h
vendor/wine/dlls/riched20/current/list.c
vendor/wine/dlls/riched20/current/paint.c
vendor/wine/dlls/riched20/current/para.c
vendor/wine/dlls/riched20/current/reader.c
vendor/wine/dlls/riched20/current/richole.c
vendor/wine/dlls/riched20/current/row.c
vendor/wine/dlls/riched20/current/run.c
vendor/wine/dlls/riched20/current/string.c
vendor/wine/dlls/riched20/current/style.c
vendor/wine/dlls/riched20/current/txtsrv.c
vendor/wine/dlls/riched20/current/undo.c
vendor/wine/dlls/riched20/current/wrap.c
vendor/wine/dlls/riched20/current/writer.c
Modified: vendor/wine/dlls/riched20/current/Makefile.in
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/Makefil…
==============================================================================
--- vendor/wine/dlls/riched20/current/Makefile.in (original)
+++ vendor/wine/dlls/riched20/current/Makefile.in Thu Jun 15 01:47:25 2006
@@ -28,6 +28,8 @@
SUBDIRS = tests
+RC_SRCS = version.rc
+
@MAKE_DLL_RULES@
### Dependencies:
Modified: vendor/wine/dlls/riched20/current/caret.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/caret.c…
==============================================================================
--- vendor/wine/dlls/riched20/current/caret.c (original)
+++ vendor/wine/dlls/riched20/current/caret.c Thu Jun 15 01:47:25 2006
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
Modified: vendor/wine/dlls/riched20/current/clipboard.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/clipboa…
==============================================================================
--- vendor/wine/dlls/riched20/current/clipboard.c (original)
+++ vendor/wine/dlls/riched20/current/clipboard.c Thu Jun 15 01:47:25 2006
@@ -1,412 +1,412 @@
-/*
- * Richedit clipboard handling
- *
- * Copyright (C) 2006 Kevin Koltzau
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "editor.h"
-
-WINE_DEFAULT_DEBUG_CHANNEL(richedit);
-
-static UINT cfRTF = 0;
-
-typedef struct DataObjectImpl {
- const IDataObjectVtbl *lpVtbl;
- LONG ref;
-
- FORMATETC *fmtetc;
- UINT fmtetc_cnt;
-
- HANDLE unicode;
- HANDLE rtf;
-} DataObjectImpl;
-
-typedef struct EnumFormatImpl {
- const IEnumFORMATETCVtbl *lpVtbl;
- LONG ref;
-
- FORMATETC *fmtetc;
- UINT fmtetc_cnt;
-
- UINT cur;
-} EnumFormatImpl;
-
-static HRESULT EnumFormatImpl_Create(FORMATETC *fmtetc, UINT size, LPENUMFORMATETC
*lplpformatetc);
-
-static HRESULT WINAPI EnumFormatImpl_QueryInterface(IEnumFORMATETC *iface, REFIID riid,
LPVOID *ppvObj)
-{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
- TRACE("%p %s\n", This, debugstr_guid(riid));
-
- if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid,
&IID_IEnumFORMATETC)) {
- IEnumFORMATETC_AddRef(iface);
- *ppvObj = (LPVOID)This;
- return S_OK;
- }
- *ppvObj = NULL;
- return E_NOINTERFACE;
-}
-
-static ULONG WINAPI EnumFormatImpl_AddRef(IEnumFORMATETC *iface)
-{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
- LONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p) ref=%ld\n", This, ref);
- return ref;
-}
-
-static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface)
-{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
- ULONG ref = InterlockedDecrement(&This->ref);
- TRACE("(%p) ref=%ld\n", This, ref);
-
- if(!ref) {
- HeapFree(GetProcessHeap(), 0, This->fmtetc);
- HeapFree(GetProcessHeap(), 0, This);
- }
-
- return ref;
-}
-
-static HRESULT WINAPI EnumFormatImpl_Next(IEnumFORMATETC *iface, ULONG celt,
- FORMATETC *rgelt, ULONG *pceltFetched)
-{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
- ULONG count = 0;
- TRACE("(%p)->(%ld %p %p)\n", This, celt, rgelt, pceltFetched);
-
- if(!rgelt)
- return E_INVALIDARG;
-
- count = min(celt, This->fmtetc_cnt-This->cur);
- if(count > 0) {
- memcpy(rgelt, This->fmtetc+This->cur, count*sizeof(FORMATETC));
- This->cur += count;
- }
- if(pceltFetched)
- *pceltFetched = count;
- return count == celt ? S_OK : S_FALSE;
-}
-
-static HRESULT WINAPI EnumFormatImpl_Skip(IEnumFORMATETC *iface, ULONG celt)
-{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
- ULONG count = 0;
- TRACE("(%p)->(%ld)\n", This, celt);
-
- count = min(celt, This->fmtetc_cnt-This->cur);
- This->cur += count;
- return count == celt ? S_OK : S_FALSE;
-}
-
-static HRESULT WINAPI EnumFormatImpl_Reset(IEnumFORMATETC *iface)
-{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
- TRACE("(%p)\n", This);
-
- This->cur = 0;
- return S_OK;
-}
-
-static HRESULT WINAPI EnumFormatImpl_Clone(IEnumFORMATETC *iface, IEnumFORMATETC
**ppenum)
-{
- EnumFormatImpl *This = (EnumFormatImpl*)iface;
- HRESULT hr;
- TRACE("(%p)->(%p)\n", This, ppenum);
-
- if(!ppenum)
- return E_INVALIDARG;
- hr = EnumFormatImpl_Create(This->fmtetc, This->fmtetc_cnt, ppenum);
- if(SUCCEEDED(hr))
- hr = IEnumFORMATETC_Skip(*ppenum, This->cur);
- return hr;
-}
-
-static const IEnumFORMATETCVtbl VT_EnumFormatImpl = {
- EnumFormatImpl_QueryInterface,
- EnumFormatImpl_AddRef,
- EnumFormatImpl_Release,
- EnumFormatImpl_Next,
- EnumFormatImpl_Skip,
- EnumFormatImpl_Reset,
- EnumFormatImpl_Clone
-};
-
-static HRESULT EnumFormatImpl_Create(FORMATETC *fmtetc, UINT fmtetc_cnt, IEnumFORMATETC
**lplpformatetc)
-{
- EnumFormatImpl *ret;
- TRACE("\n");
-
- ret = HeapAlloc(GetProcessHeap(), 0, sizeof(EnumFormatImpl));
- ret->lpVtbl = &VT_EnumFormatImpl;
- ret->ref = 1;
- ret->cur = 0;
- ret->fmtetc_cnt = fmtetc_cnt;
- ret->fmtetc = HeapAlloc(GetProcessHeap(), 0, fmtetc_cnt*sizeof(FORMATETC));
- memcpy(ret->fmtetc, fmtetc, fmtetc_cnt*sizeof(FORMATETC));
- *lplpformatetc = (LPENUMFORMATETC)ret;
- return S_OK;
-}
-
-static HRESULT WINAPI DataObjectImpl_QueryInterface(IDataObject *iface, REFIID riid,
LPVOID *ppvObj)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- TRACE("(%p)->(%s)\n", This, debugstr_guid(riid));
-
- if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDataObject))
{
- IDataObject_AddRef(iface);
- *ppvObj = (LPVOID)This;
- return S_OK;
- }
- *ppvObj = NULL;
- return E_NOINTERFACE;
-}
-
-static ULONG WINAPI DataObjectImpl_AddRef(IDataObject* iface)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p) ref=%ld\n", This, ref);
- return ref;
-}
-
-static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- ULONG ref = InterlockedDecrement(&This->ref);
- TRACE("(%p) ref=%ld\n",This, ref);
-
- if(!ref) {
- if(This->unicode) GlobalFree(This->unicode);
- if(This->rtf) GlobalFree(This->rtf);
- if(This->fmtetc) GlobalFree(This->fmtetc);
- HeapFree(GetProcessHeap(), 0, This);
- }
-
- return ref;
-}
-
-static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pformatetc,
STGMEDIUM *pmedium)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat,
pformatetc->tymed);
-
- if(pformatetc->lindex != -1)
- return DV_E_LINDEX;
-
- if(!(pformatetc->tymed & TYMED_HGLOBAL))
- return DV_E_TYMED;
-
- if(This->unicode && pformatetc->cfFormat == CF_UNICODETEXT)
- pmedium->u.hGlobal = This->unicode;
- else if(This->rtf && pformatetc->cfFormat == cfRTF)
- pmedium->u.hGlobal = This->rtf;
- else
- return DV_E_FORMATETC;
-
- pmedium->tymed = TYMED_HGLOBAL;
- pmedium->pUnkForRelease = (LPUNKNOWN)iface;
- IUnknown_AddRef(pmedium->pUnkForRelease);
- return S_OK;
-}
-
-static HRESULT WINAPI DataObjectImpl_GetDataHere(IDataObject* iface, FORMATETC
*pformatetc, STGMEDIUM *pmedium)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- FIXME("(%p): stub\n", This);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI DataObjectImpl_QueryGetData(IDataObject* iface, FORMATETC
*pformatetc)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- UINT i;
- BOOL foundFormat = FALSE;
- TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat,
pformatetc->tymed);
-
- if(pformatetc->lindex != -1)
- return DV_E_LINDEX;
-
- for(i=0; i<This->fmtetc_cnt; i++) {
- if(This->fmtetc[i].cfFormat == pformatetc->cfFormat) {
- foundFormat = TRUE;
- if(This->fmtetc[i].tymed == pformatetc->tymed)
- return S_OK;
- }
- }
- return foundFormat?DV_E_FORMATETC:DV_E_TYMED;
-}
-
-static HRESULT WINAPI DataObjectImpl_GetCanonicalFormatEtc(IDataObject* iface, FORMATETC
*pformatectIn,
- FORMATETC *pformatetcOut)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- TRACE("(%p)->(%p,%p)\n", This, pformatectIn, pformatetcOut);
-
- if(pformatetcOut) {
- memcpy(pformatetcOut, pformatectIn, sizeof(FORMATETC));
- pformatetcOut->ptd = NULL;
- }
- return DATA_S_SAMEFORMATETC;
-}
-
-static HRESULT WINAPI DataObjectImpl_SetData(IDataObject* iface, FORMATETC *pformatetc,
- STGMEDIUM *pmedium, BOOL fRelease)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- FIXME("(%p): stub\n", This);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD
dwDirection,
- IEnumFORMATETC **ppenumFormatEtc)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- TRACE("(%p)->(%ld)\n", This, dwDirection);
-
- if(dwDirection != DATADIR_GET) {
- FIXME("Unsupported direction: %ld\n", dwDirection);
- /* WinXP riched20 also returns E_NOTIMPL in this case */
- return E_NOTIMPL;
- }
- return EnumFormatImpl_Create(This->fmtetc, This->fmtetc_cnt, ppenumFormatEtc);
-}
-
-static HRESULT WINAPI DataObjectImpl_DAdvise(IDataObject* iface, FORMATETC *pformatetc,
DWORD advf,
- IAdviseSink *pAdvSink, DWORD
*pdwConnection)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- FIXME("(%p): stub\n", This);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI DataObjectImpl_DUnadvise(IDataObject* iface, DWORD dwConnection)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- FIXME("(%p): stub\n", This);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI DataObjectImpl_EnumDAdvise(IDataObject* iface, IEnumSTATDATA
**ppenumAdvise)
-{
- DataObjectImpl *This = (DataObjectImpl*)iface;
- FIXME("(%p): stub\n", This);
- return E_NOTIMPL;
-}
-
-static const IDataObjectVtbl VT_DataObjectImpl =
-{
- DataObjectImpl_QueryInterface,
- DataObjectImpl_AddRef,
- DataObjectImpl_Release,
- DataObjectImpl_GetData,
- DataObjectImpl_GetDataHere,
- DataObjectImpl_QueryGetData,
- DataObjectImpl_GetCanonicalFormatEtc,
- DataObjectImpl_SetData,
- DataObjectImpl_EnumFormatEtc,
- DataObjectImpl_DAdvise,
- DataObjectImpl_DUnadvise,
- DataObjectImpl_EnumDAdvise
-};
-
-static HGLOBAL get_unicode_text(ME_TextEditor *editor, CHARRANGE *lpchrg)
-{
- int pars, len;
- WCHAR *data;
- HANDLE ret;
-
- pars = ME_CountParagraphsBetween(editor, lpchrg->cpMin, lpchrg->cpMax);
- len = lpchrg->cpMax-lpchrg->cpMin;
- ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(WCHAR)*(len+pars+1));
- data = (WCHAR *)GlobalLock(ret);
- len = ME_GetTextW(editor, data, lpchrg->cpMin, len, TRUE);
- data[len] = 0;
- GlobalUnlock(ret);
- return ret;
-}
-
-typedef struct tagME_GlobalDestStruct
-{
- HGLOBAL hData;
- int nLength;
-} ME_GlobalDestStruct;
-
-static DWORD CALLBACK ME_AppendToHGLOBAL(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG cb, LONG
*pcb)
-{
- ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie;
- int nMaxSize;
- BYTE *pDest;
-
- nMaxSize = GlobalSize(pData->hData);
- if (pData->nLength+cb+1 >= cb) {
- /* round up to 2^17 */
- int nNewSize = (((nMaxSize+cb+1)|0x1FFFF)+1) & 0xFFFE0000;
- pData->hData = GlobalReAlloc(pData->hData, nNewSize, 0);
- }
- pDest = (BYTE *)GlobalLock(pData->hData);
- memcpy(pDest + pData->nLength, lpBuff, cb);
- pData->nLength += cb;
- pDest[pData->nLength] = '\0';
- GlobalUnlock(pData->hData);
- *pcb = cb;
-
- return 0;
-}
-
-static HGLOBAL get_rtf_text(ME_TextEditor *editor, CHARRANGE *lpchrg)
-{
- EDITSTREAM es;
- ME_GlobalDestStruct gds;
-
- gds.hData = GlobalAlloc(GMEM_MOVEABLE, 0);
- gds.nLength = 0;
- es.dwCookie = (DWORD_PTR)&gds;
- es.pfnCallback = ME_AppendToHGLOBAL;
- ME_StreamOutRange(editor, SF_RTF, lpchrg->cpMin, lpchrg->cpMax, &es);
- GlobalReAlloc(gds.hData, gds.nLength+1, 0);
- return gds.hData;
-}
-
-HRESULT ME_GetDataObject(ME_TextEditor *editor, CHARRANGE *lpchrg, LPDATAOBJECT
*lplpdataobj)
-{
- DataObjectImpl *obj;
- TRACE("(%p,%ld,%ld)\n", editor, lpchrg->cpMin, lpchrg->cpMax);
-
- obj = HeapAlloc(GetProcessHeap(), 0, sizeof(DataObjectImpl));
- if(cfRTF == 0)
- cfRTF = RegisterClipboardFormatA("Rich Text Format");
-
- obj->lpVtbl = &VT_DataObjectImpl;
- obj->ref = 1;
- obj->unicode = get_unicode_text(editor, lpchrg);
- obj->rtf = NULL;
-
- obj->fmtetc_cnt = 1;
- if(editor->mode & TM_RICHTEXT)
- obj->fmtetc_cnt++;
- obj->fmtetc = HeapAlloc(GetProcessHeap(), 0,
obj->fmtetc_cnt*sizeof(FORMATETC));
- InitFormatEtc(obj->fmtetc[0], CF_UNICODETEXT, TYMED_HGLOBAL);
- if(editor->mode & TM_RICHTEXT) {
- obj->rtf = get_rtf_text(editor, lpchrg);
- InitFormatEtc(obj->fmtetc[1], cfRTF, TYMED_HGLOBAL);
- }
-
- *lplpdataobj = (LPDATAOBJECT)obj;
- return S_OK;
-}
+/*
+ * Richedit clipboard handling
+ *
+ * Copyright (C) 2006 Kevin Koltzau
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "editor.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
+
+static UINT cfRTF = 0;
+
+typedef struct DataObjectImpl {
+ const IDataObjectVtbl *lpVtbl;
+ LONG ref;
+
+ FORMATETC *fmtetc;
+ UINT fmtetc_cnt;
+
+ HANDLE unicode;
+ HANDLE rtf;
+} DataObjectImpl;
+
+typedef struct EnumFormatImpl {
+ const IEnumFORMATETCVtbl *lpVtbl;
+ LONG ref;
+
+ FORMATETC *fmtetc;
+ UINT fmtetc_cnt;
+
+ UINT cur;
+} EnumFormatImpl;
+
+static HRESULT EnumFormatImpl_Create(FORMATETC *fmtetc, UINT size, LPENUMFORMATETC
*lplpformatetc);
+
+static HRESULT WINAPI EnumFormatImpl_QueryInterface(IEnumFORMATETC *iface, REFIID riid,
LPVOID *ppvObj)
+{
+ EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ TRACE("%p %s\n", This, debugstr_guid(riid));
+
+ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid,
&IID_IEnumFORMATETC)) {
+ IEnumFORMATETC_AddRef(iface);
+ *ppvObj = (LPVOID)This;
+ return S_OK;
+ }
+ *ppvObj = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI EnumFormatImpl_AddRef(IEnumFORMATETC *iface)
+{
+ EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ LONG ref = InterlockedIncrement(&This->ref);
+ TRACE("(%p) ref=%ld\n", This, ref);
+ return ref;
+}
+
+static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface)
+{
+ EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ ULONG ref = InterlockedDecrement(&This->ref);
+ TRACE("(%p) ref=%ld\n", This, ref);
+
+ if(!ref) {
+ HeapFree(GetProcessHeap(), 0, This->fmtetc);
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+
+ return ref;
+}
+
+static HRESULT WINAPI EnumFormatImpl_Next(IEnumFORMATETC *iface, ULONG celt,
+ FORMATETC *rgelt, ULONG *pceltFetched)
+{
+ EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ ULONG count = 0;
+ TRACE("(%p)->(%ld %p %p)\n", This, celt, rgelt, pceltFetched);
+
+ if(!rgelt)
+ return E_INVALIDARG;
+
+ count = min(celt, This->fmtetc_cnt-This->cur);
+ if(count > 0) {
+ memcpy(rgelt, This->fmtetc+This->cur, count*sizeof(FORMATETC));
+ This->cur += count;
+ }
+ if(pceltFetched)
+ *pceltFetched = count;
+ return count == celt ? S_OK : S_FALSE;
+}
+
+static HRESULT WINAPI EnumFormatImpl_Skip(IEnumFORMATETC *iface, ULONG celt)
+{
+ EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ ULONG count = 0;
+ TRACE("(%p)->(%ld)\n", This, celt);
+
+ count = min(celt, This->fmtetc_cnt-This->cur);
+ This->cur += count;
+ return count == celt ? S_OK : S_FALSE;
+}
+
+static HRESULT WINAPI EnumFormatImpl_Reset(IEnumFORMATETC *iface)
+{
+ EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ TRACE("(%p)\n", This);
+
+ This->cur = 0;
+ return S_OK;
+}
+
+static HRESULT WINAPI EnumFormatImpl_Clone(IEnumFORMATETC *iface, IEnumFORMATETC
**ppenum)
+{
+ EnumFormatImpl *This = (EnumFormatImpl*)iface;
+ HRESULT hr;
+ TRACE("(%p)->(%p)\n", This, ppenum);
+
+ if(!ppenum)
+ return E_INVALIDARG;
+ hr = EnumFormatImpl_Create(This->fmtetc, This->fmtetc_cnt, ppenum);
+ if(SUCCEEDED(hr))
+ hr = IEnumFORMATETC_Skip(*ppenum, This->cur);
+ return hr;
+}
+
+static const IEnumFORMATETCVtbl VT_EnumFormatImpl = {
+ EnumFormatImpl_QueryInterface,
+ EnumFormatImpl_AddRef,
+ EnumFormatImpl_Release,
+ EnumFormatImpl_Next,
+ EnumFormatImpl_Skip,
+ EnumFormatImpl_Reset,
+ EnumFormatImpl_Clone
+};
+
+static HRESULT EnumFormatImpl_Create(FORMATETC *fmtetc, UINT fmtetc_cnt, IEnumFORMATETC
**lplpformatetc)
+{
+ EnumFormatImpl *ret;
+ TRACE("\n");
+
+ ret = HeapAlloc(GetProcessHeap(), 0, sizeof(EnumFormatImpl));
+ ret->lpVtbl = &VT_EnumFormatImpl;
+ ret->ref = 1;
+ ret->cur = 0;
+ ret->fmtetc_cnt = fmtetc_cnt;
+ ret->fmtetc = HeapAlloc(GetProcessHeap(), 0, fmtetc_cnt*sizeof(FORMATETC));
+ memcpy(ret->fmtetc, fmtetc, fmtetc_cnt*sizeof(FORMATETC));
+ *lplpformatetc = (LPENUMFORMATETC)ret;
+ return S_OK;
+}
+
+static HRESULT WINAPI DataObjectImpl_QueryInterface(IDataObject *iface, REFIID riid,
LPVOID *ppvObj)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ TRACE("(%p)->(%s)\n", This, debugstr_guid(riid));
+
+ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDataObject))
{
+ IDataObject_AddRef(iface);
+ *ppvObj = (LPVOID)This;
+ return S_OK;
+ }
+ *ppvObj = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI DataObjectImpl_AddRef(IDataObject* iface)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ ULONG ref = InterlockedIncrement(&This->ref);
+ TRACE("(%p) ref=%ld\n", This, ref);
+ return ref;
+}
+
+static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ ULONG ref = InterlockedDecrement(&This->ref);
+ TRACE("(%p) ref=%ld\n",This, ref);
+
+ if(!ref) {
+ if(This->unicode) GlobalFree(This->unicode);
+ if(This->rtf) GlobalFree(This->rtf);
+ if(This->fmtetc) GlobalFree(This->fmtetc);
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+
+ return ref;
+}
+
+static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pformatetc,
STGMEDIUM *pmedium)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat,
pformatetc->tymed);
+
+ if(pformatetc->lindex != -1)
+ return DV_E_LINDEX;
+
+ if(!(pformatetc->tymed & TYMED_HGLOBAL))
+ return DV_E_TYMED;
+
+ if(This->unicode && pformatetc->cfFormat == CF_UNICODETEXT)
+ pmedium->u.hGlobal = This->unicode;
+ else if(This->rtf && pformatetc->cfFormat == cfRTF)
+ pmedium->u.hGlobal = This->rtf;
+ else
+ return DV_E_FORMATETC;
+
+ pmedium->tymed = TYMED_HGLOBAL;
+ pmedium->pUnkForRelease = (LPUNKNOWN)iface;
+ IUnknown_AddRef(pmedium->pUnkForRelease);
+ return S_OK;
+}
+
+static HRESULT WINAPI DataObjectImpl_GetDataHere(IDataObject* iface, FORMATETC
*pformatetc, STGMEDIUM *pmedium)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ FIXME("(%p): stub\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObjectImpl_QueryGetData(IDataObject* iface, FORMATETC
*pformatetc)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ UINT i;
+ BOOL foundFormat = FALSE;
+ TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat,
pformatetc->tymed);
+
+ if(pformatetc->lindex != -1)
+ return DV_E_LINDEX;
+
+ for(i=0; i<This->fmtetc_cnt; i++) {
+ if(This->fmtetc[i].cfFormat == pformatetc->cfFormat) {
+ foundFormat = TRUE;
+ if(This->fmtetc[i].tymed == pformatetc->tymed)
+ return S_OK;
+ }
+ }
+ return foundFormat?DV_E_FORMATETC:DV_E_TYMED;
+}
+
+static HRESULT WINAPI DataObjectImpl_GetCanonicalFormatEtc(IDataObject* iface, FORMATETC
*pformatectIn,
+ FORMATETC *pformatetcOut)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ TRACE("(%p)->(%p,%p)\n", This, pformatectIn, pformatetcOut);
+
+ if(pformatetcOut) {
+ memcpy(pformatetcOut, pformatectIn, sizeof(FORMATETC));
+ pformatetcOut->ptd = NULL;
+ }
+ return DATA_S_SAMEFORMATETC;
+}
+
+static HRESULT WINAPI DataObjectImpl_SetData(IDataObject* iface, FORMATETC *pformatetc,
+ STGMEDIUM *pmedium, BOOL fRelease)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ FIXME("(%p): stub\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD
dwDirection,
+ IEnumFORMATETC **ppenumFormatEtc)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ TRACE("(%p)->(%ld)\n", This, dwDirection);
+
+ if(dwDirection != DATADIR_GET) {
+ FIXME("Unsupported direction: %ld\n", dwDirection);
+ /* WinXP riched20 also returns E_NOTIMPL in this case */
+ return E_NOTIMPL;
+ }
+ return EnumFormatImpl_Create(This->fmtetc, This->fmtetc_cnt, ppenumFormatEtc);
+}
+
+static HRESULT WINAPI DataObjectImpl_DAdvise(IDataObject* iface, FORMATETC *pformatetc,
DWORD advf,
+ IAdviseSink *pAdvSink, DWORD
*pdwConnection)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ FIXME("(%p): stub\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObjectImpl_DUnadvise(IDataObject* iface, DWORD dwConnection)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ FIXME("(%p): stub\n", This);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObjectImpl_EnumDAdvise(IDataObject* iface, IEnumSTATDATA
**ppenumAdvise)
+{
+ DataObjectImpl *This = (DataObjectImpl*)iface;
+ FIXME("(%p): stub\n", This);
+ return E_NOTIMPL;
+}
+
+static const IDataObjectVtbl VT_DataObjectImpl =
+{
+ DataObjectImpl_QueryInterface,
+ DataObjectImpl_AddRef,
+ DataObjectImpl_Release,
+ DataObjectImpl_GetData,
+ DataObjectImpl_GetDataHere,
+ DataObjectImpl_QueryGetData,
+ DataObjectImpl_GetCanonicalFormatEtc,
+ DataObjectImpl_SetData,
+ DataObjectImpl_EnumFormatEtc,
+ DataObjectImpl_DAdvise,
+ DataObjectImpl_DUnadvise,
+ DataObjectImpl_EnumDAdvise
+};
+
+static HGLOBAL get_unicode_text(ME_TextEditor *editor, CHARRANGE *lpchrg)
+{
+ int pars, len;
+ WCHAR *data;
+ HANDLE ret;
+
+ pars = ME_CountParagraphsBetween(editor, lpchrg->cpMin, lpchrg->cpMax);
+ len = lpchrg->cpMax-lpchrg->cpMin;
+ ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(WCHAR)*(len+pars+1));
+ data = (WCHAR *)GlobalLock(ret);
+ len = ME_GetTextW(editor, data, lpchrg->cpMin, len, TRUE);
+ data[len] = 0;
+ GlobalUnlock(ret);
+ return ret;
+}
+
+typedef struct tagME_GlobalDestStruct
+{
+ HGLOBAL hData;
+ int nLength;
+} ME_GlobalDestStruct;
+
+static DWORD CALLBACK ME_AppendToHGLOBAL(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG cb, LONG
*pcb)
+{
+ ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie;
+ int nMaxSize;
+ BYTE *pDest;
+
+ nMaxSize = GlobalSize(pData->hData);
+ if (pData->nLength+cb+1 >= cb) {
+ /* round up to 2^17 */
+ int nNewSize = (((nMaxSize+cb+1)|0x1FFFF)+1) & 0xFFFE0000;
+ pData->hData = GlobalReAlloc(pData->hData, nNewSize, 0);
+ }
+ pDest = (BYTE *)GlobalLock(pData->hData);
+ memcpy(pDest + pData->nLength, lpBuff, cb);
+ pData->nLength += cb;
+ pDest[pData->nLength] = '\0';
+ GlobalUnlock(pData->hData);
+ *pcb = cb;
+
+ return 0;
+}
+
+static HGLOBAL get_rtf_text(ME_TextEditor *editor, CHARRANGE *lpchrg)
+{
+ EDITSTREAM es;
+ ME_GlobalDestStruct gds;
+
+ gds.hData = GlobalAlloc(GMEM_MOVEABLE, 0);
+ gds.nLength = 0;
+ es.dwCookie = (DWORD_PTR)&gds;
+ es.pfnCallback = ME_AppendToHGLOBAL;
+ ME_StreamOutRange(editor, SF_RTF, lpchrg->cpMin, lpchrg->cpMax, &es);
+ GlobalReAlloc(gds.hData, gds.nLength+1, 0);
+ return gds.hData;
+}
+
+HRESULT ME_GetDataObject(ME_TextEditor *editor, CHARRANGE *lpchrg, LPDATAOBJECT
*lplpdataobj)
+{
+ DataObjectImpl *obj;
+ TRACE("(%p,%ld,%ld)\n", editor, lpchrg->cpMin, lpchrg->cpMax);
+
+ obj = HeapAlloc(GetProcessHeap(), 0, sizeof(DataObjectImpl));
+ if(cfRTF == 0)
+ cfRTF = RegisterClipboardFormatA("Rich Text Format");
+
+ obj->lpVtbl = &VT_DataObjectImpl;
+ obj->ref = 1;
+ obj->unicode = get_unicode_text(editor, lpchrg);
+ obj->rtf = NULL;
+
+ obj->fmtetc_cnt = 1;
+ if(editor->mode & TM_RICHTEXT)
+ obj->fmtetc_cnt++;
+ obj->fmtetc = HeapAlloc(GetProcessHeap(), 0,
obj->fmtetc_cnt*sizeof(FORMATETC));
+ InitFormatEtc(obj->fmtetc[0], CF_UNICODETEXT, TYMED_HGLOBAL);
+ if(editor->mode & TM_RICHTEXT) {
+ obj->rtf = get_rtf_text(editor, lpchrg);
+ InitFormatEtc(obj->fmtetc[1], cfRTF, TYMED_HGLOBAL);
+ }
+
+ *lplpdataobj = (LPDATAOBJECT)obj;
+ return S_OK;
+}
Modified: vendor/wine/dlls/riched20/current/context.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/context…
==============================================================================
--- vendor/wine/dlls/riched20/current/context.c (original)
+++ vendor/wine/dlls/riched20/current/context.c Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
Modified: vendor/wine/dlls/riched20/current/editor.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/editor.…
==============================================================================
--- vendor/wine/dlls/riched20/current/editor.c (original)
+++ vendor/wine/dlls/riched20/current/editor.c Thu Jun 15 01:47:25 2006
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
@@ -117,7 +117,7 @@
+ EM_SETTEXTEX 3.0 (unicode only, no rich text insertion handling, proper style?)
- EM_SETTEXTMODE 2.0
- EM_SETTYPOGRAPHYOPTIONS 3.0
- - EM_SETUNDOLIMIT 2.0
+ + EM_SETUNDOLIMIT 2.0
+ EM_SETWORDBREAKPROC (used only for word movement at the moment)
- EM_SETWORDBREAKPROCEX
- EM_SETWORDWRAPMODE 1.0asian
@@ -229,6 +229,9 @@
#include "imm.h"
#include "textserv.h"
#include "rtf.h"
+
+#define STACK_SIZE_DEFAULT 100
+#define STACK_SIZE_MAX 1000
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
@@ -488,6 +491,9 @@
RTFFlushOutputBuffer(info);
para = ME_GetParagraph(info->editor->pCursors[0].pRun);
+ /* Release possibly inherited cell definitions */
+ ME_DestroyTableCellList(para);
+
para->member.para.pCells = ALLOC_OBJ(ME_TableCell);
para->member.para.pCells->nRightBoundary = 0;
para->member.para.pCells->next = NULL;
@@ -764,34 +770,38 @@
static int
ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, WCHAR *text, CHARRANGE
*chrgText)
{
+ const int nLen = lstrlenW(text);
+ const int nTextLen = ME_GetTextLength(editor);
int nStart, nEnd;
- int nLen = lstrlenW(text);
int nMin, nMax;
ME_DisplayItem *item;
ME_DisplayItem *para;
+ WCHAR wLastChar = ' ';
TRACE("flags==0x%08lx, chrg->cpMin==%ld, chrg->cpMax==%ld text==%s\n",
flags, chrg->cpMin, chrg->cpMax, debugstr_w(text));
- if (flags & ~(FR_DOWN | FR_MATCHCASE))
- FIXME("Flags 0x%08lx not implemented\n", flags & ~(FR_DOWN |
FR_MATCHCASE));
+ if (flags & ~(FR_DOWN | FR_MATCHCASE | FR_WHOLEWORD))
+ FIXME("Flags 0x%08lx not implemented\n",
+ flags & ~(FR_DOWN | FR_MATCHCASE | FR_WHOLEWORD));
nMin = chrg->cpMin;
if (chrg->cpMax == -1)
- nMax = ME_GetTextLength(editor);
+ nMax = nTextLen;
else
- nMax = chrg->cpMax;
+ nMax = chrg->cpMax > nTextLen ? nTextLen : chrg->cpMax;
/* when searching up, if cpMin < cpMax, then instead of searching
* on [cpMin,cpMax], we search on [0,cpMin], otherwise, search on
- * [cpMax, cpMin]
+ * [cpMax, cpMin]. The exception is when cpMax is -1, in which
+ * case, it is always bigger than cpMin.
*/
if (!(flags & FR_DOWN))
{
int nSwap = nMax;
- nMax = nMin;
- if (nMin < nSwap)
+ nMax = nMin > nTextLen ? nTextLen : nMin;
+ if (nMin < nSwap || chrg->cpMax == -1)
nMin = 0;
else
nMin = nSwap;
@@ -806,6 +816,20 @@
if (flags & FR_DOWN) /* Forward search */
{
+ /* If possible, find the character before where the search starts */
+ if ((flags & FR_WHOLEWORD) && nMin)
+ {
+ nStart = nMin - 1;
+ item = ME_FindItemAtOffset(editor, diRun, nStart, &nStart);
+ if (!item)
+ {
+ if (chrgText)
+ chrgText->cpMin = chrgText->cpMax = -1;
+ return -1;
+ }
+ wLastChar = item->member.run.strText->szData[nStart];
+ }
+
nStart = nMin;
item = ME_FindItemAtOffset(editor, diRun, nStart, &nStart);
if (!item)
@@ -825,10 +849,35 @@
while (pCurItem &&
ME_CharCompare(pCurItem->member.run.strText->szData[nCurStart + nMatched],
text[nMatched], (flags & FR_MATCHCASE)))
{
+ if ((flags & FR_WHOLEWORD) && isalnumW(wLastChar))
+ break;
+
nMatched++;
if (nMatched == nLen)
{
- nStart += para->member.para.nCharOfs + item->member.run.nCharOfs;
+ ME_DisplayItem *pNextItem = pCurItem;
+ int nNextStart = nCurStart;
+ WCHAR wNextChar;
+
+ /* Check to see if next character is a whitespace */
+ if (flags & FR_WHOLEWORD)
+ {
+ if (nCurStart + nMatched == ME_StrLen(pCurItem->member.run.strText))
+ {
+ pNextItem = ME_FindItemFwd(pCurItem, diRun);
+ nNextStart = -nMatched;
+ }
+
+ if (pNextItem)
+ wNextChar = pNextItem->member.run.strText->szData[nNextStart +
nMatched];
+ else
+ wNextChar = ' ';
+
+ if (isalnumW(wNextChar))
+ break;
+ }
+
+ nStart += para->member.para.nCharOfs + pCurItem->member.run.nCharOfs;
if (chrgText)
{
chrgText->cpMin = nStart;
@@ -844,6 +893,11 @@
nCurStart = -nMatched;
}
}
+ if (pCurItem)
+ wLastChar = pCurItem->member.run.strText->szData[nCurStart + nMatched];
+ else
+ wLastChar = ' ';
+
nStart++;
if (nStart == ME_StrLen(item->member.run.strText))
{
@@ -855,9 +909,24 @@
}
else /* Backward search */
{
+ /* If possible, find the character after where the search ends */
+ if ((flags & FR_WHOLEWORD) && nMax < nTextLen - 1)
+ {
+ nEnd = nMax + 1;
+ item = ME_FindItemAtOffset(editor, diRun, nEnd, &nEnd);
+ if (!item)
+ {
+ if (chrgText)
+ chrgText->cpMin = chrgText->cpMax = -1;
+ return -1;
+ }
+ wLastChar = item->member.run.strText->szData[nEnd];
+ }
+
nEnd = nMax;
item = ME_FindItemAtOffset(editor, diRun, nEnd, &nEnd);
- if (!item) {
+ if (!item)
+ {
if (chrgText)
chrgText->cpMin = chrgText->cpMax = -1;
return -1;
@@ -872,12 +941,45 @@
int nCurEnd = nEnd;
int nMatched = 0;
- while (ME_CharCompare(pCurItem->member.run.strText->szData[nCurEnd - nMatched
- 1], text[nLen - nMatched - 1], (flags & FR_MATCHCASE)))
+ if (nCurEnd - nMatched == 0)
{
+ pCurItem = ME_FindItemBack(pCurItem, diRun);
+ para = ME_GetParagraph(pCurItem);
+ nCurEnd = ME_StrLen(pCurItem->member.run.strText) + nMatched;
+ }
+
+ while (pCurItem &&
ME_CharCompare(pCurItem->member.run.strText->szData[nCurEnd - nMatched - 1],
text[nLen - nMatched - 1], (flags & FR_MATCHCASE)))
+ {
+ if ((flags & FR_WHOLEWORD) && isalnumW(wLastChar))
+ break;
+
nMatched++;
if (nMatched == nLen)
{
- nStart = para->member.para.nCharOfs + item->member.run.nCharOfs + nCurEnd
- nMatched;
+ ME_DisplayItem *pPrevItem = pCurItem;
+ int nPrevEnd = nCurEnd;
+ WCHAR wPrevChar;
+
+ /* Check to see if previous character is a whitespace */
+ if (flags & FR_WHOLEWORD)
+ {
+ if (nPrevEnd - nMatched == 0)
+ {
+ pPrevItem = ME_FindItemBack(pCurItem, diRun);
+ if (pPrevItem)
+ nPrevEnd = ME_StrLen(pPrevItem->member.run.strText) + nMatched;
+ }
+
+ if (pPrevItem)
+ wPrevChar = pPrevItem->member.run.strText->szData[nPrevEnd - nMatched
- 1];
+ else
+ wPrevChar = ' ';
+
+ if (isalnumW(wPrevChar))
+ break;
+ }
+
+ nStart = para->member.para.nCharOfs + pCurItem->member.run.nCharOfs +
nCurEnd - nMatched;
if (chrgText)
{
chrgText->cpMin = nStart;
@@ -895,6 +997,11 @@
nCurEnd = ME_StrLen(pCurItem->member.run.strText) + nMatched;
}
}
+ if (pCurItem)
+ wLastChar = pCurItem->member.run.strText->szData[nCurEnd - nMatched - 1];
+ else
+ wLastChar = ' ';
+
nEnd--;
if (nEnd < 0)
{
@@ -1015,7 +1122,9 @@
ed->bCaretAtEnd = FALSE;
ed->nEventMask = 0;
ed->nModifyStep = 0;
- ed->pUndoStack = ed->pRedoStack = NULL;
+ ed->pUndoStack = ed->pRedoStack = ed->pUndoStackBottom = NULL;
+ ed->nUndoStackSize = 0;
+ ed->nUndoLimit = STACK_SIZE_DEFAULT;
ed->nUndoMode = umAddToUndo;
ed->nParagraphs = 1;
ed->nLastSelStart = ed->nLastSelEnd = 0;
@@ -1322,7 +1431,6 @@
UNSUPPORTED_MSG(EM_SETTABSTOPS)
UNSUPPORTED_MSG(EM_SETTARGETDEVICE)
UNSUPPORTED_MSG(EM_SETTYPOGRAPHYOPTIONS)
- UNSUPPORTED_MSG(EM_SETUNDOLIMIT)
UNSUPPORTED_MSG(EM_SETWORDBREAKPROCEX)
UNSUPPORTED_MSG(EM_SHOWSCROLLBAR)
UNSUPPORTED_MSG(WM_SETFONT)
@@ -1372,6 +1480,17 @@
ME_GetSelection(editor, (int *)&pRange->cpMin, (int *)&pRange->cpMax);
TRACE("EM_EXGETSEL = (%ld,%ld)\n", pRange->cpMin, pRange->cpMax);
return 0;
+ }
+ case EM_SETUNDOLIMIT:
+ {
+ if ((int)wParam < 0)
+ editor->nUndoLimit = STACK_SIZE_DEFAULT;
+ else
+ editor->nUndoLimit = min(wParam, STACK_SIZE_MAX);
+ /* Setting a max stack size keeps wine from getting killed
+ for hogging memory. Windows allocates all this memory at once, so
+ no program would realisticly set a value above our maxiumum. */
+ return editor->nUndoLimit;
}
case EM_CANUNDO:
return editor->pUndoStack != NULL;
@@ -1852,7 +1971,7 @@
DWORD flags = 0;
buflen = ME_GetTextW(editor, buffer, nStart, nCount, ex->flags &
GT_USECRLF);
- rc = WideCharToMultiByte(ex->codepage, flags, buffer, buflen, (LPSTR)lParam,
ex->cb, ex->lpDefaultChar, ex->lpUsedDefaultChar);
+ rc = WideCharToMultiByte(ex->codepage, flags, buffer, -1, (LPSTR)lParam,
ex->cb, ex->lpDefaultChar, ex->lpUsedDefaultChar);
HeapFree(GetProcessHeap(),0,buffer);
return rc;
@@ -2395,21 +2514,26 @@
int nLen = ME_StrLen(item->member.run.strText);
if (nLen > nChars)
nLen = nChars;
-
+
if (item->member.run.nFlags & MERF_ENDPARA)
{
- *buffer = '\r';
- if (bCRLF)
- {
- *(++buffer) = '\n';
- nWritten++;
- }
- assert(nLen == 1);
- /* our end paragraph consists of 2 characters now */
- if (editor->bEmulateVersion10)
- nChars--;
- }
- else
+ if (!ME_FindItemFwd(item, diRun))
+ /* No '\r' is appended to the last paragraph. */
+ nLen = 0;
+ else {
+ *buffer = '\r';
+ if (bCRLF)
+ {
+ *(++buffer) = '\n';
+ nWritten++;
+ }
+ assert(nLen == 1);
+ /* our end paragraph consists of 2 characters now */
+ if (editor->bEmulateVersion10)
+ nChars--;
+ }
+ }
+ else
CopyMemory(buffer, item->member.run.strText->szData, sizeof(WCHAR)*nLen);
nChars -= nLen;
nWritten += nLen;
Modified: vendor/wine/dlls/riched20/current/editor.h
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/editor.…
==============================================================================
--- vendor/wine/dlls/riched20/current/editor.h (original)
+++ vendor/wine/dlls/riched20/current/editor.h Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editstr.h"
Modified: vendor/wine/dlls/riched20/current/editstr.h
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/editstr…
==============================================================================
--- vendor/wine/dlls/riched20/current/editstr.h (original)
+++ vendor/wine/dlls/riched20/current/editstr.h Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __EDITSTR_H
@@ -298,7 +298,9 @@
BOOL bCaretAtEnd;
int nEventMask;
int nModifyStep;
- ME_DisplayItem *pUndoStack, *pRedoStack;
+ ME_DisplayItem *pUndoStack, *pRedoStack, *pUndoStackBottom;
+ int nUndoStackSize;
+ int nUndoLimit;
ME_UndoMode nUndoMode;
int nParagraphs;
int nLastSelStart, nLastSelEnd;
Modified: vendor/wine/dlls/riched20/current/list.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/list.c?…
==============================================================================
--- vendor/wine/dlls/riched20/current/list.c (original)
+++ vendor/wine/dlls/riched20/current/list.c Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
Modified: vendor/wine/dlls/riched20/current/paint.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/paint.c…
==============================================================================
--- vendor/wine/dlls/riched20/current/paint.c (original)
+++ vendor/wine/dlls/riched20/current/paint.c Thu Jun 15 01:47:25 2006
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
Modified: vendor/wine/dlls/riched20/current/para.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/para.c?…
==============================================================================
--- vendor/wine/dlls/riched20/current/para.c (original)
+++ vendor/wine/dlls/riched20/current/para.c Thu Jun 15 01:47:25 2006
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
@@ -136,8 +136,26 @@
new_para->member.para.nFirstMargin = run_para->member.para.nFirstMargin;
new_para->member.para.bTable = run_para->member.para.bTable;
+
+ /* Inherit previous cell definitions if any */
new_para->member.para.pCells = NULL;
-
+ if (run_para->member.para.pCells)
+ {
+ ME_TableCell *pCell, *pNewCell;
+
+ for (pCell = run_para->member.para.pCells; pCell; pCell = pCell->next)
+ {
+ pNewCell = ALLOC_OBJ(ME_TableCell);
+ pNewCell->nRightBoundary = pCell->nRightBoundary;
+ pNewCell->next = NULL;
+ if (new_para->member.para.pCells)
+ new_para->member.para.pLastCell->next = pNewCell;
+ else
+ new_para->member.para.pCells = pNewCell;
+ new_para->member.para.pLastCell = pNewCell;
+ }
+ }
+
/* fix paragraph properties. FIXME only needed when called from RTF reader */
if (run_para->member.para.pCells && !run_para->member.para.bTable)
{
Modified: vendor/wine/dlls/riched20/current/reader.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/reader.…
==============================================================================
--- vendor/wine/dlls/riched20/current/reader.c (original)
+++ vendor/wine/dlls/riched20/current/reader.c Thu Jun 15 01:47:25 2006
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
Modified: vendor/wine/dlls/riched20/current/richole.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/richole…
==============================================================================
--- vendor/wine/dlls/riched20/current/richole.c (original)
+++ vendor/wine/dlls/riched20/current/richole.c Thu Jun 15 01:47:25 2006
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
Modified: vendor/wine/dlls/riched20/current/row.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/row.c?r…
==============================================================================
--- vendor/wine/dlls/riched20/current/row.c (original)
+++ vendor/wine/dlls/riched20/current/row.c Thu Jun 15 01:47:25 2006
@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
Modified: vendor/wine/dlls/riched20/current/run.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/run.c?r…
==============================================================================
--- vendor/wine/dlls/riched20/current/run.c (original)
+++ vendor/wine/dlls/riched20/current/run.c Thu Jun 15 01:47:25 2006
@@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
Modified: vendor/wine/dlls/riched20/current/string.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/string.…
==============================================================================
--- vendor/wine/dlls/riched20/current/string.c (original)
+++ vendor/wine/dlls/riched20/current/string.c Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
Modified: vendor/wine/dlls/riched20/current/style.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/style.c…
==============================================================================
--- vendor/wine/dlls/riched20/current/style.c (original)
+++ vendor/wine/dlls/riched20/current/style.c Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
Modified: vendor/wine/dlls/riched20/current/txtsrv.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/txtsrv.…
==============================================================================
--- vendor/wine/dlls/riched20/current/txtsrv.c (original)
+++ vendor/wine/dlls/riched20/current/txtsrv.c Thu Jun 15 01:47:25 2006
@@ -1,390 +1,391 @@
-/*
- * RichEdit - functions and interfaces around CreateTextServices
- *
- * Copyright 2005, 2006, Maarten Lankhorst
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-#include "wine/port.h"
-
-#define NONAMELESSSTRUCT
-#define NONAMELESSUNION
-#define COBJMACROS
-
-#include "editor.h"
-#include "ole2.h"
-#include "richole.h"
-#include "winreg.h"
-#include "imm.h"
-#include "textserv.h"
-#include "wine/debug.h"
-#include "editstr.h"
-
-#ifdef __i386__ /* thiscall functions are i386-specific */
-
-#define THISCALL(func) __thiscall_ ## func
-#define DEFINE_THISCALL_WRAPPER(func) \
- extern typeof(func) THISCALL(func); \
- __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
- "popl %eax\n\t" \
- "pushl %ecx\n\t" \
- "pushl %eax\n\t" \
- "jmp " __ASM_NAME(#func) )
-#else /* __i386__ */
-
-#define THISCALL(func) func
-#define DEFINE_THISCALL_WRAPPER(func) /* nothing */
-
-#endif /* __i386__ */
-
-WINE_DEFAULT_DEBUG_CHANNEL(richedit);
-
-typedef struct ITextServicesImpl {
- const ITextServicesVtbl *lpVtbl;
- ITextHost *pMyHost;
- LONG ref;
- CRITICAL_SECTION csTxtSrv;
-} ITextServicesImpl;
-
-static const ITextServicesVtbl textservices_Vtbl;
-
-/******************************************************************
- * CreateTextServices (RICHED20.4)
- */
-HRESULT WINAPI CreateTextServices(IUnknown * pUnkOuter,
- ITextHost * pITextHost,
- IUnknown **ppUnk)
-{
- ITextServicesImpl *ITextImpl;
- TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk);
- if (pITextHost == NULL)
- return E_POINTER;
-
- ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl));
- if (ITextImpl == NULL)
- return E_OUTOFMEMORY;
- InitializeCriticalSection(&ITextImpl->csTxtSrv);
- ITextImpl->ref = 1;
- ITextImpl->pMyHost = pITextHost;
- ITextImpl->lpVtbl = &textservices_Vtbl;
-
- if (pUnkOuter)
- {
- FIXME("Support aggregation\n");
- return CLASS_E_NOAGGREGATION;
- }
-
- *ppUnk = (IUnknown *)ITextImpl;
- return S_OK;
-}
-
-#define ICOM_THIS_MULTI(impl,field,iface) \
- impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
-
-static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices * iface,
- REFIID riid,
- LPVOID * ppv)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
- TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
- *ppv = NULL;
- if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextServices))
- *ppv = (LPVOID)This;
-
- if (*ppv)
- {
- IUnknown_AddRef((IUnknown *)(*ppv));
- TRACE ("-- Interface = %p\n", *ppv);
- return S_OK;
- }
- FIXME("Unknown interface: %s\n", debugstr_guid(riid));
- return E_NOINTERFACE;
-}
-
-static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
- DWORD ref = InterlockedIncrement(&This->ref);
-
- TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, ref - 1);
- return ref;
-}
-
-static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
- DWORD ref = InterlockedDecrement(&This->ref);
-
- TRACE("(%p/%p)->() Release from %ld\n", This, iface, ref + 1);
-
- if (!ref)
- {
- ITextHost_Release(This->pMyHost);
- DeleteCriticalSection(&This->csTxtSrv);
- CoTaskMemFree(This);
- }
- return ref;
-}
-
-HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface,
- UINT msg,
- WPARAM wparam,
- LPARAM lparam,
- LRESULT* plresult)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxDraw(ITextServices *iface,
- DWORD dwDrawAspect,
- LONG lindex,
- void* pvAspect,
- DVTARGETDEVICE* ptd,
- HDC hdcDraw,
- HDC hdcTargetDev,
- LPCRECTL lprcBounds,
- LPCRECTL lprcWBounds,
- LPRECT lprcUpdate,
- BOOL (CALLBACK * pfnContinue)(DWORD),
- DWORD dwContinue,
- LONG lViewId)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetHScroll(ITextServices *iface,
- LONG* plMin,
- LONG* plMax,
- LONG* plPos,
- LONG* plPage,
- BOOL* pfEnabled)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetVScroll(ITextServices *iface,
- LONG* plMin,
- LONG* plMax,
- LONG* plPos,
- LONG* plPage,
- BOOL* pfEnabled)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_OnTxSetCursor(ITextServices *iface,
- DWORD dwDrawAspect,
- LONG lindex,
- void* pvAspect,
- DVTARGETDEVICE* ptd,
- HDC hdcDraw,
- HDC hicTargetDev,
- LPCRECT lprcClient,
- INT x, INT y)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxQueryHitPoint(ITextServices *iface,
- DWORD dwDrawAspect,
- LONG lindex,
- void* pvAspect,
- DVTARGETDEVICE* ptd,
- HDC hdcDraw,
- HDC hicTargetDev,
- LPCRECT lprcClient,
- INT x, INT y,
- DWORD* pHitResult)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_OnTxInplaceActivate(ITextServices *iface,
- LPCRECT prcClient)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_OnTxInplaceDeactivate(ITextServices *iface)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_OnTxUIActivate(ITextServices *iface)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_OnTxUIDeactivate(ITextServices *iface)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetText(ITextServices *iface,
- BSTR* pbstrText)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxSetText(ITextServices *iface,
- LPCWSTR pszText)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetCurrentTargetX(ITextServices *iface,
- LONG* x)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetBaseLinePos(ITextServices *iface,
- LONG* x)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetNaturalSize(ITextServices *iface,
- DWORD dwAspect,
- HDC hdcDraw,
- HDC hicTargetDev,
- DVTARGETDEVICE* ptd,
- DWORD dwMode,
- const SIZEL* psizelExtent,
- LONG* pwidth,
- LONG* pheight)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetDropTarget(ITextServices *iface,
- IDropTarget** ppDropTarget)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_OnTxPropertyBitsChange(ITextServices *iface,
- DWORD dwMask,
- DWORD dwBits)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-HRESULT WINAPI fnTextSrv_TxGetCachedSize(ITextServices *iface,
- DWORD* pdwWidth,
- DWORD* pdwHeight)
-{
- ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
-
- FIXME("%p: STUB\n", This);
- return E_NOTIMPL;
-}
-
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxSendMessage);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxDraw);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetHScroll);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetVScroll);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxSetCursor);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxQueryHitPoint);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxInplaceActivate);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxInplaceDeactivate);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxUIActivate);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxUIDeactivate);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetText);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxSetText);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCurrentTargetX);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetBaseLinePos);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetNaturalSize);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetDropTarget);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxPropertyBitsChange);
-DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCachedSize);
-
-static const ITextServicesVtbl textservices_Vtbl =
-{
- fnTextSrv_QueryInterface,
- fnTextSrv_AddRef,
- fnTextSrv_Release,
- THISCALL(fnTextSrv_TxSendMessage),
- THISCALL(fnTextSrv_TxDraw),
- THISCALL(fnTextSrv_TxGetHScroll),
- THISCALL(fnTextSrv_TxGetVScroll),
- THISCALL(fnTextSrv_OnTxSetCursor),
- THISCALL(fnTextSrv_TxQueryHitPoint),
- THISCALL(fnTextSrv_OnTxInplaceActivate),
- THISCALL(fnTextSrv_OnTxInplaceDeactivate),
- THISCALL(fnTextSrv_OnTxUIActivate),
- THISCALL(fnTextSrv_OnTxUIDeactivate),
- THISCALL(fnTextSrv_TxGetText),
- THISCALL(fnTextSrv_TxSetText),
- THISCALL(fnTextSrv_TxGetCurrentTargetX),
- THISCALL(fnTextSrv_TxGetBaseLinePos),
- THISCALL(fnTextSrv_TxGetNaturalSize),
- THISCALL(fnTextSrv_TxGetDropTarget),
- THISCALL(fnTextSrv_OnTxPropertyBitsChange),
- THISCALL(fnTextSrv_TxGetCachedSize)
-};
+/*
+ * RichEdit - functions and interfaces around CreateTextServices
+ *
+ * Copyright 2005, 2006, Maarten Lankhorst
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#define NONAMELESSSTRUCT
+#define NONAMELESSUNION
+#define COBJMACROS
+
+#include "editor.h"
+#include "ole2.h"
+#include "richole.h"
+#include "winreg.h"
+#include "imm.h"
+#include "textserv.h"
+#include "wine/debug.h"
+#include "editstr.h"
+
+#ifdef __i386__ /* thiscall functions are i386-specific */
+
+#define THISCALL(func) __thiscall_ ## func
+#define DEFINE_THISCALL_WRAPPER(func) \
+ extern typeof(func) THISCALL(func); \
+ __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
+ "popl %eax\n\t" \
+ "pushl %ecx\n\t" \
+ "pushl %eax\n\t" \
+ "jmp " __ASM_NAME(#func) )
+#else /* __i386__ */
+
+#define THISCALL(func) func
+#define DEFINE_THISCALL_WRAPPER(func) /* nothing */
+
+#endif /* __i386__ */
+
+WINE_DEFAULT_DEBUG_CHANNEL(richedit);
+
+typedef struct ITextServicesImpl {
+ const ITextServicesVtbl *lpVtbl;
+ ITextHost *pMyHost;
+ LONG ref;
+ CRITICAL_SECTION csTxtSrv;
+} ITextServicesImpl;
+
+static const ITextServicesVtbl textservices_Vtbl;
+
+/******************************************************************
+ * CreateTextServices (RICHED20.4)
+ */
+HRESULT WINAPI CreateTextServices(IUnknown * pUnkOuter,
+ ITextHost * pITextHost,
+ IUnknown **ppUnk)
+{
+ ITextServicesImpl *ITextImpl;
+ TRACE("%p %p --> %p\n", pUnkOuter, pITextHost, ppUnk);
+ if (pITextHost == NULL)
+ return E_POINTER;
+
+ ITextImpl = CoTaskMemAlloc(sizeof(*ITextImpl));
+ if (ITextImpl == NULL)
+ return E_OUTOFMEMORY;
+ InitializeCriticalSection(&ITextImpl->csTxtSrv);
+ ITextImpl->ref = 1;
+ ITextHost_AddRef(pITextHost);
+ ITextImpl->pMyHost = pITextHost;
+ ITextImpl->lpVtbl = &textservices_Vtbl;
+
+ if (pUnkOuter)
+ {
+ FIXME("Support aggregation\n");
+ return CLASS_E_NOAGGREGATION;
+ }
+
+ *ppUnk = (IUnknown *)ITextImpl;
+ return S_OK;
+}
+
+#define ICOM_THIS_MULTI(impl,field,iface) \
+ impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
+
+static HRESULT WINAPI fnTextSrv_QueryInterface(ITextServices * iface,
+ REFIID riid,
+ LPVOID * ppv)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
+ *ppv = NULL;
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextServices))
+ *ppv = (LPVOID)This;
+
+ if (*ppv)
+ {
+ IUnknown_AddRef((IUnknown *)(*ppv));
+ TRACE ("-- Interface = %p\n", *ppv);
+ return S_OK;
+ }
+ FIXME("Unknown interface: %s\n", debugstr_guid(riid));
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ DWORD ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, ref - 1);
+ return ref;
+}
+
+static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+ DWORD ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p/%p)->() Release from %ld\n", This, iface, ref + 1);
+
+ if (!ref)
+ {
+ ITextHost_Release(This->pMyHost);
+ DeleteCriticalSection(&This->csTxtSrv);
+ CoTaskMemFree(This);
+ }
+ return ref;
+}
+
+HRESULT WINAPI fnTextSrv_TxSendMessage(ITextServices *iface,
+ UINT msg,
+ WPARAM wparam,
+ LPARAM lparam,
+ LRESULT* plresult)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxDraw(ITextServices *iface,
+ DWORD dwDrawAspect,
+ LONG lindex,
+ void* pvAspect,
+ DVTARGETDEVICE* ptd,
+ HDC hdcDraw,
+ HDC hdcTargetDev,
+ LPCRECTL lprcBounds,
+ LPCRECTL lprcWBounds,
+ LPRECT lprcUpdate,
+ BOOL (CALLBACK * pfnContinue)(DWORD),
+ DWORD dwContinue,
+ LONG lViewId)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetHScroll(ITextServices *iface,
+ LONG* plMin,
+ LONG* plMax,
+ LONG* plPos,
+ LONG* plPage,
+ BOOL* pfEnabled)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetVScroll(ITextServices *iface,
+ LONG* plMin,
+ LONG* plMax,
+ LONG* plPos,
+ LONG* plPage,
+ BOOL* pfEnabled)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_OnTxSetCursor(ITextServices *iface,
+ DWORD dwDrawAspect,
+ LONG lindex,
+ void* pvAspect,
+ DVTARGETDEVICE* ptd,
+ HDC hdcDraw,
+ HDC hicTargetDev,
+ LPCRECT lprcClient,
+ INT x, INT y)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxQueryHitPoint(ITextServices *iface,
+ DWORD dwDrawAspect,
+ LONG lindex,
+ void* pvAspect,
+ DVTARGETDEVICE* ptd,
+ HDC hdcDraw,
+ HDC hicTargetDev,
+ LPCRECT lprcClient,
+ INT x, INT y,
+ DWORD* pHitResult)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_OnTxInplaceActivate(ITextServices *iface,
+ LPCRECT prcClient)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_OnTxInplaceDeactivate(ITextServices *iface)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_OnTxUIActivate(ITextServices *iface)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_OnTxUIDeactivate(ITextServices *iface)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetText(ITextServices *iface,
+ BSTR* pbstrText)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxSetText(ITextServices *iface,
+ LPCWSTR pszText)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetCurrentTargetX(ITextServices *iface,
+ LONG* x)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetBaseLinePos(ITextServices *iface,
+ LONG* x)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetNaturalSize(ITextServices *iface,
+ DWORD dwAspect,
+ HDC hdcDraw,
+ HDC hicTargetDev,
+ DVTARGETDEVICE* ptd,
+ DWORD dwMode,
+ const SIZEL* psizelExtent,
+ LONG* pwidth,
+ LONG* pheight)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetDropTarget(ITextServices *iface,
+ IDropTarget** ppDropTarget)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_OnTxPropertyBitsChange(ITextServices *iface,
+ DWORD dwMask,
+ DWORD dwBits)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+HRESULT WINAPI fnTextSrv_TxGetCachedSize(ITextServices *iface,
+ DWORD* pdwWidth,
+ DWORD* pdwHeight)
+{
+ ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
+
+ FIXME("%p: STUB\n", This);
+ return E_NOTIMPL;
+}
+
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxSendMessage);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxDraw);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetHScroll);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetVScroll);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxSetCursor);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxQueryHitPoint);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxInplaceActivate);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxInplaceDeactivate);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxUIActivate);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxUIDeactivate);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetText);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxSetText);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCurrentTargetX);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetBaseLinePos);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetNaturalSize);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetDropTarget);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxPropertyBitsChange);
+DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCachedSize);
+
+static const ITextServicesVtbl textservices_Vtbl =
+{
+ fnTextSrv_QueryInterface,
+ fnTextSrv_AddRef,
+ fnTextSrv_Release,
+ THISCALL(fnTextSrv_TxSendMessage),
+ THISCALL(fnTextSrv_TxDraw),
+ THISCALL(fnTextSrv_TxGetHScroll),
+ THISCALL(fnTextSrv_TxGetVScroll),
+ THISCALL(fnTextSrv_OnTxSetCursor),
+ THISCALL(fnTextSrv_TxQueryHitPoint),
+ THISCALL(fnTextSrv_OnTxInplaceActivate),
+ THISCALL(fnTextSrv_OnTxInplaceDeactivate),
+ THISCALL(fnTextSrv_OnTxUIActivate),
+ THISCALL(fnTextSrv_OnTxUIDeactivate),
+ THISCALL(fnTextSrv_TxGetText),
+ THISCALL(fnTextSrv_TxSetText),
+ THISCALL(fnTextSrv_TxGetCurrentTargetX),
+ THISCALL(fnTextSrv_TxGetBaseLinePos),
+ THISCALL(fnTextSrv_TxGetNaturalSize),
+ THISCALL(fnTextSrv_TxGetDropTarget),
+ THISCALL(fnTextSrv_OnTxPropertyBitsChange),
+ THISCALL(fnTextSrv_TxGetCachedSize)
+};
Modified: vendor/wine/dlls/riched20/current/undo.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/undo.c?…
==============================================================================
--- vendor/wine/dlls/riched20/current/undo.c (original)
+++ vendor/wine/dlls/riched20/current/undo.c Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
@@ -32,7 +32,8 @@
TRACE("Emptying undo stack\n");
p = editor->pUndoStack;
- editor->pUndoStack = NULL;
+ editor->pUndoStack = editor->pUndoStackBottom = NULL;
+ editor->nUndoStackSize = 0;
while(p) {
pNext = p->next;
ME_DestroyDisplayItem(p);
@@ -50,6 +51,8 @@
ME_UndoItem *ME_AddUndoItem(ME_TextEditor *editor, ME_DIType type, ME_DisplayItem *pdi)
{
if (editor->nUndoMode == umIgnore)
return NULL;
+ else if (editor->nUndoLimit == 0)
+ return NULL;
else
{
ME_DisplayItem *pItem = (ME_DisplayItem *)ALLOC_OBJ(ME_UndoItem);
@@ -93,10 +96,31 @@
TRACE("Pushing id=%s to undo stack, deleting redo stack\n",
ME_GetDITypeName(type));
else
TRACE("Pushing id=%s to undo stack\n", ME_GetDITypeName(type));
+
pItem->next = editor->pUndoStack;
+ if (type == diUndoEndTransaction)
+ editor->nUndoStackSize++;
if (editor->pUndoStack)
editor->pUndoStack->prev = pItem;
+ else
+ editor->pUndoStackBottom = pItem;
editor->pUndoStack = pItem;
+
+ if (editor->nUndoStackSize > editor->nUndoLimit)
+ { /* remove oldest undo from stack */
+ ME_DisplayItem *p = editor->pUndoStackBottom;
+ while (p->type !=diUndoEndTransaction)
+ p = p->prev; /*find new stack bottom */
+ editor->pUndoStackBottom = p->prev;
+ editor->pUndoStackBottom->next = NULL;
+ do
+ {
+ ME_DisplayItem *pp = p->next;
+ ME_DestroyDisplayItem(p);
+ p = pp;
+ } while (p);
+ editor->nUndoStackSize--;
+ }
/* any new operation (not redo) clears the redo stack */
if (editor->nUndoMode == umAddToUndo) {
ME_DisplayItem *p = editor->pRedoStack;
@@ -233,6 +257,7 @@
} while(p && p->type != diUndoEndTransaction);
ME_AddUndoItem(editor, diUndoEndTransaction, NULL);
editor->pUndoStack = p;
+ editor->nUndoStackSize--;
if (p)
p->prev = NULL;
editor->nUndoMode = nMode;
Added: vendor/wine/dlls/riched20/current/version.rc
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/version…
==============================================================================
--- vendor/wine/dlls/riched20/current/version.rc (added)
+++ vendor/wine/dlls/riched20/current/version.rc Thu Jun 15 01:47:25 2006
@@ -1,0 +1,26 @@
+/*
+ * Copyright (c) 2006 Mike McCormack
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine Richedit dll"
+#define WINE_FILENAME_STR "riched20.dll"
+#define WINE_FILEVERSION 5,30,23,1215
+#define WINE_FILEVERSION_STR "5,30,23,1215"
+#define WINE_PRODUCTVERSION 5,30,23,1215
+#define WINE_PRODUCTVERSION_STR "5,30,23,1215"
+
+#include "wine/wine_common_ver.rc"
Modified: vendor/wine/dlls/riched20/current/wrap.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/wrap.c?…
==============================================================================
--- vendor/wine/dlls/riched20/current/wrap.c (original)
+++ vendor/wine/dlls/riched20/current/wrap.c Thu Jun 15 01:47:25 2006
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
Modified: vendor/wine/dlls/riched20/current/writer.c
URL:
http://svn.reactos.ru/svn/reactos/vendor/wine/dlls/riched20/current/writer.…
==============================================================================
--- vendor/wine/dlls/riched20/current/writer.c (original)
+++ vendor/wine/dlls/riched20/current/writer.c Thu Jun 15 01:47:25 2006
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "editor.h"
@@ -782,8 +782,7 @@
nSize = WideCharToMultiByte(nCodePage, 0, item->member.run.strText->szData
+ nStart,
nLen, NULL, 0, NULL, NULL);
if (nSize > nBufLen) {
- if (buffer)
- FREE_OBJ(buffer);
+ FREE_OBJ(buffer);
buffer = ALLOC_N_OBJ(char, nSize);
nBufLen = nSize;
}
@@ -800,8 +799,7 @@
item = ME_FindItemFwd(item, diRun);
}
- if (buffer)
- FREE_OBJ(buffer);
+ FREE_OBJ(buffer);
return success;
}