2 * RichEdit GUIDs and OLE interface
4 * Copyright 2004 by Krzysztof Foltman
5 * Copyright 2004 Aric Stewart
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #define NONAMELESSUNION
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(richedit
);
40 /* there is no way to be consistent across different sets of headers - mingw, Wine, Win32 SDK*/
44 DEFINE_GUID(LIBID_tom
, 0x8cc497c9, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
45 DEFINE_GUID(IID_ITextServices
, 0x8d33f740, 0xcf58, 0x11ce, 0xa8, 0x9d, 0x00, 0xaa, 0x00, 0x6c, 0xad, 0xc5);
46 DEFINE_GUID(IID_ITextHost
, 0x13e670f4,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
47 DEFINE_GUID(IID_ITextHost2
, 0x13e670f5,0x1a5a,0x11cf,0xab,0xeb,0x00,0xaa,0x00,0xb6,0x5e,0xa1);
48 DEFINE_GUID(IID_ITextDocument
, 0x8cc497c0, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
49 DEFINE_GUID(IID_ITextRange
, 0x8cc497c2, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
50 DEFINE_GUID(IID_ITextSelection
, 0x8cc497c1, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
51 DEFINE_GUID(IID_ITextFont
, 0x8cc497c3, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
52 DEFINE_GUID(IID_ITextPara
, 0x8cc497c4, 0xa1df, 0x11ce, 0x80, 0x98, 0x00, 0xaa, 0x00, 0x47, 0xbe, 0x5d);
54 static ITypeLib
*typelib
;
66 static const IID
* const tid_ids
[] =
75 static ITypeInfo
*typeinfos
[LAST_tid
];
77 static HRESULT
load_typelib(void)
82 hr
= LoadRegTypeLib(&LIBID_tom
, 1, 0, LOCALE_SYSTEM_DEFAULT
, &tl
);
84 ERR("LoadRegTypeLib failed: %08x\n", hr
);
88 if (InterlockedCompareExchangePointer((void**)&typelib
, tl
, NULL
))
93 void release_typelib(void)
100 for (i
= 0; i
< sizeof(typeinfos
)/sizeof(*typeinfos
); i
++)
102 ITypeInfo_Release(typeinfos
[i
]);
104 ITypeLib_Release(typelib
);
107 static HRESULT
get_typeinfo(enum tid_t tid
, ITypeInfo
**typeinfo
)
120 hr
= ITypeLib_GetTypeInfoOfGuid(typelib
, tid_ids
[tid
], &ti
);
123 ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids
[tid
]), hr
);
127 if (InterlockedCompareExchangePointer((void**)(typeinfos
+tid
), ti
, NULL
))
128 ITypeInfo_Release(ti
);
131 *typeinfo
= typeinfos
[tid
];
135 /* private IID used to get back IRichEditOleImpl pointer */
136 DEFINE_GUID(IID_Igetrichole
, 0xe3ce5c7a, 0x8247, 0x4622, 0x81, 0xad, 0x11, 0x81, 0x02, 0xaa, 0x01, 0x30);
138 typedef struct ITextSelectionImpl ITextSelectionImpl
;
139 typedef struct IOleClientSiteImpl IOleClientSiteImpl
;
140 typedef struct ITextRangeImpl ITextRangeImpl
;
142 enum textfont_prop_id
{
170 static const DWORD textfont_prop_masks
[] = {
203 typedef struct IRichEditOleImpl
{
204 IUnknown IUnknown_inner
;
205 IRichEditOle IRichEditOle_iface
;
206 ITextDocument ITextDocument_iface
;
210 ME_TextEditor
*editor
;
211 ITextSelectionImpl
*txtSel
;
212 IOleClientSiteImpl
*clientSite
;
213 struct list rangelist
;
216 struct ITextRangeImpl
{
217 ITextRange ITextRange_iface
;
222 IRichEditOleImpl
*reOle
;
225 struct ITextSelectionImpl
{
226 ITextSelection ITextSelection_iface
;
229 IRichEditOleImpl
*reOle
;
232 typedef struct ITextFontImpl
{
233 ITextFont ITextFont_iface
;
237 textfont_prop_val props
[FONT_PROPID_LAST
];
240 typedef struct ITextParaImpl
{
241 ITextPara ITextPara_iface
;
247 struct IOleClientSiteImpl
{
248 IOleClientSite IOleClientSite_iface
;
249 IOleWindow IOleWindow_iface
;
250 IOleInPlaceSite IOleInPlaceSite_iface
;
253 IRichEditOleImpl
*reOle
;
256 static inline IRichEditOleImpl
*impl_from_IRichEditOle(IRichEditOle
*iface
)
258 return CONTAINING_RECORD(iface
, IRichEditOleImpl
, IRichEditOle_iface
);
261 static inline IRichEditOleImpl
*impl_from_ITextDocument(ITextDocument
*iface
)
263 return CONTAINING_RECORD(iface
, IRichEditOleImpl
, ITextDocument_iface
);
266 static inline IRichEditOleImpl
*impl_from_IUnknown(IUnknown
*iface
)
268 return CONTAINING_RECORD(iface
, IRichEditOleImpl
, IUnknown_inner
);
271 static inline IOleClientSiteImpl
*impl_from_IOleWindow(IOleWindow
*iface
)
273 return CONTAINING_RECORD(iface
, IOleClientSiteImpl
, IOleWindow_iface
);
276 static inline IOleClientSiteImpl
*impl_from_IOleInPlaceSite(IOleInPlaceSite
*iface
)
278 return CONTAINING_RECORD(iface
, IOleClientSiteImpl
, IOleInPlaceSite_iface
);
281 static inline ITextRangeImpl
*impl_from_ITextRange(ITextRange
*iface
)
283 return CONTAINING_RECORD(iface
, ITextRangeImpl
, ITextRange_iface
);
286 static inline ITextSelectionImpl
*impl_from_ITextSelection(ITextSelection
*iface
)
288 return CONTAINING_RECORD(iface
, ITextSelectionImpl
, ITextSelection_iface
);
291 static inline ITextFontImpl
*impl_from_ITextFont(ITextFont
*iface
)
293 return CONTAINING_RECORD(iface
, ITextFontImpl
, ITextFont_iface
);
296 static inline ITextParaImpl
*impl_from_ITextPara(ITextPara
*iface
)
298 return CONTAINING_RECORD(iface
, ITextParaImpl
, ITextPara_iface
);
301 static HRESULT
create_textfont(ITextRange
*, const ITextFontImpl
*, ITextFont
**);
302 static HRESULT
create_textpara(ITextRange
*, ITextPara
**);
304 static inline BOOL
is_equal_textfont_prop_value(enum textfont_prop_id propid
, textfont_prop_val
*left
,
305 textfont_prop_val
*right
)
313 case FONT_STRIKETHROUGH
:
315 case FONT_SUPERSCRIPT
:
317 return left
->l
== right
->l
;
319 return !strcmpW(left
->str
, right
->str
);
321 return left
->f
== right
->f
;
323 FIXME("unhandled font property %d\n", propid
);
328 static inline void init_textfont_prop_value(enum textfont_prop_id propid
, textfont_prop_val
*v
)
336 case FONT_STRIKETHROUGH
:
338 case FONT_SUPERSCRIPT
:
349 FIXME("unhandled font property %d\n", propid
);
355 static HRESULT
get_textfont_prop_for_pos(const IRichEditOleImpl
*reole
, int pos
, enum textfont_prop_id propid
,
356 textfont_prop_val
*value
)
361 memset(&fmt
, 0, sizeof(fmt
));
362 fmt
.cbSize
= sizeof(fmt
);
363 fmt
.dwMask
= textfont_prop_masks
[propid
];
365 ME_CursorFromCharOfs(reole
->editor
, pos
, &from
);
367 ME_MoveCursorChars(reole
->editor
, &to
, 1);
368 ME_GetCharFormat(reole
->editor
, &from
, &to
, &fmt
);
373 value
->l
= fmt
.dwEffects
& CFE_BOLD
? tomTrue
: tomFalse
;
376 value
->l
= fmt
.dwEffects
& CFE_AUTOCOLOR
? GetSysColor(COLOR_WINDOWTEXT
) : fmt
.crTextColor
;
379 value
->l
= fmt
.dwEffects
& CFE_ITALIC
? tomTrue
: tomFalse
;
385 /* this case is used exclusively by GetName() */
386 value
->str
= SysAllocString(fmt
.szFaceName
);
388 return E_OUTOFMEMORY
;
391 value
->f
= fmt
.yHeight
;
393 case FONT_STRIKETHROUGH
:
394 value
->l
= fmt
.dwEffects
& CFE_STRIKEOUT
? tomTrue
: tomFalse
;
397 value
->l
= fmt
.dwEffects
& CFE_SUBSCRIPT
? tomTrue
: tomFalse
;
399 case FONT_SUPERSCRIPT
:
400 value
->l
= fmt
.dwEffects
& CFE_SUPERSCRIPT
? tomTrue
: tomFalse
;
403 value
->l
= fmt
.dwEffects
& CFE_UNDERLINE
? tomTrue
: tomFalse
;
406 FIXME("unhandled font property %d\n", propid
);
413 static inline const IRichEditOleImpl
*get_range_reole(ITextRange
*range
)
415 IRichEditOleImpl
*reole
= NULL
;
416 ITextRange_QueryInterface(range
, &IID_Igetrichole
, (void**)&reole
);
420 static HRESULT
get_textfont_prop(const ITextFontImpl
*font
, enum textfont_prop_id propid
, textfont_prop_val
*value
)
422 const IRichEditOleImpl
*reole
;
427 /* when font is not attached to any range use cached values */
429 *value
= font
->props
[propid
];
433 if (!(reole
= get_range_reole(font
->range
)))
434 return CO_E_RELEASED
;
436 init_textfont_prop_value(propid
, value
);
438 ITextRange_GetStart(font
->range
, &start
);
439 ITextRange_GetEnd(font
->range
, &end
);
441 /* iterate trough a range to see if property value is consistent */
442 hr
= get_textfont_prop_for_pos(reole
, start
, propid
, &v
);
446 for (i
= start
+ 1; i
< end
; i
++) {
447 textfont_prop_val cur
;
449 hr
= get_textfont_prop_for_pos(reole
, i
, propid
, &cur
);
453 if (!is_equal_textfont_prop_value(propid
, &v
, &cur
))
461 static HRESULT
get_textfont_propf(const ITextFontImpl
*font
, enum textfont_prop_id propid
, FLOAT
*value
)
469 hr
= get_textfont_prop(font
, propid
, &v
);
474 static HRESULT
get_textfont_propl(const ITextFontImpl
*font
, enum textfont_prop_id propid
, LONG
*value
)
482 hr
= get_textfont_prop(font
, propid
, &v
);
487 static HRESULT WINAPI
IRichEditOleImpl_inner_fnQueryInterface(IUnknown
*iface
, REFIID riid
, LPVOID
*ppvObj
)
489 IRichEditOleImpl
*This
= impl_from_IUnknown(iface
);
491 TRACE("%p %s\n", This
, debugstr_guid(riid
));
494 if (IsEqualGUID(riid
, &IID_IUnknown
))
495 *ppvObj
= &This
->IUnknown_inner
;
496 else if (IsEqualGUID(riid
, &IID_IRichEditOle
))
497 *ppvObj
= &This
->IRichEditOle_iface
;
498 else if (IsEqualGUID(riid
, &IID_ITextDocument
))
499 *ppvObj
= &This
->ITextDocument_iface
;
502 IUnknown_AddRef((IUnknown
*)*ppvObj
);
505 FIXME("%p: unhandled interface %s\n", This
, debugstr_guid(riid
));
507 return E_NOINTERFACE
;
510 static ULONG WINAPI
IRichEditOleImpl_inner_fnAddRef(IUnknown
*iface
)
512 IRichEditOleImpl
*This
= impl_from_IUnknown(iface
);
513 ULONG ref
= InterlockedIncrement(&This
->ref
);
515 TRACE("%p ref = %u\n", This
, ref
);
520 static ULONG WINAPI
IRichEditOleImpl_inner_fnRelease(IUnknown
*iface
)
522 IRichEditOleImpl
*This
= impl_from_IUnknown(iface
);
523 ULONG ref
= InterlockedDecrement(&This
->ref
);
525 TRACE ("%p ref=%u\n", This
, ref
);
529 ITextRangeImpl
*txtRge
;
531 TRACE("Destroying %p\n", This
);
532 This
->txtSel
->reOle
= NULL
;
533 This
->editor
->reOle
= NULL
;
534 ITextSelection_Release(&This
->txtSel
->ITextSelection_iface
);
535 IOleClientSite_Release(&This
->clientSite
->IOleClientSite_iface
);
536 LIST_FOR_EACH_ENTRY(txtRge
, &This
->rangelist
, ITextRangeImpl
, entry
)
537 txtRge
->reOle
= NULL
;
543 static const IUnknownVtbl reo_unk_vtbl
=
545 IRichEditOleImpl_inner_fnQueryInterface
,
546 IRichEditOleImpl_inner_fnAddRef
,
547 IRichEditOleImpl_inner_fnRelease
550 static HRESULT WINAPI
551 IRichEditOle_fnQueryInterface(IRichEditOle
*me
, REFIID riid
, LPVOID
*ppvObj
)
553 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
554 return IUnknown_QueryInterface(This
->outer_unk
, riid
, ppvObj
);
558 IRichEditOle_fnAddRef(IRichEditOle
*me
)
560 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
561 return IUnknown_AddRef(This
->outer_unk
);
565 IRichEditOle_fnRelease(IRichEditOle
*me
)
567 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
568 return IUnknown_Release(This
->outer_unk
);
571 static HRESULT WINAPI
572 IRichEditOle_fnActivateAs(IRichEditOle
*me
, REFCLSID rclsid
, REFCLSID rclsidAs
)
574 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
575 FIXME("stub %p\n",This
);
579 static HRESULT WINAPI
580 IRichEditOle_fnContextSensitiveHelp(IRichEditOle
*me
, BOOL fEnterMode
)
582 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
583 FIXME("stub %p\n",This
);
587 static HRESULT WINAPI
588 IRichEditOle_fnConvertObject(IRichEditOle
*me
, LONG iob
,
589 REFCLSID rclsidNew
, LPCSTR lpstrUserTypeNew
)
591 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
592 FIXME("stub %p\n",This
);
596 static inline IOleClientSiteImpl
*impl_from_IOleClientSite(IOleClientSite
*iface
)
598 return CONTAINING_RECORD(iface
, IOleClientSiteImpl
, IOleClientSite_iface
);
601 static HRESULT WINAPI
602 IOleClientSite_fnQueryInterface(IOleClientSite
*me
, REFIID riid
, LPVOID
*ppvObj
)
604 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(me
);
605 TRACE("%p %s\n", me
, debugstr_guid(riid
) );
608 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
609 IsEqualGUID(riid
, &IID_IOleClientSite
))
611 else if (IsEqualGUID(riid
, &IID_IOleWindow
))
612 *ppvObj
= &This
->IOleWindow_iface
;
613 else if (IsEqualGUID(riid
, &IID_IOleInPlaceSite
))
614 *ppvObj
= &This
->IOleInPlaceSite_iface
;
617 IOleClientSite_AddRef(me
);
620 FIXME("%p: unhandled interface %s\n", me
, debugstr_guid(riid
) );
622 return E_NOINTERFACE
;
625 static ULONG WINAPI
IOleClientSite_fnAddRef(IOleClientSite
*iface
)
627 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
628 return InterlockedIncrement(&This
->ref
);
631 static ULONG WINAPI
IOleClientSite_fnRelease(IOleClientSite
*iface
)
633 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
634 ULONG ref
= InterlockedDecrement(&This
->ref
);
640 static HRESULT WINAPI
IOleClientSite_fnSaveObject(IOleClientSite
*iface
)
642 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
644 return CO_E_RELEASED
;
646 FIXME("stub %p\n", iface
);
651 static HRESULT WINAPI
IOleClientSite_fnGetMoniker(IOleClientSite
*iface
, DWORD dwAssign
,
652 DWORD dwWhichMoniker
, IMoniker
**ppmk
)
654 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
656 return CO_E_RELEASED
;
658 FIXME("stub %p\n", iface
);
662 static HRESULT WINAPI
IOleClientSite_fnGetContainer(IOleClientSite
*iface
,
663 IOleContainer
**ppContainer
)
665 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
667 return CO_E_RELEASED
;
669 FIXME("stub %p\n", iface
);
673 static HRESULT WINAPI
IOleClientSite_fnShowObject(IOleClientSite
*iface
)
675 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
677 return CO_E_RELEASED
;
679 FIXME("stub %p\n", iface
);
683 static HRESULT WINAPI
IOleClientSite_fnOnShowWindow(IOleClientSite
*iface
, BOOL fShow
)
685 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
687 return CO_E_RELEASED
;
689 FIXME("stub %p\n", iface
);
693 static HRESULT WINAPI
IOleClientSite_fnRequestNewObjectLayout(IOleClientSite
*iface
)
695 IOleClientSiteImpl
*This
= impl_from_IOleClientSite(iface
);
697 return CO_E_RELEASED
;
699 FIXME("stub %p\n", iface
);
703 static const IOleClientSiteVtbl ocst
= {
704 IOleClientSite_fnQueryInterface
,
705 IOleClientSite_fnAddRef
,
706 IOleClientSite_fnRelease
,
707 IOleClientSite_fnSaveObject
,
708 IOleClientSite_fnGetMoniker
,
709 IOleClientSite_fnGetContainer
,
710 IOleClientSite_fnShowObject
,
711 IOleClientSite_fnOnShowWindow
,
712 IOleClientSite_fnRequestNewObjectLayout
715 /* IOleWindow interface */
716 static HRESULT WINAPI
IOleWindow_fnQueryInterface(IOleWindow
*iface
, REFIID riid
, void **ppvObj
)
718 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
719 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppvObj
);
722 static ULONG WINAPI
IOleWindow_fnAddRef(IOleWindow
*iface
)
724 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
725 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
728 static ULONG WINAPI
IOleWindow_fnRelease(IOleWindow
*iface
)
730 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
731 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
734 static HRESULT WINAPI
IOleWindow_fnContextSensitiveHelp(IOleWindow
*iface
, BOOL fEnterMode
)
736 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
737 FIXME("not implemented: (%p)->(%d)\n", This
, fEnterMode
);
741 static HRESULT WINAPI
IOleWindow_fnGetWindow(IOleWindow
*iface
, HWND
*phwnd
)
743 IOleClientSiteImpl
*This
= impl_from_IOleWindow(iface
);
744 TRACE("(%p)->(%p)\n", This
, phwnd
);
749 *phwnd
= This
->reOle
->editor
->hWnd
;
753 static const IOleWindowVtbl olewinvt
= {
754 IOleWindow_fnQueryInterface
,
756 IOleWindow_fnRelease
,
757 IOleWindow_fnGetWindow
,
758 IOleWindow_fnContextSensitiveHelp
761 /* IOleInPlaceSite interface */
762 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnQueryInterface(IOleInPlaceSite
*iface
, REFIID riid
, void **ppvObj
)
764 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
765 return IOleClientSite_QueryInterface(&This
->IOleClientSite_iface
, riid
, ppvObj
);
768 static ULONG STDMETHODCALLTYPE
IOleInPlaceSite_fnAddRef(IOleInPlaceSite
*iface
)
770 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
771 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
774 static ULONG STDMETHODCALLTYPE
IOleInPlaceSite_fnRelease(IOleInPlaceSite
*iface
)
776 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
777 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
780 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnGetWindow(IOleInPlaceSite
*iface
, HWND
*phwnd
)
782 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
783 return IOleWindow_GetWindow(&This
->IOleWindow_iface
, phwnd
);
786 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnContextSensitiveHelp(IOleInPlaceSite
*iface
, BOOL fEnterMode
)
788 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
789 return IOleWindow_ContextSensitiveHelp(&This
->IOleWindow_iface
, fEnterMode
);
792 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnCanInPlaceActivate(IOleInPlaceSite
*iface
)
794 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
795 FIXME("not implemented: (%p)\n", This
);
799 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnInPlaceActivate(IOleInPlaceSite
*iface
)
801 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
802 FIXME("not implemented: (%p)\n", This
);
806 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnUIActivate(IOleInPlaceSite
*iface
)
808 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
809 FIXME("not implemented: (%p)\n", This
);
813 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnGetWindowContext(IOleInPlaceSite
*iface
, IOleInPlaceFrame
**ppFrame
,
814 IOleInPlaceUIWindow
**ppDoc
, LPRECT lprcPosRect
,
815 LPRECT lprcClipRect
, LPOLEINPLACEFRAMEINFO lpFrameInfo
)
817 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
818 FIXME("not implemented: (%p)->(%p %p %p %p %p)\n", This
, ppFrame
, ppDoc
, lprcPosRect
, lprcClipRect
, lpFrameInfo
);
822 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnScroll(IOleInPlaceSite
*iface
, SIZE scrollExtent
)
824 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
825 FIXME("not implemented: (%p)\n", This
);
829 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnUIDeactivate(IOleInPlaceSite
*iface
, BOOL fUndoable
)
831 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
832 FIXME("not implemented: (%p)->(%d)\n", This
, fUndoable
);
836 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnInPlaceDeactivate(IOleInPlaceSite
*iface
)
838 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
839 FIXME("not implemented: (%p)\n", This
);
843 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnDiscardUndoState(IOleInPlaceSite
*iface
)
845 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
846 FIXME("not implemented: (%p)\n", This
);
850 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnDeactivateAndUndo(IOleInPlaceSite
*iface
)
852 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
853 FIXME("not implemented: (%p)\n", This
);
857 static HRESULT STDMETHODCALLTYPE
IOleInPlaceSite_fnOnPosRectChange(IOleInPlaceSite
*iface
, LPCRECT lprcPosRect
)
859 IOleClientSiteImpl
*This
= impl_from_IOleInPlaceSite(iface
);
860 FIXME("not implemented: (%p)->(%p)\n", This
, lprcPosRect
);
864 static const IOleInPlaceSiteVtbl olestvt
=
866 IOleInPlaceSite_fnQueryInterface
,
867 IOleInPlaceSite_fnAddRef
,
868 IOleInPlaceSite_fnRelease
,
869 IOleInPlaceSite_fnGetWindow
,
870 IOleInPlaceSite_fnContextSensitiveHelp
,
871 IOleInPlaceSite_fnCanInPlaceActivate
,
872 IOleInPlaceSite_fnOnInPlaceActivate
,
873 IOleInPlaceSite_fnOnUIActivate
,
874 IOleInPlaceSite_fnGetWindowContext
,
875 IOleInPlaceSite_fnScroll
,
876 IOleInPlaceSite_fnOnUIDeactivate
,
877 IOleInPlaceSite_fnOnInPlaceDeactivate
,
878 IOleInPlaceSite_fnDiscardUndoState
,
879 IOleInPlaceSite_fnDeactivateAndUndo
,
880 IOleInPlaceSite_fnOnPosRectChange
883 static IOleClientSiteImpl
*
884 CreateOleClientSite(IRichEditOleImpl
*reOle
)
886 IOleClientSiteImpl
*clientSite
= heap_alloc(sizeof *clientSite
);
890 clientSite
->IOleClientSite_iface
.lpVtbl
= &ocst
;
891 clientSite
->IOleWindow_iface
.lpVtbl
= &olewinvt
;
892 clientSite
->IOleInPlaceSite_iface
.lpVtbl
= &olestvt
;
894 clientSite
->reOle
= reOle
;
898 static HRESULT WINAPI
899 IRichEditOle_fnGetClientSite(IRichEditOle
*me
,
900 LPOLECLIENTSITE
*lplpolesite
)
902 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
904 TRACE("%p,%p\n",This
, lplpolesite
);
908 *lplpolesite
= &This
->clientSite
->IOleClientSite_iface
;
909 IOleClientSite_AddRef(*lplpolesite
);
913 static HRESULT WINAPI
914 IRichEditOle_fnGetClipboardData(IRichEditOle
*me
, CHARRANGE
*lpchrg
,
915 DWORD reco
, LPDATAOBJECT
*lplpdataobj
)
917 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
921 TRACE("(%p,%p,%d)\n",This
, lpchrg
, reco
);
925 int nFrom
, nTo
, nStartCur
= ME_GetSelectionOfs(This
->editor
, &nFrom
, &nTo
);
926 start
= This
->editor
->pCursors
[nStartCur
];
927 nChars
= nTo
- nFrom
;
929 ME_CursorFromCharOfs(This
->editor
, lpchrg
->cpMin
, &start
);
930 nChars
= lpchrg
->cpMax
- lpchrg
->cpMin
;
932 return ME_GetDataObject(This
->editor
, &start
, nChars
, lplpdataobj
);
935 static LONG WINAPI
IRichEditOle_fnGetLinkCount(IRichEditOle
*me
)
937 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
938 FIXME("stub %p\n",This
);
942 static HRESULT WINAPI
943 IRichEditOle_fnGetObject(IRichEditOle
*me
, LONG iob
,
944 REOBJECT
*lpreobject
, DWORD dwFlags
)
946 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
947 FIXME("stub %p\n",This
);
952 IRichEditOle_fnGetObjectCount(IRichEditOle
*me
)
954 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
955 FIXME("stub %p\n",This
);
959 static HRESULT WINAPI
960 IRichEditOle_fnHandsOffStorage(IRichEditOle
*me
, LONG iob
)
962 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
963 FIXME("stub %p\n",This
);
967 static HRESULT WINAPI
968 IRichEditOle_fnImportDataObject(IRichEditOle
*me
, LPDATAOBJECT lpdataobj
,
969 CLIPFORMAT cf
, HGLOBAL hMetaPict
)
971 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
972 FIXME("stub %p\n",This
);
976 static HRESULT WINAPI
977 IRichEditOle_fnInPlaceDeactivate(IRichEditOle
*me
)
979 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
980 FIXME("stub %p\n",This
);
984 static HRESULT WINAPI
985 IRichEditOle_fnInsertObject(IRichEditOle
*me
, REOBJECT
*reo
)
987 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
988 TRACE("(%p,%p)\n", This
, reo
);
990 if (reo
->cbStruct
< sizeof(*reo
)) return STG_E_INVALIDPARAMETER
;
992 ME_InsertOLEFromCursor(This
->editor
, reo
, 0);
993 ME_CommitUndo(This
->editor
);
994 ME_UpdateRepaint(This
->editor
, FALSE
);
998 static HRESULT WINAPI
IRichEditOle_fnSaveCompleted(IRichEditOle
*me
, LONG iob
,
1001 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
1002 FIXME("stub %p\n",This
);
1006 static HRESULT WINAPI
1007 IRichEditOle_fnSetDvaspect(IRichEditOle
*me
, LONG iob
, DWORD dvaspect
)
1009 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
1010 FIXME("stub %p\n",This
);
1014 static HRESULT WINAPI
IRichEditOle_fnSetHostNames(IRichEditOle
*me
,
1015 LPCSTR lpstrContainerApp
, LPCSTR lpstrContainerObj
)
1017 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
1018 FIXME("stub %p %s %s\n",This
, lpstrContainerApp
, lpstrContainerObj
);
1022 static HRESULT WINAPI
1023 IRichEditOle_fnSetLinkAvailable(IRichEditOle
*me
, LONG iob
, BOOL fAvailable
)
1025 IRichEditOleImpl
*This
= impl_from_IRichEditOle(me
);
1026 FIXME("stub %p\n",This
);
1030 static const IRichEditOleVtbl revt
= {
1031 IRichEditOle_fnQueryInterface
,
1032 IRichEditOle_fnAddRef
,
1033 IRichEditOle_fnRelease
,
1034 IRichEditOle_fnGetClientSite
,
1035 IRichEditOle_fnGetObjectCount
,
1036 IRichEditOle_fnGetLinkCount
,
1037 IRichEditOle_fnGetObject
,
1038 IRichEditOle_fnInsertObject
,
1039 IRichEditOle_fnConvertObject
,
1040 IRichEditOle_fnActivateAs
,
1041 IRichEditOle_fnSetHostNames
,
1042 IRichEditOle_fnSetLinkAvailable
,
1043 IRichEditOle_fnSetDvaspect
,
1044 IRichEditOle_fnHandsOffStorage
,
1045 IRichEditOle_fnSaveCompleted
,
1046 IRichEditOle_fnInPlaceDeactivate
,
1047 IRichEditOle_fnContextSensitiveHelp
,
1048 IRichEditOle_fnGetClipboardData
,
1049 IRichEditOle_fnImportDataObject
1052 /* ITextRange interface */
1053 static HRESULT WINAPI
ITextRange_fnQueryInterface(ITextRange
*me
, REFIID riid
, void **ppvObj
)
1055 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1058 if (IsEqualGUID(riid
, &IID_IUnknown
)
1059 || IsEqualGUID(riid
, &IID_IDispatch
)
1060 || IsEqualGUID(riid
, &IID_ITextRange
))
1063 ITextRange_AddRef(me
);
1066 else if (IsEqualGUID(riid
, &IID_Igetrichole
))
1068 *ppvObj
= This
->reOle
;
1072 return E_NOINTERFACE
;
1075 static ULONG WINAPI
ITextRange_fnAddRef(ITextRange
*me
)
1077 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1078 return InterlockedIncrement(&This
->ref
);
1081 static ULONG WINAPI
ITextRange_fnRelease(ITextRange
*me
)
1083 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1084 ULONG ref
= InterlockedDecrement(&This
->ref
);
1086 TRACE ("%p ref=%u\n", This
, ref
);
1091 list_remove(&This
->entry
);
1099 static HRESULT WINAPI
ITextRange_fnGetTypeInfoCount(ITextRange
*me
, UINT
*pctinfo
)
1101 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1102 TRACE("(%p)->(%p)\n", This
, pctinfo
);
1107 static HRESULT WINAPI
ITextRange_fnGetTypeInfo(ITextRange
*me
, UINT iTInfo
, LCID lcid
,
1108 ITypeInfo
**ppTInfo
)
1110 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1113 TRACE("(%p)->(%u,%d,%p)\n", This
, iTInfo
, lcid
, ppTInfo
);
1115 hr
= get_typeinfo(ITextRange_tid
, ppTInfo
);
1117 ITypeInfo_AddRef(*ppTInfo
);
1121 static HRESULT WINAPI
ITextRange_fnGetIDsOfNames(ITextRange
*me
, REFIID riid
, LPOLESTR
*rgszNames
,
1122 UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1124 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1128 TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This
, riid
, rgszNames
, cNames
, lcid
,
1131 hr
= get_typeinfo(ITextRange_tid
, &ti
);
1133 hr
= ITypeInfo_GetIDsOfNames(ti
, rgszNames
, cNames
, rgDispId
);
1137 static HRESULT WINAPI
ITextRange_fnInvoke(ITextRange
*me
, DISPID dispIdMember
, REFIID riid
,
1138 LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
,
1139 VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
,
1142 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1146 TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This
, dispIdMember
, riid
, lcid
,
1147 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1149 hr
= get_typeinfo(ITextRange_tid
, &ti
);
1151 hr
= ITypeInfo_Invoke(ti
, me
, dispIdMember
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1155 static HRESULT WINAPI
ITextRange_fnGetText(ITextRange
*me
, BSTR
*pbstr
)
1157 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1159 FIXME("(%p)->(%p): stub\n", This
, pbstr
);
1162 return CO_E_RELEASED
;
1165 return E_INVALIDARG
;
1171 static HRESULT WINAPI
ITextRange_fnSetText(ITextRange
*me
, BSTR bstr
)
1173 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1175 return CO_E_RELEASED
;
1177 FIXME("not implemented %p\n", This
);
1181 static HRESULT
range_GetChar(ME_TextEditor
*editor
, ME_Cursor
*cursor
, LONG
*pch
)
1185 ME_GetTextW(editor
, wch
, 1, cursor
, 1, FALSE
, cursor
->pRun
->next
->type
== diTextEnd
);
1191 static HRESULT WINAPI
ITextRange_fnGetChar(ITextRange
*me
, LONG
*pch
)
1193 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1197 return CO_E_RELEASED
;
1200 return E_INVALIDARG
;
1202 ME_CursorFromCharOfs(This
->reOle
->editor
, This
->start
, &cursor
);
1203 return range_GetChar(This
->reOle
->editor
, &cursor
, pch
);
1206 static HRESULT WINAPI
ITextRange_fnSetChar(ITextRange
*me
, LONG ch
)
1208 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1210 return CO_E_RELEASED
;
1212 FIXME("not implemented %p\n", This
);
1216 static HRESULT
CreateITextRange(IRichEditOleImpl
*reOle
, LONG start
, LONG end
, ITextRange
** ppRange
);
1218 static HRESULT WINAPI
ITextRange_fnGetDuplicate(ITextRange
*me
, ITextRange
**ppRange
)
1220 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1222 return CO_E_RELEASED
;
1224 TRACE("%p %p\n", This
, ppRange
);
1226 return E_INVALIDARG
;
1228 return CreateITextRange(This
->reOle
, This
->start
, This
->end
, ppRange
);
1231 static HRESULT WINAPI
ITextRange_fnGetFormattedText(ITextRange
*me
, ITextRange
**ppRange
)
1233 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1235 return CO_E_RELEASED
;
1237 FIXME("not implemented %p\n", This
);
1241 static HRESULT WINAPI
ITextRange_fnSetFormattedText(ITextRange
*me
, ITextRange
*pRange
)
1243 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1245 return CO_E_RELEASED
;
1247 FIXME("not implemented %p\n", This
);
1251 static HRESULT WINAPI
ITextRange_fnGetStart(ITextRange
*me
, LONG
*start
)
1253 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1255 TRACE("(%p)->(%p)\n", This
, start
);
1258 return CO_E_RELEASED
;
1261 return E_INVALIDARG
;
1263 *start
= This
->start
;
1267 static HRESULT
textrange_setstart(const IRichEditOleImpl
*reole
, LONG value
, LONG
*start
, LONG
*end
)
1274 if (value
== *start
)
1277 if (value
<= *end
) {
1282 len
= ME_GetTextLength(reole
->editor
);
1283 *start
= *end
= value
> len
? len
: value
;
1287 static HRESULT WINAPI
ITextRange_fnSetStart(ITextRange
*me
, LONG value
)
1289 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1291 TRACE("(%p)->(%d)\n", This
, value
);
1294 return CO_E_RELEASED
;
1296 return textrange_setstart(This
->reOle
, value
, &This
->start
, &This
->end
);
1299 static HRESULT WINAPI
ITextRange_fnGetEnd(ITextRange
*me
, LONG
*end
)
1301 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1303 TRACE("(%p)->(%p)\n", This
, end
);
1306 return CO_E_RELEASED
;
1309 return E_INVALIDARG
;
1315 static HRESULT
textrange_setend(const IRichEditOleImpl
*reole
, LONG value
, LONG
*start
, LONG
*end
)
1322 if (value
< *start
) {
1323 *start
= *end
= max(0, value
);
1327 len
= ME_GetTextLength(reole
->editor
);
1328 *end
= value
> len
? len
+ 1 : value
;
1332 static HRESULT WINAPI
ITextRange_fnSetEnd(ITextRange
*me
, LONG value
)
1334 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1336 TRACE("(%p)->(%d)\n", This
, value
);
1339 return CO_E_RELEASED
;
1341 return textrange_setend(This
->reOle
, value
, &This
->start
, &This
->end
);
1344 static HRESULT WINAPI
ITextRange_fnGetFont(ITextRange
*me
, ITextFont
**font
)
1346 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1348 TRACE("(%p)->(%p)\n", This
, font
);
1351 return CO_E_RELEASED
;
1354 return E_INVALIDARG
;
1356 return create_textfont(me
, NULL
, font
);
1359 static HRESULT WINAPI
ITextRange_fnSetFont(ITextRange
*me
, ITextFont
*pFont
)
1361 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1363 return CO_E_RELEASED
;
1365 FIXME("not implemented %p\n", This
);
1369 static HRESULT WINAPI
ITextRange_fnGetPara(ITextRange
*me
, ITextPara
**para
)
1371 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1373 TRACE("(%p)->(%p)\n", This
, para
);
1376 return CO_E_RELEASED
;
1379 return E_INVALIDARG
;
1381 return create_textpara(me
, para
);
1384 static HRESULT WINAPI
ITextRange_fnSetPara(ITextRange
*me
, ITextPara
*pPara
)
1386 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1388 return CO_E_RELEASED
;
1390 FIXME("not implemented %p\n", This
);
1394 static HRESULT WINAPI
ITextRange_fnGetStoryLength(ITextRange
*me
, LONG
*pcch
)
1396 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1398 return CO_E_RELEASED
;
1400 FIXME("not implemented %p\n", This
);
1404 static HRESULT WINAPI
ITextRange_fnGetStoryType(ITextRange
*me
, LONG
*pValue
)
1406 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1408 return CO_E_RELEASED
;
1410 FIXME("not implemented %p\n", This
);
1414 static HRESULT
range_Collapse(LONG bStart
, LONG
*start
, LONG
*end
)
1419 if (bStart
== tomEnd
|| bStart
== tomFalse
)
1426 static HRESULT WINAPI
ITextRange_fnCollapse(ITextRange
*me
, LONG bStart
)
1428 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1430 return CO_E_RELEASED
;
1432 return range_Collapse(bStart
, &This
->start
, &This
->end
);
1435 static HRESULT WINAPI
ITextRange_fnExpand(ITextRange
*me
, LONG Unit
, LONG
*pDelta
)
1437 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1439 return CO_E_RELEASED
;
1441 FIXME("not implemented %p\n", This
);
1445 static HRESULT WINAPI
ITextRange_fnGetIndex(ITextRange
*me
, LONG Unit
, LONG
*pIndex
)
1447 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1449 return CO_E_RELEASED
;
1451 FIXME("not implemented %p\n", This
);
1455 static HRESULT WINAPI
ITextRange_fnSetIndex(ITextRange
*me
, LONG Unit
, LONG Index
,
1458 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1460 return CO_E_RELEASED
;
1462 FIXME("not implemented %p\n", This
);
1466 static HRESULT WINAPI
ITextRange_fnSetRange(ITextRange
*me
, LONG cpActive
, LONG cpOther
)
1468 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1470 return CO_E_RELEASED
;
1472 FIXME("not implemented %p\n", This
);
1476 static HRESULT WINAPI
ITextRange_fnInRange(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1478 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1480 return CO_E_RELEASED
;
1482 FIXME("not implemented %p\n", This
);
1486 static HRESULT WINAPI
ITextRange_fnInStory(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1488 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1490 return CO_E_RELEASED
;
1492 FIXME("not implemented %p\n", This
);
1496 static HRESULT WINAPI
ITextRange_fnIsEqual(ITextRange
*me
, ITextRange
*pRange
, LONG
*pb
)
1498 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1500 return CO_E_RELEASED
;
1502 FIXME("not implemented %p\n", This
);
1506 static HRESULT WINAPI
ITextRange_fnSelect(ITextRange
*me
)
1508 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1510 return CO_E_RELEASED
;
1512 FIXME("not implemented %p\n", This
);
1516 static HRESULT WINAPI
ITextRange_fnStartOf(ITextRange
*me
, LONG Unit
, LONG Extend
,
1519 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1521 return CO_E_RELEASED
;
1523 FIXME("not implemented %p\n", This
);
1527 static HRESULT WINAPI
ITextRange_fnEndOf(ITextRange
*me
, LONG Unit
, LONG Extend
,
1530 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1532 return CO_E_RELEASED
;
1534 FIXME("not implemented %p\n", This
);
1538 static HRESULT WINAPI
ITextRange_fnMove(ITextRange
*me
, LONG Unit
, LONG Count
, LONG
*pDelta
)
1540 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1542 return CO_E_RELEASED
;
1544 FIXME("not implemented %p\n", This
);
1548 static HRESULT WINAPI
ITextRange_fnMoveStart(ITextRange
*me
, LONG Unit
, LONG Count
,
1551 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1553 return CO_E_RELEASED
;
1555 FIXME("not implemented %p\n", This
);
1559 static HRESULT WINAPI
ITextRange_fnMoveEnd(ITextRange
*me
, LONG Unit
, LONG Count
,
1562 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1564 return CO_E_RELEASED
;
1566 FIXME("not implemented %p\n", This
);
1570 static HRESULT WINAPI
ITextRange_fnMoveWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1573 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1575 return CO_E_RELEASED
;
1577 FIXME("not implemented %p\n", This
);
1581 static HRESULT WINAPI
ITextRange_fnMoveStartWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1584 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1586 return CO_E_RELEASED
;
1588 FIXME("not implemented %p\n", This
);
1592 static HRESULT WINAPI
ITextRange_fnMoveEndWhile(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1595 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1597 return CO_E_RELEASED
;
1599 FIXME("not implemented %p\n", This
);
1603 static HRESULT WINAPI
ITextRange_fnMoveUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1606 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1608 return CO_E_RELEASED
;
1610 FIXME("not implemented %p\n", This
);
1614 static HRESULT WINAPI
ITextRange_fnMoveStartUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1617 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1619 return CO_E_RELEASED
;
1621 FIXME("not implemented %p\n", This
);
1625 static HRESULT WINAPI
ITextRange_fnMoveEndUntil(ITextRange
*me
, VARIANT
*Cset
, LONG Count
,
1628 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1630 return CO_E_RELEASED
;
1632 FIXME("not implemented %p\n", This
);
1636 static HRESULT WINAPI
ITextRange_fnFindText(ITextRange
*me
, BSTR bstr
, LONG cch
, LONG Flags
,
1639 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1641 return CO_E_RELEASED
;
1643 FIXME("not implemented %p\n", This
);
1647 static HRESULT WINAPI
ITextRange_fnFindTextStart(ITextRange
*me
, BSTR bstr
, LONG cch
,
1648 LONG Flags
, LONG
*pLength
)
1650 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1652 return CO_E_RELEASED
;
1654 FIXME("not implemented %p\n", This
);
1658 static HRESULT WINAPI
ITextRange_fnFindTextEnd(ITextRange
*me
, BSTR bstr
, LONG cch
,
1659 LONG Flags
, LONG
*pLength
)
1661 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1663 return CO_E_RELEASED
;
1665 FIXME("not implemented %p\n", This
);
1669 static HRESULT WINAPI
ITextRange_fnDelete(ITextRange
*me
, LONG Unit
, LONG Count
,
1672 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1674 return CO_E_RELEASED
;
1676 FIXME("not implemented %p\n", This
);
1680 static HRESULT WINAPI
ITextRange_fnCut(ITextRange
*me
, VARIANT
*pVar
)
1682 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1684 return CO_E_RELEASED
;
1686 FIXME("not implemented %p\n", This
);
1690 static HRESULT WINAPI
ITextRange_fnCopy(ITextRange
*me
, VARIANT
*pVar
)
1692 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1694 return CO_E_RELEASED
;
1696 FIXME("not implemented %p\n", This
);
1700 static HRESULT WINAPI
ITextRange_fnPaste(ITextRange
*me
, VARIANT
*pVar
, LONG Format
)
1702 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1704 return CO_E_RELEASED
;
1706 FIXME("not implemented %p\n", This
);
1710 static HRESULT WINAPI
ITextRange_fnCanPaste(ITextRange
*me
, VARIANT
*pVar
, LONG Format
,
1713 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1715 return CO_E_RELEASED
;
1717 FIXME("not implemented %p\n", This
);
1721 static HRESULT WINAPI
ITextRange_fnCanEdit(ITextRange
*me
, LONG
*pb
)
1723 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1725 return CO_E_RELEASED
;
1727 FIXME("not implemented %p\n", This
);
1731 static HRESULT WINAPI
ITextRange_fnChangeCase(ITextRange
*me
, LONG Type
)
1733 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1735 return CO_E_RELEASED
;
1737 FIXME("not implemented %p\n", This
);
1741 static HRESULT WINAPI
ITextRange_fnGetPoint(ITextRange
*me
, LONG Type
, LONG
*cx
, LONG
*cy
)
1743 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1745 return CO_E_RELEASED
;
1747 FIXME("not implemented %p\n", This
);
1751 static HRESULT WINAPI
ITextRange_fnSetPoint(ITextRange
*me
, LONG x
, LONG y
, LONG Type
,
1754 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1756 return CO_E_RELEASED
;
1758 FIXME("not implemented %p\n", This
);
1762 static HRESULT WINAPI
ITextRange_fnScrollIntoView(ITextRange
*me
, LONG Value
)
1764 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1766 return CO_E_RELEASED
;
1768 FIXME("not implemented %p\n", This
);
1772 static HRESULT WINAPI
ITextRange_fnGetEmbeddedObject(ITextRange
*me
, IUnknown
**ppv
)
1774 ITextRangeImpl
*This
= impl_from_ITextRange(me
);
1776 return CO_E_RELEASED
;
1778 FIXME("not implemented %p\n", This
);
1782 static const ITextRangeVtbl trvt
= {
1783 ITextRange_fnQueryInterface
,
1784 ITextRange_fnAddRef
,
1785 ITextRange_fnRelease
,
1786 ITextRange_fnGetTypeInfoCount
,
1787 ITextRange_fnGetTypeInfo
,
1788 ITextRange_fnGetIDsOfNames
,
1789 ITextRange_fnInvoke
,
1790 ITextRange_fnGetText
,
1791 ITextRange_fnSetText
,
1792 ITextRange_fnGetChar
,
1793 ITextRange_fnSetChar
,
1794 ITextRange_fnGetDuplicate
,
1795 ITextRange_fnGetFormattedText
,
1796 ITextRange_fnSetFormattedText
,
1797 ITextRange_fnGetStart
,
1798 ITextRange_fnSetStart
,
1799 ITextRange_fnGetEnd
,
1800 ITextRange_fnSetEnd
,
1801 ITextRange_fnGetFont
,
1802 ITextRange_fnSetFont
,
1803 ITextRange_fnGetPara
,
1804 ITextRange_fnSetPara
,
1805 ITextRange_fnGetStoryLength
,
1806 ITextRange_fnGetStoryType
,
1807 ITextRange_fnCollapse
,
1808 ITextRange_fnExpand
,
1809 ITextRange_fnGetIndex
,
1810 ITextRange_fnSetIndex
,
1811 ITextRange_fnSetRange
,
1812 ITextRange_fnInRange
,
1813 ITextRange_fnInStory
,
1814 ITextRange_fnIsEqual
,
1815 ITextRange_fnSelect
,
1816 ITextRange_fnStartOf
,
1819 ITextRange_fnMoveStart
,
1820 ITextRange_fnMoveEnd
,
1821 ITextRange_fnMoveWhile
,
1822 ITextRange_fnMoveStartWhile
,
1823 ITextRange_fnMoveEndWhile
,
1824 ITextRange_fnMoveUntil
,
1825 ITextRange_fnMoveStartUntil
,
1826 ITextRange_fnMoveEndUntil
,
1827 ITextRange_fnFindText
,
1828 ITextRange_fnFindTextStart
,
1829 ITextRange_fnFindTextEnd
,
1830 ITextRange_fnDelete
,
1834 ITextRange_fnCanPaste
,
1835 ITextRange_fnCanEdit
,
1836 ITextRange_fnChangeCase
,
1837 ITextRange_fnGetPoint
,
1838 ITextRange_fnSetPoint
,
1839 ITextRange_fnScrollIntoView
,
1840 ITextRange_fnGetEmbeddedObject
1844 static HRESULT WINAPI
TextFont_QueryInterface(ITextFont
*iface
, REFIID riid
, void **ppv
)
1846 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1848 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
1850 if (IsEqualIID(riid
, &IID_ITextFont
) ||
1851 IsEqualIID(riid
, &IID_IDispatch
) ||
1852 IsEqualIID(riid
, &IID_IUnknown
))
1855 ITextFont_AddRef(iface
);
1860 return E_NOINTERFACE
;
1863 static ULONG WINAPI
TextFont_AddRef(ITextFont
*iface
)
1865 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1866 ULONG ref
= InterlockedIncrement(&This
->ref
);
1867 TRACE("(%p)->(%u)\n", This
, ref
);
1871 static ULONG WINAPI
TextFont_Release(ITextFont
*iface
)
1873 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1874 ULONG ref
= InterlockedDecrement(&This
->ref
);
1876 TRACE("(%p)->(%u)\n", This
, ref
);
1881 ITextRange_Release(This
->range
);
1882 SysFreeString(This
->props
[FONT_NAME
].str
);
1889 static HRESULT WINAPI
TextFont_GetTypeInfoCount(ITextFont
*iface
, UINT
*pctinfo
)
1891 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1892 TRACE("(%p)->(%p)\n", This
, pctinfo
);
1897 static HRESULT WINAPI
TextFont_GetTypeInfo(ITextFont
*iface
, UINT iTInfo
, LCID lcid
,
1898 ITypeInfo
**ppTInfo
)
1900 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1903 TRACE("(%p)->(%u,%d,%p)\n", This
, iTInfo
, lcid
, ppTInfo
);
1905 hr
= get_typeinfo(ITextFont_tid
, ppTInfo
);
1907 ITypeInfo_AddRef(*ppTInfo
);
1911 static HRESULT WINAPI
TextFont_GetIDsOfNames(ITextFont
*iface
, REFIID riid
,
1912 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
1914 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1918 TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This
, riid
, rgszNames
, cNames
, lcid
,
1921 hr
= get_typeinfo(ITextFont_tid
, &ti
);
1923 hr
= ITypeInfo_GetIDsOfNames(ti
, rgszNames
, cNames
, rgDispId
);
1927 static HRESULT WINAPI
TextFont_Invoke(
1929 DISPID dispIdMember
,
1933 DISPPARAMS
*pDispParams
,
1934 VARIANT
*pVarResult
,
1935 EXCEPINFO
*pExcepInfo
,
1938 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1942 TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This
, dispIdMember
, riid
, lcid
,
1943 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1945 hr
= get_typeinfo(ITextFont_tid
, &ti
);
1947 hr
= ITypeInfo_Invoke(ti
, iface
, dispIdMember
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
1951 static HRESULT WINAPI
TextFont_GetDuplicate(ITextFont
*iface
, ITextFont
**ret
)
1953 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1955 TRACE("(%p)->(%p)\n", This
, ret
);
1958 return E_INVALIDARG
;
1961 if (This
->range
&& !get_range_reole(This
->range
))
1962 return CO_E_RELEASED
;
1964 return create_textfont(NULL
, This
, ret
);
1967 static HRESULT WINAPI
TextFont_SetDuplicate(ITextFont
*iface
, ITextFont
*pFont
)
1969 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1970 FIXME("(%p)->(%p): stub\n", This
, pFont
);
1974 static HRESULT WINAPI
TextFont_CanChange(ITextFont
*iface
, LONG
*ret
)
1976 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1977 FIXME("(%p)->(%p): stub\n", This
, ret
);
1981 static HRESULT WINAPI
TextFont_IsEqual(ITextFont
*iface
, ITextFont
*font
, LONG
*ret
)
1983 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
1984 FIXME("(%p)->(%p %p): stub\n", This
, font
, ret
);
1988 static void textfont_reset_to_default(ITextFontImpl
*font
)
1990 enum textfont_prop_id id
;
1992 for (id
= FONT_ALLCAPS
; id
< FONT_PROPID_LAST
; id
++) {
1996 case FONT_ANIMATION
:
2003 case FONT_PROTECTED
:
2005 case FONT_SMALLCAPS
:
2006 case FONT_STRIKETHROUGH
:
2007 case FONT_SUBSCRIPT
:
2008 case FONT_SUPERSCRIPT
:
2009 case FONT_UNDERLINE
:
2010 font
->props
[id
].l
= tomFalse
;
2012 case FONT_BACKCOLOR
:
2013 case FONT_FORECOLOR
:
2014 font
->props
[id
].l
= tomAutoColor
;
2020 font
->props
[id
].f
= 0.0;
2023 font
->props
[id
].l
= GetSystemDefaultLCID();
2026 static const WCHAR sysW
[] = {'S','y','s','t','e','m',0};
2027 SysFreeString(font
->props
[id
].str
);
2028 font
->props
[id
].str
= SysAllocString(sysW
);
2032 font
->props
[id
].l
= FW_NORMAL
;
2035 FIXME("font property %d not handled\n", id
);
2040 static void textfont_reset_to_undefined(ITextFontImpl
*font
)
2042 enum textfont_prop_id id
;
2044 for (id
= FONT_ALLCAPS
; id
< FONT_PROPID_LAST
; id
++) {
2048 case FONT_ANIMATION
:
2055 case FONT_PROTECTED
:
2057 case FONT_SMALLCAPS
:
2058 case FONT_STRIKETHROUGH
:
2059 case FONT_SUBSCRIPT
:
2060 case FONT_SUPERSCRIPT
:
2061 case FONT_UNDERLINE
:
2062 case FONT_BACKCOLOR
:
2063 case FONT_FORECOLOR
:
2066 font
->props
[id
].l
= tomUndefined
;
2072 font
->props
[id
].f
= tomUndefined
;
2077 FIXME("font property %d not handled\n", id
);
2082 static HRESULT WINAPI
TextFont_Reset(ITextFont
*iface
, LONG value
)
2084 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2086 TRACE("(%p)->(%d)\n", This
, value
);
2088 /* If font is attached to a range, released or not, we can't
2089 reset to undefined */
2091 if (!get_range_reole(This
->range
))
2092 return CO_E_RELEASED
;
2094 if (value
== tomUndefined
)
2095 return E_INVALIDARG
;
2100 /* reset to global defaults */
2102 textfont_reset_to_default(This
);
2104 /* all properties are set to tomUndefined, font name is retained */
2106 textfont_reset_to_undefined(This
);
2111 FIXME("reset mode %d not supported\n", value
);
2115 static HRESULT WINAPI
TextFont_GetStyle(ITextFont
*iface
, LONG
*value
)
2117 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2118 FIXME("(%p)->(%p): stub\n", This
, value
);
2122 static HRESULT WINAPI
TextFont_SetStyle(ITextFont
*iface
, LONG value
)
2124 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2125 FIXME("(%p)->(%d): stub\n", This
, value
);
2129 static HRESULT WINAPI
TextFont_GetAllCaps(ITextFont
*iface
, LONG
*value
)
2131 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2132 TRACE("(%p)->(%p)\n", This
, value
);
2133 return get_textfont_propl(This
, FONT_ALLCAPS
, value
);
2136 static HRESULT WINAPI
TextFont_SetAllCaps(ITextFont
*iface
, LONG value
)
2138 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2139 FIXME("(%p)->(%d): stub\n", This
, value
);
2143 static HRESULT WINAPI
TextFont_GetAnimation(ITextFont
*iface
, LONG
*value
)
2145 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2146 TRACE("(%p)->(%p)\n", This
, value
);
2147 return get_textfont_propl(This
, FONT_ANIMATION
, value
);
2150 static HRESULT WINAPI
TextFont_SetAnimation(ITextFont
*iface
, LONG value
)
2152 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2153 FIXME("(%p)->(%d): stub\n", This
, value
);
2157 static HRESULT WINAPI
TextFont_GetBackColor(ITextFont
*iface
, LONG
*value
)
2159 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2160 TRACE("(%p)->(%p)\n", This
, value
);
2161 return get_textfont_propl(This
, FONT_BACKCOLOR
, value
);
2164 static HRESULT WINAPI
TextFont_SetBackColor(ITextFont
*iface
, LONG value
)
2166 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2167 FIXME("(%p)->(%d): stub\n", This
, value
);
2171 static HRESULT WINAPI
TextFont_GetBold(ITextFont
*iface
, LONG
*value
)
2173 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2174 TRACE("(%p)->(%p)\n", This
, value
);
2175 return get_textfont_propl(This
, FONT_BOLD
, value
);
2178 static HRESULT WINAPI
TextFont_SetBold(ITextFont
*iface
, LONG value
)
2180 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2181 FIXME("(%p)->(%d): stub\n", This
, value
);
2185 static HRESULT WINAPI
TextFont_GetEmboss(ITextFont
*iface
, LONG
*value
)
2187 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2188 TRACE("(%p)->(%p)\n", This
, value
);
2189 return get_textfont_propl(This
, FONT_EMBOSS
, value
);
2192 static HRESULT WINAPI
TextFont_SetEmboss(ITextFont
*iface
, LONG value
)
2194 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2195 FIXME("(%p)->(%d): stub\n", This
, value
);
2199 static HRESULT WINAPI
TextFont_GetForeColor(ITextFont
*iface
, LONG
*value
)
2201 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2202 TRACE("(%p)->(%p)\n", This
, value
);
2203 return get_textfont_propl(This
, FONT_FORECOLOR
, value
);
2206 static HRESULT WINAPI
TextFont_SetForeColor(ITextFont
*iface
, LONG value
)
2208 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2209 FIXME("(%p)->(%d): stub\n", This
, value
);
2213 static HRESULT WINAPI
TextFont_GetHidden(ITextFont
*iface
, LONG
*value
)
2215 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2216 TRACE("(%p)->(%p)\n", This
, value
);
2217 return get_textfont_propl(This
, FONT_HIDDEN
, value
);
2220 static HRESULT WINAPI
TextFont_SetHidden(ITextFont
*iface
, LONG value
)
2222 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2223 FIXME("(%p)->(%d): stub\n", This
, value
);
2227 static HRESULT WINAPI
TextFont_GetEngrave(ITextFont
*iface
, LONG
*value
)
2229 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2230 TRACE("(%p)->(%p)\n", This
, value
);
2231 return get_textfont_propl(This
, FONT_ENGRAVE
, value
);
2234 static HRESULT WINAPI
TextFont_SetEngrave(ITextFont
*iface
, LONG value
)
2236 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2237 FIXME("(%p)->(%d): stub\n", This
, value
);
2241 static HRESULT WINAPI
TextFont_GetItalic(ITextFont
*iface
, LONG
*value
)
2243 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2244 TRACE("(%p)->(%p)\n", This
, value
);
2245 return get_textfont_propl(This
, FONT_ITALIC
, value
);
2248 static HRESULT WINAPI
TextFont_SetItalic(ITextFont
*iface
, LONG value
)
2250 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2251 FIXME("(%p)->(%d): stub\n", This
, value
);
2255 static HRESULT WINAPI
TextFont_GetKerning(ITextFont
*iface
, FLOAT
*value
)
2257 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2258 TRACE("(%p)->(%p)\n", This
, value
);
2259 return get_textfont_propf(This
, FONT_KERNING
, value
);
2262 static HRESULT WINAPI
TextFont_SetKerning(ITextFont
*iface
, FLOAT value
)
2264 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2265 FIXME("(%p)->(%.2f): stub\n", This
, value
);
2269 static HRESULT WINAPI
TextFont_GetLanguageID(ITextFont
*iface
, LONG
*value
)
2271 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2272 TRACE("(%p)->(%p)\n", This
, value
);
2273 return get_textfont_propl(This
, FONT_LANGID
, value
);
2276 static HRESULT WINAPI
TextFont_SetLanguageID(ITextFont
*iface
, LONG value
)
2278 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2279 FIXME("(%p)->(%d): stub\n", This
, value
);
2283 static HRESULT WINAPI
TextFont_GetName(ITextFont
*iface
, BSTR
*value
)
2285 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2286 const IRichEditOleImpl
*reole
;
2287 textfont_prop_val v
;
2291 TRACE("(%p)->(%p)\n", This
, value
);
2294 return E_INVALIDARG
;
2299 if (This
->props
[FONT_NAME
].str
)
2300 *value
= SysAllocString(This
->props
[FONT_NAME
].str
);
2302 *value
= SysAllocStringLen(NULL
, 0);
2303 return *value
? S_OK
: E_OUTOFMEMORY
;
2306 if (!(reole
= get_range_reole(This
->range
)))
2307 return CO_E_RELEASED
;
2309 init_textfont_prop_value(FONT_NAME
, &v
);
2311 ITextRange_GetStart(This
->range
, &start
);
2312 hr
= get_textfont_prop_for_pos(reole
, start
, FONT_NAME
, &v
);
2320 static HRESULT WINAPI
TextFont_SetName(ITextFont
*iface
, BSTR value
)
2322 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2323 FIXME("(%p)->(%s): stub\n", This
, debugstr_w(value
));
2327 static HRESULT WINAPI
TextFont_GetOutline(ITextFont
*iface
, LONG
*value
)
2329 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2330 TRACE("(%p)->(%p)\n", This
, value
);
2331 return get_textfont_propl(This
, FONT_OUTLINE
, value
);
2334 static HRESULT WINAPI
TextFont_SetOutline(ITextFont
*iface
, LONG value
)
2336 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2337 FIXME("(%p)->(%d): stub\n", This
, value
);
2341 static HRESULT WINAPI
TextFont_GetPosition(ITextFont
*iface
, FLOAT
*value
)
2343 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2344 TRACE("(%p)->(%p)\n", This
, value
);
2345 return get_textfont_propf(This
, FONT_POSITION
, value
);
2348 static HRESULT WINAPI
TextFont_SetPosition(ITextFont
*iface
, FLOAT value
)
2350 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2351 FIXME("(%p)->(%.2f): stub\n", This
, value
);
2355 static HRESULT WINAPI
TextFont_GetProtected(ITextFont
*iface
, LONG
*value
)
2357 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2358 TRACE("(%p)->(%p)\n", This
, value
);
2359 return get_textfont_propl(This
, FONT_PROTECTED
, value
);
2362 static HRESULT WINAPI
TextFont_SetProtected(ITextFont
*iface
, LONG value
)
2364 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2365 FIXME("(%p)->(%d): stub\n", This
, value
);
2369 static HRESULT WINAPI
TextFont_GetShadow(ITextFont
*iface
, LONG
*value
)
2371 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2372 TRACE("(%p)->(%p)\n", This
, value
);
2373 return get_textfont_propl(This
, FONT_SHADOW
, value
);
2376 static HRESULT WINAPI
TextFont_SetShadow(ITextFont
*iface
, LONG value
)
2378 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2379 FIXME("(%p)->(%d): stub\n", This
, value
);
2383 static HRESULT WINAPI
TextFont_GetSize(ITextFont
*iface
, FLOAT
*value
)
2385 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2386 TRACE("(%p)->(%p)\n", This
, value
);
2387 return get_textfont_propf(This
, FONT_SIZE
, value
);
2390 static HRESULT WINAPI
TextFont_SetSize(ITextFont
*iface
, FLOAT value
)
2392 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2393 FIXME("(%p)->(%.2f): stub\n", This
, value
);
2397 static HRESULT WINAPI
TextFont_GetSmallCaps(ITextFont
*iface
, LONG
*value
)
2399 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2400 TRACE("(%p)->(%p)\n", This
, value
);
2401 return get_textfont_propl(This
, FONT_SMALLCAPS
, value
);
2404 static HRESULT WINAPI
TextFont_SetSmallCaps(ITextFont
*iface
, LONG value
)
2406 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2407 FIXME("(%p)->(%d): stub\n", This
, value
);
2411 static HRESULT WINAPI
TextFont_GetSpacing(ITextFont
*iface
, FLOAT
*value
)
2413 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2414 TRACE("(%p)->(%p)\n", This
, value
);
2415 return get_textfont_propf(This
, FONT_SPACING
, value
);
2418 static HRESULT WINAPI
TextFont_SetSpacing(ITextFont
*iface
, FLOAT value
)
2420 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2421 FIXME("(%p)->(%.2f): stub\n", This
, value
);
2425 static HRESULT WINAPI
TextFont_GetStrikeThrough(ITextFont
*iface
, LONG
*value
)
2427 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2428 TRACE("(%p)->(%p)\n", This
, value
);
2429 return get_textfont_propl(This
, FONT_STRIKETHROUGH
, value
);
2432 static HRESULT WINAPI
TextFont_SetStrikeThrough(ITextFont
*iface
, LONG value
)
2434 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2435 FIXME("(%p)->(%d): stub\n", This
, value
);
2439 static HRESULT WINAPI
TextFont_GetSubscript(ITextFont
*iface
, LONG
*value
)
2441 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2442 TRACE("(%p)->(%p)\n", This
, value
);
2443 return get_textfont_propl(This
, FONT_SUBSCRIPT
, value
);
2446 static HRESULT WINAPI
TextFont_SetSubscript(ITextFont
*iface
, LONG value
)
2448 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2449 FIXME("(%p)->(%d): stub\n", This
, value
);
2453 static HRESULT WINAPI
TextFont_GetSuperscript(ITextFont
*iface
, LONG
*value
)
2455 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2456 TRACE("(%p)->(%p)\n", This
, value
);
2457 return get_textfont_propl(This
, FONT_SUPERSCRIPT
, value
);
2460 static HRESULT WINAPI
TextFont_SetSuperscript(ITextFont
*iface
, LONG value
)
2462 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2463 FIXME("(%p)->(%d): stub\n", This
, value
);
2467 static HRESULT WINAPI
TextFont_GetUnderline(ITextFont
*iface
, LONG
*value
)
2469 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2470 TRACE("(%p)->(%p)\n", This
, value
);
2471 return get_textfont_propl(This
, FONT_UNDERLINE
, value
);
2474 static HRESULT WINAPI
TextFont_SetUnderline(ITextFont
*iface
, LONG value
)
2476 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2477 FIXME("(%p)->(%d): stub\n", This
, value
);
2481 static HRESULT WINAPI
TextFont_GetWeight(ITextFont
*iface
, LONG
*value
)
2483 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2484 TRACE("(%p)->(%p)\n", This
, value
);
2485 return get_textfont_propl(This
, FONT_WEIGHT
, value
);
2488 static HRESULT WINAPI
TextFont_SetWeight(ITextFont
*iface
, LONG value
)
2490 ITextFontImpl
*This
= impl_from_ITextFont(iface
);
2491 FIXME("(%p)->(%d): stub\n", This
, value
);
2495 static ITextFontVtbl textfontvtbl
= {
2496 TextFont_QueryInterface
,
2499 TextFont_GetTypeInfoCount
,
2500 TextFont_GetTypeInfo
,
2501 TextFont_GetIDsOfNames
,
2503 TextFont_GetDuplicate
,
2504 TextFont_SetDuplicate
,
2510 TextFont_GetAllCaps
,
2511 TextFont_SetAllCaps
,
2512 TextFont_GetAnimation
,
2513 TextFont_SetAnimation
,
2514 TextFont_GetBackColor
,
2515 TextFont_SetBackColor
,
2520 TextFont_GetForeColor
,
2521 TextFont_SetForeColor
,
2524 TextFont_GetEngrave
,
2525 TextFont_SetEngrave
,
2528 TextFont_GetKerning
,
2529 TextFont_SetKerning
,
2530 TextFont_GetLanguageID
,
2531 TextFont_SetLanguageID
,
2534 TextFont_GetOutline
,
2535 TextFont_SetOutline
,
2536 TextFont_GetPosition
,
2537 TextFont_SetPosition
,
2538 TextFont_GetProtected
,
2539 TextFont_SetProtected
,
2544 TextFont_GetSmallCaps
,
2545 TextFont_SetSmallCaps
,
2546 TextFont_GetSpacing
,
2547 TextFont_SetSpacing
,
2548 TextFont_GetStrikeThrough
,
2549 TextFont_SetStrikeThrough
,
2550 TextFont_GetSubscript
,
2551 TextFont_SetSubscript
,
2552 TextFont_GetSuperscript
,
2553 TextFont_SetSuperscript
,
2554 TextFont_GetUnderline
,
2555 TextFont_SetUnderline
,
2560 static HRESULT
create_textfont(ITextRange
*range
, const ITextFontImpl
*src
, ITextFont
**ret
)
2562 ITextFontImpl
*font
;
2565 font
= heap_alloc(sizeof(*font
));
2567 return E_OUTOFMEMORY
;
2569 font
->ITextFont_iface
.lpVtbl
= &textfontvtbl
;
2574 memcpy(&font
->props
, &src
->props
, sizeof(font
->props
));
2575 if (font
->props
[FONT_NAME
].str
)
2576 font
->props
[FONT_NAME
].str
= SysAllocString(font
->props
[FONT_NAME
].str
);
2579 font
->range
= range
;
2580 ITextRange_AddRef(range
);
2581 /* FIXME: copy current range attributes to a cache */
2582 memset(&font
->props
, 0, sizeof(font
->props
));
2585 *ret
= &font
->ITextFont_iface
;
2590 static HRESULT WINAPI
TextPara_QueryInterface(ITextPara
*iface
, REFIID riid
, void **ppv
)
2592 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2594 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
2596 if (IsEqualIID(riid
, &IID_ITextPara
) ||
2597 IsEqualIID(riid
, &IID_IDispatch
) ||
2598 IsEqualIID(riid
, &IID_IUnknown
))
2601 ITextPara_AddRef(iface
);
2606 return E_NOINTERFACE
;
2609 static ULONG WINAPI
TextPara_AddRef(ITextPara
*iface
)
2611 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2612 ULONG ref
= InterlockedIncrement(&This
->ref
);
2613 TRACE("(%p)->(%u)\n", This
, ref
);
2617 static ULONG WINAPI
TextPara_Release(ITextPara
*iface
)
2619 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2620 ULONG ref
= InterlockedDecrement(&This
->ref
);
2622 TRACE("(%p)->(%u)\n", This
, ref
);
2626 ITextRange_Release(This
->range
);
2633 static HRESULT WINAPI
TextPara_GetTypeInfoCount(ITextPara
*iface
, UINT
*pctinfo
)
2635 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2636 TRACE("(%p)->(%p)\n", This
, pctinfo
);
2641 static HRESULT WINAPI
TextPara_GetTypeInfo(ITextPara
*iface
, UINT iTInfo
, LCID lcid
,
2642 ITypeInfo
**ppTInfo
)
2644 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2647 TRACE("(%p)->(%u,%d,%p)\n", This
, iTInfo
, lcid
, ppTInfo
);
2649 hr
= get_typeinfo(ITextPara_tid
, ppTInfo
);
2651 ITypeInfo_AddRef(*ppTInfo
);
2655 static HRESULT WINAPI
TextPara_GetIDsOfNames(ITextPara
*iface
, REFIID riid
,
2656 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
2658 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2662 TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This
, riid
, rgszNames
, cNames
, lcid
,
2665 hr
= get_typeinfo(ITextPara_tid
, &ti
);
2667 hr
= ITypeInfo_GetIDsOfNames(ti
, rgszNames
, cNames
, rgDispId
);
2671 static HRESULT WINAPI
TextPara_Invoke(
2673 DISPID dispIdMember
,
2677 DISPPARAMS
*pDispParams
,
2678 VARIANT
*pVarResult
,
2679 EXCEPINFO
*pExcepInfo
,
2682 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2686 TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This
, dispIdMember
, riid
, lcid
,
2687 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2689 hr
= get_typeinfo(ITextPara_tid
, &ti
);
2691 hr
= ITypeInfo_Invoke(ti
, iface
, dispIdMember
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
2695 static HRESULT WINAPI
TextPara_GetDuplicate(ITextPara
*iface
, ITextPara
**ret
)
2697 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2698 FIXME("(%p)->(%p)\n", This
, ret
);
2702 static HRESULT WINAPI
TextPara_SetDuplicate(ITextPara
*iface
, ITextPara
*para
)
2704 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2705 FIXME("(%p)->(%p)\n", This
, para
);
2709 static HRESULT WINAPI
TextPara_CanChange(ITextPara
*iface
, LONG
*ret
)
2711 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2712 FIXME("(%p)->(%p)\n", This
, ret
);
2716 static HRESULT WINAPI
TextPara_IsEqual(ITextPara
*iface
, ITextPara
*para
, LONG
*ret
)
2718 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2719 FIXME("(%p)->(%p %p)\n", This
, para
, ret
);
2723 static HRESULT WINAPI
TextPara_Reset(ITextPara
*iface
, LONG value
)
2725 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2726 FIXME("(%p)->(%d)\n", This
, value
);
2730 static HRESULT WINAPI
TextPara_GetStyle(ITextPara
*iface
, LONG
*value
)
2732 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2733 FIXME("(%p)->(%p)\n", This
, value
);
2737 static HRESULT WINAPI
TextPara_SetStyle(ITextPara
*iface
, LONG value
)
2739 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2740 FIXME("(%p)->(%d)\n", This
, value
);
2744 static HRESULT WINAPI
TextPara_GetAlignment(ITextPara
*iface
, LONG
*value
)
2746 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2747 FIXME("(%p)->(%p)\n", This
, value
);
2751 static HRESULT WINAPI
TextPara_SetAlignment(ITextPara
*iface
, LONG value
)
2753 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2754 FIXME("(%p)->(%d)\n", This
, value
);
2758 static HRESULT WINAPI
TextPara_GetHyphenation(ITextPara
*iface
, LONG
*value
)
2760 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2761 FIXME("(%p)->(%p)\n", This
, value
);
2765 static HRESULT WINAPI
TextPara_SetHyphenation(ITextPara
*iface
, LONG value
)
2767 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2768 FIXME("(%p)->(%d)\n", This
, value
);
2772 static HRESULT WINAPI
TextPara_GetFirstLineIndent(ITextPara
*iface
, FLOAT
*value
)
2774 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2775 FIXME("(%p)->(%p)\n", This
, value
);
2779 static HRESULT WINAPI
TextPara_GetKeepTogether(ITextPara
*iface
, LONG
*value
)
2781 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2782 FIXME("(%p)->(%p)\n", This
, value
);
2786 static HRESULT WINAPI
TextPara_SetKeepTogether(ITextPara
*iface
, LONG value
)
2788 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2789 FIXME("(%p)->(%d)\n", This
, value
);
2793 static HRESULT WINAPI
TextPara_GetKeepWithNext(ITextPara
*iface
, LONG
*value
)
2795 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2796 FIXME("(%p)->(%p)\n", This
, value
);
2800 static HRESULT WINAPI
TextPara_SetKeepWithNext(ITextPara
*iface
, LONG value
)
2802 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2803 FIXME("(%p)->(%d)\n", This
, value
);
2807 static HRESULT WINAPI
TextPara_GetLeftIndent(ITextPara
*iface
, FLOAT
*value
)
2809 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2810 FIXME("(%p)->(%p)\n", This
, value
);
2814 static HRESULT WINAPI
TextPara_GetLineSpacing(ITextPara
*iface
, FLOAT
*value
)
2816 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2817 FIXME("(%p)->(%p)\n", This
, value
);
2821 static HRESULT WINAPI
TextPara_GetLineSpacingRule(ITextPara
*iface
, LONG
*value
)
2823 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2824 FIXME("(%p)->(%p)\n", This
, value
);
2828 static HRESULT WINAPI
TextPara_GetListAlignment(ITextPara
*iface
, LONG
*value
)
2830 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2831 FIXME("(%p)->(%p)\n", This
, value
);
2835 static HRESULT WINAPI
TextPara_SetListAlignment(ITextPara
*iface
, LONG value
)
2837 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2838 FIXME("(%p)->(%d)\n", This
, value
);
2842 static HRESULT WINAPI
TextPara_GetListLevelIndex(ITextPara
*iface
, LONG
*value
)
2844 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2845 FIXME("(%p)->(%p)\n", This
, value
);
2849 static HRESULT WINAPI
TextPara_SetListLevelIndex(ITextPara
*iface
, LONG value
)
2851 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2852 FIXME("(%p)->(%d)\n", This
, value
);
2856 static HRESULT WINAPI
TextPara_GetListStart(ITextPara
*iface
, LONG
*value
)
2858 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2859 FIXME("(%p)->(%p)\n", This
, value
);
2863 static HRESULT WINAPI
TextPara_SetListStart(ITextPara
*iface
, LONG value
)
2865 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2866 FIXME("(%p)->(%d)\n", This
, value
);
2870 static HRESULT WINAPI
TextPara_GetListTab(ITextPara
*iface
, FLOAT
*value
)
2872 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2873 FIXME("(%p)->(%p)\n", This
, value
);
2877 static HRESULT WINAPI
TextPara_SetListTab(ITextPara
*iface
, FLOAT value
)
2879 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2880 FIXME("(%p)->(%.2f)\n", This
, value
);
2884 static HRESULT WINAPI
TextPara_GetListType(ITextPara
*iface
, LONG
*value
)
2886 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2887 FIXME("(%p)->(%p)\n", This
, value
);
2891 static HRESULT WINAPI
TextPara_SetListType(ITextPara
*iface
, LONG value
)
2893 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2894 FIXME("(%p)->(%d)\n", This
, value
);
2898 static HRESULT WINAPI
TextPara_GetNoLineNumber(ITextPara
*iface
, LONG
*value
)
2900 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2901 FIXME("(%p)->(%p)\n", This
, value
);
2905 static HRESULT WINAPI
TextPara_SetNoLineNumber(ITextPara
*iface
, LONG value
)
2907 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2908 FIXME("(%p)->(%d)\n", This
, value
);
2912 static HRESULT WINAPI
TextPara_GetPageBreakBefore(ITextPara
*iface
, LONG
*value
)
2914 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2915 FIXME("(%p)->(%p)\n", This
, value
);
2919 static HRESULT WINAPI
TextPara_SetPageBreakBefore(ITextPara
*iface
, LONG value
)
2921 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2922 FIXME("(%p)->(%d)\n", This
, value
);
2926 static HRESULT WINAPI
TextPara_GetRightIndent(ITextPara
*iface
, FLOAT
*value
)
2928 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2929 FIXME("(%p)->(%p)\n", This
, value
);
2933 static HRESULT WINAPI
TextPara_SetRightIndent(ITextPara
*iface
, FLOAT value
)
2935 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2936 FIXME("(%p)->(%.2f)\n", This
, value
);
2940 static HRESULT WINAPI
TextPara_SetIndents(ITextPara
*iface
, FLOAT StartIndent
, FLOAT LeftIndent
, FLOAT RightIndent
)
2942 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2943 FIXME("(%p)->(%.2f %.2f %.2f)\n", This
, StartIndent
, LeftIndent
, RightIndent
);
2947 static HRESULT WINAPI
TextPara_SetLineSpacing(ITextPara
*iface
, LONG LineSpacingRule
, FLOAT LineSpacing
)
2949 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2950 FIXME("(%p)->(%d %.2f)\n", This
, LineSpacingRule
, LineSpacing
);
2954 static HRESULT WINAPI
TextPara_GetSpaceAfter(ITextPara
*iface
, FLOAT
*value
)
2956 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2957 FIXME("(%p)->(%p)\n", This
, value
);
2961 static HRESULT WINAPI
TextPara_SetSpaceAfter(ITextPara
*iface
, FLOAT value
)
2963 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2964 FIXME("(%p)->(%.2f)\n", This
, value
);
2968 static HRESULT WINAPI
TextPara_GetSpaceBefore(ITextPara
*iface
, FLOAT
*value
)
2970 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2971 FIXME("(%p)->(%p)\n", This
, value
);
2975 static HRESULT WINAPI
TextPara_SetSpaceBefore(ITextPara
*iface
, FLOAT value
)
2977 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2978 FIXME("(%p)->(%.2f)\n", This
, value
);
2982 static HRESULT WINAPI
TextPara_GetWidowControl(ITextPara
*iface
, LONG
*value
)
2984 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2985 FIXME("(%p)->(%p)\n", This
, value
);
2989 static HRESULT WINAPI
TextPara_SetWidowControl(ITextPara
*iface
, LONG value
)
2991 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2992 FIXME("(%p)->(%d)\n", This
, value
);
2996 static HRESULT WINAPI
TextPara_GetTabCount(ITextPara
*iface
, LONG
*value
)
2998 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
2999 FIXME("(%p)->(%p)\n", This
, value
);
3003 static HRESULT WINAPI
TextPara_AddTab(ITextPara
*iface
, FLOAT tbPos
, LONG tbAlign
, LONG tbLeader
)
3005 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
3006 FIXME("(%p)->(%.2f %d %d)\n", This
, tbPos
, tbAlign
, tbLeader
);
3010 static HRESULT WINAPI
TextPara_ClearAllTabs(ITextPara
*iface
)
3012 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
3013 FIXME("(%p)\n", This
);
3017 static HRESULT WINAPI
TextPara_DeleteTab(ITextPara
*iface
, FLOAT pos
)
3019 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
3020 FIXME("(%p)->(%.2f)\n", This
, pos
);
3024 static HRESULT WINAPI
TextPara_GetTab(ITextPara
*iface
, LONG iTab
, FLOAT
*ptbPos
, LONG
*ptbAlign
, LONG
*ptbLeader
)
3026 ITextParaImpl
*This
= impl_from_ITextPara(iface
);
3027 FIXME("(%p)->(%d %p %p %p)\n", This
, iTab
, ptbPos
, ptbAlign
, ptbLeader
);
3031 static ITextParaVtbl textparavtbl
= {
3032 TextPara_QueryInterface
,
3035 TextPara_GetTypeInfoCount
,
3036 TextPara_GetTypeInfo
,
3037 TextPara_GetIDsOfNames
,
3039 TextPara_GetDuplicate
,
3040 TextPara_SetDuplicate
,
3046 TextPara_GetAlignment
,
3047 TextPara_SetAlignment
,
3048 TextPara_GetHyphenation
,
3049 TextPara_SetHyphenation
,
3050 TextPara_GetFirstLineIndent
,
3051 TextPara_GetKeepTogether
,
3052 TextPara_SetKeepTogether
,
3053 TextPara_GetKeepWithNext
,
3054 TextPara_SetKeepWithNext
,
3055 TextPara_GetLeftIndent
,
3056 TextPara_GetLineSpacing
,
3057 TextPara_GetLineSpacingRule
,
3058 TextPara_GetListAlignment
,
3059 TextPara_SetListAlignment
,
3060 TextPara_GetListLevelIndex
,
3061 TextPara_SetListLevelIndex
,
3062 TextPara_GetListStart
,
3063 TextPara_SetListStart
,
3064 TextPara_GetListTab
,
3065 TextPara_SetListTab
,
3066 TextPara_GetListType
,
3067 TextPara_SetListType
,
3068 TextPara_GetNoLineNumber
,
3069 TextPara_SetNoLineNumber
,
3070 TextPara_GetPageBreakBefore
,
3071 TextPara_SetPageBreakBefore
,
3072 TextPara_GetRightIndent
,
3073 TextPara_SetRightIndent
,
3074 TextPara_SetIndents
,
3075 TextPara_SetLineSpacing
,
3076 TextPara_GetSpaceAfter
,
3077 TextPara_SetSpaceAfter
,
3078 TextPara_GetSpaceBefore
,
3079 TextPara_SetSpaceBefore
,
3080 TextPara_GetWidowControl
,
3081 TextPara_SetWidowControl
,
3082 TextPara_GetTabCount
,
3084 TextPara_ClearAllTabs
,
3089 static HRESULT
create_textpara(ITextRange
*range
, ITextPara
**ret
)
3091 ITextParaImpl
*para
;
3094 para
= heap_alloc(sizeof(*para
));
3096 return E_OUTOFMEMORY
;
3098 para
->ITextPara_iface
.lpVtbl
= &textparavtbl
;
3100 para
->range
= range
;
3101 ITextRange_AddRef(range
);
3103 *ret
= ¶
->ITextPara_iface
;
3108 static HRESULT WINAPI
3109 ITextDocument_fnQueryInterface(ITextDocument
* me
, REFIID riid
,
3112 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3113 return IRichEditOle_QueryInterface(&This
->IRichEditOle_iface
, riid
, ppvObject
);
3117 ITextDocument_fnAddRef(ITextDocument
* me
)
3119 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3120 return IRichEditOle_AddRef(&This
->IRichEditOle_iface
);
3124 ITextDocument_fnRelease(ITextDocument
* me
)
3126 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3127 return IRichEditOle_Release(&This
->IRichEditOle_iface
);
3130 static HRESULT WINAPI
3131 ITextDocument_fnGetTypeInfoCount(ITextDocument
* me
,
3134 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3135 TRACE("(%p)->(%p)\n", This
, pctinfo
);
3140 static HRESULT WINAPI
3141 ITextDocument_fnGetTypeInfo(ITextDocument
* me
, UINT iTInfo
, LCID lcid
,
3142 ITypeInfo
** ppTInfo
)
3144 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3147 TRACE("(%p)->(%u,%d,%p)\n", This
, iTInfo
, lcid
, ppTInfo
);
3149 hr
= get_typeinfo(ITextDocument_tid
, ppTInfo
);
3151 ITypeInfo_AddRef(*ppTInfo
);
3155 static HRESULT WINAPI
3156 ITextDocument_fnGetIDsOfNames(ITextDocument
* me
, REFIID riid
,
3157 LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
)
3159 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3163 TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This
, riid
, rgszNames
, cNames
, lcid
,
3166 hr
= get_typeinfo(ITextDocument_tid
, &ti
);
3168 hr
= ITypeInfo_GetIDsOfNames(ti
, rgszNames
, cNames
, rgDispId
);
3172 static HRESULT WINAPI
3173 ITextDocument_fnInvoke(ITextDocument
* me
, DISPID dispIdMember
,
3174 REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
,
3175 VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
)
3177 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3181 TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This
, dispIdMember
, riid
, lcid
,
3182 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3184 hr
= get_typeinfo(ITextDocument_tid
, &ti
);
3186 hr
= ITypeInfo_Invoke(ti
, me
, dispIdMember
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3190 static HRESULT WINAPI
3191 ITextDocument_fnGetName(ITextDocument
* me
, BSTR
* pName
)
3193 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3194 FIXME("stub %p\n",This
);
3198 static HRESULT WINAPI
3199 ITextDocument_fnGetSelection(ITextDocument
* me
, ITextSelection
** ppSel
)
3201 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3202 TRACE("(%p)\n", me
);
3205 return E_INVALIDARG
;
3206 *ppSel
= &This
->txtSel
->ITextSelection_iface
;
3207 ITextSelection_AddRef(*ppSel
);
3211 static HRESULT WINAPI
3212 ITextDocument_fnGetStoryCount(ITextDocument
* me
, LONG
* pCount
)
3214 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3215 FIXME("stub %p\n",This
);
3219 static HRESULT WINAPI
3220 ITextDocument_fnGetStoryRanges(ITextDocument
* me
,
3221 ITextStoryRanges
** ppStories
)
3223 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3224 FIXME("stub %p\n",This
);
3228 static HRESULT WINAPI
3229 ITextDocument_fnGetSaved(ITextDocument
* me
, LONG
* pValue
)
3231 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3232 FIXME("stub %p\n",This
);
3236 static HRESULT WINAPI
3237 ITextDocument_fnSetSaved(ITextDocument
* me
, LONG Value
)
3239 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3240 FIXME("stub %p\n",This
);
3244 static HRESULT WINAPI
3245 ITextDocument_fnGetDefaultTabStop(ITextDocument
* me
, float* pValue
)
3247 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3248 FIXME("stub %p\n",This
);
3252 static HRESULT WINAPI
3253 ITextDocument_fnSetDefaultTabStop(ITextDocument
* me
, float Value
)
3255 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3256 FIXME("stub %p\n",This
);
3260 static HRESULT WINAPI
3261 ITextDocument_fnNew(ITextDocument
* me
)
3263 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3264 FIXME("stub %p\n",This
);
3268 static HRESULT WINAPI
3269 ITextDocument_fnOpen(ITextDocument
* me
, VARIANT
* pVar
, LONG Flags
,
3272 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3273 FIXME("stub %p\n",This
);
3277 static HRESULT WINAPI
3278 ITextDocument_fnSave(ITextDocument
* me
, VARIANT
* pVar
, LONG Flags
,
3281 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3282 FIXME("stub %p\n",This
);
3286 static HRESULT WINAPI
3287 ITextDocument_fnFreeze(ITextDocument
* me
, LONG
* pCount
)
3289 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3290 FIXME("stub %p\n",This
);
3294 static HRESULT WINAPI
3295 ITextDocument_fnUnfreeze(ITextDocument
* me
, LONG
* pCount
)
3297 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3298 FIXME("stub %p\n",This
);
3302 static HRESULT WINAPI
3303 ITextDocument_fnBeginEditCollection(ITextDocument
* me
)
3305 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3306 FIXME("stub %p\n",This
);
3310 static HRESULT WINAPI
3311 ITextDocument_fnEndEditCollection(ITextDocument
* me
)
3313 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3314 FIXME("stub %p\n",This
);
3318 static HRESULT WINAPI
3319 ITextDocument_fnUndo(ITextDocument
* me
, LONG Count
, LONG
* prop
)
3321 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3322 FIXME("stub %p\n",This
);
3326 static HRESULT WINAPI
3327 ITextDocument_fnRedo(ITextDocument
* me
, LONG Count
, LONG
* prop
)
3329 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3330 FIXME("stub %p\n",This
);
3334 static HRESULT
CreateITextRange(IRichEditOleImpl
*reOle
, LONG start
, LONG end
, ITextRange
** ppRange
)
3336 ITextRangeImpl
*txtRge
= heap_alloc(sizeof(ITextRangeImpl
));
3339 return E_OUTOFMEMORY
;
3340 txtRge
->ITextRange_iface
.lpVtbl
= &trvt
;
3342 txtRge
->reOle
= reOle
;
3343 txtRge
->start
= start
;
3345 list_add_head(&reOle
->rangelist
, &txtRge
->entry
);
3346 *ppRange
= &txtRge
->ITextRange_iface
;
3350 static HRESULT WINAPI
3351 ITextDocument_fnRange(ITextDocument
* me
, LONG cp1
, LONG cp2
,
3352 ITextRange
** ppRange
)
3354 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3355 const int len
= ME_GetTextLength(This
->editor
) + 1;
3357 TRACE("%p %p %d %d\n", This
, ppRange
, cp1
, cp2
);
3359 return E_INVALIDARG
;
3363 cp1
= min(cp1
, len
);
3364 cp2
= min(cp2
, len
);
3373 cp1
= cp2
= len
- 1;
3375 return CreateITextRange(This
, cp1
, cp2
, ppRange
);
3378 static HRESULT WINAPI
3379 ITextDocument_fnRangeFromPoint(ITextDocument
* me
, LONG x
, LONG y
,
3380 ITextRange
** ppRange
)
3382 IRichEditOleImpl
*This
= impl_from_ITextDocument(me
);
3383 FIXME("stub %p\n",This
);
3387 static const ITextDocumentVtbl tdvt
= {
3388 ITextDocument_fnQueryInterface
,
3389 ITextDocument_fnAddRef
,
3390 ITextDocument_fnRelease
,
3391 ITextDocument_fnGetTypeInfoCount
,
3392 ITextDocument_fnGetTypeInfo
,
3393 ITextDocument_fnGetIDsOfNames
,
3394 ITextDocument_fnInvoke
,
3395 ITextDocument_fnGetName
,
3396 ITextDocument_fnGetSelection
,
3397 ITextDocument_fnGetStoryCount
,
3398 ITextDocument_fnGetStoryRanges
,
3399 ITextDocument_fnGetSaved
,
3400 ITextDocument_fnSetSaved
,
3401 ITextDocument_fnGetDefaultTabStop
,
3402 ITextDocument_fnSetDefaultTabStop
,
3403 ITextDocument_fnNew
,
3404 ITextDocument_fnOpen
,
3405 ITextDocument_fnSave
,
3406 ITextDocument_fnFreeze
,
3407 ITextDocument_fnUnfreeze
,
3408 ITextDocument_fnBeginEditCollection
,
3409 ITextDocument_fnEndEditCollection
,
3410 ITextDocument_fnUndo
,
3411 ITextDocument_fnRedo
,
3412 ITextDocument_fnRange
,
3413 ITextDocument_fnRangeFromPoint
3416 /* ITextSelection */
3417 static HRESULT WINAPI
ITextSelection_fnQueryInterface(
3422 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3425 if (IsEqualGUID(riid
, &IID_IUnknown
)
3426 || IsEqualGUID(riid
, &IID_IDispatch
)
3427 || IsEqualGUID(riid
, &IID_ITextRange
)
3428 || IsEqualGUID(riid
, &IID_ITextSelection
))
3431 ITextSelection_AddRef(me
);
3434 else if (IsEqualGUID(riid
, &IID_Igetrichole
))
3436 *ppvObj
= This
->reOle
;
3440 return E_NOINTERFACE
;
3443 static ULONG WINAPI
ITextSelection_fnAddRef(ITextSelection
*me
)
3445 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3446 return InterlockedIncrement(&This
->ref
);
3449 static ULONG WINAPI
ITextSelection_fnRelease(ITextSelection
*me
)
3451 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3452 ULONG ref
= InterlockedDecrement(&This
->ref
);
3458 static HRESULT WINAPI
ITextSelection_fnGetTypeInfoCount(ITextSelection
*me
, UINT
*pctinfo
)
3460 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3461 TRACE("(%p)->(%p)\n", This
, pctinfo
);
3466 static HRESULT WINAPI
ITextSelection_fnGetTypeInfo(ITextSelection
*me
, UINT iTInfo
, LCID lcid
,
3467 ITypeInfo
**ppTInfo
)
3469 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3472 TRACE("(%p)->(%u,%d,%p)\n", This
, iTInfo
, lcid
, ppTInfo
);
3474 hr
= get_typeinfo(ITextSelection_tid
, ppTInfo
);
3476 ITypeInfo_AddRef(*ppTInfo
);
3480 static HRESULT WINAPI
ITextSelection_fnGetIDsOfNames(ITextSelection
*me
, REFIID riid
,
3481 LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
3483 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3487 TRACE("(%p)->(%p,%p,%u,%d,%p)\n", This
, riid
, rgszNames
, cNames
, lcid
,
3490 hr
= get_typeinfo(ITextSelection_tid
, &ti
);
3492 hr
= ITypeInfo_GetIDsOfNames(ti
, rgszNames
, cNames
, rgDispId
);
3496 static HRESULT WINAPI
ITextSelection_fnInvoke(
3498 DISPID dispIdMember
,
3502 DISPPARAMS
*pDispParams
,
3503 VARIANT
*pVarResult
,
3504 EXCEPINFO
*pExcepInfo
,
3507 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3511 TRACE("(%p)->(%d,%p,%d,%u,%p,%p,%p,%p)\n", This
, dispIdMember
, riid
, lcid
,
3512 wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3514 hr
= get_typeinfo(ITextSelection_tid
, &ti
);
3516 hr
= ITypeInfo_Invoke(ti
, me
, dispIdMember
, wFlags
, pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
3520 /*** ITextRange methods ***/
3521 static HRESULT WINAPI
ITextSelection_fnGetText(ITextSelection
*me
, BSTR
*pbstr
)
3523 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3524 ME_Cursor
*start
= NULL
, *end
= NULL
;
3528 TRACE("(%p)->(%p)\n", This
, pbstr
);
3531 return CO_E_RELEASED
;
3534 return E_INVALIDARG
;
3536 ME_GetSelection(This
->reOle
->editor
, &start
, &end
);
3537 endOfs
= ME_GetCursorOfs(end
);
3538 nChars
= endOfs
- ME_GetCursorOfs(start
);
3545 *pbstr
= SysAllocStringLen(NULL
, nChars
);
3547 return E_OUTOFMEMORY
;
3549 bEOP
= (end
->pRun
->next
->type
== diTextEnd
&& endOfs
> ME_GetTextLength(This
->reOle
->editor
));
3550 ME_GetTextW(This
->reOle
->editor
, *pbstr
, nChars
, start
, nChars
, FALSE
, bEOP
);
3551 TRACE("%s\n", wine_dbgstr_w(*pbstr
));
3556 static HRESULT WINAPI
ITextSelection_fnSetText(ITextSelection
*me
, BSTR bstr
)
3558 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3560 return CO_E_RELEASED
;
3562 FIXME("not implemented\n");
3566 static HRESULT WINAPI
ITextSelection_fnGetChar(ITextSelection
*me
, LONG
*pch
)
3568 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3569 ME_Cursor
*start
= NULL
, *end
= NULL
;
3572 return CO_E_RELEASED
;
3575 return E_INVALIDARG
;
3577 ME_GetSelection(This
->reOle
->editor
, &start
, &end
);
3578 return range_GetChar(This
->reOle
->editor
, start
, pch
);
3581 static HRESULT WINAPI
ITextSelection_fnSetChar(ITextSelection
*me
, LONG ch
)
3583 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3585 return CO_E_RELEASED
;
3587 FIXME("not implemented\n");
3591 static HRESULT WINAPI
ITextSelection_fnGetDuplicate(ITextSelection
*me
, ITextRange
**ppRange
)
3593 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3595 return CO_E_RELEASED
;
3597 FIXME("not implemented\n");
3601 static HRESULT WINAPI
ITextSelection_fnGetFormattedText(ITextSelection
*me
, ITextRange
**ppRange
)
3603 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3605 return CO_E_RELEASED
;
3607 FIXME("not implemented\n");
3611 static HRESULT WINAPI
ITextSelection_fnSetFormattedText(ITextSelection
*me
, ITextRange
*pRange
)
3613 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3615 return CO_E_RELEASED
;
3617 FIXME("not implemented\n");
3621 static HRESULT WINAPI
ITextSelection_fnGetStart(ITextSelection
*me
, LONG
*pcpFirst
)
3623 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3626 return CO_E_RELEASED
;
3629 return E_INVALIDARG
;
3630 ME_GetSelectionOfs(This
->reOle
->editor
, pcpFirst
, &lim
);
3631 TRACE("%d\n", *pcpFirst
);
3635 static HRESULT WINAPI
ITextSelection_fnSetStart(ITextSelection
*me
, LONG value
)
3637 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3641 TRACE("(%p)->(%d)\n", This
, value
);
3644 return CO_E_RELEASED
;
3646 ME_GetSelectionOfs(This
->reOle
->editor
, &start
, &end
);
3647 hr
= textrange_setstart(This
->reOle
, value
, &start
, &end
);
3649 ME_SetSelection(This
->reOle
->editor
, start
, end
);
3654 static HRESULT WINAPI
ITextSelection_fnGetEnd(ITextSelection
*me
, LONG
*pcpLim
)
3656 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3659 return CO_E_RELEASED
;
3662 return E_INVALIDARG
;
3663 ME_GetSelectionOfs(This
->reOle
->editor
, &first
, pcpLim
);
3664 TRACE("%d\n", *pcpLim
);
3668 static HRESULT WINAPI
ITextSelection_fnSetEnd(ITextSelection
*me
, LONG value
)
3670 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3674 TRACE("(%p)->(%d)\n", This
, value
);
3677 return CO_E_RELEASED
;
3679 ME_GetSelectionOfs(This
->reOle
->editor
, &start
, &end
);
3680 hr
= textrange_setend(This
->reOle
, value
, &start
, &end
);
3682 ME_SetSelection(This
->reOle
->editor
, start
, end
);
3687 static HRESULT WINAPI
ITextSelection_fnGetFont(ITextSelection
*me
, ITextFont
**font
)
3689 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3691 TRACE("(%p)->(%p)\n", This
, font
);
3694 return CO_E_RELEASED
;
3697 return E_INVALIDARG
;
3699 return create_textfont((ITextRange
*)me
, NULL
, font
);
3702 static HRESULT WINAPI
ITextSelection_fnSetFont(ITextSelection
*me
, ITextFont
*pFont
)
3704 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3706 return CO_E_RELEASED
;
3708 FIXME("not implemented\n");
3712 static HRESULT WINAPI
ITextSelection_fnGetPara(ITextSelection
*me
, ITextPara
**para
)
3714 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3716 return CO_E_RELEASED
;
3718 FIXME("not implemented\n");
3722 static HRESULT WINAPI
ITextSelection_fnSetPara(ITextSelection
*me
, ITextPara
*pPara
)
3724 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3726 return CO_E_RELEASED
;
3728 FIXME("not implemented\n");
3732 static HRESULT WINAPI
ITextSelection_fnGetStoryLength(ITextSelection
*me
, LONG
*pcch
)
3734 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3736 return CO_E_RELEASED
;
3738 FIXME("not implemented\n");
3742 static HRESULT WINAPI
ITextSelection_fnGetStoryType(ITextSelection
*me
, LONG
*pValue
)
3744 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3746 return CO_E_RELEASED
;
3748 FIXME("not implemented\n");
3752 static HRESULT WINAPI
ITextSelection_fnCollapse(ITextSelection
*me
, LONG bStart
)
3754 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3758 return CO_E_RELEASED
;
3760 ME_GetSelectionOfs(This
->reOle
->editor
, &start
, &end
);
3761 hres
= range_Collapse(bStart
, &start
, &end
);
3762 if (SUCCEEDED(hres
))
3763 ME_SetSelection(This
->reOle
->editor
, start
, end
);
3767 static HRESULT WINAPI
ITextSelection_fnExpand(ITextSelection
*me
, LONG Unit
, LONG
*pDelta
)
3769 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3771 return CO_E_RELEASED
;
3773 FIXME("not implemented\n");
3777 static HRESULT WINAPI
ITextSelection_fnGetIndex(ITextSelection
*me
, LONG Unit
, LONG
*pIndex
)
3779 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3781 return CO_E_RELEASED
;
3783 FIXME("not implemented\n");
3787 static HRESULT WINAPI
ITextSelection_fnSetIndex(ITextSelection
*me
, LONG Unit
, LONG Index
,
3790 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3792 return CO_E_RELEASED
;
3794 FIXME("not implemented\n");
3798 static HRESULT WINAPI
ITextSelection_fnSetRange(ITextSelection
*me
, LONG cpActive
, LONG cpOther
)
3800 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3802 return CO_E_RELEASED
;
3804 FIXME("not implemented\n");
3808 static HRESULT WINAPI
ITextSelection_fnInRange(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3810 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3812 return CO_E_RELEASED
;
3814 FIXME("not implemented\n");
3818 static HRESULT WINAPI
ITextSelection_fnInStory(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3820 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3822 return CO_E_RELEASED
;
3824 FIXME("not implemented\n");
3828 static HRESULT WINAPI
ITextSelection_fnIsEqual(ITextSelection
*me
, ITextRange
*pRange
, LONG
*pb
)
3830 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3832 return CO_E_RELEASED
;
3834 FIXME("not implemented\n");
3838 static HRESULT WINAPI
ITextSelection_fnSelect(ITextSelection
*me
)
3840 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3842 return CO_E_RELEASED
;
3844 FIXME("not implemented\n");
3848 static HRESULT WINAPI
ITextSelection_fnStartOf(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3851 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3853 return CO_E_RELEASED
;
3855 FIXME("not implemented\n");
3859 static HRESULT WINAPI
ITextSelection_fnEndOf(ITextSelection
*me
, LONG Unit
, LONG Extend
,
3862 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3864 return CO_E_RELEASED
;
3866 FIXME("not implemented\n");
3870 static HRESULT WINAPI
ITextSelection_fnMove(ITextSelection
*me
, LONG Unit
, LONG Count
, LONG
*pDelta
)
3872 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3874 return CO_E_RELEASED
;
3876 FIXME("not implemented\n");
3880 static HRESULT WINAPI
ITextSelection_fnMoveStart(ITextSelection
*me
, LONG Unit
, LONG Count
,
3883 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3885 return CO_E_RELEASED
;
3887 FIXME("not implemented\n");
3891 static HRESULT WINAPI
ITextSelection_fnMoveEnd(ITextSelection
*me
, LONG Unit
, LONG Count
,
3894 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3896 return CO_E_RELEASED
;
3898 FIXME("not implemented\n");
3902 static HRESULT WINAPI
ITextSelection_fnMoveWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3905 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3907 return CO_E_RELEASED
;
3909 FIXME("not implemented\n");
3913 static HRESULT WINAPI
ITextSelection_fnMoveStartWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3916 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3918 return CO_E_RELEASED
;
3920 FIXME("not implemented\n");
3924 static HRESULT WINAPI
ITextSelection_fnMoveEndWhile(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3927 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3929 return CO_E_RELEASED
;
3931 FIXME("not implemented\n");
3935 static HRESULT WINAPI
ITextSelection_fnMoveUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3938 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3940 return CO_E_RELEASED
;
3942 FIXME("not implemented\n");
3946 static HRESULT WINAPI
ITextSelection_fnMoveStartUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3949 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3951 return CO_E_RELEASED
;
3953 FIXME("not implemented\n");
3957 static HRESULT WINAPI
ITextSelection_fnMoveEndUntil(ITextSelection
*me
, VARIANT
*Cset
, LONG Count
,
3960 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3962 return CO_E_RELEASED
;
3964 FIXME("not implemented\n");
3968 static HRESULT WINAPI
ITextSelection_fnFindText(ITextSelection
*me
, BSTR bstr
, LONG cch
, LONG Flags
,
3971 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3973 return CO_E_RELEASED
;
3975 FIXME("not implemented\n");
3979 static HRESULT WINAPI
ITextSelection_fnFindTextStart(ITextSelection
*me
, BSTR bstr
, LONG cch
,
3980 LONG Flags
, LONG
*pLength
)
3982 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3984 return CO_E_RELEASED
;
3986 FIXME("not implemented\n");
3990 static HRESULT WINAPI
ITextSelection_fnFindTextEnd(ITextSelection
*me
, BSTR bstr
, LONG cch
,
3991 LONG Flags
, LONG
*pLength
)
3993 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
3995 return CO_E_RELEASED
;
3997 FIXME("not implemented\n");
4001 static HRESULT WINAPI
ITextSelection_fnDelete(ITextSelection
*me
, LONG Unit
, LONG Count
,
4004 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4006 return CO_E_RELEASED
;
4008 FIXME("not implemented\n");
4012 static HRESULT WINAPI
ITextSelection_fnCut(ITextSelection
*me
, VARIANT
*pVar
)
4014 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4016 return CO_E_RELEASED
;
4018 FIXME("not implemented\n");
4022 static HRESULT WINAPI
ITextSelection_fnCopy(ITextSelection
*me
, VARIANT
*pVar
)
4024 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4026 return CO_E_RELEASED
;
4028 FIXME("not implemented\n");
4032 static HRESULT WINAPI
ITextSelection_fnPaste(ITextSelection
*me
, VARIANT
*pVar
, LONG Format
)
4034 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4036 return CO_E_RELEASED
;
4038 FIXME("not implemented\n");
4042 static HRESULT WINAPI
ITextSelection_fnCanPaste(ITextSelection
*me
, VARIANT
*pVar
, LONG Format
,
4045 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4047 return CO_E_RELEASED
;
4049 FIXME("not implemented\n");
4053 static HRESULT WINAPI
ITextSelection_fnCanEdit(ITextSelection
*me
, LONG
*pb
)
4055 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4057 return CO_E_RELEASED
;
4059 FIXME("not implemented\n");
4063 static HRESULT WINAPI
ITextSelection_fnChangeCase(ITextSelection
*me
, LONG Type
)
4065 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4067 return CO_E_RELEASED
;
4069 FIXME("not implemented\n");
4073 static HRESULT WINAPI
ITextSelection_fnGetPoint(ITextSelection
*me
, LONG Type
, LONG
*cx
, LONG
*cy
)
4075 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4077 return CO_E_RELEASED
;
4079 FIXME("not implemented\n");
4083 static HRESULT WINAPI
ITextSelection_fnSetPoint(ITextSelection
*me
, LONG x
, LONG y
, LONG Type
,
4086 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4088 return CO_E_RELEASED
;
4090 FIXME("not implemented\n");
4094 static HRESULT WINAPI
ITextSelection_fnScrollIntoView(ITextSelection
*me
, LONG Value
)
4096 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4098 return CO_E_RELEASED
;
4100 FIXME("not implemented\n");
4104 static HRESULT WINAPI
ITextSelection_fnGetEmbeddedObject(ITextSelection
*me
, IUnknown
**ppv
)
4106 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4108 return CO_E_RELEASED
;
4110 FIXME("not implemented\n");
4114 /*** ITextSelection methods ***/
4115 static HRESULT WINAPI
ITextSelection_fnGetFlags(ITextSelection
*me
, LONG
*pFlags
)
4117 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4119 return CO_E_RELEASED
;
4121 FIXME("not implemented\n");
4125 static HRESULT WINAPI
ITextSelection_fnSetFlags(ITextSelection
*me
, LONG Flags
)
4127 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4129 return CO_E_RELEASED
;
4131 FIXME("not implemented\n");
4135 static HRESULT WINAPI
ITextSelection_fnGetType(ITextSelection
*me
, LONG
*pType
)
4137 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4139 return CO_E_RELEASED
;
4141 FIXME("not implemented\n");
4145 static HRESULT WINAPI
ITextSelection_fnMoveLeft(ITextSelection
*me
, LONG Unit
, LONG Count
,
4146 LONG Extend
, LONG
*pDelta
)
4148 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4150 return CO_E_RELEASED
;
4152 FIXME("not implemented\n");
4156 static HRESULT WINAPI
ITextSelection_fnMoveRight(ITextSelection
*me
, LONG Unit
, LONG Count
,
4157 LONG Extend
, LONG
*pDelta
)
4159 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4161 return CO_E_RELEASED
;
4163 FIXME("not implemented\n");
4167 static HRESULT WINAPI
ITextSelection_fnMoveUp(ITextSelection
*me
, LONG Unit
, LONG Count
,
4168 LONG Extend
, LONG
*pDelta
)
4170 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4172 return CO_E_RELEASED
;
4174 FIXME("not implemented\n");
4178 static HRESULT WINAPI
ITextSelection_fnMoveDown(ITextSelection
*me
, LONG Unit
, LONG Count
,
4179 LONG Extend
, LONG
*pDelta
)
4181 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4183 return CO_E_RELEASED
;
4185 FIXME("not implemented\n");
4189 static HRESULT WINAPI
ITextSelection_fnHomeKey(ITextSelection
*me
, LONG Unit
, LONG Extend
,
4192 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4194 return CO_E_RELEASED
;
4196 FIXME("not implemented\n");
4200 static HRESULT WINAPI
ITextSelection_fnEndKey(ITextSelection
*me
, LONG Unit
, LONG Extend
,
4203 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4205 return CO_E_RELEASED
;
4207 FIXME("not implemented\n");
4211 static HRESULT WINAPI
ITextSelection_fnTypeText(ITextSelection
*me
, BSTR bstr
)
4213 ITextSelectionImpl
*This
= impl_from_ITextSelection(me
);
4215 return CO_E_RELEASED
;
4217 FIXME("not implemented\n");
4221 static const ITextSelectionVtbl tsvt
= {
4222 ITextSelection_fnQueryInterface
,
4223 ITextSelection_fnAddRef
,
4224 ITextSelection_fnRelease
,
4225 ITextSelection_fnGetTypeInfoCount
,
4226 ITextSelection_fnGetTypeInfo
,
4227 ITextSelection_fnGetIDsOfNames
,
4228 ITextSelection_fnInvoke
,
4229 ITextSelection_fnGetText
,
4230 ITextSelection_fnSetText
,
4231 ITextSelection_fnGetChar
,
4232 ITextSelection_fnSetChar
,
4233 ITextSelection_fnGetDuplicate
,
4234 ITextSelection_fnGetFormattedText
,
4235 ITextSelection_fnSetFormattedText
,
4236 ITextSelection_fnGetStart
,
4237 ITextSelection_fnSetStart
,
4238 ITextSelection_fnGetEnd
,
4239 ITextSelection_fnSetEnd
,
4240 ITextSelection_fnGetFont
,
4241 ITextSelection_fnSetFont
,
4242 ITextSelection_fnGetPara
,
4243 ITextSelection_fnSetPara
,
4244 ITextSelection_fnGetStoryLength
,
4245 ITextSelection_fnGetStoryType
,
4246 ITextSelection_fnCollapse
,
4247 ITextSelection_fnExpand
,
4248 ITextSelection_fnGetIndex
,
4249 ITextSelection_fnSetIndex
,
4250 ITextSelection_fnSetRange
,
4251 ITextSelection_fnInRange
,
4252 ITextSelection_fnInStory
,
4253 ITextSelection_fnIsEqual
,
4254 ITextSelection_fnSelect
,
4255 ITextSelection_fnStartOf
,
4256 ITextSelection_fnEndOf
,
4257 ITextSelection_fnMove
,
4258 ITextSelection_fnMoveStart
,
4259 ITextSelection_fnMoveEnd
,
4260 ITextSelection_fnMoveWhile
,
4261 ITextSelection_fnMoveStartWhile
,
4262 ITextSelection_fnMoveEndWhile
,
4263 ITextSelection_fnMoveUntil
,
4264 ITextSelection_fnMoveStartUntil
,
4265 ITextSelection_fnMoveEndUntil
,
4266 ITextSelection_fnFindText
,
4267 ITextSelection_fnFindTextStart
,
4268 ITextSelection_fnFindTextEnd
,
4269 ITextSelection_fnDelete
,
4270 ITextSelection_fnCut
,
4271 ITextSelection_fnCopy
,
4272 ITextSelection_fnPaste
,
4273 ITextSelection_fnCanPaste
,
4274 ITextSelection_fnCanEdit
,
4275 ITextSelection_fnChangeCase
,
4276 ITextSelection_fnGetPoint
,
4277 ITextSelection_fnSetPoint
,
4278 ITextSelection_fnScrollIntoView
,
4279 ITextSelection_fnGetEmbeddedObject
,
4280 ITextSelection_fnGetFlags
,
4281 ITextSelection_fnSetFlags
,
4282 ITextSelection_fnGetType
,
4283 ITextSelection_fnMoveLeft
,
4284 ITextSelection_fnMoveRight
,
4285 ITextSelection_fnMoveUp
,
4286 ITextSelection_fnMoveDown
,
4287 ITextSelection_fnHomeKey
,
4288 ITextSelection_fnEndKey
,
4289 ITextSelection_fnTypeText
4292 static ITextSelectionImpl
*
4293 CreateTextSelection(IRichEditOleImpl
*reOle
)
4295 ITextSelectionImpl
*txtSel
= heap_alloc(sizeof *txtSel
);
4299 txtSel
->ITextSelection_iface
.lpVtbl
= &tsvt
;
4301 txtSel
->reOle
= reOle
;
4305 LRESULT
CreateIRichEditOle(IUnknown
*outer_unk
, ME_TextEditor
*editor
, LPVOID
*ppvObj
)
4307 IRichEditOleImpl
*reo
;
4309 reo
= heap_alloc(sizeof(IRichEditOleImpl
));
4313 reo
->IUnknown_inner
.lpVtbl
= &reo_unk_vtbl
;
4314 reo
->IRichEditOle_iface
.lpVtbl
= &revt
;
4315 reo
->ITextDocument_iface
.lpVtbl
= &tdvt
;
4317 reo
->editor
= editor
;
4318 reo
->txtSel
= CreateTextSelection(reo
);
4324 reo
->clientSite
= CreateOleClientSite(reo
);
4325 if (!reo
->clientSite
)
4327 ITextSelection_Release(&reo
->txtSel
->ITextSelection_iface
);
4331 TRACE("Created %p\n",reo
);
4332 list_init(&reo
->rangelist
);
4334 reo
->outer_unk
= outer_unk
;
4336 reo
->outer_unk
= &reo
->IUnknown_inner
;
4337 *ppvObj
= &reo
->IRichEditOle_iface
;
4342 static void convert_sizel(const ME_Context
*c
, const SIZEL
* szl
, SIZE
* sz
)
4344 /* sizel is in .01 millimeters, sz in pixels */
4345 sz
->cx
= MulDiv(szl
->cx
, c
->dpi
.cx
, 2540);
4346 sz
->cy
= MulDiv(szl
->cy
, c
->dpi
.cy
, 2540);
4349 /******************************************************************************
4350 * ME_GetOLEObjectSize
4352 * Sets run extent for OLE objects.
4354 void ME_GetOLEObjectSize(const ME_Context
*c
, ME_Run
*run
, SIZE
*pSize
)
4362 assert(run
->nFlags
& MERF_GRAPHICS
);
4363 assert(run
->ole_obj
);
4365 if (run
->ole_obj
->sizel
.cx
!= 0 || run
->ole_obj
->sizel
.cy
!= 0)
4367 convert_sizel(c
, &run
->ole_obj
->sizel
, pSize
);
4368 if (c
->editor
->nZoomNumerator
!= 0)
4370 pSize
->cx
= MulDiv(pSize
->cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4371 pSize
->cy
= MulDiv(pSize
->cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4376 if (IOleObject_QueryInterface(run
->ole_obj
->poleobj
, &IID_IDataObject
, (void**)&ido
) != S_OK
)
4378 FIXME("Query Interface IID_IDataObject failed!\n");
4379 pSize
->cx
= pSize
->cy
= 0;
4382 fmt
.cfFormat
= CF_BITMAP
;
4384 fmt
.dwAspect
= DVASPECT_CONTENT
;
4386 fmt
.tymed
= TYMED_GDI
;
4387 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
4389 fmt
.cfFormat
= CF_ENHMETAFILE
;
4390 fmt
.tymed
= TYMED_ENHMF
;
4391 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
4393 FIXME("unsupported format\n");
4394 pSize
->cx
= pSize
->cy
= 0;
4395 IDataObject_Release(ido
);
4403 GetObjectW(stgm
.u
.hBitmap
, sizeof(dibsect
), &dibsect
);
4404 pSize
->cx
= dibsect
.dsBm
.bmWidth
;
4405 pSize
->cy
= dibsect
.dsBm
.bmHeight
;
4406 if (!stgm
.pUnkForRelease
) DeleteObject(stgm
.u
.hBitmap
);
4409 GetEnhMetaFileHeader(stgm
.u
.hEnhMetaFile
, sizeof(emh
), &emh
);
4410 pSize
->cx
= emh
.rclBounds
.right
- emh
.rclBounds
.left
;
4411 pSize
->cy
= emh
.rclBounds
.bottom
- emh
.rclBounds
.top
;
4412 if (!stgm
.pUnkForRelease
) DeleteEnhMetaFile(stgm
.u
.hEnhMetaFile
);
4415 FIXME("Unsupported tymed %d\n", stgm
.tymed
);
4418 IDataObject_Release(ido
);
4419 if (c
->editor
->nZoomNumerator
!= 0)
4421 pSize
->cx
= MulDiv(pSize
->cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4422 pSize
->cy
= MulDiv(pSize
->cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4426 void ME_DrawOLE(ME_Context
*c
, int x
, int y
, ME_Run
*run
,
4427 ME_Paragraph
*para
, BOOL selected
)
4438 assert(run
->nFlags
& MERF_GRAPHICS
);
4439 assert(run
->ole_obj
);
4440 if (IOleObject_QueryInterface(run
->ole_obj
->poleobj
, &IID_IDataObject
, (void**)&ido
) != S_OK
)
4442 FIXME("Couldn't get interface\n");
4445 has_size
= run
->ole_obj
->sizel
.cx
!= 0 || run
->ole_obj
->sizel
.cy
!= 0;
4446 fmt
.cfFormat
= CF_BITMAP
;
4448 fmt
.dwAspect
= DVASPECT_CONTENT
;
4450 fmt
.tymed
= TYMED_GDI
;
4451 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
4453 fmt
.cfFormat
= CF_ENHMETAFILE
;
4454 fmt
.tymed
= TYMED_ENHMF
;
4455 if (IDataObject_GetData(ido
, &fmt
, &stgm
) != S_OK
)
4457 FIXME("Couldn't get storage medium\n");
4458 IDataObject_Release(ido
);
4465 GetObjectW(stgm
.u
.hBitmap
, sizeof(dibsect
), &dibsect
);
4466 hMemDC
= CreateCompatibleDC(c
->hDC
);
4467 SelectObject(hMemDC
, stgm
.u
.hBitmap
);
4470 convert_sizel(c
, &run
->ole_obj
->sizel
, &sz
);
4472 sz
.cx
= MulDiv(dibsect
.dsBm
.bmWidth
, c
->dpi
.cx
, 96);
4473 sz
.cy
= MulDiv(dibsect
.dsBm
.bmHeight
, c
->dpi
.cy
, 96);
4475 if (c
->editor
->nZoomNumerator
!= 0)
4477 sz
.cx
= MulDiv(sz
.cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4478 sz
.cy
= MulDiv(sz
.cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4480 if (sz
.cx
== dibsect
.dsBm
.bmWidth
&& sz
.cy
== dibsect
.dsBm
.bmHeight
)
4482 BitBlt(c
->hDC
, x
, y
- sz
.cy
,
4483 dibsect
.dsBm
.bmWidth
, dibsect
.dsBm
.bmHeight
,
4484 hMemDC
, 0, 0, SRCCOPY
);
4486 StretchBlt(c
->hDC
, x
, y
- sz
.cy
, sz
.cx
, sz
.cy
,
4487 hMemDC
, 0, 0, dibsect
.dsBm
.bmWidth
,
4488 dibsect
.dsBm
.bmHeight
, SRCCOPY
);
4491 if (!stgm
.pUnkForRelease
) DeleteObject(stgm
.u
.hBitmap
);
4494 GetEnhMetaFileHeader(stgm
.u
.hEnhMetaFile
, sizeof(emh
), &emh
);
4497 convert_sizel(c
, &run
->ole_obj
->sizel
, &sz
);
4499 sz
.cy
= MulDiv(emh
.rclBounds
.bottom
- emh
.rclBounds
.top
, c
->dpi
.cx
, 96);
4500 sz
.cx
= MulDiv(emh
.rclBounds
.right
- emh
.rclBounds
.left
, c
->dpi
.cy
, 96);
4502 if (c
->editor
->nZoomNumerator
!= 0)
4504 sz
.cx
= MulDiv(sz
.cx
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4505 sz
.cy
= MulDiv(sz
.cy
, c
->editor
->nZoomNumerator
, c
->editor
->nZoomDenominator
);
4513 rc
.right
= x
+ sz
.cx
;
4515 PlayEnhMetaFile(c
->hDC
, stgm
.u
.hEnhMetaFile
, &rc
);
4517 if (!stgm
.pUnkForRelease
) DeleteEnhMetaFile(stgm
.u
.hEnhMetaFile
);
4520 FIXME("Unsupported tymed %d\n", stgm
.tymed
);
4524 if (selected
&& !c
->editor
->bHideSelection
)
4525 PatBlt(c
->hDC
, x
, y
- sz
.cy
, sz
.cx
, sz
.cy
, DSTINVERT
);
4526 IDataObject_Release(ido
);
4529 void ME_DeleteReObject(REOBJECT
* reo
)
4531 if (reo
->poleobj
) IOleObject_Release(reo
->poleobj
);
4532 if (reo
->pstg
) IStorage_Release(reo
->pstg
);
4533 if (reo
->polesite
) IOleClientSite_Release(reo
->polesite
);
4537 void ME_CopyReObject(REOBJECT
* dst
, const REOBJECT
* src
)
4541 if (dst
->poleobj
) IOleObject_AddRef(dst
->poleobj
);
4542 if (dst
->pstg
) IStorage_AddRef(dst
->pstg
);
4543 if (dst
->polesite
) IOleClientSite_AddRef(dst
->polesite
);
4546 void ME_GetITextDocumentInterface(IRichEditOle
*iface
, LPVOID
*ppvObj
)
4548 IRichEditOleImpl
*This
= impl_from_IRichEditOle(iface
);
4549 *ppvObj
= &This
->ITextDocument_iface
;