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
1133bc7c
Commit
1133bc7c
authored
Jul 09, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added String_fontcolor implementation.
parent
cd0c18be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
2 deletions
+65
-2
string.c
dlls/jscript/string.c
+52
-2
api.js
dlls/jscript/tests/api.js
+13
-0
No files found.
dlls/jscript/string.c
View file @
1133bc7c
...
...
@@ -150,6 +150,54 @@ static HRESULT do_attributeless_tag_format(DispatchEx *dispex, LCID lcid, WORD f
return
S_OK
;
}
static
HRESULT
do_attribute_tag_format
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
,
const
WCHAR
*
tagname
,
const
WCHAR
*
attr
)
{
static
const
WCHAR
tagfmtW
[]
=
{
'<'
,
'%'
,
's'
,
' '
,
'%'
,
's'
,
'='
,
'\"'
,
'%'
,
's'
,
'\"'
,
'>'
,
'%'
,
's'
,
'<'
,
'/'
,
'%'
,
's'
,
'>'
,
0
};
static
const
WCHAR
undefinedW
[]
=
{
'u'
,
'n'
,
'd'
,
'e'
,
'f'
,
'i'
,
'n'
,
'e'
,
'd'
,
0
};
StringInstance
*
string
;
BSTR
ret
,
attr_value
;
HRESULT
hres
;
if
(
!
is_class
(
dispex
,
JSCLASS_STRING
))
{
WARN
(
"this is not a string object
\n
"
);
return
E_NOTIMPL
;
}
string
=
(
StringInstance
*
)
dispex
;
if
(
arg_cnt
(
dp
))
{
hres
=
to_string
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
attr_value
);
if
(
FAILED
(
hres
))
return
hres
;
}
else
{
attr_value
=
SysAllocString
(
undefinedW
);
if
(
!
attr_value
)
return
E_OUTOFMEMORY
;
}
if
(
retv
)
{
ret
=
SysAllocStringLen
(
NULL
,
string
->
length
+
2
*
strlenW
(
tagname
)
+
strlenW
(
attr
)
+
SysStringLen
(
attr_value
)
+
9
);
if
(
!
ret
)
{
SysFreeString
(
attr_value
);
return
E_OUTOFMEMORY
;
}
sprintfW
(
ret
,
tagfmtW
,
tagname
,
attr
,
attr_value
,
string
->
str
,
tagname
);
V_VT
(
retv
)
=
VT_BSTR
;
V_BSTR
(
retv
)
=
ret
;
}
SysFreeString
(
attr_value
);
return
S_OK
;
}
static
HRESULT
String_anchor
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
...
...
@@ -336,8 +384,10 @@ static HRESULT String_fixed(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
static
HRESULT
String_fontcolor
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
sp
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
static
const
WCHAR
fontW
[]
=
{
'F'
,
'O'
,
'N'
,
'T'
,
0
};
static
const
WCHAR
colorW
[]
=
{
'C'
,
'O'
,
'L'
,
'O'
,
'R'
,
0
};
return
do_attribute_tag_format
(
dispex
,
lcid
,
flags
,
dp
,
retv
,
ei
,
sp
,
fontW
,
colorW
);
}
static
HRESULT
String_fontsize
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
dlls/jscript/tests/api.js
View file @
1133bc7c
...
...
@@ -305,6 +305,19 @@ ok(tmp === "<TT>test</TT>", "'test'.fixed() = " + tmp);
tmp
=
"test"
.
fixed
(
3
);
ok
(
tmp
===
"<TT>test</TT>"
,
"'test'.fixed(3) = "
+
tmp
);
tmp
=
""
.
fontcolor
();
ok
(
tmp
===
"<FONT COLOR=
\"
undefined
\"
></FONT>"
,
"''.fontcolor() = "
+
tmp
);
tmp
=
""
.
fontcolor
(
3
);
ok
(
tmp
===
"<FONT COLOR=
\"
3
\"
></FONT>"
,
"''.fontcolor(3) = "
+
tmp
);
tmp
=
""
.
fontcolor
(
"red"
);
ok
(
tmp
===
"<FONT COLOR=
\"
red
\"
></FONT>"
,
"''.fontcolor('red') = "
+
tmp
);
tmp
=
"test"
.
fontcolor
();
ok
(
tmp
===
"<FONT COLOR=
\"
undefined
\"
>test</FONT>"
,
"'test'.fontcolor() = "
+
tmp
);
tmp
=
"test"
.
fontcolor
(
3
);
ok
(
tmp
===
"<FONT COLOR=
\"
3
\"
>test</FONT>"
,
"'test'.fontcolor(3) = "
+
tmp
);
tmp
=
"test"
.
fontcolor
(
"green"
);
ok
(
tmp
===
"<FONT COLOR=
\"
green
\"
>test</FONT>"
,
"'test'.fontcolor('green') = "
+
tmp
);
tmp
=
""
.
italics
();
ok
(
tmp
===
"<I></I>"
,
"''.italics() = "
+
tmp
);
tmp
=
""
.
italics
(
3
);
...
...
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