2005-03-05 12:55:44 +01:00
|
|
|
/*
|
2005-03-08 17:46:00 +01:00
|
|
|
* RichEdit GUIDs and OLE interface
|
2005-03-05 12:55:44 +01:00
|
|
|
*
|
|
|
|
* Copyright 2004 by Krzysztof Foltman
|
2005-03-08 17:46:00 +01:00
|
|
|
* Copyright 2004 Aric Stewart
|
2005-03-05 12:55:44 +01:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-03-05 12:55:44 +01:00
|
|
|
*/
|
|
|
|
|
2005-03-08 17:46:00 +01:00
|
|
|
#include <stdarg.h>
|
2005-03-05 12:55:44 +01:00
|
|
|
|
2005-03-08 17:46:00 +01:00
|
|
|
#define NONAMELESSUNION
|
|
|
|
#define COBJMACROS
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "ole2.h"
|
|
|
|
#include "richole.h"
|
2006-02-23 05:05:11 +01:00
|
|
|
#include "editor.h"
|
2015-05-17 21:15:30 +02:00
|
|
|
#include "richedit.h"
|
2006-07-10 21:03:57 +02:00
|
|
|
#include "tom.h"
|
2005-03-08 17:46:00 +01:00
|
|
|
#include "wine/debug.h"
|
2005-03-05 12:55:44 +01:00
|
|
|
|
2005-03-08 17:46:00 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
|
2005-03-05 12:55:44 +01:00
|
|
|
|
2005-03-08 17:46:00 +01:00
|
|
|
/* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
|
|
|
|
|
2006-06-09 21:10:01 +02:00
|
|
|
#include "initguid.h"
|
2015-05-24 13:01:38 +02:00
|
|
|
|
|
|
|
DEFINE_GUID(LIBID_tom, 0x8cc497c9, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
|
2011-07-04 06:44:00 +02:00
|
|
|
DEFINE_GUID(IID_ITextServices, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
|
|
|
|
DEFINE_GUID(IID_ITextHost, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
|
|
|
|
DEFINE_GUID(IID_ITextHost2, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
|
2006-07-10 21:03:57 +02:00
|
|
|
DEFINE_GUID(IID_ITextDocument, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
|
2008-06-26 01:31:39 +02:00
|
|
|
DEFINE_GUID(IID_ITextRange, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
|
|
|
|
DEFINE_GUID(IID_ITextSelection, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
|
2015-05-17 16:26:33 +02:00
|
|
|
DEFINE_GUID(IID_ITextFont, 0x8cc497c3, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
|
2015-05-17 16:27:42 +02:00
|
|
|
DEFINE_GUID(IID_ITextPara, 0x8cc497c4, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
|
2008-06-26 01:31:39 +02:00
|
|
|
|
2015-05-24 13:01:38 +02:00
|
|
|
static ITypeLib *typelib;
|
|
|
|
|
|
|
|
enum tid_t {
|
|
|
|
NULL_tid,
|
|
|
|
ITextDocument_tid,
|
|
|
|
ITextRange_tid,
|
|
|
|
ITextSelection_tid,
|
|
|
|
ITextFont_tid,
|
|
|
|
ITextPara_tid,
|
|
|
|
LAST_tid
|
|
|
|
};
|
|
|
|
|
|
|
|
static const IID * const tid_ids[] =
|
|
|
|
{
|
|
|
|
&IID_NULL,
|
|
|
|
&IID_ITextDocument,
|
|
|
|
&IID_ITextRange,
|
|
|
|
&IID_ITextSelection,
|
|
|
|
&IID_ITextFont,
|
|
|
|
&IID_ITextPara,
|
|
|
|
};
|
|
|
|
static ITypeInfo *typeinfos[LAST_tid];
|
|
|
|
|
|
|
|
static HRESULT load_typelib(void)
|
|
|
|
{
|
|
|
|
ITypeLib *tl;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
hr = LoadRegTypeLib(&LIBID_tom, 1, 0, LOCALE_SYSTEM_DEFAULT, &tl);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("LoadRegTypeLib failed: %08x\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (InterlockedCompareExchangePointer((void**)&typelib, tl, NULL))
|
|
|
|
ITypeLib_Release(tl);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void release_typelib(void)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
if (!typelib)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++)
|
|
|
|
if (typeinfos[i])
|
|
|
|
ITypeInfo_Release(typeinfos[i]);
|
|
|
|
|
|
|
|
ITypeLib_Release(typelib);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (!typelib)
|
|
|
|
hr = load_typelib();
|
|
|
|
if (!typelib)
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
if (!typeinfos[tid])
|
|
|
|
{
|
|
|
|
ITypeInfo *ti;
|
|
|
|
|
|
|
|
hr = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
|
|
|
ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (InterlockedCompareExchangePointer((void**)(typeinfos+tid), ti, NULL))
|
|
|
|
ITypeInfo_Release(ti);
|
|
|
|
}
|
|
|
|
|
|
|
|
*typeinfo = typeinfos[tid];
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-05-20 10:41:34 +02:00
|
|
|
/* private IID used to get back IRichEditOleImpl pointer */
|
|
|
|
DEFINE_GUID(IID_Igetrichole, 0xe3ce5c7a, 0x8247, 0x4622, 0x81, 0xad, 0x11, 0x81, 0x02, 0xaa, 0x01, 0x30);
|
|
|
|
|
2008-06-26 01:31:39 +02:00
|
|
|
typedef struct ITextSelectionImpl ITextSelectionImpl;
|
2009-01-09 18:08:35 +01:00
|
|
|
typedef struct IOleClientSiteImpl IOleClientSiteImpl;
|
2014-09-12 14:33:29 +02:00
|
|
|
typedef struct ITextRangeImpl ITextRangeImpl;
|
2005-03-08 17:46:00 +01:00
|
|
|
|
2006-06-09 21:10:01 +02:00
|
|
|
typedef struct IRichEditOleImpl {
|
2014-10-28 13:10:33 +01:00
|
|
|
IUnknown IUnknown_inner;
|
2011-05-18 23:49:52 +02:00
|
|
|
IRichEditOle IRichEditOle_iface;
|
|
|
|
ITextDocument ITextDocument_iface;
|
2014-10-28 13:10:33 +01:00
|
|
|
IUnknown *outer_unk;
|
2006-06-09 21:10:01 +02:00
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
ME_TextEditor *editor;
|
2008-06-26 01:31:39 +02:00
|
|
|
ITextSelectionImpl *txtSel;
|
2009-01-09 18:08:35 +01:00
|
|
|
IOleClientSiteImpl *clientSite;
|
2014-09-12 14:33:29 +02:00
|
|
|
struct list rangelist;
|
2006-06-09 21:10:01 +02:00
|
|
|
} IRichEditOleImpl;
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
struct ITextRangeImpl {
|
|
|
|
ITextRange ITextRange_iface;
|
|
|
|
LONG ref;
|
|
|
|
LONG start, end;
|
|
|
|
struct list entry;
|
|
|
|
|
|
|
|
IRichEditOleImpl *reOle;
|
|
|
|
};
|
|
|
|
|
2008-06-26 01:31:39 +02:00
|
|
|
struct ITextSelectionImpl {
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelection ITextSelection_iface;
|
2008-06-26 01:31:39 +02:00
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
IRichEditOleImpl *reOle;
|
|
|
|
};
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
typedef struct ITextFontImpl {
|
|
|
|
ITextFont ITextFont_iface;
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
ITextRange *range;
|
|
|
|
} ITextFontImpl;
|
|
|
|
|
2015-05-17 16:27:42 +02:00
|
|
|
typedef struct ITextParaImpl {
|
|
|
|
ITextPara ITextPara_iface;
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
ITextRange *range;
|
|
|
|
} ITextParaImpl;
|
|
|
|
|
2009-01-09 18:08:35 +01:00
|
|
|
struct IOleClientSiteImpl {
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSite IOleClientSite_iface;
|
2015-03-16 10:27:21 +01:00
|
|
|
IOleWindow IOleWindow_iface;
|
2015-03-17 09:17:39 +01:00
|
|
|
IOleInPlaceSite IOleInPlaceSite_iface;
|
2009-01-09 18:08:35 +01:00
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
IRichEditOleImpl *reOle;
|
|
|
|
};
|
|
|
|
|
2006-07-10 21:03:57 +02:00
|
|
|
static inline IRichEditOleImpl *impl_from_IRichEditOle(IRichEditOle *iface)
|
|
|
|
{
|
2011-05-18 23:49:52 +02:00
|
|
|
return CONTAINING_RECORD(iface, IRichEditOleImpl, IRichEditOle_iface);
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline IRichEditOleImpl *impl_from_ITextDocument(ITextDocument *iface)
|
|
|
|
{
|
2011-05-18 23:49:52 +02:00
|
|
|
return CONTAINING_RECORD(iface, IRichEditOleImpl, ITextDocument_iface);
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
2014-10-28 13:10:33 +01:00
|
|
|
static inline IRichEditOleImpl *impl_from_IUnknown(IUnknown *iface)
|
2005-03-08 17:46:00 +01:00
|
|
|
{
|
2014-10-28 13:10:33 +01:00
|
|
|
return CONTAINING_RECORD(iface, IRichEditOleImpl, IUnknown_inner);
|
|
|
|
}
|
2005-03-08 17:46:00 +01:00
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2015-05-17 21:15:30 +02:00
|
|
|
static inline ITextRangeImpl *impl_from_ITextRange(ITextRange *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ITextRangeImpl, ITextRange_iface);
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
static inline ITextSelectionImpl *impl_from_ITextSelection(ITextSelection *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ITextSelectionImpl, ITextSelection_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline ITextFontImpl *impl_from_ITextFont(ITextFont *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ITextFontImpl, ITextFont_iface);
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:27:42 +02:00
|
|
|
static inline ITextParaImpl *impl_from_ITextPara(ITextPara *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, ITextParaImpl, ITextPara_iface);
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
static HRESULT create_textfont(ITextRange*, ITextFont**);
|
2015-05-17 16:27:42 +02:00
|
|
|
static HRESULT create_textpara(ITextRange*, ITextPara**);
|
2015-05-17 16:26:33 +02:00
|
|
|
|
2015-05-17 21:15:30 +02:00
|
|
|
enum textfont_prop_id {
|
|
|
|
FONT_ALLCAPS = 0,
|
|
|
|
FONT_ANIMATION,
|
|
|
|
FONT_BACKCOLOR,
|
|
|
|
FONT_BOLD,
|
|
|
|
FONT_EMBOSS,
|
|
|
|
FONT_FORECOLOR,
|
|
|
|
FONT_HIDDEN,
|
|
|
|
FONT_ENGRAVE,
|
|
|
|
FONT_ITALIC,
|
|
|
|
FONT_KERNING,
|
|
|
|
FONT_LANGID,
|
|
|
|
FONT_NAME,
|
|
|
|
FONT_OUTLINE,
|
|
|
|
FONT_POSITION,
|
|
|
|
FONT_PROTECTED,
|
|
|
|
FONT_SHADOW,
|
|
|
|
FONT_SIZE,
|
|
|
|
FONT_SMALLCAPS,
|
|
|
|
FONT_SPACING,
|
|
|
|
FONT_STRIKETHROUGH,
|
|
|
|
FONT_SUBSCRIPT,
|
|
|
|
FONT_SUPERSCRIPT,
|
|
|
|
FONT_UNDERLINE,
|
|
|
|
FONT_WEIGHT,
|
|
|
|
FONT_PROPID_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
static const DWORD textfont_prop_masks[] = {
|
|
|
|
CFM_ALLCAPS,
|
|
|
|
CFM_ANIMATION,
|
|
|
|
CFM_BACKCOLOR,
|
|
|
|
CFM_BOLD,
|
|
|
|
CFM_EMBOSS,
|
|
|
|
CFM_COLOR,
|
|
|
|
CFM_HIDDEN,
|
|
|
|
CFM_IMPRINT,
|
|
|
|
CFM_ITALIC,
|
|
|
|
CFM_KERNING,
|
|
|
|
CFM_LCID,
|
|
|
|
CFM_FACE,
|
|
|
|
CFM_OUTLINE,
|
|
|
|
CFM_OFFSET,
|
|
|
|
CFM_PROTECTED,
|
|
|
|
CFM_SHADOW,
|
|
|
|
CFM_SIZE,
|
|
|
|
CFM_SMALLCAPS,
|
|
|
|
CFM_SPACING,
|
|
|
|
CFM_STRIKEOUT,
|
|
|
|
CFM_SUBSCRIPT,
|
|
|
|
CFM_SUPERSCRIPT,
|
|
|
|
CFM_UNDERLINE,
|
|
|
|
CFM_WEIGHT
|
|
|
|
};
|
|
|
|
|
2015-05-20 09:26:21 +02:00
|
|
|
typedef union {
|
|
|
|
FLOAT f;
|
2015-05-21 10:25:24 +02:00
|
|
|
LONG l;
|
|
|
|
BSTR str;
|
2015-05-20 09:26:21 +02:00
|
|
|
} textfont_prop_val;
|
|
|
|
|
|
|
|
static inline BOOL is_equal_textfont_prop_value(enum textfont_prop_id propid, textfont_prop_val *left,
|
|
|
|
textfont_prop_val *right)
|
|
|
|
{
|
|
|
|
switch (propid)
|
|
|
|
{
|
|
|
|
case FONT_BOLD:
|
2015-05-20 09:35:44 +02:00
|
|
|
case FONT_FORECOLOR:
|
2015-05-20 09:26:21 +02:00
|
|
|
case FONT_ITALIC:
|
2015-05-20 10:18:52 +02:00
|
|
|
case FONT_LANGID:
|
2015-05-20 09:43:19 +02:00
|
|
|
case FONT_STRIKETHROUGH:
|
2015-05-20 09:46:11 +02:00
|
|
|
case FONT_SUBSCRIPT:
|
|
|
|
case FONT_SUPERSCRIPT:
|
2015-05-20 09:30:06 +02:00
|
|
|
case FONT_UNDERLINE:
|
2015-05-20 09:26:21 +02:00
|
|
|
return left->l == right->l;
|
2015-05-21 10:25:24 +02:00
|
|
|
case FONT_NAME:
|
|
|
|
return !strcmpW(left->str, right->str);
|
2015-05-20 09:26:21 +02:00
|
|
|
case FONT_SIZE:
|
|
|
|
return left->f == right->f;
|
|
|
|
default:
|
|
|
|
FIXME("unhandled font property %d\n", propid);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void init_textfont_prop_value(enum textfont_prop_id propid, textfont_prop_val *v)
|
|
|
|
{
|
|
|
|
switch (propid)
|
|
|
|
{
|
|
|
|
case FONT_BOLD:
|
2015-05-20 09:35:44 +02:00
|
|
|
case FONT_FORECOLOR:
|
2015-05-20 09:26:21 +02:00
|
|
|
case FONT_ITALIC:
|
2015-05-20 10:18:52 +02:00
|
|
|
case FONT_LANGID:
|
2015-05-20 09:43:19 +02:00
|
|
|
case FONT_STRIKETHROUGH:
|
2015-05-20 09:46:11 +02:00
|
|
|
case FONT_SUBSCRIPT:
|
|
|
|
case FONT_SUPERSCRIPT:
|
2015-05-20 09:30:06 +02:00
|
|
|
case FONT_UNDERLINE:
|
2015-05-20 09:26:21 +02:00
|
|
|
v->l = tomUndefined;
|
|
|
|
return;
|
2015-05-21 10:25:24 +02:00
|
|
|
case FONT_NAME:
|
|
|
|
v->str = NULL;
|
|
|
|
return;
|
2015-05-20 09:26:21 +02:00
|
|
|
case FONT_SIZE:
|
|
|
|
v->f = tomUndefined;
|
|
|
|
return;
|
|
|
|
default:
|
|
|
|
FIXME("unhandled font property %d\n", propid);
|
|
|
|
v->l = tomUndefined;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT get_textfont_prop_for_pos(const IRichEditOleImpl *reole, int pos, enum textfont_prop_id propid,
|
|
|
|
textfont_prop_val *value)
|
2015-05-17 21:15:30 +02:00
|
|
|
{
|
|
|
|
ME_Cursor from, to;
|
|
|
|
CHARFORMAT2W fmt;
|
|
|
|
|
|
|
|
memset(&fmt, 0, sizeof(fmt));
|
|
|
|
fmt.cbSize = sizeof(fmt);
|
|
|
|
fmt.dwMask = textfont_prop_masks[propid];
|
|
|
|
|
|
|
|
ME_CursorFromCharOfs(reole->editor, pos, &from);
|
|
|
|
to = from;
|
|
|
|
ME_MoveCursorChars(reole->editor, &to, 1);
|
|
|
|
ME_GetCharFormat(reole->editor, &from, &to, &fmt);
|
|
|
|
|
|
|
|
switch (propid)
|
|
|
|
{
|
|
|
|
case FONT_BOLD:
|
2015-05-20 09:26:21 +02:00
|
|
|
value->l = fmt.dwEffects & CFE_BOLD ? tomTrue : tomFalse;
|
2015-05-17 21:15:30 +02:00
|
|
|
break;
|
2015-05-20 09:35:44 +02:00
|
|
|
case FONT_FORECOLOR:
|
|
|
|
value->l = fmt.dwEffects & CFE_AUTOCOLOR ? GetSysColor(COLOR_WINDOWTEXT) : fmt.crTextColor;
|
|
|
|
break;
|
2015-05-17 21:15:30 +02:00
|
|
|
case FONT_ITALIC:
|
2015-05-20 09:26:21 +02:00
|
|
|
value->l = fmt.dwEffects & CFE_ITALIC ? tomTrue : tomFalse;
|
|
|
|
break;
|
2015-05-20 10:18:52 +02:00
|
|
|
case FONT_LANGID:
|
|
|
|
value->l = fmt.lcid;
|
|
|
|
break;
|
2015-05-21 10:25:24 +02:00
|
|
|
case FONT_NAME:
|
|
|
|
/* this case is used exclusively by GetName() */
|
|
|
|
value->str = SysAllocString(fmt.szFaceName);
|
|
|
|
if (!value->str)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
break;
|
2015-05-20 09:26:21 +02:00
|
|
|
case FONT_SIZE:
|
|
|
|
value->f = fmt.yHeight;
|
2015-05-17 21:15:30 +02:00
|
|
|
break;
|
2015-05-20 09:43:19 +02:00
|
|
|
case FONT_STRIKETHROUGH:
|
|
|
|
value->l = fmt.dwEffects & CFE_STRIKEOUT ? tomTrue : tomFalse;
|
|
|
|
break;
|
2015-05-20 09:46:11 +02:00
|
|
|
case FONT_SUBSCRIPT:
|
|
|
|
value->l = fmt.dwEffects & CFE_SUBSCRIPT ? tomTrue : tomFalse;
|
|
|
|
break;
|
|
|
|
case FONT_SUPERSCRIPT:
|
|
|
|
value->l = fmt.dwEffects & CFE_SUPERSCRIPT ? tomTrue : tomFalse;
|
|
|
|
break;
|
2015-05-20 09:30:06 +02:00
|
|
|
case FONT_UNDERLINE:
|
|
|
|
value->l = fmt.dwEffects & CFE_UNDERLINE ? tomTrue : tomFalse;
|
|
|
|
break;
|
2015-05-17 21:15:30 +02:00
|
|
|
default:
|
|
|
|
FIXME("unhandled font property %d\n", propid);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-05-20 09:26:21 +02:00
|
|
|
static HRESULT get_textfont_prop(ITextRange *range, enum textfont_prop_id propid, textfont_prop_val *value)
|
2015-05-17 21:15:30 +02:00
|
|
|
{
|
2015-05-20 10:41:34 +02:00
|
|
|
IRichEditOleImpl *reole;
|
2015-05-20 09:26:21 +02:00
|
|
|
textfont_prop_val v;
|
2015-05-20 10:41:34 +02:00
|
|
|
LONG start, end, i;
|
2015-05-17 21:15:30 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
2015-05-20 10:41:34 +02:00
|
|
|
ITextRange_QueryInterface(range, &IID_Igetrichole, (void**)&reole);
|
|
|
|
if (!reole)
|
2015-05-17 21:15:30 +02:00
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2015-05-20 09:26:21 +02:00
|
|
|
init_textfont_prop_value(propid, value);
|
|
|
|
|
2015-05-20 10:41:34 +02:00
|
|
|
ITextRange_GetStart(range, &start);
|
|
|
|
ITextRange_GetEnd(range, &end);
|
|
|
|
|
2015-05-17 21:15:30 +02:00
|
|
|
/* iterate trough a range to see if property value is consistent */
|
2015-05-20 10:41:34 +02:00
|
|
|
hr = get_textfont_prop_for_pos(reole, start, propid, &v);
|
2015-05-17 21:15:30 +02:00
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
2015-05-20 10:41:34 +02:00
|
|
|
for (i = start + 1; i < end; i++) {
|
2015-05-20 09:26:21 +02:00
|
|
|
textfont_prop_val cur;
|
2015-05-17 21:15:30 +02:00
|
|
|
|
2015-05-20 10:41:34 +02:00
|
|
|
hr = get_textfont_prop_for_pos(reole, i, propid, &cur);
|
2015-05-17 21:15:30 +02:00
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
2015-05-20 09:26:21 +02:00
|
|
|
if (!is_equal_textfont_prop_value(propid, &v, &cur))
|
2015-05-17 21:15:30 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*value = v;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-05-20 09:26:21 +02:00
|
|
|
static HRESULT get_textfont_propf(ITextRange *range, enum textfont_prop_id propid, FLOAT *value)
|
|
|
|
{
|
|
|
|
textfont_prop_val v;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (!value)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
hr = get_textfont_prop(range, propid, &v);
|
|
|
|
*value = v.f;
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT get_textfont_propl(ITextRange *range, enum textfont_prop_id propid, LONG *value)
|
|
|
|
{
|
|
|
|
textfont_prop_val v;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
if (!value)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
hr = get_textfont_prop(range, propid, &v);
|
|
|
|
*value = v.l;
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2014-10-28 13:10:33 +01:00
|
|
|
static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppvObj)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_IUnknown(iface);
|
|
|
|
|
|
|
|
TRACE("%p %s\n", This, debugstr_guid(riid));
|
2005-03-08 17:46:00 +01:00
|
|
|
|
2006-07-10 21:03:57 +02:00
|
|
|
*ppvObj = NULL;
|
2014-10-28 13:10:33 +01:00
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown))
|
|
|
|
*ppvObj = &This->IUnknown_inner;
|
|
|
|
else if (IsEqualGUID(riid, &IID_IRichEditOle))
|
2011-05-18 23:49:52 +02:00
|
|
|
*ppvObj = &This->IRichEditOle_iface;
|
2006-07-10 21:03:57 +02:00
|
|
|
else if (IsEqualGUID(riid, &IID_ITextDocument))
|
2011-05-18 23:49:52 +02:00
|
|
|
*ppvObj = &This->ITextDocument_iface;
|
2006-07-10 21:03:57 +02:00
|
|
|
if (*ppvObj)
|
2005-03-08 17:46:00 +01:00
|
|
|
{
|
2014-10-28 13:10:33 +01:00
|
|
|
IUnknown_AddRef((IUnknown *)*ppvObj);
|
2005-03-08 17:46:00 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
2014-10-28 13:10:33 +01:00
|
|
|
FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid));
|
2005-03-08 17:46:00 +01:00
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2014-10-28 13:10:33 +01:00
|
|
|
static ULONG WINAPI IRichEditOleImpl_inner_fnAddRef(IUnknown *iface)
|
2005-03-08 17:46:00 +01:00
|
|
|
{
|
2014-10-28 13:10:33 +01:00
|
|
|
IRichEditOleImpl *This = impl_from_IUnknown(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
2005-03-08 17:46:00 +01:00
|
|
|
|
2006-10-13 21:25:54 +02:00
|
|
|
TRACE("%p ref = %u\n", This, ref);
|
2005-03-08 17:46:00 +01:00
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2014-10-28 13:10:33 +01:00
|
|
|
static ULONG WINAPI IRichEditOleImpl_inner_fnRelease(IUnknown *iface)
|
2005-03-08 17:46:00 +01:00
|
|
|
{
|
2014-10-28 13:10:33 +01:00
|
|
|
IRichEditOleImpl *This = impl_from_IUnknown(iface);
|
2005-03-08 17:46:00 +01:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
2006-10-13 21:25:54 +02:00
|
|
|
TRACE ("%p ref=%u\n", This, ref);
|
2005-03-08 17:46:00 +01:00
|
|
|
|
|
|
|
if (!ref)
|
2015-01-05 19:42:20 +01:00
|
|
|
{
|
|
|
|
ITextRangeImpl *txtRge;
|
|
|
|
|
|
|
|
TRACE("Destroying %p\n", This);
|
|
|
|
This->txtSel->reOle = NULL;
|
|
|
|
This->editor->reOle = NULL;
|
|
|
|
ITextSelection_Release(&This->txtSel->ITextSelection_iface);
|
|
|
|
IOleClientSite_Release(&This->clientSite->IOleClientSite_iface);
|
|
|
|
LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, entry)
|
|
|
|
txtRge->reOle = NULL;
|
|
|
|
heap_free(This);
|
|
|
|
}
|
2005-03-08 17:46:00 +01:00
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2014-10-28 13:10:33 +01:00
|
|
|
static const IUnknownVtbl reo_unk_vtbl =
|
|
|
|
{
|
|
|
|
IRichEditOleImpl_inner_fnQueryInterface,
|
|
|
|
IRichEditOleImpl_inner_fnAddRef,
|
|
|
|
IRichEditOleImpl_inner_fnRelease
|
|
|
|
};
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
|
|
|
return IUnknown_QueryInterface(This->outer_unk, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IRichEditOle_fnAddRef(IRichEditOle *me)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
|
|
|
return IUnknown_AddRef(This->outer_unk);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
IRichEditOle_fnRelease(IRichEditOle *me)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
|
|
|
return IUnknown_Release(This->outer_unk);
|
|
|
|
}
|
|
|
|
|
2005-03-08 17:46:00 +01:00
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnActivateAs(IRichEditOle *me, REFCLSID rclsid, REFCLSID rclsidAs)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnContextSensitiveHelp(IRichEditOle *me, BOOL fEnterMode)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnConvertObject(IRichEditOle *me, LONG iob,
|
|
|
|
REFCLSID rclsidNew, LPCSTR lpstrUserTypeNew)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static inline IOleClientSiteImpl *impl_from_IOleClientSite(IOleClientSite *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, IOleClientSiteImpl, IOleClientSite_iface);
|
|
|
|
}
|
|
|
|
|
2009-01-09 18:08:35 +01:00
|
|
|
static HRESULT WINAPI
|
|
|
|
IOleClientSite_fnQueryInterface(IOleClientSite *me, REFIID riid, LPVOID *ppvObj)
|
|
|
|
{
|
2015-03-16 10:27:21 +01:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(me);
|
2009-01-09 18:08:35 +01:00
|
|
|
TRACE("%p %s\n", me, debugstr_guid(riid) );
|
|
|
|
|
|
|
|
*ppvObj = NULL;
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IOleClientSite))
|
|
|
|
*ppvObj = me;
|
2015-03-16 10:27:21 +01:00
|
|
|
else if (IsEqualGUID(riid, &IID_IOleWindow))
|
|
|
|
*ppvObj = &This->IOleWindow_iface;
|
2015-03-17 09:17:39 +01:00
|
|
|
else if (IsEqualGUID(riid, &IID_IOleInPlaceSite))
|
|
|
|
*ppvObj = &This->IOleInPlaceSite_iface;
|
2009-01-09 18:08:35 +01:00
|
|
|
if (*ppvObj)
|
|
|
|
{
|
|
|
|
IOleClientSite_AddRef(me);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
FIXME("%p: unhandled interface %s\n", me, debugstr_guid(riid) );
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static ULONG WINAPI IOleClientSite_fnAddRef(IOleClientSite *iface)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
return InterlockedIncrement(&This->ref);
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static ULONG WINAPI IOleClientSite_fnRelease(IOleClientSite *iface)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
if (ref == 0)
|
|
|
|
heap_free(This);
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static HRESULT WINAPI IOleClientSite_fnSaveObject(IOleClientSite *iface)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
FIXME("stub %p\n", iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static HRESULT WINAPI IOleClientSite_fnGetMoniker(IOleClientSite *iface, DWORD dwAssign,
|
|
|
|
DWORD dwWhichMoniker, IMoniker **ppmk)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
FIXME("stub %p\n", iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static HRESULT WINAPI IOleClientSite_fnGetContainer(IOleClientSite *iface,
|
|
|
|
IOleContainer **ppContainer)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
FIXME("stub %p\n", iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static HRESULT WINAPI IOleClientSite_fnShowObject(IOleClientSite *iface)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
FIXME("stub %p\n", iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static HRESULT WINAPI IOleClientSite_fnOnShowWindow(IOleClientSite *iface, BOOL fShow)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
FIXME("stub %p\n", iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
static HRESULT WINAPI IOleClientSite_fnRequestNewObjectLayout(IOleClientSite *iface)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-18 23:45:15 +02:00
|
|
|
IOleClientSiteImpl *This = impl_from_IOleClientSite(iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
FIXME("stub %p\n", iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IOleClientSiteVtbl ocst = {
|
|
|
|
IOleClientSite_fnQueryInterface,
|
|
|
|
IOleClientSite_fnAddRef,
|
|
|
|
IOleClientSite_fnRelease,
|
|
|
|
IOleClientSite_fnSaveObject,
|
|
|
|
IOleClientSite_fnGetMoniker,
|
|
|
|
IOleClientSite_fnGetContainer,
|
|
|
|
IOleClientSite_fnShowObject,
|
|
|
|
IOleClientSite_fnOnShowWindow,
|
|
|
|
IOleClientSite_fnRequestNewObjectLayout
|
|
|
|
};
|
|
|
|
|
2015-03-16 10:27:21 +01:00
|
|
|
/* 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);
|
2015-03-16 10:27:38 +01:00
|
|
|
TRACE("(%p)->(%p)\n", This, phwnd);
|
|
|
|
|
|
|
|
if (!phwnd)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*phwnd = This->reOle->editor->hWnd;
|
|
|
|
return S_OK;
|
2015-03-16 10:27:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static const IOleWindowVtbl olewinvt = {
|
|
|
|
IOleWindow_fnQueryInterface,
|
|
|
|
IOleWindow_fnAddRef,
|
|
|
|
IOleWindow_fnRelease,
|
|
|
|
IOleWindow_fnGetWindow,
|
|
|
|
IOleWindow_fnContextSensitiveHelp
|
|
|
|
};
|
|
|
|
|
2015-03-17 09:17:39 +01:00
|
|
|
/* IOleInPlaceSite interface */
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppvObj)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnAddRef(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG STDMETHODCALLTYPE IOleInPlaceSite_fnRelease(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
return IOleClientSite_Release(&This->IOleClientSite_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindow(IOleInPlaceSite *iface, HWND *phwnd)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
return IOleWindow_GetWindow(&This->IOleWindow_iface, phwnd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
return IOleWindow_ContextSensitiveHelp(&This->IOleWindow_iface, fEnterMode);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnCanInPlaceActivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnInPlaceActivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnUIActivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnGetWindowContext(IOleInPlaceSite *iface, IOleInPlaceFrame **ppFrame,
|
|
|
|
IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
|
|
|
|
LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
2015-03-20 09:35:57 +01:00
|
|
|
FIXME("not implemented: (%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
|
2015-03-17 09:17:39 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnScroll(IOleInPlaceSite *iface, SIZE scrollExtent)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)->(%d)\n", This, fUndoable);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnInPlaceDeactivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnDiscardUndoState(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnDeactivateAndUndo(IOleInPlaceSite *iface)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE IOleInPlaceSite_fnOnPosRectChange(IOleInPlaceSite *iface, LPCRECT lprcPosRect)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *This = impl_from_IOleInPlaceSite(iface);
|
|
|
|
FIXME("not implemented: (%p)->(%p)\n", This, lprcPosRect);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IOleInPlaceSiteVtbl olestvt =
|
|
|
|
{
|
|
|
|
IOleInPlaceSite_fnQueryInterface,
|
|
|
|
IOleInPlaceSite_fnAddRef,
|
|
|
|
IOleInPlaceSite_fnRelease,
|
|
|
|
IOleInPlaceSite_fnGetWindow,
|
|
|
|
IOleInPlaceSite_fnContextSensitiveHelp,
|
|
|
|
IOleInPlaceSite_fnCanInPlaceActivate,
|
|
|
|
IOleInPlaceSite_fnOnInPlaceActivate,
|
|
|
|
IOleInPlaceSite_fnOnUIActivate,
|
|
|
|
IOleInPlaceSite_fnGetWindowContext,
|
|
|
|
IOleInPlaceSite_fnScroll,
|
|
|
|
IOleInPlaceSite_fnOnUIDeactivate,
|
|
|
|
IOleInPlaceSite_fnOnInPlaceDeactivate,
|
|
|
|
IOleInPlaceSite_fnDiscardUndoState,
|
|
|
|
IOleInPlaceSite_fnDeactivateAndUndo,
|
|
|
|
IOleInPlaceSite_fnOnPosRectChange
|
|
|
|
};
|
|
|
|
|
2009-01-09 18:08:35 +01:00
|
|
|
static IOleClientSiteImpl *
|
|
|
|
CreateOleClientSite(IRichEditOleImpl *reOle)
|
|
|
|
{
|
|
|
|
IOleClientSiteImpl *clientSite = heap_alloc(sizeof *clientSite);
|
|
|
|
if (!clientSite)
|
|
|
|
return NULL;
|
|
|
|
|
2011-05-18 23:45:15 +02:00
|
|
|
clientSite->IOleClientSite_iface.lpVtbl = &ocst;
|
2015-03-16 10:27:21 +01:00
|
|
|
clientSite->IOleWindow_iface.lpVtbl = &olewinvt;
|
2015-03-17 09:17:39 +01:00
|
|
|
clientSite->IOleInPlaceSite_iface.lpVtbl = &olestvt;
|
2009-01-09 18:08:35 +01:00
|
|
|
clientSite->ref = 1;
|
|
|
|
clientSite->reOle = reOle;
|
|
|
|
return clientSite;
|
|
|
|
}
|
|
|
|
|
2005-03-08 17:46:00 +01:00
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnGetClientSite(IRichEditOle *me,
|
|
|
|
LPOLECLIENTSITE *lplpolesite)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2009-01-09 18:08:35 +01:00
|
|
|
|
|
|
|
TRACE("%p,%p\n",This, lplpolesite);
|
|
|
|
|
|
|
|
if(!lplpolesite)
|
|
|
|
return E_INVALIDARG;
|
2011-05-18 23:45:15 +02:00
|
|
|
*lplpolesite = &This->clientSite->IOleClientSite_iface;
|
2013-06-08 14:53:45 +02:00
|
|
|
IOleClientSite_AddRef(*lplpolesite);
|
2009-01-09 18:08:35 +01:00
|
|
|
return S_OK;
|
2005-03-08 17:46:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg,
|
|
|
|
DWORD reco, LPDATAOBJECT *lplpdataobj)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2009-08-13 14:44:05 +02:00
|
|
|
ME_Cursor start;
|
|
|
|
int nChars;
|
2006-02-23 05:09:11 +01:00
|
|
|
|
2006-10-13 21:25:54 +02:00
|
|
|
TRACE("(%p,%p,%d)\n",This, lpchrg, reco);
|
2006-02-23 05:09:11 +01:00
|
|
|
if(!lplpdataobj)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
if(!lpchrg) {
|
2009-08-13 14:44:05 +02:00
|
|
|
int nFrom, nTo, nStartCur = ME_GetSelectionOfs(This->editor, &nFrom, &nTo);
|
|
|
|
start = This->editor->pCursors[nStartCur];
|
|
|
|
nChars = nTo - nFrom;
|
|
|
|
} else {
|
|
|
|
ME_CursorFromCharOfs(This->editor, lpchrg->cpMin, &start);
|
|
|
|
nChars = lpchrg->cpMax - lpchrg->cpMin;
|
2006-02-23 05:09:11 +01:00
|
|
|
}
|
2009-08-13 14:44:05 +02:00
|
|
|
return ME_GetDataObject(This->editor, &start, nChars, lplpdataobj);
|
2005-03-08 17:46:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static LONG WINAPI IRichEditOle_fnGetLinkCount(IRichEditOle *me)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob,
|
|
|
|
REOBJECT *lpreobject, DWORD dwFlags)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static LONG WINAPI
|
|
|
|
IRichEditOle_fnGetObjectCount(IRichEditOle *me)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
2009-01-20 22:44:04 +01:00
|
|
|
return 0;
|
2005-03-08 17:46:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnHandsOffStorage(IRichEditOle *me, LONG iob)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnImportDataObject(IRichEditOle *me, LPDATAOBJECT lpdataobj,
|
|
|
|
CLIPFORMAT cf, HGLOBAL hMetaPict)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnInPlaceDeactivate(IRichEditOle *me)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2008-01-27 19:01:41 +01:00
|
|
|
IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *reo)
|
2005-03-08 17:46:00 +01:00
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2008-01-27 19:01:41 +01:00
|
|
|
TRACE("(%p,%p)\n", This, reo);
|
|
|
|
|
|
|
|
if (reo->cbStruct < sizeof(*reo)) return STG_E_INVALIDPARAMETER;
|
|
|
|
|
|
|
|
ME_InsertOLEFromCursor(This->editor, reo, 0);
|
2010-05-15 02:11:28 +02:00
|
|
|
ME_CommitUndo(This->editor);
|
2010-07-29 03:17:40 +02:00
|
|
|
ME_UpdateRepaint(This->editor, FALSE);
|
2008-01-27 19:01:41 +01:00
|
|
|
return S_OK;
|
2005-03-08 17:46:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *me, LONG iob,
|
|
|
|
LPSTORAGE lpstg)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnSetDvaspect(IRichEditOle *me, LONG iob, DWORD dvaspect)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *me,
|
|
|
|
LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-17 11:23:40 +01:00
|
|
|
FIXME("stub %p %s %s\n",This, lpstrContainerApp, lpstrContainerObj);
|
2005-03-08 17:46:00 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
IRichEditOle_fnSetLinkAvailable(IRichEditOle *me, LONG iob, BOOL fAvailable)
|
|
|
|
{
|
2006-07-10 21:03:57 +02:00
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
|
2005-03-08 17:46:00 +01:00
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IRichEditOleVtbl revt = {
|
2005-03-08 17:46:00 +01:00
|
|
|
IRichEditOle_fnQueryInterface,
|
|
|
|
IRichEditOle_fnAddRef,
|
|
|
|
IRichEditOle_fnRelease,
|
|
|
|
IRichEditOle_fnGetClientSite,
|
|
|
|
IRichEditOle_fnGetObjectCount,
|
|
|
|
IRichEditOle_fnGetLinkCount,
|
|
|
|
IRichEditOle_fnGetObject,
|
|
|
|
IRichEditOle_fnInsertObject,
|
|
|
|
IRichEditOle_fnConvertObject,
|
|
|
|
IRichEditOle_fnActivateAs,
|
|
|
|
IRichEditOle_fnSetHostNames,
|
|
|
|
IRichEditOle_fnSetLinkAvailable,
|
|
|
|
IRichEditOle_fnSetDvaspect,
|
|
|
|
IRichEditOle_fnHandsOffStorage,
|
|
|
|
IRichEditOle_fnSaveCompleted,
|
|
|
|
IRichEditOle_fnInPlaceDeactivate,
|
|
|
|
IRichEditOle_fnContextSensitiveHelp,
|
|
|
|
IRichEditOle_fnGetClipboardData,
|
|
|
|
IRichEditOle_fnImportDataObject
|
|
|
|
};
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
/* ITextRange interface */
|
|
|
|
static HRESULT WINAPI ITextRange_fnQueryInterface(ITextRange *me, REFIID riid, void **ppvObj)
|
|
|
|
{
|
2015-05-20 10:41:34 +02:00
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
*ppvObj = NULL;
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
|
|
|
|| IsEqualGUID(riid, &IID_IDispatch)
|
|
|
|
|| IsEqualGUID(riid, &IID_ITextRange))
|
|
|
|
{
|
|
|
|
*ppvObj = me;
|
|
|
|
ITextRange_AddRef(me);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2015-05-20 10:41:34 +02:00
|
|
|
else if (IsEqualGUID(riid, &IID_Igetrichole))
|
|
|
|
{
|
|
|
|
*ppvObj = This->reOle;
|
|
|
|
return S_OK;
|
|
|
|
}
|
2014-09-12 14:33:29 +02:00
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ITextRange_fnAddRef(ITextRange *me)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
return InterlockedIncrement(&This->ref);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ITextRange_fnRelease(ITextRange *me)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE ("%p ref=%u\n", This, ref);
|
|
|
|
if (ref == 0)
|
|
|
|
{
|
2014-09-15 04:49:21 +02:00
|
|
|
if (This->reOle)
|
|
|
|
{
|
|
|
|
list_remove(&This->entry);
|
|
|
|
This->reOle = NULL;
|
|
|
|
}
|
2014-09-12 14:33:29 +02:00
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetTypeInfoCount(ITextRange *me, UINT *pctinfo)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetTypeInfo(ITextRange *me, UINT iTInfo, LCID lcid,
|
|
|
|
ITypeInfo **ppTInfo)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
HRESULT hr;
|
2014-09-12 14:33:29 +02:00
|
|
|
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextRange_tid, ppTInfo);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
ITypeInfo_AddRef(*ppTInfo);
|
|
|
|
return hr;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetIDsOfNames(ITextRange *me, REFIID riid, LPOLESTR *rgszNames,
|
|
|
|
UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
2014-09-12 14:33:29 +02:00
|
|
|
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextRange_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
|
|
|
|
return hr;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnInvoke(ITextRange *me, DISPID dispIdMember, REFIID riid,
|
|
|
|
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
|
|
|
|
UINT *puArgErr)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
2014-09-12 14:33:29 +02:00
|
|
|
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This, dispIdMember, riid, lcid,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextRange_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
return hr;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetText(ITextRange *me, BSTR *pbstr)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetText(ITextRange *me, BSTR bstr)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2014-09-15 18:13:30 +02:00
|
|
|
static HRESULT range_GetChar(ME_TextEditor *editor, ME_Cursor *cursor, LONG *pch)
|
|
|
|
{
|
|
|
|
WCHAR wch[2];
|
|
|
|
|
|
|
|
ME_GetTextW(editor, wch, 1, cursor, 1, FALSE, cursor->pRun->next->type == diTextEnd);
|
|
|
|
*pch = wch[0];
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
static HRESULT WINAPI ITextRange_fnGetChar(ITextRange *me, LONG *pch)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2014-09-15 18:13:30 +02:00
|
|
|
ME_Cursor cursor;
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
2014-09-15 18:13:30 +02:00
|
|
|
TRACE("%p\n", pch);
|
|
|
|
if (!pch)
|
|
|
|
return E_INVALIDARG;
|
2014-09-12 14:33:29 +02:00
|
|
|
|
2014-09-15 18:13:30 +02:00
|
|
|
ME_CursorFromCharOfs(This->reOle->editor, This->start, &cursor);
|
|
|
|
return range_GetChar(This->reOle->editor, &cursor, pch);
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetChar(ITextRange *me, LONG ch)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2014-09-17 11:36:44 +02:00
|
|
|
static HRESULT CreateITextRange(IRichEditOleImpl *reOle, LONG start, LONG end, ITextRange** ppRange);
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
static HRESULT WINAPI ITextRange_fnGetDuplicate(ITextRange *me, ITextRange **ppRange)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2014-09-17 11:36:44 +02:00
|
|
|
TRACE("%p %p\n", This, ppRange);
|
|
|
|
if (!ppRange)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
return CreateITextRange(This->reOle, This->start, This->end, ppRange);
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetFormattedText(ITextRange *me, ITextRange **ppRange)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetFormattedText(ITextRange *me, ITextRange *pRange)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *pcpFirst)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2014-09-16 12:38:56 +02:00
|
|
|
if (!pcpFirst)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
*pcpFirst = This->start;
|
|
|
|
TRACE("%d\n", *pcpFirst);
|
|
|
|
return S_OK;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:28:41 +02:00
|
|
|
static HRESULT WINAPI ITextRange_fnSetStart(ITextRange *me, LONG start)
|
2014-09-12 14:33:29 +02:00
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-17 16:28:41 +02:00
|
|
|
int len;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d)\n", This, start);
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2015-05-17 16:28:41 +02:00
|
|
|
if (start == This->start)
|
|
|
|
return S_FALSE;
|
|
|
|
|
|
|
|
if (start < 0) {
|
|
|
|
This->start = 0;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
len = ME_GetTextLength(This->reOle->editor);
|
|
|
|
if (start > This->end)
|
|
|
|
This->end = len;
|
|
|
|
|
|
|
|
if (start > len)
|
|
|
|
This->start = len;
|
|
|
|
else
|
|
|
|
This->start = start;
|
|
|
|
|
|
|
|
return S_OK;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *pcpLim)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2014-09-16 12:38:56 +02:00
|
|
|
if (!pcpLim)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
*pcpLim = This->end;
|
|
|
|
TRACE("%d\n", *pcpLim);
|
|
|
|
return S_OK;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:30:06 +02:00
|
|
|
static HRESULT WINAPI ITextRange_fnSetEnd(ITextRange *me, LONG end)
|
2014-09-12 14:33:29 +02:00
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-17 16:30:06 +02:00
|
|
|
int len;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d)\n", This, end);
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2015-05-17 16:30:06 +02:00
|
|
|
if (end == This->end)
|
|
|
|
return S_FALSE;
|
|
|
|
|
|
|
|
if (end < This->start) {
|
|
|
|
This->start = This->end = max(0, end);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
len = ME_GetTextLength(This->reOle->editor);
|
|
|
|
if (end > len)
|
|
|
|
This->end = len + 1;
|
|
|
|
else
|
|
|
|
This->end = end;
|
|
|
|
|
|
|
|
return S_OK;
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
static HRESULT WINAPI ITextRange_fnGetFont(ITextRange *me, ITextFont **font)
|
2014-09-12 14:33:29 +02:00
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-17 16:26:33 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, font);
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
if (!font)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
return create_textfont(me, font);
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetFont(ITextRange *me, ITextFont *pFont)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:27:42 +02:00
|
|
|
static HRESULT WINAPI ITextRange_fnGetPara(ITextRange *me, ITextPara **para)
|
2014-09-12 14:33:29 +02:00
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
2015-05-17 16:27:42 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, para);
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2015-05-17 16:27:42 +02:00
|
|
|
if (!para)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
return create_textpara(me, para);
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetPara(ITextRange *me, ITextPara *pPara)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetStoryLength(ITextRange *me, LONG *pcch)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetStoryType(ITextRange *me, LONG *pValue)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2014-09-17 11:38:31 +02:00
|
|
|
static HRESULT range_Collapse(LONG bStart, LONG *start, LONG *end)
|
|
|
|
{
|
|
|
|
if (*end == *start)
|
|
|
|
return S_FALSE;
|
|
|
|
|
|
|
|
if (bStart == tomEnd || bStart == tomFalse)
|
|
|
|
*start = *end;
|
|
|
|
else
|
|
|
|
*end = *start;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
static HRESULT WINAPI ITextRange_fnCollapse(ITextRange *me, LONG bStart)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2014-09-17 11:38:31 +02:00
|
|
|
return range_Collapse(bStart, &This->start, &This->end);
|
2014-09-12 14:33:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnExpand(ITextRange *me, LONG Unit, LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetIndex(ITextRange *me, LONG Unit, LONG *pIndex)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetIndex(ITextRange *me, LONG Unit, LONG Index,
|
|
|
|
LONG Extend)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetRange(ITextRange *me, LONG cpActive, LONG cpOther)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnInRange(ITextRange *me, ITextRange *pRange, LONG *pb)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnInStory(ITextRange *me, ITextRange *pRange, LONG *pb)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnIsEqual(ITextRange *me, ITextRange *pRange, LONG *pb)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSelect(ITextRange *me)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnStartOf(ITextRange *me, LONG Unit, LONG Extend,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnEndOf(ITextRange *me, LONG Unit, LONG Extend,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMove(ITextRange *me, LONG Unit, LONG Count, LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveStart(ITextRange *me, LONG Unit, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveEnd(ITextRange *me, LONG Unit, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveWhile(ITextRange *me, VARIANT *Cset, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveStartWhile(ITextRange *me, VARIANT *Cset, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveEndWhile(ITextRange *me, VARIANT *Cset, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveUntil(ITextRange *me, VARIANT *Cset, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveStartUntil(ITextRange *me, VARIANT *Cset, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnMoveEndUntil(ITextRange *me, VARIANT *Cset, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnFindText(ITextRange *me, BSTR bstr, LONG cch, LONG Flags,
|
|
|
|
LONG *pLength)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnFindTextStart(ITextRange *me, BSTR bstr, LONG cch,
|
|
|
|
LONG Flags, LONG *pLength)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnFindTextEnd(ITextRange *me, BSTR bstr, LONG cch,
|
|
|
|
LONG Flags, LONG *pLength)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnDelete(ITextRange *me, LONG Unit, LONG Count,
|
|
|
|
LONG *pDelta)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnCut(ITextRange *me, VARIANT *pVar)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnCopy(ITextRange *me, VARIANT *pVar)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnPaste(ITextRange *me, VARIANT *pVar, LONG Format)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnCanPaste(ITextRange *me, VARIANT *pVar, LONG Format,
|
|
|
|
LONG *pb)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnCanEdit(ITextRange *me, LONG *pb)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnChangeCase(ITextRange *me, LONG Type)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetPoint(ITextRange *me, LONG Type, LONG *cx, LONG *cy)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnSetPoint(ITextRange *me, LONG x, LONG y, LONG Type,
|
|
|
|
LONG Extend)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG Value)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextRange_fnGetEmbeddedObject(ITextRange *me, IUnknown **ppv)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *This = impl_from_ITextRange(me);
|
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented %p\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ITextRangeVtbl trvt = {
|
|
|
|
ITextRange_fnQueryInterface,
|
|
|
|
ITextRange_fnAddRef,
|
|
|
|
ITextRange_fnRelease,
|
|
|
|
ITextRange_fnGetTypeInfoCount,
|
|
|
|
ITextRange_fnGetTypeInfo,
|
|
|
|
ITextRange_fnGetIDsOfNames,
|
|
|
|
ITextRange_fnInvoke,
|
|
|
|
ITextRange_fnGetText,
|
|
|
|
ITextRange_fnSetText,
|
|
|
|
ITextRange_fnGetChar,
|
|
|
|
ITextRange_fnSetChar,
|
|
|
|
ITextRange_fnGetDuplicate,
|
|
|
|
ITextRange_fnGetFormattedText,
|
|
|
|
ITextRange_fnSetFormattedText,
|
|
|
|
ITextRange_fnGetStart,
|
|
|
|
ITextRange_fnSetStart,
|
|
|
|
ITextRange_fnGetEnd,
|
|
|
|
ITextRange_fnSetEnd,
|
|
|
|
ITextRange_fnGetFont,
|
|
|
|
ITextRange_fnSetFont,
|
|
|
|
ITextRange_fnGetPara,
|
|
|
|
ITextRange_fnSetPara,
|
|
|
|
ITextRange_fnGetStoryLength,
|
|
|
|
ITextRange_fnGetStoryType,
|
|
|
|
ITextRange_fnCollapse,
|
|
|
|
ITextRange_fnExpand,
|
|
|
|
ITextRange_fnGetIndex,
|
|
|
|
ITextRange_fnSetIndex,
|
|
|
|
ITextRange_fnSetRange,
|
|
|
|
ITextRange_fnInRange,
|
|
|
|
ITextRange_fnInStory,
|
|
|
|
ITextRange_fnIsEqual,
|
|
|
|
ITextRange_fnSelect,
|
|
|
|
ITextRange_fnStartOf,
|
|
|
|
ITextRange_fnEndOf,
|
|
|
|
ITextRange_fnMove,
|
|
|
|
ITextRange_fnMoveStart,
|
|
|
|
ITextRange_fnMoveEnd,
|
|
|
|
ITextRange_fnMoveWhile,
|
|
|
|
ITextRange_fnMoveStartWhile,
|
|
|
|
ITextRange_fnMoveEndWhile,
|
|
|
|
ITextRange_fnMoveUntil,
|
|
|
|
ITextRange_fnMoveStartUntil,
|
|
|
|
ITextRange_fnMoveEndUntil,
|
|
|
|
ITextRange_fnFindText,
|
|
|
|
ITextRange_fnFindTextStart,
|
|
|
|
ITextRange_fnFindTextEnd,
|
|
|
|
ITextRange_fnDelete,
|
|
|
|
ITextRange_fnCut,
|
|
|
|
ITextRange_fnCopy,
|
|
|
|
ITextRange_fnPaste,
|
|
|
|
ITextRange_fnCanPaste,
|
|
|
|
ITextRange_fnCanEdit,
|
|
|
|
ITextRange_fnChangeCase,
|
|
|
|
ITextRange_fnGetPoint,
|
|
|
|
ITextRange_fnSetPoint,
|
|
|
|
ITextRange_fnScrollIntoView,
|
|
|
|
ITextRange_fnGetEmbeddedObject
|
|
|
|
};
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
/* ITextFont */
|
|
|
|
static HRESULT WINAPI TextFont_QueryInterface(ITextFont *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
if (IsEqualIID(riid, &IID_ITextFont) ||
|
|
|
|
IsEqualIID(riid, &IID_IDispatch) ||
|
|
|
|
IsEqualIID(riid, &IID_IUnknown))
|
|
|
|
{
|
|
|
|
*ppv = iface;
|
|
|
|
ITextFont_AddRef(iface);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI TextFont_AddRef(ITextFont *iface)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
TRACE("(%p)->(%u)\n", This, ref);
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI TextFont_Release(ITextFont *iface)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u)\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
ITextRange_Release(This->range);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetTypeInfoCount(ITextFont *iface, UINT *pctinfo)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetTypeInfo(ITextFont *iface, UINT iTInfo, LCID lcid,
|
|
|
|
ITypeInfo **ppTInfo)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextFont_tid, ppTInfo);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
ITypeInfo_AddRef(*ppTInfo);
|
|
|
|
return hr;
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetIDsOfNames(ITextFont *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextFont_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
|
|
|
|
return hr;
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_Invoke(
|
|
|
|
ITextFont *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo,
|
|
|
|
UINT *puArgErr)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This, dispIdMember, riid, lcid,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextFont_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
return hr;
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetDuplicate(ITextFont *iface, ITextFont **ret)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetDuplicate(ITextFont *iface, ITextFont *pFont)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, pFont);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_CanChange(ITextFont *iface, LONG *ret)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_IsEqual(ITextFont *iface, ITextFont *font, LONG *ret)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-22 10:46:43 +02:00
|
|
|
FIXME("(%p)->(%p %p): stub\n", This, font, ret);
|
2015-05-17 16:26:33 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_Reset(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-22 10:46:43 +02:00
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetStyle(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetStyle(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetAllCaps(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetAllCaps(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetAnimation(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetAnimation(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetBackColor(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetBackColor(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetBold(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-17 21:15:30 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
2015-05-20 09:26:21 +02:00
|
|
|
return get_textfont_propl(This->range, FONT_BOLD, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetBold(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetEmboss(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetEmboss(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetForeColor(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-20 09:35:44 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
return get_textfont_propl(This->range, FONT_FORECOLOR, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetForeColor(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetHidden(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetHidden(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetEngrave(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetEngrave(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetItalic(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-17 21:15:30 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
2015-05-20 09:26:21 +02:00
|
|
|
return get_textfont_propl(This->range, FONT_ITALIC, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetItalic(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetKerning(ITextFont *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetKerning(ITextFont *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%.2f): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetLanguageID(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-20 10:18:52 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
return get_textfont_propl(This->range, FONT_LANGID, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetLanguageID(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetName(ITextFont *iface, BSTR *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-21 10:25:24 +02:00
|
|
|
const IRichEditOleImpl *reole;
|
|
|
|
textfont_prop_val v;
|
|
|
|
LONG start;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
|
|
|
|
if (!value)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*value = NULL;
|
|
|
|
|
|
|
|
ITextRange_QueryInterface(This->range, &IID_Igetrichole, (void**)&reole);
|
|
|
|
if (!reole)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
init_textfont_prop_value(FONT_NAME, &v);
|
|
|
|
|
|
|
|
ITextRange_GetStart(This->range, &start);
|
|
|
|
hr = get_textfont_prop_for_pos(reole, start, FONT_NAME, &v);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
*value = v.str;
|
|
|
|
return S_OK;
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetName(ITextFont *iface, BSTR value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%s): stub\n", This, debugstr_w(value));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetOutline(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetOutline(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetPosition(ITextFont *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetPosition(ITextFont *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%.2f): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetProtected(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetProtected(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetShadow(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetShadow(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetSize(ITextFont *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-20 09:26:21 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
return get_textfont_propf(This->range, FONT_SIZE, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetSize(ITextFont *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%.2f): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetSmallCaps(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetSmallCaps(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetSpacing(ITextFont *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetSpacing(ITextFont *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%.2f): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetStrikeThrough(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-20 09:43:19 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
return get_textfont_propl(This->range, FONT_STRIKETHROUGH, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetStrikeThrough(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetSubscript(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-20 09:46:11 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
return get_textfont_propl(This->range, FONT_SUBSCRIPT, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetSubscript(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetSuperscript(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-20 09:46:11 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
return get_textfont_propl(This->range, FONT_SUPERSCRIPT, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetSuperscript(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetUnderline(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
2015-05-20 09:30:06 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, value);
|
|
|
|
return get_textfont_propl(This->range, FONT_UNDERLINE, value);
|
2015-05-17 16:26:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetUnderline(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_GetWeight(ITextFont *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextFont_SetWeight(ITextFont *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextFontImpl *This = impl_from_ITextFont(iface);
|
|
|
|
FIXME("(%p)->(%d): stub\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ITextFontVtbl textfontvtbl = {
|
|
|
|
TextFont_QueryInterface,
|
|
|
|
TextFont_AddRef,
|
|
|
|
TextFont_Release,
|
|
|
|
TextFont_GetTypeInfoCount,
|
|
|
|
TextFont_GetTypeInfo,
|
|
|
|
TextFont_GetIDsOfNames,
|
|
|
|
TextFont_Invoke,
|
|
|
|
TextFont_GetDuplicate,
|
|
|
|
TextFont_SetDuplicate,
|
|
|
|
TextFont_CanChange,
|
|
|
|
TextFont_IsEqual,
|
|
|
|
TextFont_Reset,
|
|
|
|
TextFont_GetStyle,
|
|
|
|
TextFont_SetStyle,
|
|
|
|
TextFont_GetAllCaps,
|
|
|
|
TextFont_SetAllCaps,
|
|
|
|
TextFont_GetAnimation,
|
|
|
|
TextFont_SetAnimation,
|
|
|
|
TextFont_GetBackColor,
|
|
|
|
TextFont_SetBackColor,
|
|
|
|
TextFont_GetBold,
|
|
|
|
TextFont_SetBold,
|
|
|
|
TextFont_GetEmboss,
|
|
|
|
TextFont_SetEmboss,
|
|
|
|
TextFont_GetForeColor,
|
|
|
|
TextFont_SetForeColor,
|
|
|
|
TextFont_GetHidden,
|
|
|
|
TextFont_SetHidden,
|
|
|
|
TextFont_GetEngrave,
|
|
|
|
TextFont_SetEngrave,
|
|
|
|
TextFont_GetItalic,
|
|
|
|
TextFont_SetItalic,
|
|
|
|
TextFont_GetKerning,
|
|
|
|
TextFont_SetKerning,
|
|
|
|
TextFont_GetLanguageID,
|
|
|
|
TextFont_SetLanguageID,
|
|
|
|
TextFont_GetName,
|
|
|
|
TextFont_SetName,
|
|
|
|
TextFont_GetOutline,
|
|
|
|
TextFont_SetOutline,
|
|
|
|
TextFont_GetPosition,
|
|
|
|
TextFont_SetPosition,
|
|
|
|
TextFont_GetProtected,
|
|
|
|
TextFont_SetProtected,
|
|
|
|
TextFont_GetShadow,
|
|
|
|
TextFont_SetShadow,
|
|
|
|
TextFont_GetSize,
|
|
|
|
TextFont_SetSize,
|
|
|
|
TextFont_GetSmallCaps,
|
|
|
|
TextFont_SetSmallCaps,
|
|
|
|
TextFont_GetSpacing,
|
|
|
|
TextFont_SetSpacing,
|
|
|
|
TextFont_GetStrikeThrough,
|
|
|
|
TextFont_SetStrikeThrough,
|
|
|
|
TextFont_GetSubscript,
|
|
|
|
TextFont_SetSubscript,
|
|
|
|
TextFont_GetSuperscript,
|
|
|
|
TextFont_SetSuperscript,
|
|
|
|
TextFont_GetUnderline,
|
|
|
|
TextFont_SetUnderline,
|
|
|
|
TextFont_GetWeight,
|
|
|
|
TextFont_SetWeight
|
|
|
|
};
|
|
|
|
|
|
|
|
static HRESULT create_textfont(ITextRange *range, ITextFont **ret)
|
|
|
|
{
|
|
|
|
ITextFontImpl *font;
|
|
|
|
|
|
|
|
*ret = NULL;
|
|
|
|
font = heap_alloc(sizeof(*font));
|
|
|
|
if (!font)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
font->ITextFont_iface.lpVtbl = &textfontvtbl;
|
|
|
|
font->ref = 1;
|
|
|
|
font->range = range;
|
|
|
|
ITextRange_AddRef(range);
|
|
|
|
|
|
|
|
*ret = &font->ITextFont_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:27:42 +02:00
|
|
|
/* ITextPara */
|
|
|
|
static HRESULT WINAPI TextPara_QueryInterface(ITextPara *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
if (IsEqualIID(riid, &IID_ITextPara) ||
|
|
|
|
IsEqualIID(riid, &IID_IDispatch) ||
|
|
|
|
IsEqualIID(riid, &IID_IUnknown))
|
|
|
|
{
|
|
|
|
*ppv = iface;
|
|
|
|
ITextPara_AddRef(iface);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI TextPara_AddRef(ITextPara *iface)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
TRACE("(%p)->(%u)\n", This, ref);
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI TextPara_Release(ITextPara *iface)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u)\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
ITextRange_Release(This->range);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetTypeInfoCount(ITextPara *iface, UINT *pctinfo)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
2015-05-17 16:27:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetTypeInfo(ITextPara *iface, UINT iTInfo, LCID lcid,
|
|
|
|
ITypeInfo **ppTInfo)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextPara_tid, ppTInfo);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
ITypeInfo_AddRef(*ppTInfo);
|
|
|
|
return hr;
|
2015-05-17 16:27:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetIDsOfNames(ITextPara *iface, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextPara_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
|
|
|
|
return hr;
|
2015-05-17 16:27:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_Invoke(
|
|
|
|
ITextPara *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo,
|
|
|
|
UINT *puArgErr)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This, dispIdMember, riid, lcid,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextPara_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_Invoke(ti, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
return hr;
|
2015-05-17 16:27:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetDuplicate(ITextPara *iface, ITextPara **ret)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetDuplicate(ITextPara *iface, ITextPara *para)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, para);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_CanChange(ITextPara *iface, LONG *ret)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_IsEqual(ITextPara *iface, ITextPara *para, LONG *ret)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p %p)\n", This, para, ret);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_Reset(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetStyle(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetStyle(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetAlignment(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetAlignment(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetHyphenation(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetHyphenation(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetFirstLineIndent(ITextPara *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetKeepTogether(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetKeepTogether(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetKeepWithNext(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetKeepWithNext(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetLeftIndent(ITextPara *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetLineSpacing(ITextPara *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetLineSpacingRule(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetListAlignment(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetListAlignment(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetListLevelIndex(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetListLevelIndex(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetListStart(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetListStart(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetListTab(ITextPara *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetListTab(ITextPara *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%.2f)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetListType(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetListType(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetNoLineNumber(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetNoLineNumber(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetPageBreakBefore(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetPageBreakBefore(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetRightIndent(ITextPara *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetRightIndent(ITextPara *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%.2f)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetIndents(ITextPara *iface, FLOAT StartIndent, FLOAT LeftIndent, FLOAT RightIndent)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%.2f %.2f %.2f)\n", This, StartIndent, LeftIndent, RightIndent);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetLineSpacing(ITextPara *iface, LONG LineSpacingRule, FLOAT LineSpacing)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d %.2f)\n", This, LineSpacingRule, LineSpacing);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetSpaceAfter(ITextPara *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetSpaceAfter(ITextPara *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%.2f)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetSpaceBefore(ITextPara *iface, FLOAT *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetSpaceBefore(ITextPara *iface, FLOAT value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%.2f)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetWidowControl(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_SetWidowControl(ITextPara *iface, LONG value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetTabCount(ITextPara *iface, LONG *value)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%p)\n", This, value);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_AddTab(ITextPara *iface, FLOAT tbPos, LONG tbAlign, LONG tbLeader)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%.2f %d %d)\n", This, tbPos, tbAlign, tbLeader);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_ClearAllTabs(ITextPara *iface)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_DeleteTab(ITextPara *iface, FLOAT pos)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%.2f)\n", This, pos);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI TextPara_GetTab(ITextPara *iface, LONG iTab, FLOAT *ptbPos, LONG *ptbAlign, LONG *ptbLeader)
|
|
|
|
{
|
|
|
|
ITextParaImpl *This = impl_from_ITextPara(iface);
|
|
|
|
FIXME("(%p)->(%d %p %p %p)\n", This, iTab, ptbPos, ptbAlign, ptbLeader);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ITextParaVtbl textparavtbl = {
|
|
|
|
TextPara_QueryInterface,
|
|
|
|
TextPara_AddRef,
|
|
|
|
TextPara_Release,
|
|
|
|
TextPara_GetTypeInfoCount,
|
|
|
|
TextPara_GetTypeInfo,
|
|
|
|
TextPara_GetIDsOfNames,
|
|
|
|
TextPara_Invoke,
|
|
|
|
TextPara_GetDuplicate,
|
|
|
|
TextPara_SetDuplicate,
|
|
|
|
TextPara_CanChange,
|
|
|
|
TextPara_IsEqual,
|
|
|
|
TextPara_Reset,
|
|
|
|
TextPara_GetStyle,
|
|
|
|
TextPara_SetStyle,
|
|
|
|
TextPara_GetAlignment,
|
|
|
|
TextPara_SetAlignment,
|
|
|
|
TextPara_GetHyphenation,
|
|
|
|
TextPara_SetHyphenation,
|
|
|
|
TextPara_GetFirstLineIndent,
|
|
|
|
TextPara_GetKeepTogether,
|
|
|
|
TextPara_SetKeepTogether,
|
|
|
|
TextPara_GetKeepWithNext,
|
|
|
|
TextPara_SetKeepWithNext,
|
|
|
|
TextPara_GetLeftIndent,
|
|
|
|
TextPara_GetLineSpacing,
|
|
|
|
TextPara_GetLineSpacingRule,
|
|
|
|
TextPara_GetListAlignment,
|
|
|
|
TextPara_SetListAlignment,
|
|
|
|
TextPara_GetListLevelIndex,
|
|
|
|
TextPara_SetListLevelIndex,
|
|
|
|
TextPara_GetListStart,
|
|
|
|
TextPara_SetListStart,
|
|
|
|
TextPara_GetListTab,
|
|
|
|
TextPara_SetListTab,
|
|
|
|
TextPara_GetListType,
|
|
|
|
TextPara_SetListType,
|
|
|
|
TextPara_GetNoLineNumber,
|
|
|
|
TextPara_SetNoLineNumber,
|
|
|
|
TextPara_GetPageBreakBefore,
|
|
|
|
TextPara_SetPageBreakBefore,
|
|
|
|
TextPara_GetRightIndent,
|
|
|
|
TextPara_SetRightIndent,
|
|
|
|
TextPara_SetIndents,
|
|
|
|
TextPara_SetLineSpacing,
|
|
|
|
TextPara_GetSpaceAfter,
|
|
|
|
TextPara_SetSpaceAfter,
|
|
|
|
TextPara_GetSpaceBefore,
|
|
|
|
TextPara_SetSpaceBefore,
|
|
|
|
TextPara_GetWidowControl,
|
|
|
|
TextPara_SetWidowControl,
|
|
|
|
TextPara_GetTabCount,
|
|
|
|
TextPara_AddTab,
|
|
|
|
TextPara_ClearAllTabs,
|
|
|
|
TextPara_DeleteTab,
|
|
|
|
TextPara_GetTab
|
|
|
|
};
|
|
|
|
|
|
|
|
static HRESULT create_textpara(ITextRange *range, ITextPara **ret)
|
|
|
|
{
|
|
|
|
ITextParaImpl *para;
|
|
|
|
|
|
|
|
*ret = NULL;
|
|
|
|
para = heap_alloc(sizeof(*para));
|
|
|
|
if (!para)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
para->ITextPara_iface.lpVtbl = &textparavtbl;
|
|
|
|
para->ref = 1;
|
|
|
|
para->range = range;
|
|
|
|
ITextRange_AddRef(range);
|
|
|
|
|
|
|
|
*ret = ¶->ITextPara_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
/* ITextDocument */
|
2006-07-10 21:03:57 +02:00
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnQueryInterface(ITextDocument* me, REFIID riid,
|
|
|
|
void** ppvObject)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2013-06-08 14:53:45 +02:00
|
|
|
return IRichEditOle_QueryInterface(&This->IRichEditOle_iface, riid, ppvObject);
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
ITextDocument_fnAddRef(ITextDocument* me)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2013-06-08 14:53:45 +02:00
|
|
|
return IRichEditOle_AddRef(&This->IRichEditOle_iface);
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI
|
|
|
|
ITextDocument_fnRelease(ITextDocument* me)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2013-06-08 14:53:45 +02:00
|
|
|
return IRichEditOle_Release(&This->IRichEditOle_iface);
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnGetTypeInfoCount(ITextDocument* me,
|
|
|
|
UINT* pctinfo)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnGetTypeInfo(ITextDocument* me, UINT iTInfo, LCID lcid,
|
|
|
|
ITypeInfo** ppTInfo)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextDocument_tid, ppTInfo);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
ITypeInfo_AddRef(*ppTInfo);
|
|
|
|
return hr;
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnGetIDsOfNames(ITextDocument* me, REFIID riid,
|
|
|
|
LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgDispId)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextDocument_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
|
|
|
|
return hr;
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnInvoke(ITextDocument* me, DISPID dispIdMember,
|
|
|
|
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
|
|
|
|
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This, dispIdMember, riid, lcid,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextDocument_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
return hr;
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnGetName(ITextDocument* me, BSTR* pName)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnGetSelection(ITextDocument* me, ITextSelection** ppSel)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
TRACE("(%p)\n", me);
|
2014-03-25 16:53:59 +01:00
|
|
|
|
|
|
|
if(!ppSel)
|
|
|
|
return E_INVALIDARG;
|
2011-05-17 12:11:22 +02:00
|
|
|
*ppSel = &This->txtSel->ITextSelection_iface;
|
2008-06-26 01:31:39 +02:00
|
|
|
ITextSelection_AddRef(*ppSel);
|
|
|
|
return S_OK;
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnGetStoryCount(ITextDocument* me, LONG* pCount)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnGetStoryRanges(ITextDocument* me,
|
|
|
|
ITextStoryRanges** ppStories)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnGetSaved(ITextDocument* me, LONG* pValue)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnSetSaved(ITextDocument* me, LONG Value)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnGetDefaultTabStop(ITextDocument* me, float* pValue)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnSetDefaultTabStop(ITextDocument* me, float Value)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnNew(ITextDocument* me)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnOpen(ITextDocument* me, VARIANT* pVar, LONG Flags,
|
|
|
|
LONG CodePage)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnSave(ITextDocument* me, VARIANT* pVar, LONG Flags,
|
|
|
|
LONG CodePage)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnFreeze(ITextDocument* me, LONG* pCount)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnUnfreeze(ITextDocument* me, LONG* pCount)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnBeginEditCollection(ITextDocument* me)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
|
|
|
ITextDocument_fnEndEditCollection(ITextDocument* me)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnUndo(ITextDocument* me, LONG Count, LONG* prop)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnRedo(ITextDocument* me, LONG Count, LONG* prop)
|
2006-07-10 21:03:57 +02:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2014-09-12 14:33:29 +02:00
|
|
|
static HRESULT CreateITextRange(IRichEditOleImpl *reOle, LONG start, LONG end, ITextRange** ppRange)
|
|
|
|
{
|
|
|
|
ITextRangeImpl *txtRge = heap_alloc(sizeof(ITextRangeImpl));
|
|
|
|
|
|
|
|
if (!txtRge)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
txtRge->ITextRange_iface.lpVtbl = &trvt;
|
|
|
|
txtRge->ref = 1;
|
|
|
|
txtRge->reOle = reOle;
|
|
|
|
txtRge->start = start;
|
|
|
|
txtRge->end = end;
|
|
|
|
list_add_head(&reOle->rangelist, &txtRge->entry);
|
|
|
|
*ppRange = &txtRge->ITextRange_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2006-07-10 21:03:57 +02:00
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnRange(ITextDocument* me, LONG cp1, LONG cp2,
|
2006-07-10 21:03:57 +02:00
|
|
|
ITextRange** ppRange)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
2014-09-12 14:33:29 +02:00
|
|
|
const int len = ME_GetTextLength(This->editor) + 1;
|
|
|
|
|
|
|
|
TRACE("%p %p %d %d\n", This, ppRange, cp1, cp2);
|
|
|
|
if (!ppRange)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
cp1 = max(cp1, 0);
|
|
|
|
cp2 = max(cp2, 0);
|
|
|
|
cp1 = min(cp1, len);
|
|
|
|
cp2 = min(cp2, len);
|
|
|
|
if (cp1 > cp2)
|
|
|
|
{
|
|
|
|
LONG tmp;
|
|
|
|
tmp = cp1;
|
|
|
|
cp1 = cp2;
|
|
|
|
cp2 = tmp;
|
|
|
|
}
|
|
|
|
if (cp1 == len)
|
|
|
|
cp1 = cp2 = len - 1;
|
|
|
|
|
|
|
|
return CreateITextRange(This, cp1, cp2, ppRange);
|
2006-07-10 21:03:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI
|
2009-03-09 23:27:55 +01:00
|
|
|
ITextDocument_fnRangeFromPoint(ITextDocument* me, LONG x, LONG y,
|
2006-07-10 21:03:57 +02:00
|
|
|
ITextRange** ppRange)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_ITextDocument(me);
|
|
|
|
FIXME("stub %p\n",This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ITextDocumentVtbl tdvt = {
|
|
|
|
ITextDocument_fnQueryInterface,
|
|
|
|
ITextDocument_fnAddRef,
|
|
|
|
ITextDocument_fnRelease,
|
|
|
|
ITextDocument_fnGetTypeInfoCount,
|
|
|
|
ITextDocument_fnGetTypeInfo,
|
|
|
|
ITextDocument_fnGetIDsOfNames,
|
|
|
|
ITextDocument_fnInvoke,
|
|
|
|
ITextDocument_fnGetName,
|
|
|
|
ITextDocument_fnGetSelection,
|
|
|
|
ITextDocument_fnGetStoryCount,
|
|
|
|
ITextDocument_fnGetStoryRanges,
|
|
|
|
ITextDocument_fnGetSaved,
|
|
|
|
ITextDocument_fnSetSaved,
|
|
|
|
ITextDocument_fnGetDefaultTabStop,
|
|
|
|
ITextDocument_fnSetDefaultTabStop,
|
|
|
|
ITextDocument_fnNew,
|
|
|
|
ITextDocument_fnOpen,
|
|
|
|
ITextDocument_fnSave,
|
|
|
|
ITextDocument_fnFreeze,
|
|
|
|
ITextDocument_fnUnfreeze,
|
|
|
|
ITextDocument_fnBeginEditCollection,
|
|
|
|
ITextDocument_fnEndEditCollection,
|
|
|
|
ITextDocument_fnUndo,
|
|
|
|
ITextDocument_fnRedo,
|
|
|
|
ITextDocument_fnRange,
|
|
|
|
ITextDocument_fnRangeFromPoint
|
|
|
|
};
|
|
|
|
|
2015-05-17 16:26:33 +02:00
|
|
|
/* ITextSelection */
|
2008-06-26 01:31:39 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnQueryInterface(
|
|
|
|
ITextSelection *me,
|
|
|
|
REFIID riid,
|
|
|
|
void **ppvObj)
|
|
|
|
{
|
2015-05-20 10:41:34 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
|
|
|
|
2008-06-26 01:31:39 +02:00
|
|
|
*ppvObj = NULL;
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
|
|
|
|| IsEqualGUID(riid, &IID_IDispatch)
|
|
|
|
|| IsEqualGUID(riid, &IID_ITextRange)
|
|
|
|
|| IsEqualGUID(riid, &IID_ITextSelection))
|
|
|
|
{
|
|
|
|
*ppvObj = me;
|
|
|
|
ITextSelection_AddRef(me);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2015-05-20 10:41:34 +02:00
|
|
|
else if (IsEqualGUID(riid, &IID_Igetrichole))
|
|
|
|
{
|
|
|
|
*ppvObj = This->reOle;
|
|
|
|
return S_OK;
|
|
|
|
}
|
2008-06-26 01:31:39 +02:00
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static ULONG WINAPI ITextSelection_fnAddRef(ITextSelection *me)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
return InterlockedIncrement(&This->ref);
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static ULONG WINAPI ITextSelection_fnRelease(ITextSelection *me)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
if (ref == 0)
|
|
|
|
heap_free(This);
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetTypeInfoCount(ITextSelection *me, UINT *pctinfo)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
*pctinfo = 1;
|
|
|
|
return S_OK;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetTypeInfo(ITextSelection *me, UINT iTInfo, LCID lcid,
|
2008-06-26 01:31:39 +02:00
|
|
|
ITypeInfo **ppTInfo)
|
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
HRESULT hr;
|
2008-06-26 01:31:39 +02:00
|
|
|
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextSelection_tid, ppTInfo);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
ITypeInfo_AddRef(*ppTInfo);
|
|
|
|
return hr;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetIDsOfNames(ITextSelection *me, REFIID riid,
|
|
|
|
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2015-05-24 13:01:38 +02:00
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
2008-06-26 01:31:39 +02:00
|
|
|
|
2015-05-24 13:01:38 +02:00
|
|
|
TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This, riid, rgszNames, cNames, lcid,
|
|
|
|
rgDispId);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextSelection_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_GetIDsOfNames(ti, rgszNames, cNames, rgDispId);
|
|
|
|
return hr;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ITextSelection_fnInvoke(
|
|
|
|
ITextSelection *me,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult,
|
|
|
|
EXCEPINFO *pExcepInfo,
|
|
|
|
UINT *puArgErr)
|
|
|
|
{
|
2015-05-24 13:01:38 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
|
|
|
ITypeInfo *ti;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This, dispIdMember, riid, lcid,
|
|
|
|
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
|
|
|
|
hr = get_typeinfo(ITextSelection_tid, &ti);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = ITypeInfo_Invoke(ti, me, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
return hr;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** ITextRange methods ***/
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2014-07-21 18:41:29 +02:00
|
|
|
ME_Cursor *start = NULL, *end = NULL;
|
|
|
|
int nChars, endOfs;
|
|
|
|
BOOL bEOP;
|
|
|
|
|
2015-05-21 11:13:42 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, pbstr);
|
|
|
|
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
2015-05-21 11:13:42 +02:00
|
|
|
|
2014-07-21 18:41:29 +02:00
|
|
|
if (!pbstr)
|
|
|
|
return E_INVALIDARG;
|
2008-06-26 01:31:39 +02:00
|
|
|
|
2014-07-21 18:41:29 +02:00
|
|
|
ME_GetSelection(This->reOle->editor, &start, &end);
|
|
|
|
endOfs = ME_GetCursorOfs(end);
|
|
|
|
nChars = endOfs - ME_GetCursorOfs(start);
|
|
|
|
if (!nChars)
|
|
|
|
{
|
|
|
|
*pbstr = NULL;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*pbstr = SysAllocStringLen(NULL, nChars);
|
|
|
|
if (!*pbstr)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
bEOP = (end->pRun->next->type == diTextEnd && endOfs > ME_GetTextLength(This->reOle->editor));
|
|
|
|
ME_GetTextW(This->reOle->editor, *pbstr, nChars, start, nChars, FALSE, bEOP);
|
|
|
|
TRACE("%s\n", wine_dbgstr_w(*pbstr));
|
|
|
|
|
|
|
|
return S_OK;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetText(ITextSelection *me, BSTR bstr)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetChar(ITextSelection *me, LONG *pch)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2014-09-15 18:13:51 +02:00
|
|
|
ME_Cursor *start = NULL, *end = NULL;
|
|
|
|
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
2014-09-15 18:13:51 +02:00
|
|
|
TRACE("%p\n", pch);
|
|
|
|
if (!pch)
|
|
|
|
return E_INVALIDARG;
|
2008-06-26 01:31:39 +02:00
|
|
|
|
2014-09-15 18:13:51 +02:00
|
|
|
ME_GetSelection(This->reOle->editor, &start, &end);
|
|
|
|
return range_GetChar(This->reOle->editor, start, pch);
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetDuplicate(ITextSelection *me, ITextRange **ppRange)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITextRange **ppRange)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITextRange *pRange)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFirst)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2014-09-16 12:39:10 +02:00
|
|
|
LONG lim;
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2014-09-16 12:39:10 +02:00
|
|
|
if (!pcpFirst)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
ME_GetSelectionOfs(This->reOle->editor, pcpFirst, &lim);
|
|
|
|
TRACE("%d\n", *pcpFirst);
|
|
|
|
return S_OK;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetStart(ITextSelection *me, LONG cpFirst)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2014-09-16 12:39:10 +02:00
|
|
|
LONG first;
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2014-09-16 12:39:10 +02:00
|
|
|
if (!pcpLim)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
ME_GetSelectionOfs(This->reOle->editor, &first, pcpLim);
|
|
|
|
TRACE("%d\n", *pcpLim);
|
|
|
|
return S_OK;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG cpLim)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2015-05-20 10:41:34 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **font)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2015-05-20 10:41:34 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, font);
|
|
|
|
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2015-05-20 10:41:34 +02:00
|
|
|
if (!font)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
return create_textfont((ITextRange*)me, font);
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *pFont)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:27:42 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetPara(ITextSelection *me, ITextPara **para)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *pPara)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetStoryLength(ITextSelection *me, LONG *pcch)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetStoryType(ITextSelection *me, LONG *pValue)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnCollapse(ITextSelection *me, LONG bStart)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2014-09-17 11:38:47 +02:00
|
|
|
LONG start, end;
|
|
|
|
HRESULT hres;
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
2014-09-17 11:38:47 +02:00
|
|
|
ME_GetSelectionOfs(This->reOle->editor, &start, &end);
|
|
|
|
hres = range_Collapse(bStart, &start, &end);
|
|
|
|
if (SUCCEEDED(hres))
|
|
|
|
ME_SetSelection(This->reOle->editor, start, end);
|
|
|
|
return hres;
|
2008-06-26 01:31:39 +02:00
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG Unit, LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG Unit, LONG *pIndex)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG Unit, LONG Index,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG Extend)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG cpActive, LONG cpOther)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *pRange, LONG *pb)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *pRange, LONG *pb)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *pRange, LONG *pb)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG Unit, LONG Extend,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnEndOf(ITextSelection *me, LONG Unit, LONG Extend,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG Unit, LONG Count, LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG Unit, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG Unit, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *Cset, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIANT *Cset, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT *Cset, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *Cset, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIANT *Cset, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT *Cset, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR bstr, LONG cch, LONG Flags,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pLength)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR bstr, LONG cch,
|
|
|
|
LONG Flags, LONG *pLength)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR bstr, LONG cch,
|
|
|
|
LONG Flags, LONG *pLength)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG Unit, LONG Count,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnCut(ITextSelection *me, VARIANT *pVar)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnCopy(ITextSelection *me, VARIANT *pVar)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *pVar, LONG Format)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *pVar, LONG Format,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pb)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *pb)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG Type)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG Type, LONG *cx, LONG *cy)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG y, LONG Type,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG Extend)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG Value)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(ITextSelection *me, IUnknown **ppv)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** ITextSelection methods ***/
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *pFlags)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG Flags)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *pType)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG Unit, LONG Count,
|
|
|
|
LONG Extend, LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG Unit, LONG Count,
|
|
|
|
LONG Extend, LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG Unit, LONG Count,
|
|
|
|
LONG Extend, LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG Unit, LONG Count,
|
|
|
|
LONG Extend, LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG Unit, LONG Extend,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG Unit, LONG Extend,
|
2009-03-09 23:27:55 +01:00
|
|
|
LONG *pDelta)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
static HRESULT WINAPI ITextSelection_fnTypeText(ITextSelection *me, BSTR bstr)
|
2008-06-26 01:31:39 +02:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelectionImpl *This = impl_from_ITextSelection(me);
|
2008-06-26 01:31:39 +02:00
|
|
|
if (!This->reOle)
|
|
|
|
return CO_E_RELEASED;
|
|
|
|
|
|
|
|
FIXME("not implemented\n");
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const ITextSelectionVtbl tsvt = {
|
|
|
|
ITextSelection_fnQueryInterface,
|
|
|
|
ITextSelection_fnAddRef,
|
|
|
|
ITextSelection_fnRelease,
|
|
|
|
ITextSelection_fnGetTypeInfoCount,
|
|
|
|
ITextSelection_fnGetTypeInfo,
|
|
|
|
ITextSelection_fnGetIDsOfNames,
|
|
|
|
ITextSelection_fnInvoke,
|
|
|
|
ITextSelection_fnGetText,
|
|
|
|
ITextSelection_fnSetText,
|
|
|
|
ITextSelection_fnGetChar,
|
|
|
|
ITextSelection_fnSetChar,
|
|
|
|
ITextSelection_fnGetDuplicate,
|
|
|
|
ITextSelection_fnGetFormattedText,
|
|
|
|
ITextSelection_fnSetFormattedText,
|
|
|
|
ITextSelection_fnGetStart,
|
|
|
|
ITextSelection_fnSetStart,
|
|
|
|
ITextSelection_fnGetEnd,
|
|
|
|
ITextSelection_fnSetEnd,
|
|
|
|
ITextSelection_fnGetFont,
|
|
|
|
ITextSelection_fnSetFont,
|
|
|
|
ITextSelection_fnGetPara,
|
|
|
|
ITextSelection_fnSetPara,
|
|
|
|
ITextSelection_fnGetStoryLength,
|
|
|
|
ITextSelection_fnGetStoryType,
|
|
|
|
ITextSelection_fnCollapse,
|
|
|
|
ITextSelection_fnExpand,
|
|
|
|
ITextSelection_fnGetIndex,
|
|
|
|
ITextSelection_fnSetIndex,
|
|
|
|
ITextSelection_fnSetRange,
|
|
|
|
ITextSelection_fnInRange,
|
|
|
|
ITextSelection_fnInStory,
|
|
|
|
ITextSelection_fnIsEqual,
|
|
|
|
ITextSelection_fnSelect,
|
|
|
|
ITextSelection_fnStartOf,
|
|
|
|
ITextSelection_fnEndOf,
|
|
|
|
ITextSelection_fnMove,
|
|
|
|
ITextSelection_fnMoveStart,
|
|
|
|
ITextSelection_fnMoveEnd,
|
|
|
|
ITextSelection_fnMoveWhile,
|
|
|
|
ITextSelection_fnMoveStartWhile,
|
|
|
|
ITextSelection_fnMoveEndWhile,
|
|
|
|
ITextSelection_fnMoveUntil,
|
|
|
|
ITextSelection_fnMoveStartUntil,
|
|
|
|
ITextSelection_fnMoveEndUntil,
|
|
|
|
ITextSelection_fnFindText,
|
|
|
|
ITextSelection_fnFindTextStart,
|
|
|
|
ITextSelection_fnFindTextEnd,
|
|
|
|
ITextSelection_fnDelete,
|
|
|
|
ITextSelection_fnCut,
|
|
|
|
ITextSelection_fnCopy,
|
|
|
|
ITextSelection_fnPaste,
|
|
|
|
ITextSelection_fnCanPaste,
|
|
|
|
ITextSelection_fnCanEdit,
|
|
|
|
ITextSelection_fnChangeCase,
|
|
|
|
ITextSelection_fnGetPoint,
|
|
|
|
ITextSelection_fnSetPoint,
|
|
|
|
ITextSelection_fnScrollIntoView,
|
|
|
|
ITextSelection_fnGetEmbeddedObject,
|
|
|
|
ITextSelection_fnGetFlags,
|
|
|
|
ITextSelection_fnSetFlags,
|
|
|
|
ITextSelection_fnGetType,
|
|
|
|
ITextSelection_fnMoveLeft,
|
|
|
|
ITextSelection_fnMoveRight,
|
|
|
|
ITextSelection_fnMoveUp,
|
|
|
|
ITextSelection_fnMoveDown,
|
|
|
|
ITextSelection_fnHomeKey,
|
|
|
|
ITextSelection_fnEndKey,
|
|
|
|
ITextSelection_fnTypeText
|
|
|
|
};
|
|
|
|
|
|
|
|
static ITextSelectionImpl *
|
|
|
|
CreateTextSelection(IRichEditOleImpl *reOle)
|
|
|
|
{
|
|
|
|
ITextSelectionImpl *txtSel = heap_alloc(sizeof *txtSel);
|
|
|
|
if (!txtSel)
|
|
|
|
return NULL;
|
|
|
|
|
2011-05-17 12:11:22 +02:00
|
|
|
txtSel->ITextSelection_iface.lpVtbl = &tsvt;
|
2008-06-26 01:31:39 +02:00
|
|
|
txtSel->ref = 1;
|
|
|
|
txtSel->reOle = reOle;
|
|
|
|
return txtSel;
|
|
|
|
}
|
|
|
|
|
2014-10-28 13:10:33 +01:00
|
|
|
LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj)
|
2005-03-08 17:46:00 +01:00
|
|
|
{
|
|
|
|
IRichEditOleImpl *reo;
|
|
|
|
|
2007-12-07 23:42:22 +01:00
|
|
|
reo = heap_alloc(sizeof(IRichEditOleImpl));
|
2005-03-08 17:46:00 +01:00
|
|
|
if (!reo)
|
|
|
|
return 0;
|
|
|
|
|
2014-10-28 13:10:33 +01:00
|
|
|
reo->IUnknown_inner.lpVtbl = &reo_unk_vtbl;
|
2011-05-18 23:49:52 +02:00
|
|
|
reo->IRichEditOle_iface.lpVtbl = &revt;
|
|
|
|
reo->ITextDocument_iface.lpVtbl = &tdvt;
|
2005-03-08 17:46:00 +01:00
|
|
|
reo->ref = 1;
|
2006-02-23 05:05:11 +01:00
|
|
|
reo->editor = editor;
|
2008-06-26 01:31:39 +02:00
|
|
|
reo->txtSel = CreateTextSelection(reo);
|
|
|
|
if (!reo->txtSel)
|
|
|
|
{
|
|
|
|
heap_free(reo);
|
|
|
|
return 0;
|
|
|
|
}
|
2009-01-09 18:08:35 +01:00
|
|
|
reo->clientSite = CreateOleClientSite(reo);
|
2014-03-27 15:59:50 +01:00
|
|
|
if (!reo->clientSite)
|
2009-01-09 18:08:35 +01:00
|
|
|
{
|
2011-05-17 12:11:22 +02:00
|
|
|
ITextSelection_Release(&reo->txtSel->ITextSelection_iface);
|
2009-01-09 18:08:35 +01:00
|
|
|
heap_free(reo);
|
|
|
|
return 0;
|
|
|
|
}
|
2005-03-08 17:46:00 +01:00
|
|
|
TRACE("Created %p\n",reo);
|
2014-09-12 14:33:29 +02:00
|
|
|
list_init(&reo->rangelist);
|
2014-10-28 13:10:33 +01:00
|
|
|
if (outer_unk)
|
|
|
|
reo->outer_unk = outer_unk;
|
|
|
|
else
|
|
|
|
reo->outer_unk = &reo->IUnknown_inner;
|
|
|
|
*ppvObj = &reo->IRichEditOle_iface;
|
2005-03-08 17:46:00 +01:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
2008-01-27 19:01:41 +01:00
|
|
|
|
2011-10-22 18:11:27 +02:00
|
|
|
static void convert_sizel(const ME_Context *c, const SIZEL* szl, SIZE* sz)
|
2008-01-27 19:02:34 +01:00
|
|
|
{
|
|
|
|
/* sizel is in .01 millimeters, sz in pixels */
|
|
|
|
sz->cx = MulDiv(szl->cx, c->dpi.cx, 2540);
|
|
|
|
sz->cy = MulDiv(szl->cy, c->dpi.cy, 2540);
|
|
|
|
}
|
|
|
|
|
2008-01-27 19:01:41 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* ME_GetOLEObjectSize
|
|
|
|
*
|
|
|
|
* Sets run extent for OLE objects.
|
|
|
|
*/
|
2011-10-22 18:11:27 +02:00
|
|
|
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize)
|
2008-01-27 19:01:41 +01:00
|
|
|
{
|
|
|
|
IDataObject* ido;
|
|
|
|
FORMATETC fmt;
|
|
|
|
STGMEDIUM stgm;
|
|
|
|
DIBSECTION dibsect;
|
|
|
|
ENHMETAHEADER emh;
|
|
|
|
|
|
|
|
assert(run->nFlags & MERF_GRAPHICS);
|
|
|
|
assert(run->ole_obj);
|
2008-01-27 19:02:34 +01:00
|
|
|
|
|
|
|
if (run->ole_obj->sizel.cx != 0 || run->ole_obj->sizel.cy != 0)
|
|
|
|
{
|
|
|
|
convert_sizel(c, &run->ole_obj->sizel, pSize);
|
2010-02-27 19:31:07 +01:00
|
|
|
if (c->editor->nZoomNumerator != 0)
|
|
|
|
{
|
|
|
|
pSize->cx = MulDiv(pSize->cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
|
|
|
pSize->cy = MulDiv(pSize->cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
|
|
|
}
|
2008-01-27 19:02:34 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-09-01 04:00:59 +02:00
|
|
|
if (IOleObject_QueryInterface(run->ole_obj->poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
|
|
|
|
{
|
|
|
|
FIXME("Query Interface IID_IDataObject failed!\n");
|
|
|
|
pSize->cx = pSize->cy = 0;
|
|
|
|
return;
|
|
|
|
}
|
2008-01-27 19:01:41 +01:00
|
|
|
fmt.cfFormat = CF_BITMAP;
|
|
|
|
fmt.ptd = NULL;
|
|
|
|
fmt.dwAspect = DVASPECT_CONTENT;
|
|
|
|
fmt.lindex = -1;
|
|
|
|
fmt.tymed = TYMED_GDI;
|
|
|
|
if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
|
|
|
|
{
|
|
|
|
fmt.cfFormat = CF_ENHMETAFILE;
|
|
|
|
fmt.tymed = TYMED_ENHMF;
|
|
|
|
if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
|
|
|
|
{
|
|
|
|
FIXME("unsupported format\n");
|
|
|
|
pSize->cx = pSize->cy = 0;
|
|
|
|
IDataObject_Release(ido);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (stgm.tymed)
|
|
|
|
{
|
|
|
|
case TYMED_GDI:
|
|
|
|
GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
|
|
|
|
pSize->cx = dibsect.dsBm.bmWidth;
|
|
|
|
pSize->cy = dibsect.dsBm.bmHeight;
|
|
|
|
if (!stgm.pUnkForRelease) DeleteObject(stgm.u.hBitmap);
|
|
|
|
break;
|
|
|
|
case TYMED_ENHMF:
|
|
|
|
GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
|
|
|
|
pSize->cx = emh.rclBounds.right - emh.rclBounds.left;
|
|
|
|
pSize->cy = emh.rclBounds.bottom - emh.rclBounds.top;
|
|
|
|
if (!stgm.pUnkForRelease) DeleteEnhMetaFile(stgm.u.hEnhMetaFile);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("Unsupported tymed %d\n", stgm.tymed);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
IDataObject_Release(ido);
|
2008-01-27 19:02:34 +01:00
|
|
|
if (c->editor->nZoomNumerator != 0)
|
2008-01-27 19:01:50 +01:00
|
|
|
{
|
2008-01-27 19:02:34 +01:00
|
|
|
pSize->cx = MulDiv(pSize->cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
|
|
|
pSize->cy = MulDiv(pSize->cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
2008-01-27 19:01:50 +01:00
|
|
|
}
|
2008-01-27 19:01:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void ME_DrawOLE(ME_Context *c, int x, int y, ME_Run *run,
|
|
|
|
ME_Paragraph *para, BOOL selected)
|
|
|
|
{
|
|
|
|
IDataObject* ido;
|
|
|
|
FORMATETC fmt;
|
|
|
|
STGMEDIUM stgm;
|
|
|
|
DIBSECTION dibsect;
|
|
|
|
ENHMETAHEADER emh;
|
|
|
|
HDC hMemDC;
|
2008-01-27 19:02:05 +01:00
|
|
|
SIZE sz;
|
2008-01-27 19:02:34 +01:00
|
|
|
BOOL has_size;
|
2008-01-27 19:01:41 +01:00
|
|
|
|
|
|
|
assert(run->nFlags & MERF_GRAPHICS);
|
|
|
|
assert(run->ole_obj);
|
|
|
|
if (IOleObject_QueryInterface(run->ole_obj->poleobj, &IID_IDataObject, (void**)&ido) != S_OK)
|
|
|
|
{
|
|
|
|
FIXME("Couldn't get interface\n");
|
|
|
|
return;
|
|
|
|
}
|
2008-01-27 19:02:34 +01:00
|
|
|
has_size = run->ole_obj->sizel.cx != 0 || run->ole_obj->sizel.cy != 0;
|
2008-01-27 19:01:41 +01:00
|
|
|
fmt.cfFormat = CF_BITMAP;
|
|
|
|
fmt.ptd = NULL;
|
|
|
|
fmt.dwAspect = DVASPECT_CONTENT;
|
|
|
|
fmt.lindex = -1;
|
|
|
|
fmt.tymed = TYMED_GDI;
|
|
|
|
if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
|
|
|
|
{
|
|
|
|
fmt.cfFormat = CF_ENHMETAFILE;
|
|
|
|
fmt.tymed = TYMED_ENHMF;
|
|
|
|
if (IDataObject_GetData(ido, &fmt, &stgm) != S_OK)
|
|
|
|
{
|
|
|
|
FIXME("Couldn't get storage medium\n");
|
|
|
|
IDataObject_Release(ido);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (stgm.tymed)
|
|
|
|
{
|
|
|
|
case TYMED_GDI:
|
|
|
|
GetObjectW(stgm.u.hBitmap, sizeof(dibsect), &dibsect);
|
|
|
|
hMemDC = CreateCompatibleDC(c->hDC);
|
|
|
|
SelectObject(hMemDC, stgm.u.hBitmap);
|
2010-02-27 19:31:07 +01:00
|
|
|
if (has_size)
|
2008-01-27 19:02:05 +01:00
|
|
|
{
|
2010-02-27 19:31:07 +01:00
|
|
|
convert_sizel(c, &run->ole_obj->sizel, &sz);
|
|
|
|
} else {
|
|
|
|
sz.cx = MulDiv(dibsect.dsBm.bmWidth, c->dpi.cx, 96);
|
|
|
|
sz.cy = MulDiv(dibsect.dsBm.bmHeight, c->dpi.cy, 96);
|
|
|
|
}
|
|
|
|
if (c->editor->nZoomNumerator != 0)
|
|
|
|
{
|
|
|
|
sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
|
|
|
sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
2008-01-27 19:02:05 +01:00
|
|
|
}
|
2010-02-27 19:31:07 +01:00
|
|
|
if (sz.cx == dibsect.dsBm.bmWidth && sz.cy == dibsect.dsBm.bmHeight)
|
2008-01-27 19:01:50 +01:00
|
|
|
{
|
2010-02-27 19:31:07 +01:00
|
|
|
BitBlt(c->hDC, x, y - sz.cy,
|
|
|
|
dibsect.dsBm.bmWidth, dibsect.dsBm.bmHeight,
|
|
|
|
hMemDC, 0, 0, SRCCOPY);
|
|
|
|
} else {
|
2008-01-27 19:02:05 +01:00
|
|
|
StretchBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy,
|
2010-02-27 19:31:07 +01:00
|
|
|
hMemDC, 0, 0, dibsect.dsBm.bmWidth,
|
|
|
|
dibsect.dsBm.bmHeight, SRCCOPY);
|
2008-01-27 19:01:50 +01:00
|
|
|
}
|
2012-01-28 13:27:03 +01:00
|
|
|
DeleteDC(hMemDC);
|
2008-01-27 19:01:41 +01:00
|
|
|
if (!stgm.pUnkForRelease) DeleteObject(stgm.u.hBitmap);
|
|
|
|
break;
|
|
|
|
case TYMED_ENHMF:
|
|
|
|
GetEnhMetaFileHeader(stgm.u.hEnhMetaFile, sizeof(emh), &emh);
|
2010-02-27 19:31:07 +01:00
|
|
|
if (has_size)
|
2008-01-27 19:01:50 +01:00
|
|
|
{
|
2010-02-27 19:31:07 +01:00
|
|
|
convert_sizel(c, &run->ole_obj->sizel, &sz);
|
|
|
|
} else {
|
|
|
|
sz.cy = MulDiv(emh.rclBounds.bottom - emh.rclBounds.top, c->dpi.cx, 96);
|
|
|
|
sz.cx = MulDiv(emh.rclBounds.right - emh.rclBounds.left, c->dpi.cy, 96);
|
2008-01-27 19:01:50 +01:00
|
|
|
}
|
2010-02-27 19:31:07 +01:00
|
|
|
if (c->editor->nZoomNumerator != 0)
|
2008-01-27 19:01:50 +01:00
|
|
|
{
|
2010-02-27 19:31:07 +01:00
|
|
|
sz.cx = MulDiv(sz.cx, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
|
|
|
sz.cy = MulDiv(sz.cy, c->editor->nZoomNumerator, c->editor->nZoomDenominator);
|
2008-01-27 19:02:05 +01:00
|
|
|
}
|
2010-02-27 19:31:07 +01:00
|
|
|
|
2008-01-27 19:02:05 +01:00
|
|
|
{
|
|
|
|
RECT rc;
|
|
|
|
|
|
|
|
rc.left = x;
|
|
|
|
rc.top = y - sz.cy;
|
|
|
|
rc.right = x + sz.cx;
|
|
|
|
rc.bottom = y;
|
|
|
|
PlayEnhMetaFile(c->hDC, stgm.u.hEnhMetaFile, &rc);
|
2008-01-27 19:01:50 +01:00
|
|
|
}
|
2008-01-27 19:01:41 +01:00
|
|
|
if (!stgm.pUnkForRelease) DeleteEnhMetaFile(stgm.u.hEnhMetaFile);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
FIXME("Unsupported tymed %d\n", stgm.tymed);
|
2008-01-27 19:02:05 +01:00
|
|
|
selected = FALSE;
|
2008-01-27 19:01:41 +01:00
|
|
|
break;
|
|
|
|
}
|
2008-01-27 19:02:05 +01:00
|
|
|
if (selected && !c->editor->bHideSelection)
|
|
|
|
PatBlt(c->hDC, x, y - sz.cy, sz.cx, sz.cy, DSTINVERT);
|
2008-01-27 19:01:41 +01:00
|
|
|
IDataObject_Release(ido);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ME_DeleteReObject(REOBJECT* reo)
|
|
|
|
{
|
|
|
|
if (reo->poleobj) IOleObject_Release(reo->poleobj);
|
|
|
|
if (reo->pstg) IStorage_Release(reo->pstg);
|
|
|
|
if (reo->polesite) IOleClientSite_Release(reo->polesite);
|
|
|
|
FREE_OBJ(reo);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src)
|
|
|
|
{
|
|
|
|
*dst = *src;
|
|
|
|
|
|
|
|
if (dst->poleobj) IOleObject_AddRef(dst->poleobj);
|
|
|
|
if (dst->pstg) IStorage_AddRef(dst->pstg);
|
|
|
|
if (dst->polesite) IOleClientSite_AddRef(dst->polesite);
|
|
|
|
}
|
2014-10-28 13:10:46 +01:00
|
|
|
|
|
|
|
void ME_GetITextDocumentInterface(IRichEditOle *iface, LPVOID *ppvObj)
|
|
|
|
{
|
|
|
|
IRichEditOleImpl *This = impl_from_IRichEditOle(iface);
|
|
|
|
*ppvObj = &This->ITextDocument_iface;
|
|
|
|
}
|