Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
234310e7
Commit
234310e7
authored
Oct 28, 2014
by
Jactry Zeng
Committed by
Alexandre Julliard
Oct 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add COM aggregation support for IRichEditOle.
parent
ffb706ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
20 deletions
+58
-20
editor.c
dlls/riched20/editor.c
+2
-2
editor.h
dlls/riched20/editor.h
+1
-1
richole.c
dlls/riched20/richole.c
+55
-17
No files found.
dlls/riched20/editor.c
View file @
234310e7
...
...
@@ -1194,7 +1194,7 @@ static BOOL ME_RTFInsertOleObject(RTF_Info *info, HENHMETAFILE hemf, HBITMAP hbm
if
(
!
info
->
lpRichEditOle
)
{
CreateIRichEditOle
(
info
->
editor
,
(
VOID
**
)
&
info
->
lpRichEditOle
);
CreateIRichEditOle
(
NULL
,
info
->
editor
,
(
VOID
**
)
&
info
->
lpRichEditOle
);
}
if
(
OleCreateDefaultHandler
(
&
CLSID_NULL
,
NULL
,
&
IID_IOleObject
,
(
void
**
)
&
lpObject
)
==
S_OK
&&
...
...
@@ -4474,7 +4474,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
case
EM_GETOLEINTERFACE
:
{
if
(
!
editor
->
reOle
)
if
(
!
CreateIRichEditOle
(
editor
,
(
LPVOID
*
)
&
editor
->
reOle
))
if
(
!
CreateIRichEditOle
(
NULL
,
editor
,
(
LPVOID
*
)
&
editor
->
reOle
))
return
0
;
*
(
LPVOID
*
)
lParam
=
editor
->
reOle
;
IRichEditOle_AddRef
(
editor
->
reOle
);
...
...
dlls/riched20/editor.h
View file @
234310e7
...
...
@@ -240,7 +240,7 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) DECLSPEC_HIDDEN;
int
ME_GetParaBorderWidth
(
const
ME_Context
*
c
,
int
flags
)
DECLSPEC_HIDDEN
;
/* richole.c */
LRESULT
CreateIRichEditOle
(
ME_TextEditor
*
editor
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
LRESULT
CreateIRichEditOle
(
IUnknown
*
outer_unk
,
ME_TextEditor
*
editor
,
LPVOID
*
ppvObj
)
DECLSPEC_HIDDEN
;
void
ME_DrawOLE
(
ME_Context
*
c
,
int
x
,
int
y
,
ME_Run
*
run
,
ME_Paragraph
*
para
,
BOOL
selected
)
DECLSPEC_HIDDEN
;
void
ME_GetOLEObjectSize
(
const
ME_Context
*
c
,
ME_Run
*
run
,
SIZE
*
pSize
)
DECLSPEC_HIDDEN
;
void
ME_CopyReObject
(
REOBJECT
*
dst
,
const
REOBJECT
*
src
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/richole.c
View file @
234310e7
...
...
@@ -52,8 +52,10 @@ typedef struct IOleClientSiteImpl IOleClientSiteImpl;
typedef
struct
ITextRangeImpl
ITextRangeImpl
;
typedef
struct
IRichEditOleImpl
{
IUnknown
IUnknown_inner
;
IRichEditOle
IRichEditOle_iface
;
ITextDocument
ITextDocument_iface
;
IUnknown
*
outer_unk
;
LONG
ref
;
ME_TextEditor
*
editor
;
...
...
@@ -95,44 +97,47 @@ static inline IRichEditOleImpl *impl_from_ITextDocument(ITextDocument *iface)
return
CONTAINING_RECORD
(
iface
,
IRichEditOleImpl
,
ITextDocument_iface
);
}
static
HRESULT
WINAPI
IRichEditOle_fnQueryInterface
(
IRichEditOle
*
me
,
REFIID
riid
,
LPVOID
*
ppvObj
)
static
inline
IRichEditOleImpl
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
IRichEditOleImpl
*
This
=
impl_from_IRichEditOle
(
me
);
return
CONTAINING_RECORD
(
iface
,
IRichEditOleImpl
,
IUnknown_inner
);
}
TRACE
(
"%p %s
\n
"
,
This
,
debugstr_guid
(
riid
)
);
static
HRESULT
WINAPI
IRichEditOleImpl_inner_fnQueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
IRichEditOleImpl
*
This
=
impl_from_IUnknown
(
iface
);
TRACE
(
"%p %s
\n
"
,
This
,
debugstr_guid
(
riid
));
*
ppvObj
=
NULL
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IRichEditOle
))
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
*
ppvObj
=
&
This
->
IUnknown_inner
;
else
if
(
IsEqualGUID
(
riid
,
&
IID_IRichEditOle
))
*
ppvObj
=
&
This
->
IRichEditOle_iface
;
else
if
(
IsEqualGUID
(
riid
,
&
IID_ITextDocument
))
*
ppvObj
=
&
This
->
ITextDocument_iface
;
if
(
*
ppvObj
)
{
I
RichEditOle_AddRef
(
me
);
I
Unknown_AddRef
((
IUnknown
*
)
*
ppvObj
);
return
S_OK
;
}
FIXME
(
"%p: unhandled interface %s
\n
"
,
This
,
debugstr_guid
(
riid
)
);
FIXME
(
"%p: unhandled interface %s
\n
"
,
This
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IRichEditOle_fnAddRef
(
IRichEditOle
*
me
)
static
ULONG
WINAPI
IRichEditOleImpl_inner_fnAddRef
(
IUnknown
*
iface
)
{
IRichEditOleImpl
*
This
=
impl_from_I
RichEditOle
(
m
e
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
IRichEditOleImpl
*
This
=
impl_from_I
Unknown
(
ifac
e
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"%p ref = %u
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
IRichEditOle_fnRelease
(
IRichEditOle
*
me
)
static
ULONG
WINAPI
IRichEditOleImpl_inner_fnRelease
(
IUnknown
*
iface
)
{
IRichEditOleImpl
*
This
=
impl_from_I
RichEditOle
(
m
e
);
IRichEditOleImpl
*
This
=
impl_from_I
Unknown
(
ifac
e
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"%p ref=%u
\n
"
,
This
,
ref
);
...
...
@@ -152,6 +157,34 @@ IRichEditOle_fnRelease(IRichEditOle *me)
return
ref
;
}
static
const
IUnknownVtbl
reo_unk_vtbl
=
{
IRichEditOleImpl_inner_fnQueryInterface
,
IRichEditOleImpl_inner_fnAddRef
,
IRichEditOleImpl_inner_fnRelease
};
static
HRESULT
WINAPI
IRichEditOle_fnQueryInterface
(
IRichEditOle
*
me
,
REFIID
riid
,
LPVOID
*
ppvObj
)
{
IRichEditOleImpl
*
This
=
impl_from_IRichEditOle
(
me
);
return
IUnknown_QueryInterface
(
This
->
outer_unk
,
riid
,
ppvObj
);
}
static
ULONG
WINAPI
IRichEditOle_fnAddRef
(
IRichEditOle
*
me
)
{
IRichEditOleImpl
*
This
=
impl_from_IRichEditOle
(
me
);
return
IUnknown_AddRef
(
This
->
outer_unk
);
}
static
ULONG
WINAPI
IRichEditOle_fnRelease
(
IRichEditOle
*
me
)
{
IRichEditOleImpl
*
This
=
impl_from_IRichEditOle
(
me
);
return
IUnknown_Release
(
This
->
outer_unk
);
}
static
HRESULT
WINAPI
IRichEditOle_fnActivateAs
(
IRichEditOle
*
me
,
REFCLSID
rclsid
,
REFCLSID
rclsidAs
)
{
...
...
@@ -2305,7 +2338,7 @@ CreateTextSelection(IRichEditOleImpl *reOle)
return
txtSel
;
}
LRESULT
CreateIRichEditOle
(
ME_TextEditor
*
editor
,
LPVOID
*
pp
Obj
)
LRESULT
CreateIRichEditOle
(
IUnknown
*
outer_unk
,
ME_TextEditor
*
editor
,
LPVOID
*
ppv
Obj
)
{
IRichEditOleImpl
*
reo
;
...
...
@@ -2313,6 +2346,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj)
if
(
!
reo
)
return
0
;
reo
->
IUnknown_inner
.
lpVtbl
=
&
reo_unk_vtbl
;
reo
->
IRichEditOle_iface
.
lpVtbl
=
&
revt
;
reo
->
ITextDocument_iface
.
lpVtbl
=
&
tdvt
;
reo
->
ref
=
1
;
...
...
@@ -2331,8 +2365,12 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj)
return
0
;
}
TRACE
(
"Created %p
\n
"
,
reo
);
*
ppObj
=
reo
;
list_init
(
&
reo
->
rangelist
);
if
(
outer_unk
)
reo
->
outer_unk
=
outer_unk
;
else
reo
->
outer_unk
=
&
reo
->
IUnknown_inner
;
*
ppvObj
=
&
reo
->
IRichEditOle_iface
;
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment