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
3d3786c2
Commit
3d3786c2
authored
Oct 05, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Support setting namespaces feature to default value.
parent
5f68f371
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
5 deletions
+67
-5
saxreader.c
dlls/msxml3/saxreader.c
+22
-5
saxreader.c
dlls/msxml3/tests/saxreader.c
+45
-0
No files found.
dlls/msxml3/saxreader.c
View file @
3d3786c2
...
...
@@ -56,7 +56,7 @@ enum ReaderFeatures
ExternalParameterEntities
=
1
<<
3
,
ForcedResync
=
1
<<
4
,
NamespacePrefixes
=
1
<<
5
,
Namespace
=
1
<<
6
,
Namespace
s
=
1
<<
6
,
ParameterEntities
=
1
<<
7
,
PreserveSystemIndentifiers
=
1
<<
8
,
ProhibitDTD
=
1
<<
9
,
...
...
@@ -221,6 +221,11 @@ static const WCHAR FeatureProhibitDTDW[] = {
'p'
,
'r'
,
'o'
,
'h'
,
'i'
,
'b'
,
'i'
,
't'
,
'-'
,
'd'
,
't'
,
'd'
,
0
};
static
const
WCHAR
FeatureNamespacesW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'x'
,
'm'
,
'l'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
's'
,
'a'
,
'x'
,
'/'
,
'f'
,
'e'
,
'a'
,
't'
,
'u'
,
'r'
,
'e'
,
's'
,
'/'
,
'n'
,
'a'
,
'm'
,
'e'
,
's'
,
'p'
,
'a'
,
'c'
,
'e'
,
's'
,
0
};
static
inline
HRESULT
set_feature_value
(
saxreader
*
reader
,
enum
ReaderFeatures
feature
,
VARIANT_BOOL
value
)
{
if
(
value
==
VARIANT_TRUE
)
...
...
@@ -231,6 +236,12 @@ static inline HRESULT set_feature_value(saxreader *reader, enum ReaderFeatures f
return
S_OK
;
}
static
inline
HRESULT
get_feature_value
(
const
saxreader
*
reader
,
enum
ReaderFeatures
feature
,
VARIANT_BOOL
*
value
)
{
*
value
=
reader
->
features
&
feature
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
}
static
inline
BOOL
has_content_handler
(
const
saxlocator
*
locator
)
{
return
(
locator
->
vbInterface
&&
locator
->
saxreader
->
vbcontentHandler
)
||
...
...
@@ -2616,12 +2627,15 @@ static HRESULT WINAPI saxxmlreader_Invoke(
/*** IVBSAXXMLReader methods ***/
static
HRESULT
WINAPI
saxxmlreader_getFeature
(
IVBSAXXMLReader
*
iface
,
const
WCHAR
*
pF
eature
,
VARIANT_BOOL
*
pV
alue
)
const
WCHAR
*
f
eature
,
VARIANT_BOOL
*
v
alue
)
{
saxreader
*
This
=
impl_from_IVBSAXXMLReader
(
iface
);
FIXME
(
"(%p)->(%s %p) stub
\n
"
,
This
,
debugstr_w
(
pFeature
),
pValue
);
if
(
!
strcmpW
(
FeatureNamespacesW
,
feature
))
return
get_feature_value
(
This
,
Namespaces
,
value
);
FIXME
(
"(%p)->(%s %p) stub
\n
"
,
This
,
debugstr_w
(
feature
),
value
);
return
E_NOTIMPL
;
}
...
...
@@ -2652,6 +2666,9 @@ static HRESULT WINAPI saxxmlreader_putFeature(
return
set_feature_value
(
This
,
ProhibitDTD
,
value
);
}
if
(
!
strcmpW
(
FeatureNamespacesW
,
feature
)
&&
value
==
VARIANT_TRUE
)
return
set_feature_value
(
This
,
Namespaces
,
value
);
FIXME
(
"(%p)->(%s %x) stub
\n
"
,
This
,
debugstr_w
(
feature
),
value
);
return
E_NOTIMPL
;
}
...
...
@@ -3043,7 +3060,7 @@ HRESULT SAXXMLReader_create(IUnknown *pUnkOuter, LPVOID *ppObj)
reader
->
pool
.
pool
=
NULL
;
reader
->
pool
.
index
=
0
;
reader
->
pool
.
len
=
0
;
reader
->
features
=
0
;
reader
->
features
=
Namespaces
;
memset
(
&
reader
->
sax
,
0
,
sizeof
(
xmlSAXHandler
));
reader
->
sax
.
initialized
=
XML_SAX2_MAGIC
;
...
...
dlls/msxml3/tests/saxreader.c
View file @
3d3786c2
...
...
@@ -1267,6 +1267,50 @@ static void test_saxreader_properties(void)
free_bstrs
();
}
struct
feature_ns_entry_t
{
const
GUID
*
guid
;
const
char
*
clsid
;
VARIANT_BOOL
value
;
};
static
const
struct
feature_ns_entry_t
feature_ns_entry_data
[]
=
{
{
&
CLSID_SAXXMLReader
,
"CLSID_SAXXMLReader"
,
VARIANT_TRUE
},
{
&
CLSID_SAXXMLReader30
,
"CLSID_SAXXMLReader30"
,
VARIANT_TRUE
},
{
&
CLSID_SAXXMLReader40
,
"CLSID_SAXXMLReader40"
,
VARIANT_TRUE
},
{
&
CLSID_SAXXMLReader60
,
"CLSID_SAXXMLReader60"
,
VARIANT_TRUE
},
{
0
}
};
static
void
test_saxreader_features
(
void
)
{
const
struct
feature_ns_entry_t
*
entry
=
feature_ns_entry_data
;
ISAXXMLReader
*
reader
;
while
(
entry
->
guid
)
{
VARIANT_BOOL
value
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
entry
->
guid
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_ISAXXMLReader
,
(
void
**
)
&
reader
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"can't create %s instance
\n
"
,
entry
->
clsid
);
entry
++
;
continue
;
}
value
=
0xc
;
hr
=
ISAXXMLReader_getFeature
(
reader
,
_bstr_
(
"http://xml.org/sax/features/namespaces"
),
&
value
);
EXPECT_HR
(
hr
,
S_OK
);
ok
(
entry
->
value
==
value
,
"%s: got wrong default value %x, expected %x
\n
"
,
entry
->
clsid
,
value
,
entry
->
value
);
ISAXXMLReader_Release
(
reader
);
entry
++
;
}
}
/* UTF-8 data with UTF-8 BOM and UTF-16 in prolog */
static
const
CHAR
UTF8BOMTest
[]
=
"
\xEF\xBB\xBF
<?xml version =
\"
1.0
\"
encoding =
\"
UTF-16
\"
?>
\n
"
...
...
@@ -2317,6 +2361,7 @@ START_TEST(saxreader)
test_saxreader
();
test_saxreader_properties
();
test_saxreader_features
();
test_encoding
();
/* MXXMLWriter tests */
...
...
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