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
791b868c
Commit
791b868c
authored
Jun 10, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move setup_ns_editing to nsembed.c.
parent
bd71f19e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
49 deletions
+50
-49
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+48
-0
olecmd.c
dlls/mshtml/olecmd.c
+1
-49
No files found.
dlls/mshtml/mshtml_private.h
View file @
791b868c
...
...
@@ -383,6 +383,7 @@ typedef struct {
extern
const
cmdtable_t
editmode_cmds
[];
/* editor */
void
set_ns_editmode
(
NSContainer
*
);
void
handle_edit_event
(
HTMLDocument
*
,
nsIDOMEvent
*
);
extern
DWORD
mshtml_tls
;
...
...
dlls/mshtml/nsembed.c
View file @
791b868c
...
...
@@ -580,6 +580,54 @@ void nsnode_to_nsstring(nsIDOMNode *nsdoc, nsAString *str)
nsIContentSerializer_Release
(
serializer
);
}
void
set_ns_editmode
(
NSContainer
*
This
)
{
nsIInterfaceRequestor
*
iface_req
;
nsIEditingSession
*
editing_session
=
NULL
;
nsIURIContentListener
*
listener
=
NULL
;
nsIDOMWindow
*
dom_window
=
NULL
;
nsresult
nsres
;
nsres
=
nsIWebBrowser_QueryInterface
(
This
->
webbrowser
,
&
IID_nsIInterfaceRequestor
,
(
void
**
)
&
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIInterfaceRequestor: %08x
\n
"
,
nsres
);
return
;
}
nsres
=
nsIInterfaceRequestor_GetInterface
(
iface_req
,
&
IID_nsIEditingSession
,
(
void
**
)
&
editing_session
);
nsIInterfaceRequestor_Release
(
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIEditingSession: %08x
\n
"
,
nsres
);
return
;
}
nsres
=
nsIWebBrowser_GetContentDOMWindow
(
This
->
webbrowser
,
&
dom_window
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get content DOM window: %08x
\n
"
,
nsres
);
nsIEditingSession_Release
(
editing_session
);
return
;
}
nsres
=
nsIEditingSession_MakeWindowEditable
(
editing_session
,
dom_window
,
NULL
,
FALSE
);
nsIEditingSession_Release
(
editing_session
);
nsIDOMWindow_Release
(
dom_window
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"MakeWindowEditable failed: %08x
\n
"
,
nsres
);
return
;
}
/* MakeWindowEditable changes WebBrowser's parent URI content listener.
* It seams to be a bug in Gecko. To workaround it we set our content
* listener again and Gecko's one as its parent.
*/
nsIWebBrowser_GetParentURIContentListener
(
This
->
webbrowser
,
&
listener
);
nsIURIContentListener_SetParentContentListener
(
NSURICL
(
This
),
listener
);
nsIURIContentListener_Release
(
listener
);
nsIWebBrowser_SetParentURIContentListener
(
This
->
webbrowser
,
NSURICL
(
This
));
}
void
close_gecko
(
void
)
{
TRACE
(
"()
\n
"
);
...
...
dlls/mshtml/olecmd.c
View file @
791b868c
...
...
@@ -511,54 +511,6 @@ static HRESULT exec_browsemode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in
return
S_OK
;
}
static
void
setup_ns_editing
(
NSContainer
*
This
)
{
nsIInterfaceRequestor
*
iface_req
;
nsIEditingSession
*
editing_session
=
NULL
;
nsIURIContentListener
*
listener
=
NULL
;
nsIDOMWindow
*
dom_window
=
NULL
;
nsresult
nsres
;
nsres
=
nsIWebBrowser_QueryInterface
(
This
->
webbrowser
,
&
IID_nsIInterfaceRequestor
,
(
void
**
)
&
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIInterfaceRequestor: %08x
\n
"
,
nsres
);
return
;
}
nsres
=
nsIInterfaceRequestor_GetInterface
(
iface_req
,
&
IID_nsIEditingSession
,
(
void
**
)
&
editing_session
);
nsIInterfaceRequestor_Release
(
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIEditingSession: %08x
\n
"
,
nsres
);
return
;
}
nsres
=
nsIWebBrowser_GetContentDOMWindow
(
This
->
webbrowser
,
&
dom_window
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get content DOM window: %08x
\n
"
,
nsres
);
nsIEditingSession_Release
(
editing_session
);
return
;
}
nsres
=
nsIEditingSession_MakeWindowEditable
(
editing_session
,
dom_window
,
NULL
,
FALSE
);
nsIEditingSession_Release
(
editing_session
);
nsIDOMWindow_Release
(
dom_window
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"MakeWindowEditable failed: %08x
\n
"
,
nsres
);
return
;
}
/* MakeWindowEditable changes WebBrowser's parent URI content listener.
* It seams to be a bug in Gecko. To workaround it we set our content
* listener again and Gecko's one as its parent.
*/
nsIWebBrowser_GetParentURIContentListener
(
This
->
webbrowser
,
&
listener
);
nsIURIContentListener_SetParentContentListener
(
NSURICL
(
This
),
listener
);
nsIURIContentListener_Release
(
listener
);
nsIWebBrowser_SetParentURIContentListener
(
This
->
webbrowser
,
NSURICL
(
This
));
}
static
HRESULT
exec_editmode
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
IMoniker
*
mon
;
...
...
@@ -590,7 +542,7 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
}
if
(
This
->
nscontainer
)
set
up_ns_editing
(
This
->
nscontainer
);
set
_ns_editmode
(
This
->
nscontainer
);
hres
=
CreateURLMoniker
(
NULL
,
wszAboutBlank
,
&
mon
);
if
(
FAILED
(
hres
))
{
...
...
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