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
9a264e54
Commit
9a264e54
authored
Dec 27, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store known colors as RGB.
parent
bbd925dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
25 deletions
+37
-25
htmlbody.c
dlls/mshtml/htmlbody.c
+37
-25
No files found.
dlls/mshtml/htmlbody.c
View file @
9a264e54
...
...
@@ -63,45 +63,57 @@ static const WCHAR yellowW[] = {'y','e','l','l','o','w',0};
static
const
struct
{
LPCWSTR
keyword
;
const
WCHAR
hexstr
[
8
]
;
DWORD
rgb
;
}
keyword_table
[]
=
{
{
aquaW
,
{
'#'
,
'0'
,
'0'
,
'f'
,
'f'
,
'f'
,
'f'
,
0
}
},
{
blackW
,
{
'#'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
}
},
{
blueW
,
{
'#'
,
'0'
,
'0'
,
'0'
,
'0'
,
'f'
,
'f'
,
0
}
},
{
fuchsiaW
,
{
'#'
,
'f'
,
'f'
,
'0'
,
'0'
,
'f'
,
'f'
,
0
}
},
{
grayW
,
{
'#'
,
'8'
,
'0'
,
'8'
,
'0'
,
'8'
,
'0'
,
0
}
},
{
greenW
,
{
'#'
,
'0'
,
'0'
,
'8'
,
'0'
,
'0'
,
'0'
,
0
}
},
{
limeW
,
{
'#'
,
'0'
,
'0'
,
'f'
,
'f'
,
'0'
,
'0'
,
0
}
},
{
maroonW
,
{
'#'
,
'8'
,
'0'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
}
},
{
navyW
,
{
'#'
,
'0'
,
'0'
,
'0'
,
'0'
,
'8'
,
'0'
,
0
}
},
{
oliveW
,
{
'#'
,
'8'
,
'0'
,
'8'
,
'0'
,
'0'
,
'0'
,
0
}
},
{
purpleW
,
{
'#'
,
'8'
,
'0'
,
'0'
,
'0'
,
'8'
,
'0'
,
0
}
},
{
redW
,
{
'#'
,
'f'
,
'f'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
}
},
{
silverW
,
{
'#'
,
'c'
,
'0'
,
'c'
,
'0'
,
'c'
,
'0'
,
0
}
},
{
tealW
,
{
'#'
,
'0'
,
'0'
,
'8'
,
'0'
,
'8'
,
'0'
,
0
}
},
{
whiteW
,
{
'#'
,
'f'
,
'f'
,
'f'
,
'f'
,
'f'
,
'f'
,
0
}
},
{
yellowW
,
{
'#'
,
'f'
,
'f'
,
'f'
,
'f'
,
'0'
,
'0'
,
0
}
}
{
aquaW
,
0x00ffff
},
{
blackW
,
0x000000
},
{
blueW
,
0x0000ff
},
{
fuchsiaW
,
0xff00ff
},
{
grayW
,
0x808080
},
{
greenW
,
0x008000
},
{
limeW
,
0x00ff00
},
{
maroonW
,
0x800000
},
{
navyW
,
0x000080
},
{
oliveW
,
0x808000
},
{
purpleW
,
0x800080
},
{
redW
,
0xff0000
},
{
silverW
,
0xc0c0c0
},
{
tealW
,
0x008080
},
{
whiteW
,
0xffffff
},
{
yellowW
,
0xffff00
}
};
static
HRESULT
nscolor_to_str
(
LPCWSTR
color
,
BSTR
*
ret
)
{
int
i
;
int
i
,
rgb
=
-
1
;
static
const
WCHAR
formatW
[]
=
{
'#'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
0
};
if
(
!
color
||
*
color
==
'#'
)
{
*
ret
=
SysAllocString
(
color
);
return
*
ret
?
S_OK
:
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
sizeof
(
keyword_table
)
/
sizeof
(
keyword_table
[
0
]);
i
++
)
{
if
(
!
strcmpiW
(
color
,
keyword_table
[
i
].
keyword
)
)
{
*
ret
=
SysAllocString
(
keyword_table
[
i
].
hexstr
);
return
*
ret
?
S_OK
:
E_OUTOFMEMORY
;
if
(
*
color
!=
'#'
)
{
for
(
i
=
0
;
i
<
sizeof
(
keyword_table
)
/
sizeof
(
keyword_table
[
0
]);
i
++
)
{
if
(
!
strcmpiW
(
color
,
keyword_table
[
i
].
keyword
))
rgb
=
keyword_table
[
i
].
rgb
;
}
}
if
(
rgb
==
-
1
)
{
WARN
(
"unknown color %s
\n
"
,
debugstr_w
(
color
));
*
ret
=
SysAllocString
(
color
);
return
*
ret
?
S_OK
:
E_OUTOFMEMORY
;
}
WARN
(
"unknown color %s
\n
"
,
debugstr_w
(
color
));
*
ret
=
SysAllocString
(
color
);
return
*
ret
?
S_OK
:
E_OUTOFMEMORY
;
*
ret
=
SysAllocStringLen
(
NULL
,
7
);
if
(
!*
ret
)
return
E_OUTOFMEMORY
;
sprintfW
(
*
ret
,
formatW
,
rgb
>>
16
,
(
rgb
>>
8
)
&
0xff
,
rgb
&
0xff
);
TRACE
(
"%s -> %s
\n
"
,
debugstr_w
(
color
),
debugstr_w
(
*
ret
));
return
S_OK
;
}
static
BOOL
variant_to_nscolor
(
const
VARIANT
*
v
,
nsAString
*
nsstr
)
...
...
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