Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a9c83385
Commit
a9c83385
authored
Apr 16, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved style_tbl lookup to separated function.
parent
cea8bc52
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
15 deletions
+28
-15
htmlstyle.c
dlls/mshtml/htmlstyle.c
+28
-15
No files found.
dlls/mshtml/htmlstyle.c
View file @
a9c83385
...
...
@@ -173,10 +173,12 @@ static const WCHAR attrWordWrap[] =
static
const
WCHAR
attrZIndex
[]
=
{
'z'
,
'-'
,
'i'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
static
const
struct
{
typedef
struct
{
const
WCHAR
*
name
;
DISPID
dispid
;
}
style_tbl
[]
=
{
}
style_tbl_entry_t
;
static
const
style_tbl_entry_t
style_tbl
[]
=
{
{
attrBackground
,
DISPID_IHTMLSTYLE_BACKGROUND
},
{
attrBackgroundColor
,
DISPID_IHTMLSTYLE_BACKGROUNDCOLOR
},
{
attrBackgroundImage
,
DISPID_IHTMLSTYLE_BACKGROUNDIMAGE
},
...
...
@@ -264,6 +266,26 @@ static const WCHAR valBlink[] =
static
const
WCHAR
px_formatW
[]
=
{
'%'
,
'd'
,
'p'
,
'x'
,
0
};
static
const
WCHAR
emptyW
[]
=
{
0
};
static
const
style_tbl_entry_t
*
lookup_style_tbl
(
const
WCHAR
*
name
)
{
int
c
,
i
,
min
=
0
,
max
=
sizeof
(
style_tbl
)
/
sizeof
(
*
style_tbl
)
-
1
;
while
(
min
<=
max
)
{
i
=
(
min
+
max
)
/
2
;
c
=
strcmpW
(
style_tbl
[
i
].
name
,
name
);
if
(
!
c
)
return
style_tbl
+
i
;
if
(
c
>
0
)
max
=
i
-
1
;
else
min
=
i
+
1
;
}
return
NULL
;
}
static
LPWSTR
fix_px_value
(
LPCWSTR
val
)
{
LPCWSTR
ptr
=
val
;
...
...
@@ -2929,23 +2951,14 @@ static const IHTMLStyleVtbl HTMLStyleVtbl = {
static
HRESULT
HTMLStyle_get_dispid
(
DispatchEx
*
dispex
,
BSTR
name
,
DWORD
flags
,
DISPID
*
dispid
)
{
int
c
,
i
,
min
=
0
,
max
=
sizeof
(
style_tbl
)
/
sizeof
(
*
style_tbl
)
-
1
;
const
style_tbl_entry_t
*
style_entry
;
while
(
min
<=
max
)
{
i
=
(
min
+
max
)
/
2
;
c
=
strcmpW
(
style_tbl
[
i
].
name
,
name
);
if
(
!
c
)
{
*
dispid
=
style_tbl
[
i
].
dispid
;
style_entry
=
lookup_style_tbl
(
name
);
if
(
style_entry
)
{
*
dispid
=
style_entry
->
dispid
;
return
S_OK
;
}
if
(
c
>
0
)
max
=
i
-
1
;
else
min
=
i
+
1
;
}
return
DISP_E_UNKNOWNNAME
;
}
...
...
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