Release 1.1.37.
[wine/gsoc-2012-control.git] / dlls / msxml3 / comment.c
blob62132a7deadf0ca23caefb3ae6d4ef055f4ad153
1 /*
2 * DOM comment node implementation
4 * Copyright 2006 Huw Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define COBJMACROS
23 #include "config.h"
25 #include <stdarg.h>
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "ole2.h"
30 #include "msxml2.h"
32 #include "msxml_private.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
38 #ifdef HAVE_LIBXML2
40 typedef struct _domcomment
42 xmlnode node;
43 const struct IXMLDOMCommentVtbl *lpVtbl;
44 LONG ref;
45 } domcomment;
47 static inline domcomment *impl_from_IXMLDOMComment( IXMLDOMComment *iface )
49 return (domcomment *)((char*)iface - FIELD_OFFSET(domcomment, lpVtbl));
52 static HRESULT WINAPI domcomment_QueryInterface(
53 IXMLDOMComment *iface,
54 REFIID riid,
55 void** ppvObject )
57 domcomment *This = impl_from_IXMLDOMComment( iface );
58 TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject);
60 if ( IsEqualGUID( riid, &IID_IXMLDOMComment ) ||
61 IsEqualGUID( riid, &IID_IXMLDOMCharacterData) ||
62 IsEqualGUID( riid, &IID_IDispatch ) ||
63 IsEqualGUID( riid, &IID_IUnknown ) )
65 *ppvObject = iface;
67 else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) )
69 *ppvObject = IXMLDOMNode_from_impl(&This->node);
71 else
73 FIXME("Unsupported interface %s\n", debugstr_guid(riid));
74 return E_NOINTERFACE;
77 IXMLDOMText_AddRef((IUnknown*)*ppvObject);
78 return S_OK;
81 static ULONG WINAPI domcomment_AddRef(
82 IXMLDOMComment *iface )
84 domcomment *This = impl_from_IXMLDOMComment( iface );
85 return InterlockedIncrement( &This->ref );
88 static ULONG WINAPI domcomment_Release(
89 IXMLDOMComment *iface )
91 domcomment *This = impl_from_IXMLDOMComment( iface );
92 ULONG ref;
94 ref = InterlockedDecrement( &This->ref );
95 if ( ref == 0 )
97 destroy_xmlnode(&This->node);
98 HeapFree( GetProcessHeap(), 0, This );
101 return ref;
104 static HRESULT WINAPI domcomment_GetTypeInfoCount(
105 IXMLDOMComment *iface,
106 UINT* pctinfo )
108 domcomment *This = impl_from_IXMLDOMComment( iface );
110 TRACE("(%p)->(%p)\n", This, pctinfo);
112 *pctinfo = 1;
114 return S_OK;
117 static HRESULT WINAPI domcomment_GetTypeInfo(
118 IXMLDOMComment *iface,
119 UINT iTInfo, LCID lcid,
120 ITypeInfo** ppTInfo )
122 domcomment *This = impl_from_IXMLDOMComment( iface );
123 HRESULT hr;
125 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
127 hr = get_typeinfo(IXMLDOMComment_tid, ppTInfo);
129 return hr;
132 static HRESULT WINAPI domcomment_GetIDsOfNames(
133 IXMLDOMComment *iface,
134 REFIID riid, LPOLESTR* rgszNames,
135 UINT cNames, LCID lcid, DISPID* rgDispId )
137 domcomment *This = impl_from_IXMLDOMComment( iface );
138 ITypeInfo *typeinfo;
139 HRESULT hr;
141 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
142 lcid, rgDispId);
144 if(!rgszNames || cNames == 0 || !rgDispId)
145 return E_INVALIDARG;
147 hr = get_typeinfo(IXMLDOMComment_tid, &typeinfo);
148 if(SUCCEEDED(hr))
150 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
151 ITypeInfo_Release(typeinfo);
154 return hr;
157 static HRESULT WINAPI domcomment_Invoke(
158 IXMLDOMComment *iface,
159 DISPID dispIdMember, REFIID riid, LCID lcid,
160 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
161 EXCEPINFO* pExcepInfo, UINT* puArgErr )
163 domcomment *This = impl_from_IXMLDOMComment( iface );
164 ITypeInfo *typeinfo;
165 HRESULT hr;
167 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
168 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
170 hr = get_typeinfo(IXMLDOMComment_tid, &typeinfo);
171 if(SUCCEEDED(hr))
173 hr = ITypeInfo_Invoke(typeinfo, &(This->lpVtbl), dispIdMember, wFlags, pDispParams,
174 pVarResult, pExcepInfo, puArgErr);
175 ITypeInfo_Release(typeinfo);
178 return hr;
181 static HRESULT WINAPI domcomment_get_nodeName(
182 IXMLDOMComment *iface,
183 BSTR* p )
185 domcomment *This = impl_from_IXMLDOMComment( iface );
186 return IXMLDOMNode_get_nodeName( IXMLDOMNode_from_impl(&This->node), p );
189 static HRESULT WINAPI domcomment_get_nodeValue(
190 IXMLDOMComment *iface,
191 VARIANT* var1 )
193 domcomment *This = impl_from_IXMLDOMComment( iface );
194 return IXMLDOMNode_get_nodeValue( IXMLDOMNode_from_impl(&This->node), var1 );
197 static HRESULT WINAPI domcomment_put_nodeValue(
198 IXMLDOMComment *iface,
199 VARIANT var1 )
201 domcomment *This = impl_from_IXMLDOMComment( iface );
202 return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), var1 );
205 static HRESULT WINAPI domcomment_get_nodeType(
206 IXMLDOMComment *iface,
207 DOMNodeType* domNodeType )
209 domcomment *This = impl_from_IXMLDOMComment( iface );
210 return IXMLDOMNode_get_nodeType( IXMLDOMNode_from_impl(&This->node), domNodeType );
213 static HRESULT WINAPI domcomment_get_parentNode(
214 IXMLDOMComment *iface,
215 IXMLDOMNode** parent )
217 domcomment *This = impl_from_IXMLDOMComment( iface );
218 return IXMLDOMNode_get_parentNode( IXMLDOMNode_from_impl(&This->node), parent );
221 static HRESULT WINAPI domcomment_get_childNodes(
222 IXMLDOMComment *iface,
223 IXMLDOMNodeList** outList)
225 domcomment *This = impl_from_IXMLDOMComment( iface );
226 return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
229 static HRESULT WINAPI domcomment_get_firstChild(
230 IXMLDOMComment *iface,
231 IXMLDOMNode** domNode)
233 domcomment *This = impl_from_IXMLDOMComment( iface );
234 return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
237 static HRESULT WINAPI domcomment_get_lastChild(
238 IXMLDOMComment *iface,
239 IXMLDOMNode** domNode)
241 domcomment *This = impl_from_IXMLDOMComment( iface );
242 return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
245 static HRESULT WINAPI domcomment_get_previousSibling(
246 IXMLDOMComment *iface,
247 IXMLDOMNode** domNode)
249 domcomment *This = impl_from_IXMLDOMComment( iface );
250 return IXMLDOMNode_get_previousSibling( IXMLDOMNode_from_impl(&This->node), domNode );
253 static HRESULT WINAPI domcomment_get_nextSibling(
254 IXMLDOMComment *iface,
255 IXMLDOMNode** domNode)
257 domcomment *This = impl_from_IXMLDOMComment( iface );
258 return IXMLDOMNode_get_nextSibling( IXMLDOMNode_from_impl(&This->node), domNode );
261 static HRESULT WINAPI domcomment_get_attributes(
262 IXMLDOMComment *iface,
263 IXMLDOMNamedNodeMap** attributeMap)
265 domcomment *This = impl_from_IXMLDOMComment( iface );
266 return IXMLDOMNode_get_attributes( IXMLDOMNode_from_impl(&This->node), attributeMap );
269 static HRESULT WINAPI domcomment_insertBefore(
270 IXMLDOMComment *iface,
271 IXMLDOMNode* newNode, VARIANT var1,
272 IXMLDOMNode** outOldNode)
274 domcomment *This = impl_from_IXMLDOMComment( iface );
275 return IXMLDOMNode_insertBefore( IXMLDOMNode_from_impl(&This->node), newNode, var1, outOldNode );
278 static HRESULT WINAPI domcomment_replaceChild(
279 IXMLDOMComment *iface,
280 IXMLDOMNode* newNode,
281 IXMLDOMNode* oldNode,
282 IXMLDOMNode** outOldNode)
284 domcomment *This = impl_from_IXMLDOMComment( iface );
285 return IXMLDOMNode_replaceChild( IXMLDOMNode_from_impl(&This->node), newNode, oldNode, outOldNode );
288 static HRESULT WINAPI domcomment_removeChild(
289 IXMLDOMComment *iface,
290 IXMLDOMNode* domNode, IXMLDOMNode** oldNode)
292 domcomment *This = impl_from_IXMLDOMComment( iface );
293 return IXMLDOMNode_removeChild( IXMLDOMNode_from_impl(&This->node), domNode, oldNode );
296 static HRESULT WINAPI domcomment_appendChild(
297 IXMLDOMComment *iface,
298 IXMLDOMNode* newNode, IXMLDOMNode** outNewNode)
300 domcomment *This = impl_from_IXMLDOMComment( iface );
301 return IXMLDOMNode_appendChild( IXMLDOMNode_from_impl(&This->node), newNode, outNewNode );
304 static HRESULT WINAPI domcomment_hasChildNodes(
305 IXMLDOMComment *iface,
306 VARIANT_BOOL* pbool)
308 domcomment *This = impl_from_IXMLDOMComment( iface );
309 return IXMLDOMNode_hasChildNodes( IXMLDOMNode_from_impl(&This->node), pbool );
312 static HRESULT WINAPI domcomment_get_ownerDocument(
313 IXMLDOMComment *iface,
314 IXMLDOMDocument** domDocument)
316 domcomment *This = impl_from_IXMLDOMComment( iface );
317 return IXMLDOMNode_get_ownerDocument( IXMLDOMNode_from_impl(&This->node), domDocument );
320 static HRESULT WINAPI domcomment_cloneNode(
321 IXMLDOMComment *iface,
322 VARIANT_BOOL pbool, IXMLDOMNode** outNode)
324 domcomment *This = impl_from_IXMLDOMComment( iface );
325 return IXMLDOMNode_cloneNode( IXMLDOMNode_from_impl(&This->node), pbool, outNode );
328 static HRESULT WINAPI domcomment_get_nodeTypeString(
329 IXMLDOMComment *iface,
330 BSTR* p)
332 domcomment *This = impl_from_IXMLDOMComment( iface );
333 return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
336 static HRESULT WINAPI domcomment_get_text(
337 IXMLDOMComment *iface,
338 BSTR* p)
340 domcomment *This = impl_from_IXMLDOMComment( iface );
341 return IXMLDOMNode_get_text( IXMLDOMNode_from_impl(&This->node), p );
344 static HRESULT WINAPI domcomment_put_text(
345 IXMLDOMComment *iface,
346 BSTR p)
348 domcomment *This = impl_from_IXMLDOMComment( iface );
349 return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p );
352 static HRESULT WINAPI domcomment_get_specified(
353 IXMLDOMComment *iface,
354 VARIANT_BOOL* pbool)
356 domcomment *This = impl_from_IXMLDOMComment( iface );
357 return IXMLDOMNode_get_specified( IXMLDOMNode_from_impl(&This->node), pbool );
360 static HRESULT WINAPI domcomment_get_definition(
361 IXMLDOMComment *iface,
362 IXMLDOMNode** domNode)
364 domcomment *This = impl_from_IXMLDOMComment( iface );
365 return IXMLDOMNode_get_definition( IXMLDOMNode_from_impl(&This->node), domNode );
368 static HRESULT WINAPI domcomment_get_nodeTypedValue(
369 IXMLDOMComment *iface,
370 VARIANT* var1)
372 domcomment *This = impl_from_IXMLDOMComment( iface );
373 return IXMLDOMNode_get_nodeTypedValue( IXMLDOMNode_from_impl(&This->node), var1 );
376 static HRESULT WINAPI domcomment_put_nodeTypedValue(
377 IXMLDOMComment *iface,
378 VARIANT var1)
380 domcomment *This = impl_from_IXMLDOMComment( iface );
381 return IXMLDOMNode_put_nodeTypedValue( IXMLDOMNode_from_impl(&This->node), var1 );
384 static HRESULT WINAPI domcomment_get_dataType(
385 IXMLDOMComment *iface,
386 VARIANT* var1)
388 domcomment *This = impl_from_IXMLDOMComment( iface );
389 return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 );
392 static HRESULT WINAPI domcomment_put_dataType(
393 IXMLDOMComment *iface,
394 BSTR p)
396 domcomment *This = impl_from_IXMLDOMComment( iface );
397 return IXMLDOMNode_put_dataType( IXMLDOMNode_from_impl(&This->node), p );
400 static HRESULT WINAPI domcomment_get_xml(
401 IXMLDOMComment *iface,
402 BSTR* p)
404 domcomment *This = impl_from_IXMLDOMComment( iface );
405 return IXMLDOMNode_get_xml( IXMLDOMNode_from_impl(&This->node), p );
408 static HRESULT WINAPI domcomment_transformNode(
409 IXMLDOMComment *iface,
410 IXMLDOMNode* domNode, BSTR* p)
412 domcomment *This = impl_from_IXMLDOMComment( iface );
413 return IXMLDOMNode_transformNode( IXMLDOMNode_from_impl(&This->node), domNode, p );
416 static HRESULT WINAPI domcomment_selectNodes(
417 IXMLDOMComment *iface,
418 BSTR p, IXMLDOMNodeList** outList)
420 domcomment *This = impl_from_IXMLDOMComment( iface );
421 return IXMLDOMNode_selectNodes( IXMLDOMNode_from_impl(&This->node), p, outList );
424 static HRESULT WINAPI domcomment_selectSingleNode(
425 IXMLDOMComment *iface,
426 BSTR p, IXMLDOMNode** outNode)
428 domcomment *This = impl_from_IXMLDOMComment( iface );
429 return IXMLDOMNode_selectSingleNode( IXMLDOMNode_from_impl(&This->node), p, outNode );
432 static HRESULT WINAPI domcomment_get_parsed(
433 IXMLDOMComment *iface,
434 VARIANT_BOOL* pbool)
436 domcomment *This = impl_from_IXMLDOMComment( iface );
437 return IXMLDOMNode_get_parsed( IXMLDOMNode_from_impl(&This->node), pbool );
440 static HRESULT WINAPI domcomment_get_namespaceURI(
441 IXMLDOMComment *iface,
442 BSTR* p)
444 domcomment *This = impl_from_IXMLDOMComment( iface );
445 return IXMLDOMNode_get_namespaceURI( IXMLDOMNode_from_impl(&This->node), p );
448 static HRESULT WINAPI domcomment_get_prefix(
449 IXMLDOMComment *iface,
450 BSTR* p)
452 domcomment *This = impl_from_IXMLDOMComment( iface );
453 return IXMLDOMNode_get_prefix( IXMLDOMNode_from_impl(&This->node), p );
456 static HRESULT WINAPI domcomment_get_baseName(
457 IXMLDOMComment *iface,
458 BSTR* p)
460 domcomment *This = impl_from_IXMLDOMComment( iface );
461 return IXMLDOMNode_get_baseName( IXMLDOMNode_from_impl(&This->node), p );
464 static HRESULT WINAPI domcomment_transformNodeToObject(
465 IXMLDOMComment *iface,
466 IXMLDOMNode* domNode, VARIANT var1)
468 domcomment *This = impl_from_IXMLDOMComment( iface );
469 return IXMLDOMNode_transformNodeToObject( IXMLDOMNode_from_impl(&This->node), domNode, var1 );
472 static HRESULT WINAPI domcomment_get_data(
473 IXMLDOMComment *iface,
474 BSTR *p)
476 domcomment *This = impl_from_IXMLDOMComment( iface );
477 HRESULT hr = E_FAIL;
478 VARIANT vRet;
480 if(!p)
481 return E_INVALIDARG;
483 hr = IXMLDOMNode_get_nodeValue( IXMLDOMNode_from_impl(&This->node), &vRet );
484 if(hr == S_OK)
486 *p = V_BSTR(&vRet);
489 return hr;
492 static HRESULT WINAPI domcomment_put_data(
493 IXMLDOMComment *iface,
494 BSTR data)
496 domcomment *This = impl_from_IXMLDOMComment( iface );
497 HRESULT hr = E_FAIL;
498 VARIANT val;
500 TRACE("%p %s\n", This, debugstr_w(data) );
502 V_VT(&val) = VT_BSTR;
503 V_BSTR(&val) = data;
505 hr = IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
507 return hr;
510 static HRESULT WINAPI domcomment_get_length(
511 IXMLDOMComment *iface,
512 LONG *len)
514 domcomment *This = impl_from_IXMLDOMComment( iface );
515 xmlChar *pContent;
516 LONG nLength = 0;
518 TRACE("%p\n", iface);
520 if(!len)
521 return E_INVALIDARG;
523 pContent = xmlNodeGetContent(This->node.node);
524 if(pContent)
526 nLength = xmlStrlen(pContent);
527 xmlFree(pContent);
530 *len = nLength;
532 return S_OK;
535 static HRESULT WINAPI domcomment_substringData(
536 IXMLDOMComment *iface,
537 LONG offset, LONG count, BSTR *p)
539 domcomment *This = impl_from_IXMLDOMComment( iface );
540 xmlChar *pContent;
541 LONG nLength = 0;
542 HRESULT hr = S_FALSE;
544 TRACE("%p %d %d %p\n", iface, offset, count, p);
546 if(!p)
547 return E_INVALIDARG;
549 *p = NULL;
550 if(offset < 0 || count < 0)
551 return E_INVALIDARG;
553 if(count == 0)
554 return S_FALSE;
556 pContent = xmlNodeGetContent(This->node.node);
557 if(pContent)
559 nLength = xmlStrlen(pContent);
561 if( offset < nLength)
563 BSTR sContent = bstr_from_xmlChar(pContent);
564 if(offset + count > nLength)
565 *p = SysAllocString(&sContent[offset]);
566 else
567 *p = SysAllocStringLen(&sContent[offset], count);
569 SysFreeString(sContent);
570 hr = S_OK;
573 xmlFree(pContent);
576 return hr;
579 static HRESULT WINAPI domcomment_appendData(
580 IXMLDOMComment *iface,
581 BSTR p)
583 domcomment *This = impl_from_IXMLDOMComment( iface );
584 xmlChar *pContent;
585 HRESULT hr = S_FALSE;
587 TRACE("%p\n", iface);
589 /* Nothing to do if NULL or an Empty string passed in. */
590 if(p == NULL || SysStringLen(p) == 0)
591 return S_OK;
593 pContent = xmlChar_from_wchar( p );
594 if(pContent)
596 /* Older versions of libxml < 2.6.27 didn't correctly support
597 xmlTextConcat on Comment nodes. Fallback to setting the
598 contents directly if xmlTextConcat fails.
600 if(xmlTextConcat(This->node.node, pContent, SysStringLen(p) ) == 0)
601 hr = S_OK;
602 else
604 xmlChar *pNew;
605 pNew = xmlStrcat(xmlNodeGetContent(This->node.node), pContent);
606 if(pNew)
608 xmlNodeSetContent(This->node.node, pNew);
609 hr = S_OK;
611 else
612 hr = E_FAIL;
614 HeapFree( GetProcessHeap(), 0, pContent );
616 else
617 hr = E_FAIL;
619 return hr;
622 static HRESULT WINAPI domcomment_insertData(
623 IXMLDOMComment *iface,
624 LONG offset, BSTR p)
626 domcomment *This = impl_from_IXMLDOMComment( iface );
627 xmlChar *pXmlContent;
628 BSTR sNewString;
629 HRESULT hr = S_FALSE;
630 LONG nLength = 0, nLengthP = 0;
631 xmlChar *str = NULL;
633 TRACE("%p %d %p\n", iface, offset, p);
635 /* If have a NULL or empty string, don't do anything. */
636 if(SysStringLen(p) == 0)
637 return S_OK;
639 if(offset < 0)
641 return E_INVALIDARG;
644 pXmlContent = xmlNodeGetContent(This->node.node);
645 if(pXmlContent)
647 BSTR sContent = bstr_from_xmlChar( pXmlContent );
648 nLength = SysStringLen(sContent);
649 nLengthP = SysStringLen(p);
651 if(nLength < offset)
653 SysFreeString(sContent);
654 xmlFree(pXmlContent);
656 return E_INVALIDARG;
659 sNewString = SysAllocStringLen(NULL, nLength + nLengthP + 1);
660 if(sNewString)
662 if(offset > 0)
663 memcpy(sNewString, sContent, offset * sizeof(WCHAR));
665 memcpy(&sNewString[offset], p, nLengthP * sizeof(WCHAR));
667 if(offset+nLengthP < nLength)
668 memcpy(&sNewString[offset+nLengthP], &sContent[offset], (nLength-offset) * sizeof(WCHAR));
670 sNewString[nLengthP + nLength] = 0;
672 str = xmlChar_from_wchar(sNewString);
673 if(str)
675 xmlNodeSetContent(This->node.node, str);
676 hr = S_OK;
678 HeapFree( GetProcessHeap(), 0, str );
680 SysFreeString(sNewString);
683 SysFreeString(sContent);
685 xmlFree(pXmlContent);
688 return hr;
691 static HRESULT WINAPI domcomment_deleteData(
692 IXMLDOMComment *iface,
693 LONG offset, LONG count)
695 HRESULT hr;
696 LONG len = -1;
697 BSTR str;
699 TRACE("%p %d %d\n", iface, offset, count);
701 hr = IXMLDOMComment_get_length(iface, &len);
702 if(hr != S_OK) return hr;
704 if((offset < 0) || (offset > len) || (count < 0))
705 return E_INVALIDARG;
707 if(len == 0) return S_OK;
709 /* cutting start or end */
710 if((offset == 0) || ((count + offset) >= len))
712 if(offset == 0)
713 IXMLDOMComment_substringData(iface, count, len - count, &str);
714 else
715 IXMLDOMComment_substringData(iface, 0, offset, &str);
716 hr = IXMLDOMComment_put_data(iface, str);
718 else
719 /* cutting from the inside */
721 BSTR str_end;
723 IXMLDOMComment_substringData(iface, 0, offset, &str);
724 IXMLDOMComment_substringData(iface, offset + count, len - count, &str_end);
726 hr = IXMLDOMComment_put_data(iface, str);
727 if(hr == S_OK)
728 hr = IXMLDOMComment_appendData(iface, str_end);
730 SysFreeString(str_end);
733 SysFreeString(str);
735 return hr;
738 static HRESULT WINAPI domcomment_replaceData(
739 IXMLDOMComment *iface,
740 LONG offset, LONG count, BSTR p)
742 FIXME("\n");
743 return E_NOTIMPL;
746 static const struct IXMLDOMCommentVtbl domcomment_vtbl =
748 domcomment_QueryInterface,
749 domcomment_AddRef,
750 domcomment_Release,
751 domcomment_GetTypeInfoCount,
752 domcomment_GetTypeInfo,
753 domcomment_GetIDsOfNames,
754 domcomment_Invoke,
755 domcomment_get_nodeName,
756 domcomment_get_nodeValue,
757 domcomment_put_nodeValue,
758 domcomment_get_nodeType,
759 domcomment_get_parentNode,
760 domcomment_get_childNodes,
761 domcomment_get_firstChild,
762 domcomment_get_lastChild,
763 domcomment_get_previousSibling,
764 domcomment_get_nextSibling,
765 domcomment_get_attributes,
766 domcomment_insertBefore,
767 domcomment_replaceChild,
768 domcomment_removeChild,
769 domcomment_appendChild,
770 domcomment_hasChildNodes,
771 domcomment_get_ownerDocument,
772 domcomment_cloneNode,
773 domcomment_get_nodeTypeString,
774 domcomment_get_text,
775 domcomment_put_text,
776 domcomment_get_specified,
777 domcomment_get_definition,
778 domcomment_get_nodeTypedValue,
779 domcomment_put_nodeTypedValue,
780 domcomment_get_dataType,
781 domcomment_put_dataType,
782 domcomment_get_xml,
783 domcomment_transformNode,
784 domcomment_selectNodes,
785 domcomment_selectSingleNode,
786 domcomment_get_parsed,
787 domcomment_get_namespaceURI,
788 domcomment_get_prefix,
789 domcomment_get_baseName,
790 domcomment_transformNodeToObject,
791 domcomment_get_data,
792 domcomment_put_data,
793 domcomment_get_length,
794 domcomment_substringData,
795 domcomment_appendData,
796 domcomment_insertData,
797 domcomment_deleteData,
798 domcomment_replaceData
801 IUnknown* create_comment( xmlNodePtr comment )
803 domcomment *This;
805 This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
806 if ( !This )
807 return NULL;
809 This->lpVtbl = &domcomment_vtbl;
810 This->ref = 1;
812 init_xmlnode(&This->node, comment, (IUnknown*)&This->lpVtbl, NULL);
814 return (IUnknown*) &This->lpVtbl;
817 #endif