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
8dcd01bb
Commit
8dcd01bb
authored
Apr 16, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Added getIndexFromName() implementation for SAXAttributes.
parent
6f95c699
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
5 deletions
+121
-5
mxwriter.c
dlls/msxml3/mxwriter.c
+25
-5
saxreader.c
dlls/msxml3/tests/saxreader.c
+96
-0
No files found.
dlls/msxml3/mxwriter.c
View file @
8dcd01bb
...
...
@@ -1827,13 +1827,33 @@ static HRESULT WINAPI SAXAttributes_getName(ISAXAttributes *iface, int nIndex, c
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
SAXAttributes_getIndexFromName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
pUri
,
int
cUriLength
,
const
WCHAR
*
pLocalName
,
int
cocalNameLength
,
int
*
index
)
static
HRESULT
WINAPI
SAXAttributes_getIndexFromName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
uri
,
int
uri_len
,
const
WCHAR
*
name
,
int
len
,
int
*
index
)
{
mxattributes
*
This
=
impl_from_ISAXAttributes
(
iface
);
FIXME
(
"(%p)->(%s:%d %s:%d %p): stub
\n
"
,
This
,
debugstr_wn
(
pUri
,
cUriLength
),
cUriLength
,
debugstr_wn
(
pLocalName
,
cocalNameLength
),
cocalNameLength
,
index
);
return
E_NOTIMPL
;
int
i
;
TRACE
(
"(%p)->(%s:%d %s:%d %p)
\n
"
,
This
,
debugstr_wn
(
uri
,
uri_len
),
uri_len
,
debugstr_wn
(
name
,
len
),
len
,
index
);
if
(
!
index
&&
(
This
->
class_version
==
MSXML_DEFAULT
||
This
->
class_version
==
MSXML3
))
return
E_POINTER
;
if
(
!
uri
||
!
name
||
!
index
)
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
This
->
length
;
i
++
)
{
if
(
uri_len
!=
SysStringLen
(
This
->
attr
[
i
].
uri
))
continue
;
if
(
strncmpW
(
uri
,
This
->
attr
[
i
].
uri
,
uri_len
))
continue
;
if
(
len
!=
SysStringLen
(
This
->
attr
[
i
].
local
))
continue
;
if
(
strncmpW
(
name
,
This
->
attr
[
i
].
local
,
len
))
continue
;
*
index
=
i
;
return
S_OK
;
}
return
E_INVALIDARG
;
}
static
HRESULT
WINAPI
SAXAttributes_getIndexFromQName
(
ISAXAttributes
*
iface
,
const
WCHAR
*
qname
,
...
...
dlls/msxml3/tests/saxreader.c
View file @
8dcd01bb
...
...
@@ -4175,6 +4175,101 @@ static void test_mxattr_qi(void)
IVBSAXAttributes_Release
(
vbsaxattr2
);
}
static
struct
msxmlsupported_data_t
saxattr_support_data
[]
=
{
{
&
CLSID_SAXAttributes
,
"SAXAttributes"
},
{
&
CLSID_SAXAttributes30
,
"SAXAttributes30"
},
{
&
CLSID_SAXAttributes40
,
"SAXAttributes40"
},
{
&
CLSID_SAXAttributes60
,
"SAXAttributes60"
},
{
NULL
}
};
static
void
test_mxattr_localname
(
void
)
{
static
const
WCHAR
localname1W
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'n'
,
'a'
,
'm'
,
'e'
,
'1'
,
0
};
static
const
WCHAR
localnameW
[]
=
{
'l'
,
'o'
,
'c'
,
'a'
,
'l'
,
'n'
,
'a'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
uri1W
[]
=
{
'u'
,
'r'
,
'i'
,
'1'
,
0
};
static
const
WCHAR
uriW
[]
=
{
'u'
,
'r'
,
'i'
,
0
};
const
struct
msxmlsupported_data_t
*
table
=
saxattr_support_data
;
while
(
table
->
clsid
)
{
ISAXAttributes
*
saxattr
;
IMXAttributes
*
mxattr
;
HRESULT
hr
;
int
index
;
if
(
!
is_clsid_supported
(
table
->
clsid
,
mxattributes_support_data
))
{
table
++
;
continue
;
}
hr
=
CoCreateInstance
(
table
->
clsid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMXAttributes
,
(
void
**
)
&
mxattr
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IMXAttributes_QueryInterface
(
mxattr
,
&
IID_ISAXAttributes
,
(
void
**
)
&
saxattr
);
EXPECT_HR
(
hr
,
S_OK
);
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
NULL
,
0
,
NULL
,
0
,
&
index
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
/* add some ambiguos attribute names */
hr
=
IMXAttributes_addAttribute
(
mxattr
,
_bstr_
(
"uri"
),
_bstr_
(
"localname"
),
_bstr_
(
"a:localname"
),
_bstr_
(
""
),
_bstr_
(
"value"
));
EXPECT_HR
(
hr
,
S_OK
);
hr
=
IMXAttributes_addAttribute
(
mxattr
,
_bstr_
(
"uri"
),
_bstr_
(
"localname"
),
_bstr_
(
"b:localname"
),
_bstr_
(
""
),
_bstr_
(
"value"
));
EXPECT_HR
(
hr
,
S_OK
);
index
=
-
1
;
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
uriW
,
lstrlenW
(
uriW
),
localnameW
,
lstrlenW
(
localnameW
),
&
index
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
index
==
0
,
"%s: got index %d
\n
"
,
table
->
name
,
index
);
index
=
-
1
;
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
uri1W
,
lstrlenW
(
uri1W
),
localnameW
,
lstrlenW
(
localnameW
),
&
index
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
ok
(
index
==
-
1
,
"%s: got index %d
\n
"
,
table
->
name
,
index
);
index
=
-
1
;
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
uriW
,
lstrlenW
(
uriW
),
localname1W
,
lstrlenW
(
localname1W
),
&
index
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
ok
(
index
==
-
1
,
"%s: got index %d
\n
"
,
table
->
name
,
index
);
if
(
IsEqualGUID
(
table
->
clsid
,
&
CLSID_SAXAttributes
)
||
IsEqualGUID
(
table
->
clsid
,
&
CLSID_SAXAttributes30
))
{
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
NULL
,
0
,
NULL
,
0
,
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
uriW
,
lstrlenW
(
uriW
),
localname1W
,
lstrlenW
(
localname1W
),
NULL
);
EXPECT_HR
(
hr
,
E_POINTER
);
}
else
{
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
NULL
,
0
,
NULL
,
0
,
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
uriW
,
lstrlenW
(
uriW
),
localname1W
,
lstrlenW
(
localname1W
),
NULL
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
}
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
uriW
,
lstrlenW
(
uriW
),
NULL
,
0
,
&
index
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
hr
=
ISAXAttributes_getIndexFromName
(
saxattr
,
NULL
,
0
,
localname1W
,
lstrlenW
(
localname1W
),
&
index
);
EXPECT_HR
(
hr
,
E_INVALIDARG
);
table
++
;
ISAXAttributes_Release
(
saxattr
);
IMXAttributes_Release
(
mxattr
);
}
}
START_TEST
(
saxreader
)
{
ISAXXMLReader
*
reader
;
...
...
@@ -4233,6 +4328,7 @@ START_TEST(saxreader)
test_mxattr_qi
();
test_mxattr_addAttribute
();
test_mxattr_clear
();
test_mxattr_localname
();
test_mxattr_dispex
();
}
else
...
...
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