Commit 11d1ff15 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

msxml3: Make element_get_dt() static and move it around to avoid a forward declaration.

parent 60b63fea
...@@ -671,6 +671,52 @@ static inline HRESULT VARIANT_from_DT(XDR_DT dt, xmlChar* str, VARIANT* v) ...@@ -671,6 +671,52 @@ static inline HRESULT VARIANT_from_DT(XDR_DT dt, xmlChar* str, VARIANT* v)
return hr; return hr;
} }
static XDR_DT element_get_dt(xmlNodePtr node)
{
XDR_DT dt = DT_INVALID;
TRACE("(%p)\n", node);
if(node->type != XML_ELEMENT_NODE)
{
FIXME("invalid element node\n");
return dt;
}
if (node->ns && xmlStrEqual(node->ns->href, DT_nsURI))
{
dt = str_to_dt(node->name, -1);
}
else
{
xmlChar* pVal = xmlGetNsProp(node, BAD_CAST "dt", DT_nsURI);
if (pVal)
{
dt = str_to_dt(pVal, -1);
xmlFree(pVal);
}
else if (node->doc)
{
IXMLDOMDocument3* doc = (IXMLDOMDocument3*)create_domdoc((xmlNodePtr)node->doc);
if (doc)
{
VARIANT v;
VariantInit(&v);
if (IXMLDOMDocument3_get_schemas(doc, &v) == S_OK &&
V_VT(&v) == VT_DISPATCH)
{
dt = SchemaCache_get_node_dt((IXMLDOMSchemaCollection2*)V_DISPATCH(&v), node);
}
VariantClear(&v);
IXMLDOMDocument3_Release(doc);
}
}
}
TRACE("=> dt:%s\n", dt_to_str(dt));
return dt;
}
static HRESULT WINAPI domelem_get_nodeTypedValue( static HRESULT WINAPI domelem_get_nodeTypedValue(
IXMLDOMElement *iface, IXMLDOMElement *iface,
VARIANT* var1) VARIANT* var1)
...@@ -730,52 +776,6 @@ static HRESULT WINAPI domelem_put_nodeTypedValue( ...@@ -730,52 +776,6 @@ static HRESULT WINAPI domelem_put_nodeTypedValue(
return hr; return hr;
} }
XDR_DT element_get_dt(xmlNodePtr node)
{
XDR_DT dt = DT_INVALID;
TRACE("(%p)\n", node);
if(node->type != XML_ELEMENT_NODE)
{
FIXME("invalid element node\n");
return dt;
}
if (node->ns && xmlStrEqual(node->ns->href, DT_nsURI))
{
dt = str_to_dt(node->name, -1);
}
else
{
xmlChar* pVal = xmlGetNsProp(node, BAD_CAST "dt", DT_nsURI);
if (pVal)
{
dt = str_to_dt(pVal, -1);
xmlFree(pVal);
}
else if (node->doc)
{
IXMLDOMDocument3* doc = (IXMLDOMDocument3*)create_domdoc((xmlNodePtr)node->doc);
if (doc)
{
VARIANT v;
VariantInit(&v);
if (IXMLDOMDocument3_get_schemas(doc, &v) == S_OK &&
V_VT(&v) == VT_DISPATCH)
{
dt = SchemaCache_get_node_dt((IXMLDOMSchemaCollection2*)V_DISPATCH(&v), node);
}
VariantClear(&v);
IXMLDOMDocument3_Release(doc);
}
}
}
TRACE("=> dt:%s\n", dt_to_str(dt));
return dt;
}
static HRESULT WINAPI domelem_get_dataType( static HRESULT WINAPI domelem_get_dataType(
IXMLDOMElement *iface, IXMLDOMElement *iface,
VARIANT* typename) VARIANT* typename)
......
...@@ -317,7 +317,6 @@ extern XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */); ...@@ -317,7 +317,6 @@ extern XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */);
extern XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */); extern XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */);
extern xmlChar const* dt_to_str(XDR_DT dt); extern xmlChar const* dt_to_str(XDR_DT dt);
extern OLECHAR const* dt_to_bstr(XDR_DT dt); extern OLECHAR const* dt_to_bstr(XDR_DT dt);
extern XDR_DT element_get_dt(xmlNodePtr node);
extern HRESULT dt_validate(XDR_DT dt, xmlChar const* content); extern HRESULT dt_validate(XDR_DT dt, xmlChar const* content);
extern BSTR EnsureCorrectEOL(BSTR); extern BSTR EnsureCorrectEOL(BSTR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment