msxml3: Implement setting attributes properties with IMXAttributes.
This commit is contained in:
parent
11736f36c9
commit
ccf04d644b
|
@ -1888,14 +1888,20 @@ static HRESULT WINAPI MXAttributes_clear(IMXAttributes *iface)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static mxattribute *get_attribute_byindex(mxattributes *attrs, int index)
|
||||||
|
{
|
||||||
|
if (index < 0 || index >= attrs->length) return NULL;
|
||||||
|
return &attrs->attr[index];
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI MXAttributes_removeAttribute(IMXAttributes *iface, int index)
|
static HRESULT WINAPI MXAttributes_removeAttribute(IMXAttributes *iface, int index)
|
||||||
{
|
{
|
||||||
mxattributes *This = impl_from_IMXAttributes( iface );
|
mxattributes *This = impl_from_IMXAttributes( iface );
|
||||||
mxattribute *src, *dst;
|
mxattribute *dst;
|
||||||
|
|
||||||
TRACE("(%p)->(%d)\n", This, index);
|
TRACE("(%p)->(%d)\n", This, index);
|
||||||
|
|
||||||
if (index < 0 || index >= This->length) return E_INVALIDARG;
|
if (!(dst = get_attribute_byindex(This, index))) return E_INVALIDARG;
|
||||||
|
|
||||||
/* no need to remove last attribute, just make it inaccessible */
|
/* no need to remove last attribute, just make it inaccessible */
|
||||||
if (index + 1 == This->length)
|
if (index + 1 == This->length)
|
||||||
|
@ -1904,10 +1910,7 @@ static HRESULT WINAPI MXAttributes_removeAttribute(IMXAttributes *iface, int ind
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
dst = &This->attr[index];
|
memmove(dst, dst + 1, (This->length-index-1)*sizeof(*dst));
|
||||||
src = &This->attr[index+1];
|
|
||||||
|
|
||||||
memmove(dst, src, (This->length-index-1)*sizeof(*dst));
|
|
||||||
This->length--;
|
This->length--;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -1933,29 +1936,61 @@ static HRESULT WINAPI MXAttributes_setLocalName(IMXAttributes *iface, int index,
|
||||||
BSTR localName)
|
BSTR localName)
|
||||||
{
|
{
|
||||||
mxattributes *This = impl_from_IMXAttributes( iface );
|
mxattributes *This = impl_from_IMXAttributes( iface );
|
||||||
FIXME("(%p)->(%d %s): stub\n", This, index, debugstr_w(localName));
|
mxattribute *attr;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(localName));
|
||||||
|
|
||||||
|
if (!(attr = get_attribute_byindex(This, index))) return E_INVALIDARG;
|
||||||
|
|
||||||
|
SysFreeString(attr->local);
|
||||||
|
attr->local = SysAllocString(localName);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI MXAttributes_setQName(IMXAttributes *iface, int index, BSTR QName)
|
static HRESULT WINAPI MXAttributes_setQName(IMXAttributes *iface, int index, BSTR QName)
|
||||||
{
|
{
|
||||||
mxattributes *This = impl_from_IMXAttributes( iface );
|
mxattributes *This = impl_from_IMXAttributes( iface );
|
||||||
FIXME("(%p)->(%d %s): stub\n", This, index, debugstr_w(QName));
|
mxattribute *attr;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(QName));
|
||||||
|
|
||||||
|
if (!(attr = get_attribute_byindex(This, index))) return E_INVALIDARG;
|
||||||
|
|
||||||
|
SysFreeString(attr->qname);
|
||||||
|
attr->qname = SysAllocString(QName);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI MXAttributes_setURI(IMXAttributes *iface, int index, BSTR uri)
|
static HRESULT WINAPI MXAttributes_setURI(IMXAttributes *iface, int index, BSTR uri)
|
||||||
{
|
{
|
||||||
mxattributes *This = impl_from_IMXAttributes( iface );
|
mxattributes *This = impl_from_IMXAttributes( iface );
|
||||||
FIXME("(%p)->(%d %s): stub\n", This, index, debugstr_w(uri));
|
mxattribute *attr;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(uri));
|
||||||
|
|
||||||
|
if (!(attr = get_attribute_byindex(This, index))) return E_INVALIDARG;
|
||||||
|
|
||||||
|
SysFreeString(attr->uri);
|
||||||
|
attr->uri = SysAllocString(uri);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI MXAttributes_setValue(IMXAttributes *iface, int index, BSTR value)
|
static HRESULT WINAPI MXAttributes_setValue(IMXAttributes *iface, int index, BSTR value)
|
||||||
{
|
{
|
||||||
mxattributes *This = impl_from_IMXAttributes( iface );
|
mxattributes *This = impl_from_IMXAttributes( iface );
|
||||||
FIXME("(%p)->(%d %s): stub\n", This, index, debugstr_w(value));
|
mxattribute *attr;
|
||||||
return E_NOTIMPL;
|
|
||||||
|
TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(value));
|
||||||
|
|
||||||
|
if (!(attr = get_attribute_byindex(This, index))) return E_INVALIDARG;
|
||||||
|
|
||||||
|
SysFreeString(attr->value);
|
||||||
|
attr->value = SysAllocString(value);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IMXAttributesVtbl MXAttributesVtbl = {
|
static const IMXAttributesVtbl MXAttributesVtbl = {
|
||||||
|
|
Loading…
Reference in New Issue