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
03f79097
Commit
03f79097
authored
Aug 20, 2008
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Add ISAXContentHandler_endPrefix event.
parent
93f1d070
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
5 deletions
+65
-5
saxreader.c
dlls/msxml3/saxreader.c
+65
-5
No files found.
dlls/msxml3/saxreader.c
View file @
03f79097
...
...
@@ -72,6 +72,9 @@ typedef struct _saxlocator
int
line
;
int
column
;
BOOL
vbInterface
;
int
nsStackSize
;
int
nsStackLast
;
int
*
nsStack
;
}
saxlocator
;
typedef
struct
_saxattributes
...
...
@@ -117,6 +120,29 @@ static inline saxattributes *impl_from_ISAXAttributes( ISAXAttributes *iface )
}
static
HRESULT
namespacePush
(
saxlocator
*
locator
,
int
ns
)
{
if
(
locator
->
nsStackLast
>=
locator
->
nsStackSize
)
{
int
*
new_stack
;
new_stack
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
locator
->
nsStack
,
locator
->
nsStackSize
*
2
);
if
(
!
new_stack
)
return
E_OUTOFMEMORY
;
locator
->
nsStack
=
new_stack
;
locator
->
nsStackSize
*=
2
;
}
locator
->
nsStack
[
locator
->
nsStackLast
++
]
=
ns
;
return
S_OK
;
}
static
int
namespacePop
(
saxlocator
*
locator
)
{
if
(
locator
->
nsStackLast
==
0
)
return
0
;
return
locator
->
nsStack
[
--
locator
->
nsStackLast
];
}
static
BSTR
bstr_from_xmlCharN
(
const
xmlChar
*
buf
,
int
len
)
{
DWORD
dLen
;
...
...
@@ -937,7 +963,9 @@ static void libxmlStartElementNS(
update_position
(
This
,
(
xmlChar
*
)
This
->
pParserCtxt
->
input
->
cur
+
1
);
if
(
This
->
saxreader
->
contentHandler
)
hr
=
namespacePush
(
This
,
nb_namespaces
);
if
(
hr
==
S_OK
&&
This
->
saxreader
->
contentHandler
)
{
for
(
index
=
0
;
index
<
nb_namespaces
;
index
++
)
{
...
...
@@ -990,10 +1018,10 @@ static void libxmlStartElementNS(
SysFreeString
(
NamespaceUri
);
SysFreeString
(
LocalName
);
SysFreeString
(
QName
);
if
(
hr
!=
S_OK
)
format_error_message_from_id
(
This
,
hr
);
}
if
(
hr
!=
S_OK
)
format_error_message_from_id
(
This
,
hr
);
}
static
void
libxmlEndElementNS
(
...
...
@@ -1002,15 +1030,18 @@ static void libxmlEndElementNS(
const
xmlChar
*
prefix
,
const
xmlChar
*
URI
)
{
BSTR
NamespaceUri
,
LocalName
,
QName
;
BSTR
NamespaceUri
,
LocalName
,
QName
,
Prefix
;
saxlocator
*
This
=
ctx
;
HRESULT
hr
;
xmlChar
*
end
;
int
nsNr
,
index
;
end
=
This
->
lastCur
;
while
(
*
end
!=
'<'
&&
*
(
end
+
1
)
!=
'/'
)
end
++
;
update_position
(
This
,
end
+
2
);
nsNr
=
namespacePop
(
This
);
if
(
This
->
saxreader
->
contentHandler
)
{
NamespaceUri
=
bstr_from_xmlChar
(
URI
);
...
...
@@ -1033,7 +1064,26 @@ static void libxmlEndElementNS(
SysFreeString
(
QName
);
if
(
hr
!=
S_OK
)
{
format_error_message_from_id
(
This
,
hr
);
return
;
}
for
(
index
=
This
->
pParserCtxt
->
nsNr
-
2
;
index
>=
This
->
pParserCtxt
->
nsNr
-
nsNr
*
2
;
index
-=
2
)
{
Prefix
=
bstr_from_xmlChar
(
This
->
pParserCtxt
->
nsTab
[
index
]);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
vbcontentHandler
,
&
Prefix
);
else
hr
=
ISAXContentHandler_endPrefixMapping
(
This
->
saxreader
->
contentHandler
,
Prefix
,
SysStringLen
(
Prefix
));
SysFreeString
(
Prefix
);
}
}
}
...
...
@@ -1410,6 +1460,7 @@ static ULONG WINAPI isaxlocator_Release(
SysFreeString
(
This
->
publicId
);
if
(
This
->
systemId
)
SysFreeString
(
This
->
systemId
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
nsStack
);
ISAXXMLReader_Release
((
ISAXXMLReader
*
)
&
This
->
saxreader
->
lpSAXXMLReaderVtbl
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -1517,6 +1568,15 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B
locator
->
line
=
0
;
locator
->
column
=
0
;
locator
->
ret
=
S_OK
;
locator
->
nsStackSize
=
8
;
locator
->
nsStackLast
=
0
;
locator
->
nsStack
=
HeapAlloc
(
GetProcessHeap
(),
0
,
locator
->
nsStackSize
);
if
(
!
locator
->
nsStack
)
{
ISAXXMLReader_Release
((
ISAXXMLReader
*
)
&
reader
->
lpSAXXMLReaderVtbl
);
HeapFree
(
GetProcessHeap
(),
0
,
locator
);
return
E_OUTOFMEMORY
;
}
*
ppsaxlocator
=
locator
;
...
...
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