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
3d3f223a
Commit
3d3f223a
authored
Aug 18, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use QueryCommandState to get align state.
parent
3fbf6bdf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
editor.c
dlls/mshtml/editor.c
+24
-13
No files found.
dlls/mshtml/editor.c
View file @
3d3f223a
...
...
@@ -180,25 +180,33 @@ static void set_ns_align(HTMLDocument *This, const char *align_str)
nsICommandParams_Release
(
nsparam
);
}
static
DWORD
query_align_status
(
HTMLDocument
*
This
,
const
char
*
align_str
)
static
DWORD
query_align_status
(
HTMLDocument
*
This
,
const
WCHAR
*
align
)
{
nsICommandParams
*
nsparam
;
char
*
align
=
NULL
;
DWORD
ret
=
OLECMDF_SUPPORTED
|
OLECMDF_ENABLED
;
nsIDOMNSHTMLDocument
*
nsdoc
;
nsAString
justify_str
;
PRBool
b
;
nsresult
nsres
;
if
(
This
->
doc_obj
->
usermode
!=
EDITMODE
||
This
->
window
->
readystate
<
READYSTATE_INTERACTIVE
)
return
OLECMDF_SUPPORTED
;
if
(
This
->
doc_obj
->
nscontainer
)
{
nsparam
=
create_nscommand_params
();
get_ns_command_state
(
This
->
doc_obj
->
nscontainer
,
NSCMD_ALIGN
,
nsparam
);
nsICommandParams_GetCStringValue
(
nsparam
,
NSSTATE_ATTRIBUTE
,
&
align
);
nsICommandParams_Release
(
nsparam
);
nsres
=
nsIDOMHTMLDocument_QueryInterface
(
This
->
doc_node
->
nsdoc
,
&
IID_nsIDOMNSHTMLDocument
,
(
void
**
)
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMNSHTMLDocument iface: %08x
\n
"
,
nsres
);
return
0
;
}
return
OLECMDF_SUPPORTED
|
OLECMDF_ENABLED
|
(
align
&&
!
strcmp
(
align_str
,
align
)
?
OLECMDF_LATCHED
:
0
);
nsAString_Init
(
&
justify_str
,
align
);
nsres
=
nsIDOMNSHTMLDocument_QueryCommandState
(
nsdoc
,
&
justify_str
,
&
b
);
nsAString_Finish
(
&
justify_str
);
if
(
NS_SUCCEEDED
(
nsres
)
&&
b
)
ret
|=
OLECMDF_LATCHED
;
nsIDOMNSHTMLDocument_Release
(
nsdoc
);
return
ret
;
}
...
...
@@ -704,10 +712,13 @@ static HRESULT exec_italic(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VA
static
HRESULT
query_justify
(
HTMLDocument
*
This
,
OLECMD
*
cmd
)
{
static
const
PRUnichar
justifycenterW
[]
=
{
'j'
,
'u'
,
's'
,
't'
,
'i'
,
'f'
,
'y'
,
'c'
,
'e'
,
'n'
,
't'
,
'e'
,
'r'
,
0
};
static
const
PRUnichar
justifyrightW
[]
=
{
'j'
,
'u'
,
's'
,
't'
,
'i'
,
'f'
,
'y'
,
'r'
,
'i'
,
'g'
,
'h'
,
't'
,
0
};
switch
(
cmd
->
cmdID
)
{
case
IDM_JUSTIFYCENTER
:
TRACE
(
"(%p) IDM_JUSTIFYCENTER
\n
"
,
This
);
cmd
->
cmdf
=
query_align_status
(
This
,
NSALIGN_CENTER
);
cmd
->
cmdf
=
query_align_status
(
This
,
justifycenterW
);
break
;
case
IDM_JUSTIFYLEFT
:
TRACE
(
"(%p) IDM_JUSTIFYLEFT
\n
"
,
This
);
...
...
@@ -719,7 +730,7 @@ static HRESULT query_justify(HTMLDocument *This, OLECMD *cmd)
break
;
case
IDM_JUSTIFYRIGHT
:
TRACE
(
"(%p) IDM_JUSTIFYRIGHT
\n
"
,
This
);
cmd
->
cmdf
=
query_align_status
(
This
,
NSALIGN_RIGHT
);
cmd
->
cmdf
=
query_align_status
(
This
,
justifyrightW
);
break
;
}
...
...
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