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
0dfc101e
Commit
0dfc101e
authored
May 28, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
May 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use return_nsstr_variant in HTMLTable_get_width.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
93dfc9b6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
43 deletions
+35
-43
htmlnode.c
dlls/mshtml/htmlnode.c
+2
-2
htmltable.c
dlls/mshtml/htmltable.c
+3
-35
mshtml_private.h
dlls/mshtml/mshtml_private.h
+3
-1
nsembed.c
dlls/mshtml/nsembed.c
+17
-5
dom.c
dlls/mshtml/tests/dom.c
+10
-0
No files found.
dlls/mshtml/htmlnode.c
View file @
0dfc101e
...
...
@@ -1234,7 +1234,7 @@ static HRESULT WINAPI HTMLDOMNode3_get_namespaceURI(IHTMLDOMNode3 *iface, VARIAN
nsAString_InitDepend
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMNode_GetNamespaceURI
(
This
->
nsnode
,
&
nsstr
);
return
return_nsstr_variant
(
nsres
,
&
nsstr
,
p
);
return
return_nsstr_variant
(
nsres
,
&
nsstr
,
0
,
p
);
}
static
HRESULT
WINAPI
HTMLDOMNode3_put_textContent
(
IHTMLDOMNode3
*
iface
,
VARIANT
v
)
...
...
@@ -1266,7 +1266,7 @@ static HRESULT WINAPI HTMLDOMNode3_get_textContent(IHTMLDOMNode3 *iface, VARIANT
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMNode_GetTextContent
(
This
->
nsnode
,
&
nsstr
);
return
return_nsstr_variant
(
nsres
,
&
nsstr
,
p
);
return
return_nsstr_variant
(
nsres
,
&
nsstr
,
0
,
p
);
}
static
HRESULT
WINAPI
HTMLDOMNode3_isEqualNode
(
IHTMLDOMNode3
*
iface
,
IHTMLDOMNode3
*
otherNode
,
VARIANT_BOOL
*
isEqual
)
...
...
dlls/mshtml/htmltable.c
View file @
0dfc101e
...
...
@@ -1014,26 +1014,6 @@ static HRESULT var2str(const VARIANT *p, nsAString *nsstr)
return
ret
?
S_OK
:
E_OUTOFMEMORY
;
}
static
HRESULT
nsstr_to_truncated_bstr
(
const
nsAString
*
nsstr
,
BSTR
*
ret_ptr
)
{
const
PRUnichar
*
str
,
*
ptr
,
*
end
=
NULL
;
BSTR
ret
;
nsAString_GetData
(
nsstr
,
&
str
);
for
(
ptr
=
str
;
is_digit
(
*
ptr
);
ptr
++
);
if
(
*
ptr
==
'.'
)
{
for
(
end
=
ptr
++
;
is_digit
(
*
ptr
);
ptr
++
);
if
(
*
ptr
)
end
=
NULL
;
}
ret
=
end
?
SysAllocStringLen
(
str
,
end
-
str
)
:
SysAllocString
(
str
);
*
ret_ptr
=
ret
;
return
ret
?
S_OK
:
E_OUTOFMEMORY
;
}
static
HRESULT
WINAPI
HTMLTable_QueryInterface
(
IHTMLTable
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
@@ -1244,7 +1224,7 @@ static HRESULT WINAPI HTMLTable_get_cellPadding(IHTMLTable *iface, VARIANT *p)
nsAString_Init
(
&
val
,
NULL
);
nsres
=
nsIDOMHTMLTableElement_GetCellPadding
(
This
->
nstable
,
&
val
);
return
return_nsstr_variant
(
nsres
,
&
val
,
p
);
return
return_nsstr_variant
(
nsres
,
&
val
,
0
,
p
);
}
static
HRESULT
WINAPI
HTMLTable_put_background
(
IHTMLTable
*
iface
,
BSTR
v
)
...
...
@@ -1440,25 +1420,13 @@ static HRESULT WINAPI HTMLTable_get_width(IHTMLTable *iface, VARIANT *p)
{
HTMLTable
*
This
=
impl_from_IHTMLTable
(
iface
);
nsAString
val
;
BSTR
bstr
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
val
,
NULL
);
nsres
=
nsIDOMHTMLTableElement_GetWidth
(
This
->
nstable
,
&
val
);
if
(
NS_FAILED
(
nsres
)){
ERR
(
"Get Width failed!
\n
"
);
nsAString_Finish
(
&
val
);
return
E_FAIL
;
}
hres
=
nsstr_to_truncated_bstr
(
&
val
,
&
bstr
);
nsAString_Finish
(
&
val
);
V_VT
(
p
)
=
VT_BSTR
;
V_BSTR
(
p
)
=
bstr
;
return
hres
;
return
return_nsstr_variant
(
nsres
,
&
val
,
NSSTR_IMPLICIT_PX
,
p
);
}
static
HRESULT
WINAPI
HTMLTable_put_height
(
IHTMLTable
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
0dfc101e
...
...
@@ -981,9 +981,11 @@ void nsAString_SetData(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
UINT32
nsAString_GetData
(
const
nsAString
*
,
const
PRUnichar
**
)
DECLSPEC_HIDDEN
;
void
nsAString_Finish
(
nsAString
*
)
DECLSPEC_HIDDEN
;
#define NSSTR_IMPLICIT_PX 0x01
HRESULT
map_nsresult
(
nsresult
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr
(
nsresult
,
nsAString
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr_variant
(
nsresult
nsres
,
nsAString
*
nsstr
,
VARIANT
*
p
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr_variant
(
nsresult
,
nsAString
*
,
unsigned
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
variant_to_nsstr
(
VARIANT
*
,
BOOL
,
nsAString
*
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsform
(
nsresult
,
nsIDOMHTMLFormElement
*
,
IHTMLFormElement
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
0dfc101e
...
...
@@ -962,10 +962,8 @@ HRESULT return_nsstr(nsresult nsres, nsAString *nsstr, BSTR *p)
return
S_OK
;
}
HRESULT
return_nsstr_variant
(
nsresult
nsres
,
nsAString
*
nsstr
,
VARIANT
*
p
)
HRESULT
return_nsstr_variant
(
nsresult
nsres
,
nsAString
*
nsstr
,
unsigned
flags
,
VARIANT
*
p
)
{
const
PRUnichar
*
str
;
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"failed: %08x
\n
"
,
nsres
);
nsAString_Finish
(
nsstr
);
...
...
@@ -976,10 +974,24 @@ HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p)
TRACE
(
"ret null
\n
"
);
V_VT
(
p
)
=
VT_NULL
;
}
else
{
const
WCHAR
*
str
;
size_t
len
;
nsAString_GetData
(
nsstr
,
&
str
);
TRACE
(
"ret %s
\n
"
,
debugstr_w
(
str
));
len
=
wcslen
(
str
);
if
(
flags
&
NSSTR_IMPLICIT_PX
)
{
const
WCHAR
*
iter
;
if
(
len
>
2
&&
!
wcscmp
(
str
+
len
-
2
,
L"px"
))
len
-=
2
;
for
(
iter
=
str
;
iter
<
str
+
len
&&
is_digit
(
*
iter
);
iter
++
);
if
(
*
iter
==
'.'
)
{
const
WCHAR
*
dot
=
iter
++
;
while
(
iter
<
str
+
len
&&
is_digit
(
*
iter
))
iter
++
;
if
(
iter
==
str
+
len
&&
dot
)
len
=
dot
-
str
;
}
}
TRACE
(
"ret %s
\n
"
,
debugstr_wn
(
str
,
len
));
if
(
*
str
)
{
V_BSTR
(
p
)
=
SysAllocString
(
str
);
V_BSTR
(
p
)
=
SysAllocString
Len
(
str
,
len
);
if
(
!
V_BSTR
(
p
))
{
nsAString_Finish
(
nsstr
);
return
E_OUTOFMEMORY
;
...
...
dlls/mshtml/tests/dom.c
View file @
0dfc101e
...
...
@@ -7911,6 +7911,16 @@ static void test_table_elem(IHTMLElement *elem)
VariantClear
(
&
vDefaultbg
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
L"12px"
);
hres
=
IHTMLTable_put_width
(
table
,
v
);
ok
(
hres
==
S_OK
,
"put_width = %08x
\n
"
,
hres
);
VariantClear
(
&
v
);
hres
=
IHTMLTable_get_width
(
table
,
&
v
);
ok
(
hres
==
S_OK
,
"get_width = %08x
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
V_BSTR
(
&
v
),
L"12"
),
"Expected 12, got %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
VariantClear
(
&
v
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
L"11"
);
hres
=
IHTMLTable_put_width
(
table
,
v
);
ok
(
hres
==
S_OK
,
"put_width = %08x
\n
"
,
hres
);
...
...
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