Commit 6818cc6f authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msxml3: Added ISAXAttributes_getQName implementation.

parent df5e40ec
...@@ -79,6 +79,7 @@ typedef struct _saxattributes ...@@ -79,6 +79,7 @@ typedef struct _saxattributes
BSTR *szPrefix; BSTR *szPrefix;
BSTR *szURI; BSTR *szURI;
BSTR *szValue; BSTR *szValue;
BSTR *szQName;
} saxattributes; } saxattributes;
static inline saxreader *impl_from_IVBSAXXMLReader( IVBSAXXMLReader *iface ) static inline saxreader *impl_from_IVBSAXXMLReader( IVBSAXXMLReader *iface )
...@@ -293,9 +294,14 @@ static HRESULT WINAPI isaxattributes_getQName( ...@@ -293,9 +294,14 @@ static HRESULT WINAPI isaxattributes_getQName(
int *pQNameLength) int *pQNameLength)
{ {
saxattributes *This = impl_from_ISAXAttributes( iface ); saxattributes *This = impl_from_ISAXAttributes( iface );
TRACE("(%p)->(%d)\n", This, nIndex);
FIXME("(%p)->(%d) stub\n", This, nIndex); if(nIndex >= This->nb_attributes) return E_INVALIDARG;
return E_NOTIMPL;
*pQNameLength = SysStringLen(This->szQName[nIndex]);
*pQName = This->szQName[nIndex];
return S_OK;
} }
static HRESULT WINAPI isaxattributes_getName( static HRESULT WINAPI isaxattributes_getName(
...@@ -471,9 +477,12 @@ static HRESULT SAXAttributes_create(saxattributes **attr, ...@@ -471,9 +477,12 @@ static HRESULT SAXAttributes_create(saxattributes **attr,
HeapAlloc(GetProcessHeap(), 0, sizeof(BSTR)*nb_attributes); HeapAlloc(GetProcessHeap(), 0, sizeof(BSTR)*nb_attributes);
attributes->szValue = attributes->szValue =
HeapAlloc(GetProcessHeap(), 0, sizeof(BSTR)*nb_attributes); HeapAlloc(GetProcessHeap(), 0, sizeof(BSTR)*nb_attributes);
attributes->szQName =
HeapAlloc(GetProcessHeap(), 0, sizeof(BSTR)*nb_attributes);
if(!attributes->szLocalname || !attributes->szPrefix if(!attributes->szLocalname || !attributes->szPrefix
|| !attributes->szURI || !attributes->szValue) || !attributes->szURI || !attributes->szValue
|| !attributes->szQName)
{ {
if(attributes->szLocalname) if(attributes->szLocalname)
HeapFree(GetProcessHeap(), 0, attributes->szLocalname); HeapFree(GetProcessHeap(), 0, attributes->szLocalname);
...@@ -483,11 +492,15 @@ static HRESULT SAXAttributes_create(saxattributes **attr, ...@@ -483,11 +492,15 @@ static HRESULT SAXAttributes_create(saxattributes **attr,
HeapFree(GetProcessHeap(), 0, attributes->szURI); HeapFree(GetProcessHeap(), 0, attributes->szURI);
if(attributes->szValue) if(attributes->szValue)
HeapFree(GetProcessHeap(), 0, attributes->szValue); HeapFree(GetProcessHeap(), 0, attributes->szValue);
if(attributes->szQName)
HeapFree(GetProcessHeap(), 0, attributes->szQName);
return E_FAIL; return E_FAIL;
} }
for(index=0; index<nb_attributes; index++) for(index=0; index<nb_attributes; index++)
{ {
int len1, len2;
attributes->szLocalname[index] = attributes->szLocalname[index] =
bstr_from_xmlChar(xmlAttributes[index*5]); bstr_from_xmlChar(xmlAttributes[index*5]);
attributes->szPrefix[index] = attributes->szPrefix[index] =
...@@ -497,6 +510,15 @@ static HRESULT SAXAttributes_create(saxattributes **attr, ...@@ -497,6 +510,15 @@ static HRESULT SAXAttributes_create(saxattributes **attr,
attributes->szValue[index] = attributes->szValue[index] =
bstr_from_xmlCharN(xmlAttributes[index*5+3], bstr_from_xmlCharN(xmlAttributes[index*5+3],
xmlAttributes[index*5+4]-xmlAttributes[index*5+3]); xmlAttributes[index*5+4]-xmlAttributes[index*5+3]);
len1 = SysStringLen(attributes->szPrefix[index]);
len2 = SysStringLen(attributes->szLocalname[index]);
attributes->szQName[index] = SysAllocStringLen(NULL, len1+len2);
memcpy(attributes->szQName[index], attributes->szPrefix[index],
len1*sizeof(WCHAR));
memcpy(attributes->szQName[index]+len1,
attributes->szLocalname[index], len2*sizeof(WCHAR));
attributes->szQName[index][len1+len2] = '\0';
} }
*attr = attributes; *attr = attributes;
......
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