Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
685be40c
Commit
685be40c
authored
13 years ago
by
Piotr Caban
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
msxml3: Fix attributes handling when msxml6 is used.
parent
ba2ea235
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/msxml3/saxreader.c
+60
-29
60 additions, 29 deletions
dlls/msxml3/saxreader.c
with
60 additions
and
29 deletions
dlls/msxml3/saxreader.c
+
60
−
29
View file @
685be40c
...
...
@@ -1088,13 +1088,16 @@ static const struct ISAXAttributesVtbl isaxattributes_vtbl =
isaxattributes_getValueFromQName
};
static
HRESULT
SAXAttributes_create
(
saxattributes
**
attr
,
static
HRESULT
SAXAttributes_create
(
saxattributes
**
attr
,
MSXML_VERSION
version
,
int
nb_namespaces
,
const
xmlChar
**
xmlNamespaces
,
int
nb_attributes
,
const
xmlChar
**
xmlAttributes
)
{
saxattributes
*
attributes
;
int
index
;
static
const
xmlChar
xmlns
[]
=
"xmlns"
;
static
const
WCHAR
xmlnsW
[]
=
{
'x'
,
'm'
,
'l'
,
'n'
,
's'
,
0
};
static
const
WCHAR
w3xmlns
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'3'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
'2'
,
'0'
,
'0'
,
'0'
,
'/'
,
'x'
,
'm'
,
'l'
,
'n'
,
's'
,
'/'
,
0
};
attributes
=
heap_alloc
(
sizeof
(
*
attributes
));
if
(
!
attributes
)
...
...
@@ -1124,23 +1127,26 @@ static HRESULT SAXAttributes_create(saxattributes **attr,
for
(
index
=
0
;
index
<
nb_namespaces
;
index
++
)
{
attributes
->
szLocalname
[
index
]
=
SysAllocStringLen
(
NULL
,
0
);
attributes
->
szURI
[
index
]
=
SysAllocStringLen
(
NULL
,
0
);
attributes
->
szValue
[
index
]
=
bstr_from_xmlChar
(
xmlNamespaces
[
2
*
index
+
1
]);
attributes
->
szQName
[
index
]
=
QName_from_xmlChar
(
xmlns
,
xmlNamespaces
[
2
*
index
]);
attributes
->
szLocalname
[
nb_attributes
+
index
]
=
SysAllocStringLen
(
NULL
,
0
);
if
(
version
>=
MSXML6
)
attributes
->
szURI
[
nb_attributes
+
index
]
=
SysAllocString
(
w3xmlns
);
else
attributes
->
szURI
[
nb_attributes
+
index
]
=
SysAllocStringLen
(
NULL
,
0
);
attributes
->
szValue
[
nb_attributes
+
index
]
=
bstr_from_xmlChar
(
xmlNamespaces
[
2
*
index
+
1
]);
if
(
!
xmlNamespaces
[
2
*
index
])
attributes
->
szQName
[
nb_attributes
+
index
]
=
SysAllocString
(
xmlnsW
);
else
attributes
->
szQName
[
nb_attributes
+
index
]
=
QName_from_xmlChar
(
xmlns
,
xmlNamespaces
[
2
*
index
]);
}
for
(
index
=
0
;
index
<
nb_attributes
;
index
++
)
{
attributes
->
szLocalname
[
nb_namespaces
+
index
]
=
bstr_from_xmlChar
(
xmlAttributes
[
index
*
5
]);
attributes
->
szURI
[
nb_namespaces
+
index
]
=
bstr_from_xmlChar
(
xmlAttributes
[
index
*
5
+
2
]);
attributes
->
szValue
[
nb_namespaces
+
index
]
=
bstr_from_xmlCharN
(
xmlAttributes
[
index
*
5
+
3
],
xmlAttributes
[
index
*
5
+
4
]
-
xmlAttributes
[
index
*
5
+
3
]);
attributes
->
szQName
[
nb_namespaces
+
index
]
=
QName_from_xmlChar
(
xmlAttributes
[
index
*
5
+
1
],
xmlAttributes
[
index
*
5
]);
attributes
->
szLocalname
[
index
]
=
bstr_from_xmlChar
(
xmlAttributes
[
index
*
5
]);
attributes
->
szURI
[
index
]
=
bstr_from_xmlChar
(
xmlAttributes
[
index
*
5
+
2
]);
attributes
->
szValue
[
index
]
=
bstr_from_xmlCharN
(
xmlAttributes
[
index
*
5
+
3
],
xmlAttributes
[
index
*
5
+
4
]
-
xmlAttributes
[
index
*
5
+
3
]);
attributes
->
szQName
[
index
]
=
QName_from_xmlChar
(
xmlAttributes
[
index
*
5
+
1
],
xmlAttributes
[
index
*
5
]);
}
*
attr
=
attributes
;
...
...
@@ -1259,7 +1265,8 @@ static void libxmlStartElementNS(
LocalName
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
localname
);
QName
=
pooled_QName_from_xmlChar
(
&
This
->
saxreader
->
pool
,
prefix
,
localname
);
hr
=
SAXAttributes_create
(
&
attr
,
nb_namespaces
,
namespaces
,
nb_attributes
,
attributes
);
hr
=
SAXAttributes_create
(
&
attr
,
This
->
saxreader
->
version
,
nb_namespaces
,
namespaces
,
nb_attributes
,
attributes
);
if
(
hr
==
S_OK
)
{
if
(
This
->
vbInterface
)
...
...
@@ -1326,25 +1333,49 @@ static void libxmlEndElementNS(
return
;
}
for
(
index
=
This
->
pParserCtxt
->
nsNr
-
2
;
index
>=
This
->
pParserCtxt
->
nsNr
-
nsNr
*
2
;
index
-=
2
)
if
(
This
->
saxreader
->
version
>=
MSXML6
)
{
Prefix
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
This
->
pParserCtxt
->
nsTab
[
index
]);
for
(
index
=
This
->
pParserCtxt
->
nsNr
-
nsNr
*
2
;
index
<
This
->
pParserCtxt
->
nsNr
;
index
+=
2
)
{
Prefix
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
This
->
pParserCtxt
->
nsTab
[
index
]);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
vbcontentHandler
,
&
Prefix
);
else
hr
=
ISAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
contentHandler
,
Prefix
,
SysStringLen
(
Prefix
));
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
vbcontentHandler
,
&
Prefix
);
else
hr
=
ISAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
contentHandler
,
Prefix
,
SysStringLen
(
Prefix
));
if
(
This
->
saxreader
->
version
>=
MSXML6
?
FAILED
(
hr
)
:
hr
!=
S_OK
)
{
format_error_message_from_id
(
This
,
hr
);
return
;
if
(
FAILED
(
hr
))
{
format_error_message_from_id
(
This
,
hr
);
return
;
}
}
}
else
{
for
(
index
=
This
->
pParserCtxt
->
nsNr
-
2
;
index
>=
This
->
pParserCtxt
->
nsNr
-
nsNr
*
2
;
index
-=
2
)
{
Prefix
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
This
->
pParserCtxt
->
nsTab
[
index
]);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
vbcontentHandler
,
&
Prefix
);
else
hr
=
ISAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
contentHandler
,
Prefix
,
SysStringLen
(
Prefix
));
if
(
hr
!=
S_OK
)
{
format_error_message_from_id
(
This
,
hr
);
return
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment