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
69bc0966
Commit
69bc0966
authored
Mar 14, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Implement getType() for MXAttributes.
parent
4cddf045
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
5 deletions
+53
-5
mxwriter.c
dlls/msxml3/mxwriter.c
+15
-5
saxreader.c
dlls/msxml3/tests/saxreader.c
+38
-0
No files found.
dlls/msxml3/mxwriter.c
View file @
69bc0966
...
...
@@ -1612,7 +1612,7 @@ static HRESULT WINAPI MXAttributes_addAttribute(IMXAttributes *iface,
attr
->
qname
=
SysAllocString
(
QName
);
attr
->
local
=
SysAllocString
(
localName
);
attr
->
uri
=
SysAllocString
(
uri
);
attr
->
type
=
SysAllocString
(
type
);
attr
->
type
=
SysAllocString
(
type
?
type
:
emptyW
);
attr
->
value
=
SysAllocString
(
value
);
This
->
length
++
;
...
...
@@ -1794,12 +1794,22 @@ static HRESULT WINAPI SAXAttributes_getIndexFromQName(ISAXAttributes *iface, con
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
SAXAttributes_getType
(
ISAXAttributes
*
iface
,
int
nIndex
,
const
WCHAR
**
pT
ype
,
int
*
pTypeLength
)
static
HRESULT
WINAPI
SAXAttributes_getType
(
ISAXAttributes
*
iface
,
int
index
,
const
WCHAR
**
t
ype
,
int
*
len
)
{
mxattributes
*
This
=
impl_from_ISAXAttributes
(
iface
);
FIXME
(
"(%p)->(%d %p %p): stub
\n
"
,
This
,
nIndex
,
pType
,
pTypeLength
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%d %p %p)
\n
"
,
This
,
index
,
type
,
len
);
if
(
index
>=
This
->
length
)
return
E_INVALIDARG
;
if
((
!
type
||
!
len
)
&&
(
This
->
class_version
==
MSXML_DEFAULT
||
This
->
class_version
==
MSXML3
))
return
E_POINTER
;
*
type
=
This
->
attr
[
index
].
type
;
*
len
=
SysStringLen
(
This
->
attr
[
index
].
type
);
return
S_OK
;
}
static
HRESULT
WINAPI
SAXAttributes_getTypeFromName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pUri
,
int
nUri
,
...
...
dlls/msxml3/tests/saxreader.c
View file @
69bc0966
...
...
@@ -3341,6 +3341,18 @@ static void test_mxattr_addAttribute(void)
hr
=
ISAXAttributes_getValue
(
saxattr
,
0
,
NULL
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
&
value
,
&
len
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
NULL
,
&
len
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
&
value
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
NULL
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
IMXAttributes_addAttribute
(
mxattr
,
_bstr_
(
table
->
uri
),
_bstr_
(
table
->
local
),
_bstr_
(
table
->
qname
),
_bstr_
(
table
->
type
),
_bstr_
(
table
->
value
));
ok
(
hr
==
table
->
hr
,
"%d: got 0x%08x, expected 0x%08x
\n
"
,
i
,
hr
,
table
->
hr
);
...
...
@@ -3359,6 +3371,15 @@ static void test_mxattr_addAttribute(void)
hr
=
ISAXAttributes_getValue
(
saxattr
,
0
,
NULL
,
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
NULL
,
&
len
);
EXPECT_HR
(
hr
,
E_POINTER
);
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
&
value
,
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
NULL
,
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
}
len
=
-
1
;
...
...
@@ -3367,6 +3388,23 @@ static void test_mxattr_addAttribute(void)
ok
(
!
lstrcmpW
(
_bstr_
(
table
->
value
),
value
),
"%d: got %s, expected %s
\n
"
,
i
,
wine_dbgstr_w
(
value
),
table
->
value
);
ok
(
lstrlenW
(
value
)
==
len
,
"%d: got wrong value length %d
\n
"
,
i
,
len
);
len
=
-
1
;
value
=
(
void
*
)
0xdeadbeef
;
hr
=
ISAXAttributes_getType
(
saxattr
,
0
,
&
value
,
&
len
);
EXPECT_HR
(
hr
,
S_OK
);
if
(
table
->
type
)
{
ok
(
!
lstrcmpW
(
_bstr_
(
table
->
type
),
value
),
"%d: got %s, expected %s
\n
"
,
i
,
wine_dbgstr_w
(
value
),
table
->
type
);
ok
(
lstrlenW
(
value
)
==
len
,
"%d: got wrong type value length %d
\n
"
,
i
,
len
);
}
else
{
ok
(
*
value
==
0
,
"%d: got type value %s
\n
"
,
i
,
wine_dbgstr_w
(
value
));
ok
(
len
==
0
,
"%d: got wrong type value length %d
\n
"
,
i
,
len
);
}
}
len
=
-
1
;
...
...
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