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
893e8a46
Commit
893e8a46
authored
Sep 16, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Store selected query language in backend document instance.
parent
a930084d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
15 deletions
+48
-15
domdoc.c
dlls/msxml3/domdoc.c
+31
-14
domdoc.c
dlls/msxml3/tests/domdoc.c
+17
-1
No files found.
dlls/msxml3/domdoc.c
View file @
893e8a46
...
...
@@ -77,7 +77,6 @@ typedef struct _domdoc
VARIANT_BOOL
validating
;
VARIANT_BOOL
resolving
;
VARIANT_BOOL
preserving
;
BOOL
XPath
;
IXMLDOMSchemaCollection
*
schema
;
bsc_t
*
bsc
;
HRESULT
error
;
...
...
@@ -117,6 +116,7 @@ typedef struct _domdoc
typedef
struct
_xmldoc_priv
{
LONG
refs
;
struct
list
orphans
;
BOOL
XPath
;
}
xmldoc_priv
;
typedef
struct
_orphan_entry
{
...
...
@@ -124,19 +124,35 @@ typedef struct _orphan_entry {
xmlNode
*
node
;
}
orphan_entry
;
static
inline
xmldoc_priv
*
priv_from_xmlDocPtr
(
xmlDocPtr
doc
)
static
inline
xmldoc_priv
*
priv_from_xmlDocPtr
(
const
xmlDocPtr
doc
)
{
return
doc
->
_private
;
}
static
inline
BOOL
is_xpathmode
(
const
xmlDocPtr
doc
)
{
return
priv_from_xmlDocPtr
(
doc
)
->
XPath
;
}
static
inline
void
set_xpathmode
(
const
xmlDocPtr
doc
)
{
priv_from_xmlDocPtr
(
doc
)
->
XPath
=
TRUE
;
}
static
inline
void
reset_xpathmode
(
const
xmlDocPtr
doc
)
{
priv_from_xmlDocPtr
(
doc
)
->
XPath
=
FALSE
;
}
static
xmldoc_priv
*
create_priv
(
void
)
{
xmldoc_priv
*
priv
;
priv
=
heap_alloc
(
sizeof
(
*
priv
)
);
if
(
priv
)
if
(
priv
)
{
priv
->
refs
=
0
;
priv
->
XPath
=
FALSE
;
list_init
(
&
priv
->
orphans
);
}
...
...
@@ -2139,9 +2155,9 @@ static HRESULT WINAPI domdoc_setProperty(
hr
=
S_OK
;
if
(
lstrcmpiW
(
bstr
,
PropValueXPathW
)
==
0
)
This
->
XPath
=
TRUE
;
set_xpathmode
(
get_doc
(
This
))
;
else
if
(
lstrcmpiW
(
bstr
,
PropValueXSLPatternW
)
==
0
)
This
->
XPath
=
FALSE
;
reset_xpathmode
(
get_doc
(
This
))
;
else
hr
=
E_FAIL
;
...
...
@@ -2174,17 +2190,16 @@ static HRESULT WINAPI domdoc_getProperty(
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
debugstr_w
(
p
));
if
(
var
==
NULL
)
if
(
!
var
)
return
E_INVALIDARG
;
if
(
lstrcmpiW
(
p
,
PropertySelectionLanguageW
)
==
0
)
{
V_VT
(
var
)
=
VT_BSTR
;
if
(
This
->
XPath
)
V_BSTR
(
var
)
=
SysAllocString
(
PropValueXPathW
);
else
V_BSTR
(
var
)
=
SysAllocString
(
PropValueXSLPatternW
);
return
S_OK
;
V_BSTR
(
var
)
=
is_xpathmode
(
This
->
node
.
node
->
doc
)
?
SysAllocString
(
PropValueXPathW
)
:
SysAllocString
(
PropValueXSLPatternW
);
return
V_BSTR
(
var
)
?
S_OK
:
E_OUTOFMEMORY
;
}
FIXME
(
"Unknown property %s
\n
"
,
wine_dbgstr_w
(
p
));
...
...
@@ -2461,7 +2476,6 @@ HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **docu
doc
->
validating
=
0
;
doc
->
resolving
=
0
;
doc
->
preserving
=
0
;
doc
->
XPath
=
FALSE
;
doc
->
error
=
S_OK
;
doc
->
schema
=
NULL
;
doc
->
stream
=
NULL
;
...
...
@@ -2482,7 +2496,7 @@ HRESULT DOMDocument_create(const GUID *clsid, IUnknown *pUnkOuter, void **ppObj)
xmlDocPtr
xmldoc
;
HRESULT
hr
;
TRACE
(
"(%
p, %p)
\n
"
,
pUnkOuter
,
ppObj
);
TRACE
(
"(%
s, %p, %p)
\n
"
,
debugstr_guid
(
clsid
)
,
pUnkOuter
,
ppObj
);
xmldoc
=
xmlNewDoc
(
NULL
);
if
(
!
xmldoc
)
...
...
@@ -2492,14 +2506,17 @@ HRESULT DOMDocument_create(const GUID *clsid, IUnknown *pUnkOuter, void **ppObj)
hr
=
DOMDocument_create_from_xmldoc
(
xmldoc
,
(
IXMLDOMDocument3
**
)
ppObj
);
if
(
FAILED
(
hr
))
{
xmlFreeDoc
(
xmldoc
);
return
hr
;
}
/* properties that are dependent on object versions */
if
(
IsEqualCLSID
(
clsid
,
&
CLSID_DOMDocument40
)
||
IsEqualCLSID
(
clsid
,
&
CLSID_DOMDocument60
))
{
domdoc
*
This
=
impl_from_IXMLDOMDocument3
(
*
ppObj
);
This
->
XPath
=
TRUE
;
set_xpathmode
(
get_doc
(
This
))
;
}
return
hr
;
...
...
dlls/msxml3/tests/domdoc.c
View file @
893e8a46
...
...
@@ -5961,6 +5961,17 @@ static void test_get_ownerDocument(void)
ok
(
b
==
VARIANT_TRUE
,
"failed to load XML string
\n
"
);
SysFreeString
(
str
);
hr
=
IXMLDOMDocument2_getProperty
(
doc
,
_bstr_
(
"SelectionLanguage"
),
&
var
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
lstrcmpW
(
V_BSTR
(
&
var
),
_bstr_
(
"XSLPattern"
))
==
0
,
"expected XSLPattern
\n
"
);
VariantClear
(
&
var
);
/* set to XPath and check that new instances use it */
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
_bstr_
(
"XPath"
);
hr
=
IXMLDOMDocument2_setProperty
(
doc
,
_bstr_
(
"SelectionLanguage"
),
var
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
_bstr_
(
"xmlns:wi=
\'
www.winehq.org
\'
"
);
hr
=
IXMLDOMDocument2_setProperty
(
doc
,
_bstr_
(
"SelectionNamespaces"
),
var
);
...
...
@@ -5979,9 +5990,14 @@ static void test_get_ownerDocument(void)
hr
=
IXMLDOMDocument2_getProperty
(
doc_owner
,
_bstr_
(
"SelectionNamespaces"
),
&
var
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
lstrcmpW
(
V_BSTR
(
&
var
),
_bstr_
(
"xmlns:wi=
\'
www.winehq.org
\'
"
))
==
0
,
"expected previously set value
\n
"
);
IXMLDOMDocument2_Release
(
doc_owner
);
VariantClear
(
&
var
);
hr
=
IXMLDOMDocument2_getProperty
(
doc_owner
,
_bstr_
(
"SelectionLanguage"
),
&
var
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
lstrcmpW
(
V_BSTR
(
&
var
),
_bstr_
(
"XPath"
))
==
0
,
"expected XPath
\n
"
);
VariantClear
(
&
var
);
IXMLDOMDocument2_Release
(
doc_owner
);
hr
=
IXMLDOMNode_get_ownerDocument
(
node
,
&
doc2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IXMLDOMNode_Release
(
node
);
...
...
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