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
bb849dc9
Commit
bb849dc9
authored
Jul 23, 2008
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Change ISAXXMLReader_getLine and ISAXXMLReader_getColumn functions.
parent
fc825af3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
32 deletions
+52
-32
saxreader.c
dlls/msxml3/saxreader.c
+52
-32
No files found.
dlls/msxml3/saxreader.c
View file @
bb849dc9
...
...
@@ -64,8 +64,9 @@ typedef struct _saxlocator
xmlParserCtxtPtr
pParserCtxt
;
WCHAR
*
publicId
;
WCHAR
*
systemId
;
int
lastLine
;
int
lastColumn
;
xmlChar
*
lastCur
;
int
line
;
int
column
;
}
saxlocator
;
static
inline
saxreader
*
impl_from_IVBSAXXMLReader
(
IVBSAXXMLReader
*
iface
)
...
...
@@ -83,6 +84,7 @@ static inline saxlocator *impl_from_ISAXLocator( ISAXLocator *iface )
return
(
saxlocator
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
saxlocator
,
lpSAXLocatorVtbl
));
}
static
void
format_error_message_from_id
(
saxlocator
*
This
,
HRESULT
hr
)
{
xmlStopParser
(
This
->
pParserCtxt
);
...
...
@@ -103,6 +105,35 @@ static void format_error_message_from_id(saxlocator *This, HRESULT hr)
}
}
static
void
update_position
(
saxlocator
*
This
,
xmlChar
*
end
)
{
if
(
This
->
lastCur
==
NULL
)
{
This
->
lastCur
=
(
xmlChar
*
)
This
->
pParserCtxt
->
input
->
base
;
This
->
line
=
1
;
This
->
column
=
1
;
}
if
(
!
end
)
end
=
(
xmlChar
*
)
This
->
pParserCtxt
->
input
->
cur
;
while
(
This
->
lastCur
<
end
)
{
if
(
*
(
This
->
lastCur
)
==
'\n'
)
{
This
->
line
++
;
This
->
column
=
1
;
}
else
if
(
*
(
This
->
lastCur
)
==
'\r'
&&
(
This
->
lastCur
==
This
->
pParserCtxt
->
input
->
end
||
*
(
This
->
lastCur
+
1
)
!=
'\n'
))
{
This
->
line
++
;
This
->
column
=
1
;
}
else
This
->
column
++
;
This
->
lastCur
++
;
}
}
/*** LibXML callbacks ***/
static
void
libxmlStartDocument
(
void
*
ctx
)
{
...
...
@@ -116,8 +147,7 @@ static void libxmlStartDocument(void *ctx)
format_error_message_from_id
(
This
,
hr
);
}
This
->
lastColumn
=
xmlSAX2GetColumnNumber
(
This
->
pParserCtxt
);
This
->
lastLine
=
xmlSAX2GetLineNumber
(
This
->
pParserCtxt
);
update_position
(
This
,
NULL
);
}
static
void
libxmlEndDocument
(
void
*
ctx
)
...
...
@@ -125,8 +155,8 @@ static void libxmlEndDocument(void *ctx)
saxlocator
*
This
=
ctx
;
HRESULT
hr
;
This
->
lastC
olumn
=
0
;
This
->
l
astL
ine
=
0
;
This
->
c
olumn
=
0
;
This
->
line
=
0
;
if
(
This
->
ret
!=
S_OK
)
return
;
...
...
@@ -155,8 +185,7 @@ static void libxmlStartElementNS(
FIXME
(
"Arguments processing not yet implemented.
\n
"
);
This
->
lastColumn
=
xmlSAX2GetColumnNumber
(
This
->
pParserCtxt
)
+
1
;
This
->
lastLine
=
xmlSAX2GetLineNumber
(
This
->
pParserCtxt
);
update_position
(
This
,
(
xmlChar
*
)
This
->
pParserCtxt
->
input
->
cur
+
1
);
if
(
This
->
saxreader
->
contentHandler
)
{
...
...
@@ -189,9 +218,11 @@ static void libxmlEndElementNS(
BSTR
NamespaceUri
,
LocalName
,
QName
;
saxlocator
*
This
=
ctx
;
HRESULT
hr
;
xmlChar
*
end
;
This
->
lastColumn
=
xmlSAX2GetColumnNumber
(
This
->
pParserCtxt
);
This
->
lastLine
=
xmlSAX2GetLineNumber
(
This
->
pParserCtxt
);
end
=
This
->
lastCur
;
while
(
*
end
!=
'<'
&&
*
(
end
+
1
)
!=
'/'
)
end
++
;
update_position
(
This
,
end
+
2
);
if
(
This
->
saxreader
->
contentHandler
)
{
...
...
@@ -221,28 +252,14 @@ static void libxmlCharacters(
{
BSTR
Chars
;
saxlocator
*
This
=
ctx
;
const
xmlChar
*
cur
;
int
pos
;
HRESULT
hr
;
xmlChar
*
end
;
This
->
lastColumn
=
1
;
This
->
lastLine
=
xmlSAX2GetLineNumber
(
This
->
pParserCtxt
);
cur
=
This
->
pParserCtxt
->
input
->
cur
;
if
(
*
cur
!=
'<'
)
if
(
*
(
This
->
lastCur
-
1
)
!=
'>'
)
{
for
(
pos
=
0
;
pos
<
len
;
pos
++
)
if
(
*
(
cur
+
pos
)
==
'\n'
)
This
->
lastLine
--
;
cur
--
;
end
=
(
xmlChar
*
)
This
->
pParserCtxt
->
input
->
cur
-
len
;
update_position
(
This
,
end
);
}
else
{
for
(
pos
=
0
;
pos
<
len
;
pos
++
)
if
(
*
(
cur
-
pos
-
1
)
==
'\n'
)
This
->
lastLine
--
;
cur
=
cur
-
len
-
1
;
}
for
(;
*
cur
!=
'\n'
&&
cur
!=
This
->
pParserCtxt
->
input
->
base
;
cur
--
)
This
->
lastColumn
++
;
if
(
This
->
saxreader
->
contentHandler
)
{
...
...
@@ -253,6 +270,8 @@ static void libxmlCharacters(
if
(
hr
!=
S_OK
)
format_error_message_from_id
(
This
,
hr
);
}
update_position
(
This
,
NULL
);
}
static
void
libxmlSetDocumentLocator
(
...
...
@@ -366,7 +385,7 @@ static HRESULT WINAPI isaxlocator_getColumnNumber(
{
saxlocator
*
This
=
impl_from_ISAXLocator
(
iface
);
*
pnColumn
=
This
->
lastC
olumn
;
*
pnColumn
=
This
->
c
olumn
;
return
S_OK
;
}
...
...
@@ -376,7 +395,7 @@ static HRESULT WINAPI isaxlocator_getLineNumber(
{
saxlocator
*
This
=
impl_from_ISAXLocator
(
iface
);
*
pnLine
=
This
->
l
astL
ine
;
*
pnLine
=
This
->
line
;
return
S_OK
;
}
...
...
@@ -452,8 +471,9 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator)
locator
->
pParserCtxt
=
NULL
;
locator
->
publicId
=
NULL
;
locator
->
systemId
=
NULL
;
locator
->
lastLine
=
0
;
locator
->
lastColumn
=
0
;
locator
->
lastCur
=
NULL
;
locator
->
line
=
0
;
locator
->
column
=
0
;
locator
->
ret
=
S_OK
;
*
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