ReactOS 0.4.16-dev-2216-ga08d639
text.c File Reference
#include <stdarg.h>
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <libxml/xmlerror.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "msxml6.h"
#include "msxml_private.h"
#include "wine/debug.h"
Include dependency graph for text.c:

Go to the source code of this file.

Classes

struct  _domtext
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct _domtext domtext
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msxml)
 
static domtextimpl_from_IXMLDOMText (IXMLDOMText *iface)
 
static void domtext_reset_noenc (domtext *This)
 
static HRESULT WINAPI domtext_QueryInterface (IXMLDOMText *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI domtext_AddRef (IXMLDOMText *iface)
 
static ULONG WINAPI domtext_Release (IXMLDOMText *iface)
 
static HRESULT WINAPI domtext_GetTypeInfoCount (IXMLDOMText *iface, UINT *pctinfo)
 
static HRESULT WINAPI domtext_GetTypeInfo (IXMLDOMText *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI domtext_GetIDsOfNames (IXMLDOMText *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI domtext_Invoke (IXMLDOMText *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI domtext_get_nodeName (IXMLDOMText *iface, BSTR *p)
 
static HRESULT WINAPI domtext_get_nodeValue (IXMLDOMText *iface, VARIANT *value)
 
static HRESULT WINAPI domtext_put_nodeValue (IXMLDOMText *iface, VARIANT value)
 
static HRESULT WINAPI domtext_get_nodeType (IXMLDOMText *iface, DOMNodeType *domNodeType)
 
static HRESULT WINAPI domtext_get_parentNode (IXMLDOMText *iface, IXMLDOMNode **parent)
 
static HRESULT WINAPI domtext_get_childNodes (IXMLDOMText *iface, IXMLDOMNodeList **outList)
 
static HRESULT WINAPI domtext_get_firstChild (IXMLDOMText *iface, IXMLDOMNode **domNode)
 
static HRESULT WINAPI domtext_get_lastChild (IXMLDOMText *iface, IXMLDOMNode **domNode)
 
static HRESULT WINAPI domtext_get_previousSibling (IXMLDOMText *iface, IXMLDOMNode **domNode)
 
static HRESULT WINAPI domtext_get_nextSibling (IXMLDOMText *iface, IXMLDOMNode **domNode)
 
static HRESULT WINAPI domtext_get_attributes (IXMLDOMText *iface, IXMLDOMNamedNodeMap **attributeMap)
 
static HRESULT WINAPI domtext_insertBefore (IXMLDOMText *iface, IXMLDOMNode *newNode, VARIANT refChild, IXMLDOMNode **outOldNode)
 
static HRESULT WINAPI domtext_replaceChild (IXMLDOMText *iface, IXMLDOMNode *newNode, IXMLDOMNode *oldNode, IXMLDOMNode **outOldNode)
 
static HRESULT WINAPI domtext_removeChild (IXMLDOMText *iface, IXMLDOMNode *child, IXMLDOMNode **oldChild)
 
static HRESULT WINAPI domtext_appendChild (IXMLDOMText *iface, IXMLDOMNode *child, IXMLDOMNode **outChild)
 
static HRESULT WINAPI domtext_hasChildNodes (IXMLDOMText *iface, VARIANT_BOOL *ret)
 
static HRESULT WINAPI domtext_get_ownerDocument (IXMLDOMText *iface, IXMLDOMDocument **doc)
 
static HRESULT WINAPI domtext_cloneNode (IXMLDOMText *iface, VARIANT_BOOL deep, IXMLDOMNode **outNode)
 
static HRESULT WINAPI domtext_get_nodeTypeString (IXMLDOMText *iface, BSTR *p)
 
static HRESULT WINAPI domtext_get_text (IXMLDOMText *iface, BSTR *p)
 
static HRESULT WINAPI domtext_put_text (IXMLDOMText *iface, BSTR p)
 
static HRESULT WINAPI domtext_get_specified (IXMLDOMText *iface, VARIANT_BOOL *isSpecified)
 
static HRESULT WINAPI domtext_get_definition (IXMLDOMText *iface, IXMLDOMNode **definitionNode)
 
static HRESULT WINAPI domtext_get_nodeTypedValue (IXMLDOMText *iface, VARIANT *var1)
 
static HRESULT WINAPI domtext_put_nodeTypedValue (IXMLDOMText *iface, VARIANT value)
 
static HRESULT WINAPI domtext_get_dataType (IXMLDOMText *iface, VARIANT *dtName)
 
static HRESULT WINAPI domtext_put_dataType (IXMLDOMText *iface, BSTR dtName)
 
static HRESULT WINAPI domtext_get_xml (IXMLDOMText *iface, BSTR *p)
 
static HRESULT WINAPI domtext_transformNode (IXMLDOMText *iface, IXMLDOMNode *node, BSTR *p)
 
static HRESULT WINAPI domtext_selectNodes (IXMLDOMText *iface, BSTR p, IXMLDOMNodeList **outList)
 
static HRESULT WINAPI domtext_selectSingleNode (IXMLDOMText *iface, BSTR p, IXMLDOMNode **outNode)
 
static HRESULT WINAPI domtext_get_parsed (IXMLDOMText *iface, VARIANT_BOOL *isParsed)
 
static HRESULT WINAPI domtext_get_namespaceURI (IXMLDOMText *iface, BSTR *p)
 
static HRESULT WINAPI domtext_get_prefix (IXMLDOMText *iface, BSTR *prefix)
 
static HRESULT WINAPI domtext_get_baseName (IXMLDOMText *iface, BSTR *name)
 
static HRESULT WINAPI domtext_transformNodeToObject (IXMLDOMText *iface, IXMLDOMNode *domNode, VARIANT var1)
 
static HRESULT WINAPI domtext_get_data (IXMLDOMText *iface, BSTR *p)
 
static HRESULT WINAPI domtext_put_data (IXMLDOMText *iface, BSTR data)
 
static HRESULT WINAPI domtext_get_length (IXMLDOMText *iface, LONG *len)
 
static HRESULT WINAPI domtext_substringData (IXMLDOMText *iface, LONG offset, LONG count, BSTR *p)
 
static HRESULT WINAPI domtext_appendData (IXMLDOMText *iface, BSTR p)
 
static HRESULT WINAPI domtext_insertData (IXMLDOMText *iface, LONG offset, BSTR p)
 
static HRESULT WINAPI domtext_deleteData (IXMLDOMText *iface, LONG offset, LONG count)
 
static HRESULT WINAPI domtext_replaceData (IXMLDOMText *iface, LONG offset, LONG count, BSTR p)
 
static HRESULT WINAPI domtext_splitText (IXMLDOMText *iface, LONG offset, IXMLDOMText **txtNode)
 
IUnknowncreate_text (xmlNodePtr text)
 

Variables

static const struct IXMLDOMTextVtbl domtext_vtbl
 
static const tid_t domtext_iface_tids []
 
static dispex_static_data_t domtext_dispex
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file text.c.

Typedef Documentation

◆ domtext

Function Documentation

◆ create_text()

IUnknown * create_text ( xmlNodePtr  text)

Definition at line 940 of file text.c.

941{
942 domtext *This;
943
944 This = malloc(sizeof(*This));
945 if ( !This )
946 return NULL;
947
948 This->IXMLDOMText_iface.lpVtbl = &domtext_vtbl;
949 This->ref = 1;
950
951 init_xmlnode(&This->node, text, (IXMLDOMNode*)&This->IXMLDOMText_iface, &domtext_dispex);
952
953 return (IUnknown*)&This->IXMLDOMText_iface;
954}
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
const WCHAR * text
Definition: package.c:1794
static const struct IXMLDOMTextVtbl domtext_vtbl
Definition: text.c:872
static dispex_static_data_t domtext_dispex
Definition: text.c:933
void init_xmlnode(xmlnode *, xmlNodePtr, IXMLDOMNode *, dispex_static_data_t *)
Definition: node.c:1647
Definition: text.c:42

◆ domtext_AddRef()

static ULONG WINAPI domtext_AddRef ( IXMLDOMText iface)
static

Definition at line 89 of file text.c.

91{
94 TRACE("%p, refcount %lu.\n", iface, ref);
95 return ref;
96}
#define InterlockedIncrement
Definition: armddk.h:53
static domtext * impl_from_IXMLDOMText(IXMLDOMText *iface)
Definition: text.c:48
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ domtext_appendChild()

static HRESULT WINAPI domtext_appendChild ( IXMLDOMText iface,
IXMLDOMNode child,
IXMLDOMNode **  outChild 
)
static

Definition at line 312 of file text.c.

315{
317 TRACE("(%p)->(%p %p)\n", This, child, outChild);
318 return node_append_child(&This->node, child, outChild);
319}
static HWND child
Definition: cursoricon.c:298
HRESULT node_append_child(xmlnode *, IXMLDOMNode *, IXMLDOMNode **)
Definition: node.c:639

◆ domtext_appendData()

static HRESULT WINAPI domtext_appendData ( IXMLDOMText iface,
BSTR  p 
)
static

Definition at line 707 of file text.c.

710{
712 HRESULT hr;
713 BSTR data;
714 LONG p_len;
715
716 TRACE("(%p)->(%s)\n", This, debugstr_w(p));
717
718 /* Nothing to do if NULL or an Empty string passed in. */
719 if((p_len = SysStringLen(p)) == 0) return S_OK;
720
721 hr = IXMLDOMText_get_data(iface, &data);
722 if(hr == S_OK)
723 {
725 BSTR str = SysAllocStringLen(NULL, p_len + len);
726
727 memcpy(str, data, len*sizeof(WCHAR));
728 memcpy(&str[len], p, p_len*sizeof(WCHAR));
729 str[len+p_len] = 0;
730
731 hr = IXMLDOMText_put_data(iface, str);
732
735 }
736
737 return hr;
738}
OLECHAR * BSTR
Definition: compat.h:2293
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
long LONG
Definition: pedump.c:60
const WCHAR * str
HRESULT hr
Definition: shlfolder.c:183
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ domtext_cloneNode()

static HRESULT WINAPI domtext_cloneNode ( IXMLDOMText iface,
VARIANT_BOOL  deep,
IXMLDOMNode **  outNode 
)
static

Definition at line 339 of file text.c.

342{
344 TRACE("(%p)->(%d %p)\n", This, deep, outNode);
345 return node_clone( &This->node, deep, outNode );
346}
HRESULT node_clone(xmlnode *, VARIANT_BOOL, IXMLDOMNode **)
Definition: node.c:679

◆ domtext_deleteData()

static HRESULT WINAPI domtext_deleteData ( IXMLDOMText iface,
LONG  offset,
LONG  count 
)
static

Definition at line 787 of file text.c.

790{
791 HRESULT hr;
792 LONG len = -1;
793 BSTR str;
794
795 TRACE("%p, %ld, %ld.\n", iface, offset, count);
796
797 hr = IXMLDOMText_get_length(iface, &len);
798 if(hr != S_OK) return hr;
799
800 if((offset < 0) || (offset > len) || (count < 0))
801 return E_INVALIDARG;
802
803 if(len == 0) return S_OK;
804
805 /* cutting start or end */
806 if((offset == 0) || ((count + offset) >= len))
807 {
808 if(offset == 0)
809 IXMLDOMText_substringData(iface, count, len - count, &str);
810 else
811 IXMLDOMText_substringData(iface, 0, offset, &str);
812 hr = IXMLDOMText_put_data(iface, str);
813 }
814 else
815 /* cutting from the inside */
816 {
817 BSTR str_end;
818
819 IXMLDOMText_substringData(iface, 0, offset, &str);
820 IXMLDOMText_substringData(iface, offset + count, len - count, &str_end);
821
822 hr = IXMLDOMText_put_data(iface, str);
823 if(hr == S_OK)
824 hr = IXMLDOMText_appendData(iface, str_end);
825
826 SysFreeString(str_end);
827 }
828
830
831 return hr;
832}
#define E_INVALIDARG
Definition: ddrawi.h:101
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLintptr offset
Definition: glext.h:5920

◆ domtext_get_attributes()

static HRESULT WINAPI domtext_get_attributes ( IXMLDOMText iface,
IXMLDOMNamedNodeMap **  attributeMap 
)
static

Definition at line 267 of file text.c.

270{
272
273 TRACE("(%p)->(%p)\n", This, attributeMap);
274
275 return return_null_ptr((void**)attributeMap);
276}
static HRESULT return_null_ptr(void **p)

◆ domtext_get_baseName()

static HRESULT WINAPI domtext_get_baseName ( IXMLDOMText iface,
BSTR name 
)
static

Definition at line 577 of file text.c.

580{
582 TRACE("(%p)->(%p)\n", This, name);
583 return return_null_bstr( name );
584}
static HRESULT return_null_bstr(BSTR *p)
Definition: name.c:39

◆ domtext_get_childNodes()

static HRESULT WINAPI domtext_get_childNodes ( IXMLDOMText iface,
IXMLDOMNodeList **  outList 
)
static

Definition at line 212 of file text.c.

215{
217
218 TRACE("(%p)->(%p)\n", This, outList);
219
220 return node_get_child_nodes(&This->node, outList);
221}
HRESULT node_get_child_nodes(xmlnode *, IXMLDOMNodeList **)
Definition: node.c:353

◆ domtext_get_data()

static HRESULT WINAPI domtext_get_data ( IXMLDOMText iface,
BSTR p 
)
static

Definition at line 595 of file text.c.

598{
600
601 if(!p)
602 return E_INVALIDARG;
603
604 *p = bstr_from_xmlChar(This->node.node->content);
605 return S_OK;
606}
static BSTR bstr_from_xmlChar(const xmlChar *str)

◆ domtext_get_dataType()

static HRESULT WINAPI domtext_get_dataType ( IXMLDOMText iface,
VARIANT dtName 
)
static

Definition at line 453 of file text.c.

456{
459 HRESULT hr;
460
461 TRACE("(%p)->(%p)\n", This, dtName);
462
463 if (!dtName)
464 return E_INVALIDARG;
465
466 hr = IXMLDOMText_get_parentNode(iface, &parent);
467
468 if (hr == S_OK)
469 {
470 hr = IXMLDOMNode_get_dataType(parent, dtName);
471 IXMLDOMNode_Release(parent);
472 }
473 else
474 {
475 V_VT(dtName) = VT_NULL;
476 V_BSTR(dtName) = NULL;
477 hr = S_FALSE;
478 }
479
480 return hr;
481}
@ VT_NULL
Definition: compat.h:2296
r parent
Definition: btrfs.c:3010
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_FALSE
Definition: winerror.h:3451

◆ domtext_get_definition()

static HRESULT WINAPI domtext_get_definition ( IXMLDOMText iface,
IXMLDOMNode **  definitionNode 
)
static

Definition at line 389 of file text.c.

392{
394 FIXME("(%p)->(%p)\n", This, definitionNode);
395 return E_NOTIMPL;
396}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ domtext_get_firstChild()

static HRESULT WINAPI domtext_get_firstChild ( IXMLDOMText iface,
IXMLDOMNode **  domNode 
)
static

Definition at line 223 of file text.c.

226{
228
229 TRACE("(%p)->(%p)\n", This, domNode);
230
231 return return_null_node(domNode);
232}
static HRESULT return_null_node(IXMLDOMNode **p)

◆ domtext_get_lastChild()

static HRESULT WINAPI domtext_get_lastChild ( IXMLDOMText iface,
IXMLDOMNode **  domNode 
)
static

Definition at line 234 of file text.c.

237{
239
240 TRACE("(%p)->(%p)\n", This, domNode);
241
242 return return_null_node(domNode);
243}

◆ domtext_get_length()

static HRESULT WINAPI domtext_get_length ( IXMLDOMText iface,
LONG len 
)
static

Definition at line 644 of file text.c.

647{
649 HRESULT hr;
650 BSTR data;
651
652 TRACE("(%p)->(%p)\n", This, len);
653
654 if(!len)
655 return E_INVALIDARG;
656
657 hr = IXMLDOMText_get_data(iface, &data);
658 if(hr == S_OK)
659 {
662 }
663
664 return hr;
665}

◆ domtext_get_namespaceURI()

static HRESULT WINAPI domtext_get_namespaceURI ( IXMLDOMText iface,
BSTR p 
)
static

Definition at line 559 of file text.c.

562{
564 TRACE("(%p)->(%p)\n", This, p);
565 return node_get_namespaceURI(&This->node, p);
566}
HRESULT node_get_namespaceURI(xmlnode *, BSTR *)
Definition: node.c:1589

◆ domtext_get_nextSibling()

static HRESULT WINAPI domtext_get_nextSibling ( IXMLDOMText iface,
IXMLDOMNode **  domNode 
)
static

Definition at line 256 of file text.c.

259{
261
262 TRACE("(%p)->(%p)\n", This, domNode);
263
264 return node_get_next_sibling(&This->node, domNode);
265}
HRESULT node_get_next_sibling(xmlnode *, IXMLDOMNode **)
Definition: node.c:380

◆ domtext_get_nodeName()

static HRESULT WINAPI domtext_get_nodeName ( IXMLDOMText iface,
BSTR p 
)
static

Definition at line 153 of file text.c.

156{
158
159 static const WCHAR textW[] = {'#','t','e','x','t',0};
160
161 TRACE("(%p)->(%p)\n", This, p);
162
163 return return_bstr(textW, p);
164}
static const WCHAR textW[]
Definition: itemdlg.c:1559
static HRESULT return_bstr(const WCHAR *value, BSTR *p)
Definition: msxml_dispex.h:115

◆ domtext_get_nodeType()

static HRESULT WINAPI domtext_get_nodeType ( IXMLDOMText iface,
DOMNodeType domNodeType 
)
static

Definition at line 189 of file text.c.

192{
194
195 TRACE("(%p)->(%p)\n", This, domNodeType);
196
197 *domNodeType = NODE_TEXT;
198 return S_OK;
199}
@ NODE_TEXT
Definition: msxml6.idl:115

◆ domtext_get_nodeTypedValue()

static HRESULT WINAPI domtext_get_nodeTypedValue ( IXMLDOMText iface,
VARIANT var1 
)
static

Definition at line 398 of file text.c.

401{
404 HRESULT hr;
405
406 TRACE("(%p)->(%p)\n", This, var1);
407
408 if (!var1)
409 return E_INVALIDARG;
410
411 hr = IXMLDOMText_get_parentNode(iface, &parent);
412
413 if (hr == S_OK)
414 {
415 hr = IXMLDOMNode_get_nodeTypedValue(parent, var1);
416 IXMLDOMNode_Release(parent);
417 }
418 else
419 {
420 V_VT(var1) = VT_NULL;
421 V_BSTR(var1) = NULL;
422 hr = S_FALSE;
423 }
424
425 return hr;
426}

◆ domtext_get_nodeTypeString()

static HRESULT WINAPI domtext_get_nodeTypeString ( IXMLDOMText iface,
BSTR p 
)
static

Definition at line 348 of file text.c.

351{
353 static const WCHAR textW[] = {'t','e','x','t',0};
354
355 TRACE("(%p)->(%p)\n", This, p);
356
357 return return_bstr(textW, p);
358}

◆ domtext_get_nodeValue()

static HRESULT WINAPI domtext_get_nodeValue ( IXMLDOMText iface,
VARIANT value 
)
static

Definition at line 166 of file text.c.

169{
171
172 TRACE("(%p)->(%p)\n", This, value);
173
174 return node_get_content(&This->node, value);
175}
HRESULT node_get_content(xmlnode *, VARIANT *)
Definition: node.c:225
Definition: pdh_main.c:96

◆ domtext_get_ownerDocument()

static HRESULT WINAPI domtext_get_ownerDocument ( IXMLDOMText iface,
IXMLDOMDocument **  doc 
)
static

Definition at line 330 of file text.c.

333{
335 TRACE("(%p)->(%p)\n", This, doc);
336 return node_get_owner_doc(&This->node, doc);
337}
HRESULT node_get_owner_doc(const xmlnode *, IXMLDOMDocument **)
Definition: node.c:672

◆ domtext_get_parentNode()

static HRESULT WINAPI domtext_get_parentNode ( IXMLDOMText iface,
IXMLDOMNode **  parent 
)
static

Definition at line 201 of file text.c.

204{
206
207 TRACE("(%p)->(%p)\n", This, parent);
208
209 return node_get_parent(&This->node, parent);
210}
HRESULT node_get_parent(xmlnode *, IXMLDOMNode **)
Definition: node.c:348

◆ domtext_get_parsed()

static HRESULT WINAPI domtext_get_parsed ( IXMLDOMText iface,
VARIANT_BOOL isParsed 
)
static

Definition at line 549 of file text.c.

552{
554 FIXME("(%p)->(%p) stub!\n", This, isParsed);
555 *isParsed = VARIANT_TRUE;
556 return S_OK;
557}

◆ domtext_get_prefix()

static HRESULT WINAPI domtext_get_prefix ( IXMLDOMText iface,
BSTR prefix 
)
static

Definition at line 568 of file text.c.

571{
573 TRACE("(%p)->(%p)\n", This, prefix);
574 return return_null_bstr( prefix );
575}
Character const *const prefix
Definition: tempnam.cpp:195

◆ domtext_get_previousSibling()

static HRESULT WINAPI domtext_get_previousSibling ( IXMLDOMText iface,
IXMLDOMNode **  domNode 
)
static

Definition at line 245 of file text.c.

248{
250
251 TRACE("(%p)->(%p)\n", This, domNode);
252
253 return node_get_previous_sibling(&This->node, domNode);
254}
HRESULT node_get_previous_sibling(xmlnode *, IXMLDOMNode **)
Definition: node.c:375

◆ domtext_get_specified()

static HRESULT WINAPI domtext_get_specified ( IXMLDOMText iface,
VARIANT_BOOL isSpecified 
)
static

Definition at line 379 of file text.c.

382{
384 FIXME("(%p)->(%p) stub!\n", This, isSpecified);
385 *isSpecified = VARIANT_TRUE;
386 return S_OK;
387}

◆ domtext_get_text()

static HRESULT WINAPI domtext_get_text ( IXMLDOMText iface,
BSTR p 
)
static

Definition at line 360 of file text.c.

363{
365 TRACE("(%p)->(%p)\n", This, p);
366 return node_get_text(&This->node, p);
367}
HRESULT node_get_text(const xmlnode *, BSTR *)
Definition: node.c:842

◆ domtext_get_xml()

static HRESULT WINAPI domtext_get_xml ( IXMLDOMText iface,
BSTR p 
)
static

Definition at line 511 of file text.c.

514{
516
517 TRACE("(%p)->(%p)\n", This, p);
518
519 return node_get_xml(&This->node, TRUE, p);
520}
#define TRUE
Definition: types.h:120
HRESULT node_get_xml(xmlnode *, BOOL, BSTR *)
Definition: node.c:936

◆ domtext_GetIDsOfNames()

static HRESULT WINAPI domtext_GetIDsOfNames ( IXMLDOMText iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 132 of file text.c.

136{
138 return IDispatchEx_GetIDsOfNames(&This->node.dispex.IDispatchEx_iface,
139 riid, rgszNames, cNames, lcid, rgDispId);
140}
LCID lcid
Definition: locale.c:5656
REFIID riid
Definition: atlbase.h:39

◆ domtext_GetTypeInfo()

static HRESULT WINAPI domtext_GetTypeInfo ( IXMLDOMText iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 122 of file text.c.

126{
128 return IDispatchEx_GetTypeInfo(&This->node.dispex.IDispatchEx_iface,
129 iTInfo, lcid, ppTInfo);
130}

◆ domtext_GetTypeInfoCount()

static HRESULT WINAPI domtext_GetTypeInfoCount ( IXMLDOMText iface,
UINT pctinfo 
)
static

Definition at line 114 of file text.c.

117{
119 return IDispatchEx_GetTypeInfoCount(&This->node.dispex.IDispatchEx_iface, pctinfo);
120}

◆ domtext_hasChildNodes()

static HRESULT WINAPI domtext_hasChildNodes ( IXMLDOMText iface,
VARIANT_BOOL ret 
)
static

Definition at line 321 of file text.c.

324{
326 TRACE("(%p)->(%p)\n", This, ret);
327 return return_var_false(ret);
328}
return ret
Definition: mutex.c:146
static HRESULT return_var_false(VARIANT_BOOL *p)

◆ domtext_insertBefore()

static HRESULT WINAPI domtext_insertBefore ( IXMLDOMText iface,
IXMLDOMNode newNode,
VARIANT  refChild,
IXMLDOMNode **  outOldNode 
)
static

Definition at line 278 of file text.c.

282{
284
285 FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode);
286
287 return node_insert_before(&This->node, newNode, &refChild, outOldNode);
288}
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
HRESULT node_insert_before(xmlnode *, IXMLDOMNode *, const VARIANT *, IXMLDOMNode **)
Definition: node.c:432

◆ domtext_insertData()

static HRESULT WINAPI domtext_insertData ( IXMLDOMText iface,
LONG  offset,
BSTR  p 
)
static

Definition at line 740 of file text.c.

743{
744 HRESULT hr;
745 BSTR data;
746 LONG p_len;
747
748 TRACE("%p, %ld, %s.\n", iface, offset, debugstr_w(p));
749
750 /* If have a NULL or empty string, don't do anything. */
751 if((p_len = SysStringLen(p)) == 0)
752 return S_OK;
753
754 if(offset < 0)
755 {
756 return E_INVALIDARG;
757 }
758
759 hr = IXMLDOMText_get_data(iface, &data);
760 if(hr == S_OK)
761 {
763 BSTR str;
764
765 if(len < offset)
766 {
768 return E_INVALIDARG;
769 }
770
771 str = SysAllocStringLen(NULL, len + p_len);
772 /* start part, supplied string and end part */
773 memcpy(str, data, offset*sizeof(WCHAR));
774 memcpy(&str[offset], p, p_len*sizeof(WCHAR));
775 memcpy(&str[offset+p_len], &data[offset], (len-offset)*sizeof(WCHAR));
776 str[len+p_len] = 0;
777
778 hr = IXMLDOMText_put_data(iface, str);
779
782 }
783
784 return hr;
785}

◆ domtext_Invoke()

static HRESULT WINAPI domtext_Invoke ( IXMLDOMText iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 142 of file text.c.

147{
149 return IDispatchEx_Invoke(&This->node.dispex.IDispatchEx_iface,
150 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
151}
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337

◆ domtext_put_data()

static HRESULT WINAPI domtext_put_data ( IXMLDOMText iface,
BSTR  data 
)
static

Definition at line 608 of file text.c.

611{
613 BSTR normalized_data = NULL;
614 HRESULT hr;
615 size_t i, j;
616
617 TRACE("(%p)->(%s)\n", This, debugstr_w(data));
618
619 if (data)
620 {
621 /* normalize line endings */
622 normalized_data = SysAllocStringLen(NULL, SysStringLen(data));
623 if (!normalized_data) return E_OUTOFMEMORY;
624 for (i = 0, j = 0; data[i]; i++)
625 {
626 if (data[i] == '\r')
627 {
628 if (data[i + 1] == '\n') i++; /* change \r\n to just \n */
629 normalized_data[j++] = '\n'; /* change \r by itself to \n */
630 }
631 else
632 normalized_data[j++] = data[i];
633 }
634 normalized_data[j] = 0;
635 }
636
638 hr = node_set_content(&This->node, normalized_data);
639
640 SysFreeString(normalized_data);
641 return hr;
642}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static void domtext_reset_noenc(domtext *This)
Definition: text.c:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
HRESULT node_set_content(xmlnode *, LPCWSTR)
Definition: node.c:241

◆ domtext_put_dataType()

static HRESULT WINAPI domtext_put_dataType ( IXMLDOMText iface,
BSTR  dtName 
)
static

Definition at line 483 of file text.c.

486{
489 HRESULT hr;
490
491 TRACE("(%p)->(%p)\n", This, dtName);
492
493 if (!dtName)
494 return E_INVALIDARG;
495
496 hr = IXMLDOMText_get_parentNode(iface, &parent);
497
498 if (hr == S_OK)
499 {
500 hr = IXMLDOMNode_put_dataType(parent, dtName);
501 IXMLDOMNode_Release(parent);
502 }
503 else
504 {
505 hr = S_FALSE;
506 }
507
508 return hr;
509}

◆ domtext_put_nodeTypedValue()

static HRESULT WINAPI domtext_put_nodeTypedValue ( IXMLDOMText iface,
VARIANT  value 
)
static

Definition at line 428 of file text.c.

431{
434 HRESULT hr;
435
436 TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
437
438 hr = IXMLDOMText_get_parentNode(iface, &parent);
439
440 if (hr == S_OK)
441 {
442 hr = IXMLDOMNode_put_nodeTypedValue(parent, value);
443 IXMLDOMNode_Release(parent);
444 }
445 else
446 {
447 hr = S_FALSE;
448 }
449
450 return hr;
451}

◆ domtext_put_nodeValue()

static HRESULT WINAPI domtext_put_nodeValue ( IXMLDOMText iface,
VARIANT  value 
)
static

Definition at line 177 of file text.c.

180{
182
183 TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
184
186 return node_put_value(&This->node, &value);
187}
HRESULT node_put_value(xmlnode *, VARIANT *)
Definition: node.c:279

◆ domtext_put_text()

static HRESULT WINAPI domtext_put_text ( IXMLDOMText iface,
BSTR  p 
)
static

Definition at line 369 of file text.c.

372{
374 TRACE("(%p)->(%s)\n", This, debugstr_w(p));
376 return node_put_text( &This->node, p );
377}
HRESULT node_put_text(xmlnode *, BSTR)
Definition: node.c:867

◆ domtext_QueryInterface()

static HRESULT WINAPI domtext_QueryInterface ( IXMLDOMText iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 58 of file text.c.

62{
64 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
65
66 if ( IsEqualGUID( riid, &IID_IXMLDOMText ) ||
67 IsEqualGUID( riid, &IID_IXMLDOMCharacterData) ||
68 IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
71 {
72 *ppvObject = iface;
73 }
74 else if(node_query_interface(&This->node, riid, ppvObject))
75 {
76 return *ppvObject ? S_OK : E_NOINTERFACE;
77 }
78 else
79 {
80 TRACE("Unsupported interface %s\n", debugstr_guid(riid));
81 *ppvObject = NULL;
82 return E_NOINTERFACE;
83 }
84
85 IXMLDOMText_AddRef(iface);
86 return S_OK;
87}
const GUID IID_IUnknown
#define debugstr_guid
Definition: kernel32.h:35
BOOL node_query_interface(xmlnode *, REFIID, void **)
Definition: node.c:66
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ domtext_Release()

static ULONG WINAPI domtext_Release ( IXMLDOMText iface)
static

Definition at line 98 of file text.c.

100{
103
104 TRACE("%p, refcount %lu.\n", iface, ref);
105 if ( ref == 0 )
106 {
107 destroy_xmlnode(&This->node);
108 free(This);
109 }
110
111 return ref;
112}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5
void destroy_xmlnode(xmlnode *)
Definition: node.c:1638

◆ domtext_removeChild()

static HRESULT WINAPI domtext_removeChild ( IXMLDOMText iface,
IXMLDOMNode child,
IXMLDOMNode **  oldChild 
)
static

Definition at line 303 of file text.c.

306{
308 TRACE("(%p)->(%p %p)\n", This, child, oldChild);
309 return node_remove_child(&This->node, child, oldChild);
310}
HRESULT node_remove_child(xmlnode *, IXMLDOMNode *, IXMLDOMNode **)
Definition: node.c:608

◆ domtext_replaceChild()

static HRESULT WINAPI domtext_replaceChild ( IXMLDOMText iface,
IXMLDOMNode newNode,
IXMLDOMNode oldNode,
IXMLDOMNode **  outOldNode 
)
static

Definition at line 290 of file text.c.

295{
297
298 FIXME("(%p)->(%p %p %p) needs test\n", This, newNode, oldNode, outOldNode);
299
300 return node_replace_child(&This->node, newNode, oldNode, outOldNode);
301}
HRESULT node_replace_child(xmlnode *, IXMLDOMNode *, IXMLDOMNode *, IXMLDOMNode **)
Definition: node.c:543

◆ domtext_replaceData()

static HRESULT WINAPI domtext_replaceData ( IXMLDOMText iface,
LONG  offset,
LONG  count,
BSTR  p 
)
static

Definition at line 834 of file text.c.

837{
838 HRESULT hr;
839
840 TRACE("%p, %ld, %ld, %s.\n", iface, offset, count, debugstr_w(p));
841
842 hr = IXMLDOMText_deleteData(iface, offset, count);
843
844 if (hr == S_OK)
845 hr = IXMLDOMText_insertData(iface, offset, p);
846
847 return hr;
848}

◆ domtext_reset_noenc()

static void domtext_reset_noenc ( domtext This)
static

Definition at line 53 of file text.c.

54{
55 This->node.node->name = NULL;
56}

Referenced by domtext_put_data(), domtext_put_nodeValue(), and domtext_put_text().

◆ domtext_selectNodes()

static HRESULT WINAPI domtext_selectNodes ( IXMLDOMText iface,
BSTR  p,
IXMLDOMNodeList **  outList 
)
static

Definition at line 531 of file text.c.

534{
536 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outList);
537 return node_select_nodes(&This->node, p, outList);
538}
HRESULT node_select_nodes(const xmlnode *, BSTR, IXMLDOMNodeList **)
Definition: node.c:1558

◆ domtext_selectSingleNode()

static HRESULT WINAPI domtext_selectSingleNode ( IXMLDOMText iface,
BSTR  p,
IXMLDOMNode **  outNode 
)
static

Definition at line 540 of file text.c.

543{
545 TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
546 return node_select_singlenode(&This->node, p, outNode);
547}
HRESULT node_select_singlenode(const xmlnode *, BSTR, IXMLDOMNode **)
Definition: node.c:1572

◆ domtext_splitText()

static HRESULT WINAPI domtext_splitText ( IXMLDOMText iface,
LONG  offset,
IXMLDOMText **  txtNode 
)
static

Definition at line 850 of file text.c.

853{
854 LONG length = 0;
855
856 TRACE("%p, %ld, %p.\n", iface, offset, txtNode);
857
858 if (!txtNode || offset < 0) return E_INVALIDARG;
859
860 *txtNode = NULL;
861
862 IXMLDOMText_get_length(iface, &length);
863
864 if (offset > length) return E_INVALIDARG;
865 if (offset == length) return S_FALSE;
866
867 FIXME("adjacent text nodes are not supported\n");
868
869 return E_NOTIMPL;
870}
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

◆ domtext_substringData()

static HRESULT WINAPI domtext_substringData ( IXMLDOMText iface,
LONG  offset,
LONG  count,
BSTR p 
)
static

Definition at line 667 of file text.c.

670{
671 HRESULT hr;
672 BSTR data;
673
674 TRACE("%p, %ld, %ld, %p.\n", iface, offset, count, p);
675
676 if(!p)
677 return E_INVALIDARG;
678
679 *p = NULL;
680 if(offset < 0 || count < 0)
681 return E_INVALIDARG;
682
683 if(count == 0)
684 return S_FALSE;
685
686 hr = IXMLDOMText_get_data(iface, &data);
687 if(hr == S_OK)
688 {
690
691 if(offset < len)
692 {
693 if(offset + count > len)
695 else
697 }
698 else
699 hr = S_FALSE;
700
702 }
703
704 return hr;
705}
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238

◆ domtext_transformNode()

static HRESULT WINAPI domtext_transformNode ( IXMLDOMText iface,
IXMLDOMNode node,
BSTR p 
)
static

Definition at line 522 of file text.c.

525{
527 TRACE("(%p)->(%p %p)\n", This, node, p);
528 return node_transform_node(&This->node, node, p);
529}
HRESULT node_transform_node(const xmlnode *, IXMLDOMNode *, BSTR *)
Definition: node.c:1553
Definition: dlist.c:348

◆ domtext_transformNodeToObject()

static HRESULT WINAPI domtext_transformNodeToObject ( IXMLDOMText iface,
IXMLDOMNode domNode,
VARIANT  var1 
)
static

Definition at line 586 of file text.c.

589{
591 FIXME("(%p)->(%p %s)\n", This, domNode, debugstr_variant(&var1));
592 return E_NOTIMPL;
593}

◆ impl_from_IXMLDOMText()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msxml  )

Variable Documentation

◆ domtext_dispex

dispex_static_data_t domtext_dispex
static
Initial value:
= {
}
static const tid_t domtext_iface_tids[]
Definition: text.c:928
@ IXMLDOMText_tid
Definition: msxml_dispex.h:58

Definition at line 933 of file text.c.

Referenced by create_text().

◆ domtext_iface_tids

const tid_t domtext_iface_tids[]
static
Initial value:
= {
0
}

Definition at line 928 of file text.c.

◆ domtext_vtbl

const struct IXMLDOMTextVtbl domtext_vtbl
static

Definition at line 872 of file text.c.

Referenced by create_text().