Module: wine Branch: master Commit: 11736f36c9d498949c724ad525707d0b530bcd33 URL: http://source.winehq.org/git/wine.git/?a=commit;h=11736f36c9d498949c724ad525...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Jul 30 15:03:22 2013 +0400
msxml3: Implement IMXAttributes_removeAttribute().
---
dlls/msxml3/mxwriter.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index 3196374..03c1b67 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -1891,8 +1891,26 @@ static HRESULT WINAPI MXAttributes_clear(IMXAttributes *iface) static HRESULT WINAPI MXAttributes_removeAttribute(IMXAttributes *iface, int index) { mxattributes *This = impl_from_IMXAttributes( iface ); - FIXME("(%p)->(%d): stub\n", This, index); - return E_NOTIMPL; + mxattribute *src, *dst; + + TRACE("(%p)->(%d)\n", This, index); + + if (index < 0 || index >= This->length) return E_INVALIDARG; + + /* no need to remove last attribute, just make it inaccessible */ + if (index + 1 == This->length) + { + This->length--; + return S_OK; + } + + dst = &This->attr[index]; + src = &This->attr[index+1]; + + memmove(dst, src, (This->length-index-1)*sizeof(*dst)); + This->length--; + + return S_OK; }
static HRESULT WINAPI MXAttributes_setAttribute(IMXAttributes *iface, int index,