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
216b6480
Commit
216b6480
authored
Oct 31, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Don't allocate new strings when returning namespace related data.
parent
619c2dcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
saxreader.c
dlls/msxml3/saxreader.c
+23
-9
No files found.
dlls/msxml3/saxreader.c
View file @
216b6480
...
@@ -313,6 +313,20 @@ static HRESULT namespacePop(saxlocator *locator)
...
@@ -313,6 +313,20 @@ static HRESULT namespacePop(saxlocator *locator)
return
S_OK
;
return
S_OK
;
}
}
static
BSTR
namespaceFind
(
saxlocator
*
locator
,
const
xmlChar
*
ptr
)
{
int
i
;
for
(
i
=
locator
->
nsStackLast
-
1
;
i
>=
0
;
i
--
)
{
if
(
ptr
==
locator
->
nsStack
[
i
].
ptr
)
return
locator
->
nsStack
[
i
].
uri
;
}
ERR
(
"namespace not found
\n
"
);
return
NULL
;
}
static
BOOL
bstr_pool_insert
(
struct
bstrpool
*
pool
,
BSTR
pool_entry
)
static
BOOL
bstr_pool_insert
(
struct
bstrpool
*
pool
,
BSTR
pool_entry
)
{
{
if
(
!
pool
->
pool
)
if
(
!
pool
->
pool
)
...
@@ -1188,7 +1202,7 @@ static void libxmlStartElementNS(
...
@@ -1188,7 +1202,7 @@ static void libxmlStartElementNS(
int
nb_defaulted
,
int
nb_defaulted
,
const
xmlChar
**
attributes
)
const
xmlChar
**
attributes
)
{
{
BSTR
NamespaceUri
,
LocalName
,
QName
,
Prefix
,
Uri
;
BSTR
NamespaceUri
,
LocalName
,
QName
;
saxlocator
*
This
=
ctx
;
saxlocator
*
This
=
ctx
;
HRESULT
hr
;
HRESULT
hr
;
int
index
;
int
index
;
...
@@ -1214,18 +1228,18 @@ static void libxmlStartElementNS(
...
@@ -1214,18 +1228,18 @@ static void libxmlStartElementNS(
{
{
for
(
index
=
0
;
index
<
nb_namespaces
;
index
++
)
for
(
index
=
0
;
index
<
nb_namespaces
;
index
++
)
{
{
Prefix
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
namespaces
[
2
*
index
]);
Uri
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
namespaces
[
2
*
index
+
1
]);
if
(
This
->
vbInterface
)
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_startPrefixMapping
(
hr
=
IVBSAXContentHandler_startPrefixMapping
(
This
->
saxreader
->
vbcontentHandler
,
This
->
saxreader
->
vbcontentHandler
,
&
Prefix
,
&
Uri
);
&
This
->
nsStack
[
This
->
nsStackLast
-
nb_namespaces
+
index
].
prefix
,
&
This
->
nsStack
[
This
->
nsStackLast
-
nb_namespaces
+
index
].
uri
);
else
else
hr
=
ISAXContentHandler_startPrefixMapping
(
hr
=
ISAXContentHandler_startPrefixMapping
(
This
->
saxreader
->
contentHandler
,
This
->
saxreader
->
contentHandler
,
Prefix
,
SysStringLen
(
Prefix
),
This
->
nsStack
[
This
->
nsStackLast
-
nb_namespaces
+
index
].
prefix
,
Uri
,
SysStringLen
(
Uri
));
SysStringLen
(
This
->
nsStack
[
This
->
nsStackLast
-
nb_namespaces
+
index
].
prefix
),
This
->
nsStack
[
This
->
nsStackLast
-
nb_namespaces
+
index
].
uri
,
SysStringLen
(
This
->
nsStack
[
This
->
nsStackLast
-
nb_namespaces
+
index
].
uri
));
if
(
This
->
saxreader
->
version
>=
MSXML6
?
FAILED
(
hr
)
:
hr
!=
S_OK
)
if
(
This
->
saxreader
->
version
>=
MSXML6
?
FAILED
(
hr
)
:
hr
!=
S_OK
)
{
{
...
@@ -1234,7 +1248,7 @@ static void libxmlStartElementNS(
...
@@ -1234,7 +1248,7 @@ static void libxmlStartElementNS(
}
}
}
}
NamespaceUri
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
URI
);
NamespaceUri
=
namespaceFind
(
This
,
URI
);
LocalName
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
localname
);
LocalName
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
localname
);
QName
=
pooled_QName_from_xmlChar
(
&
This
->
saxreader
->
pool
,
prefix
,
localname
);
QName
=
pooled_QName_from_xmlChar
(
&
This
->
saxreader
->
pool
,
prefix
,
localname
);
...
@@ -1280,7 +1294,7 @@ static void libxmlEndElementNS(
...
@@ -1280,7 +1294,7 @@ static void libxmlEndElementNS(
if
(
has_content_handler
(
This
))
if
(
has_content_handler
(
This
))
{
{
NamespaceUri
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
URI
);
NamespaceUri
=
namespaceFind
(
This
,
URI
);
LocalName
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
localname
);
LocalName
=
pooled_bstr_from_xmlChar
(
&
This
->
saxreader
->
pool
,
localname
);
QName
=
pooled_QName_from_xmlChar
(
&
This
->
saxreader
->
pool
,
prefix
,
localname
);
QName
=
pooled_QName_from_xmlChar
(
&
This
->
saxreader
->
pool
,
prefix
,
localname
);
...
...
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