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
16b38c45
Commit
16b38c45
authored
Jul 12, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Make do_attribute_tag_format generic.
parent
0ee06df4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
string.c
dlls/jscript/string.c
+29
-9
No files found.
dlls/jscript/string.c
View file @
16b38c45
...
...
@@ -177,43 +177,63 @@ static HRESULT do_attribute_tag_format(DispatchEx *dispex, LCID lcid, WORD flags
=
{
'<'
,
'%'
,
'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
;
const
WCHAR
*
str
;
DWORD
length
;
BSTR
attr_value
,
val_str
=
NULL
;
HRESULT
hres
;
if
(
!
is_class
(
dispex
,
JSCLASS_STRING
))
{
WARN
(
"this is not a string object
\n
"
);
return
E_NOTIMPL
;
VARIANT
this
;
V_VT
(
&
this
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
this
)
=
(
IDispatch
*
)
_IDispatchEx_
(
dispex
);
hres
=
to_string
(
dispex
->
ctx
,
&
this
,
ei
,
&
val_str
);
if
(
FAILED
(
hres
))
return
hres
;
str
=
val_str
;
length
=
SysStringLen
(
val_str
);
}
else
{
StringInstance
*
this
=
(
StringInstance
*
)
dispex
;
string
=
(
StringInstance
*
)
dispex
;
str
=
this
->
str
;
length
=
this
->
length
;
}
if
(
arg_cnt
(
dp
))
{
hres
=
to_string
(
dispex
->
ctx
,
get_arg
(
dp
,
0
),
ei
,
&
attr_value
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
{
SysFreeString
(
val_str
);
return
hres
;
}
}
else
{
attr_value
=
SysAllocString
(
undefinedW
);
if
(
!
attr_value
)
if
(
!
attr_value
)
{
SysFreeString
(
val_str
);
return
E_OUTOFMEMORY
;
}
}
if
(
retv
)
{
ret
=
SysAllocStringLen
(
NULL
,
string
->
length
+
2
*
strlenW
(
tagname
)
BSTR
ret
=
SysAllocStringLen
(
NULL
,
length
+
2
*
strlenW
(
tagname
)
+
strlenW
(
attr
)
+
SysStringLen
(
attr_value
)
+
9
);
if
(
!
ret
)
{
SysFreeString
(
attr_value
);
SysFreeString
(
val_str
);
return
E_OUTOFMEMORY
;
}
sprintfW
(
ret
,
tagfmtW
,
tagname
,
attr
,
attr_value
,
str
ing
->
str
,
tagname
);
sprintfW
(
ret
,
tagfmtW
,
tagname
,
attr
,
attr_value
,
str
,
tagname
);
V_VT
(
retv
)
=
VT_BSTR
;
V_BSTR
(
retv
)
=
ret
;
}
SysFreeString
(
attr_value
);
SysFreeString
(
val_str
);
return
S_OK
;
}
...
...
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