* Sync with Wine 1.7.27.
CORE-8540

svn path=/trunk/; revision=64488
This commit is contained in:
Amine Khaldi 2014-10-03 11:23:01 +00:00
parent 6b19e75efa
commit 10c6f73e97
10 changed files with 1317 additions and 1501 deletions

View file

@ -1825,12 +1825,18 @@ static HRESULT WINAPI domdoc_createEntityReference(
xmlChar* tagName_to_XPath(const BSTR tagName)
{
xmlChar *query, *tmp;
static const xmlChar everything[] = "/descendant::node()";
static const xmlChar mod_pre[] = "*[local-name()='";
static const xmlChar mod_post[] = "']";
static const xmlChar prefix[] = "descendant::";
const WCHAR *tokBegin, *tokEnd;
int len;
/* Special case - empty tagname - means select all nodes,
except document itself. */
if (!*tagName)
return xmlStrdup(everything);
query = xmlStrdup(prefix);
tokBegin = tagName;

View file

@ -1263,7 +1263,12 @@ static HRESULT WINAPI domelem_setAttribute(
xmlFree(local);
if (ns)
return xmlStrEqual(ns->href, xml_value) ? S_OK : E_INVALIDARG;
{
int cmp = xmlStrEqual(ns->href, xml_value);
heap_free(xml_value);
heap_free(xml_name);
return cmp ? S_OK : E_INVALIDARG;
}
}
if (!xmlSetNsProp(element, NULL, xml_name, xml_value))

View file

@ -205,22 +205,6 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
return ret;
}
static inline LPSTR heap_strdupWtoA(LPCWSTR str)
{
LPSTR ret = NULL;
if(str) {
DWORD len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
ret = heap_alloc(len+1);
if(!ret)
return NULL;
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len+1, NULL, NULL);
}
return ret;
}
/* XSLProcessor parameter list */
struct xslprocessor_par
{
@ -560,8 +544,6 @@ HRESULT create_moniker_from_url(LPCWSTR, IMoniker**) DECLSPEC_HIDDEN;
HRESULT bind_url(IMoniker*, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**) DECLSPEC_HIDDEN;
HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
/* Error Codes - not defined anywhere in the public headers */
#define E_XML_ELEMENT_UNDECLARED 0xC00CE00D
#define E_XML_ELEMENT_ID_NOT_FOUND 0xC00CE00E

View file

@ -52,6 +52,8 @@ MAKE_FUNCPTR(xsltParseStylesheetDoc);
MAKE_FUNCPTR(xsltQuoteUserParams);
MAKE_FUNCPTR(xsltSaveResultTo);
# undef MAKE_FUNCPTR
#else
WINE_DECLARE_DEBUG_CHANNEL(winediag);
#endif
static const IID IID_xmlnode = {0x4f2f4ba2,0xb822,0x11df,{0x8b,0x8a,0x68,0x50,0xdf,0xd7,0x20,0x85}};
@ -1289,7 +1291,8 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet,
return hr;
#else
FIXME("libxslt headers were not found at compile time\n");
ERR_(winediag)("libxslt headers were not found at compile time. Expect problems.\n");
return E_NOTIMPL;
#endif
}

View file

@ -279,8 +279,8 @@ typedef struct
struct list elements;
BSTR namespaceUri;
int attributesSize;
int nb_attributes;
int attr_alloc_count;
int attr_count;
struct _attributes
{
BSTR szLocalname;
@ -1084,11 +1084,16 @@ static HRESULT WINAPI isaxattributes_getLength(
{
saxlocator *This = impl_from_ISAXAttributes( iface );
*length = This->nb_attributes;
*length = This->attr_count;
TRACE("Length set to %d\n", *length);
return S_OK;
}
static inline BOOL is_valid_attr_index(const saxlocator *locator, int index)
{
return index < locator->attr_count && index >= 0;
}
static HRESULT WINAPI isaxattributes_getURI(
ISAXAttributes* iface,
int index,
@ -1098,7 +1103,7 @@ static HRESULT WINAPI isaxattributes_getURI(
saxlocator *This = impl_from_ISAXAttributes( iface );
TRACE("(%p)->(%d)\n", This, index);
if(index >= This->nb_attributes || index < 0) return E_INVALIDARG;
if(!is_valid_attr_index(This, index)) return E_INVALIDARG;
if(!url || !size) return E_POINTER;
*size = SysStringLen(This->attributes[index].szURI);
@ -1111,36 +1116,36 @@ static HRESULT WINAPI isaxattributes_getURI(
static HRESULT WINAPI isaxattributes_getLocalName(
ISAXAttributes* iface,
int nIndex,
int index,
const WCHAR **pLocalName,
int *pLocalNameLength)
{
saxlocator *This = impl_from_ISAXAttributes( iface );
TRACE("(%p)->(%d)\n", This, nIndex);
TRACE("(%p)->(%d)\n", This, index);
if(nIndex>=This->nb_attributes || nIndex<0) return E_INVALIDARG;
if(!is_valid_attr_index(This, index)) return E_INVALIDARG;
if(!pLocalName || !pLocalNameLength) return E_POINTER;
*pLocalNameLength = SysStringLen(This->attributes[nIndex].szLocalname);
*pLocalName = This->attributes[nIndex].szLocalname;
*pLocalNameLength = SysStringLen(This->attributes[index].szLocalname);
*pLocalName = This->attributes[index].szLocalname;
return S_OK;
}
static HRESULT WINAPI isaxattributes_getQName(
ISAXAttributes* iface,
int nIndex,
int index,
const WCHAR **pQName,
int *pQNameLength)
{
saxlocator *This = impl_from_ISAXAttributes( iface );
TRACE("(%p)->(%d)\n", This, nIndex);
TRACE("(%p)->(%d)\n", This, index);
if(nIndex>=This->nb_attributes || nIndex<0) return E_INVALIDARG;
if(!is_valid_attr_index(This, index)) return E_INVALIDARG;
if(!pQName || !pQNameLength) return E_POINTER;
*pQNameLength = SysStringLen(This->attributes[nIndex].szQName);
*pQName = This->attributes[nIndex].szQName;
*pQNameLength = SysStringLen(This->attributes[index].szQName);
*pQName = This->attributes[index].szQName;
return S_OK;
}
@ -1158,7 +1163,7 @@ static HRESULT WINAPI isaxattributes_getName(
saxlocator *This = impl_from_ISAXAttributes( iface );
TRACE("(%p)->(%d)\n", This, index);
if(index>=This->nb_attributes || index<0) return E_INVALIDARG;
if(!is_valid_attr_index(This, index)) return E_INVALIDARG;
if(!uri || !pUriLength || !localName || !pLocalNameSize
|| !QName || !pQNameLength) return E_POINTER;
@ -1189,7 +1194,7 @@ static HRESULT WINAPI isaxattributes_getIndexFromName(
if(!pUri || !pLocalName || !index) return E_POINTER;
for(i=0; i<This->nb_attributes; i++)
for(i=0; i<This->attr_count; i++)
{
if(cUriLength!=SysStringLen(This->attributes[i].szURI)
|| cocalNameLength!=SysStringLen(This->attributes[i].szLocalname))
@ -1221,7 +1226,7 @@ static HRESULT WINAPI isaxattributes_getIndexFromQName(
if(!pQName || !index) return E_POINTER;
if(!nQNameLength) return E_INVALIDARG;
for(i=0; i<This->nb_attributes; i++)
for(i=0; i<This->attr_count; i++)
{
if(nQNameLength!=SysStringLen(This->attributes[i].szQName)) continue;
if(memcmp(pQName, This->attributes[i].szQName, sizeof(WCHAR)*nQNameLength)) continue;
@ -1283,7 +1288,7 @@ static HRESULT WINAPI isaxattributes_getValue(
saxlocator *This = impl_from_ISAXAttributes( iface );
TRACE("(%p)->(%d)\n", This, index);
if(index>=This->nb_attributes || index<0) return E_INVALIDARG;
if(!is_valid_attr_index(This, index)) return E_INVALIDARG;
if(!value || !nValue) return E_POINTER;
*nValue = SysStringLen(This->attributes[index].szValue);
@ -1401,7 +1406,7 @@ static void free_attribute_values(saxlocator *locator)
{
int i;
for (i = 0; i < locator->nb_attributes; i++)
for (i = 0; i < locator->attr_count; i++)
{
SysFreeString(locator->attributes[i].szLocalname);
locator->attributes[i].szLocalname = NULL;
@ -1428,19 +1433,19 @@ static HRESULT SAXAttributes_populate(saxlocator *locator,
if ((locator->saxreader->features & NamespacePrefixes) == 0)
nb_namespaces = 0;
locator->nb_attributes = nb_namespaces + nb_attributes;
if(locator->nb_attributes > locator->attributesSize)
locator->attr_count = nb_namespaces + nb_attributes;
if(locator->attr_count > locator->attr_alloc_count)
{
int new_size = locator->attributesSize * 2;
int new_size = locator->attr_count * 2;
attrs = heap_realloc_zero(locator->attributes, new_size * sizeof(struct _attributes));
if(!attrs)
{
free_attribute_values(locator);
locator->nb_attributes = 0;
locator->attr_count = 0;
return E_OUTOFMEMORY;
}
locator->attributes = attrs;
locator->attributesSize = new_size;
locator->attr_alloc_count = new_size;
}
else
{
@ -1684,7 +1689,7 @@ static void libxmlEndElementNS(
if (!saxreader_has_handler(This, SAXContentHandler))
{
free_attribute_values(This);
This->nb_attributes = 0;
This->attr_count = 0;
free_element_entry(element);
return;
}
@ -1706,7 +1711,7 @@ static void libxmlEndElementNS(
element->qname, SysStringLen(element->qname));
free_attribute_values(This);
This->nb_attributes = 0;
This->attr_count = 0;
if (sax_callback_failed(This, hr))
{
@ -2304,7 +2309,7 @@ static ULONG WINAPI isaxlocator_Release(
SysFreeString(This->systemId);
SysFreeString(This->namespaceUri);
for(index=0; index<This->attributesSize; index++)
for(index = 0; index < This->attr_alloc_count; index++)
{
SysFreeString(This->attributes[index].szLocalname);
SysFreeString(This->attributes[index].szValue);
@ -2440,9 +2445,9 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator, B
return E_OUTOFMEMORY;
}
locator->attributesSize = 8;
locator->nb_attributes = 0;
locator->attributes = heap_alloc_zero(sizeof(struct _attributes)*locator->attributesSize);
locator->attr_alloc_count = 8;
locator->attr_count = 0;
locator->attributes = heap_alloc_zero(sizeof(struct _attributes)*locator->attr_alloc_count);
if(!locator->attributes)
{
ISAXXMLReader_Release(&reader->ISAXXMLReader_iface);

View file

@ -1038,8 +1038,6 @@ HRESULT cache_from_doc_ns(IXMLDOMSchemaCollection2 *iface, xmlnode *node)
{
int pos = 0, len = xmlXPathNodeSetGetLength(nodeset->nodesetval);
if (len == 0) return S_OK;
while (pos < len)
{
xmlNodePtr node = xmlXPathNodeSetItem(nodeset->nodesetval, pos);
@ -1173,11 +1171,14 @@ static HRESULT WINAPI schema_cache_Invoke(IXMLDOMSchemaCollection2* iface,
static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri, VARIANT var)
{
schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface);
xmlChar* name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
xmlChar* name;
TRACE("(%p)->(%s %s)\n", This, debugstr_w(uri), debugstr_variant(&var));
if (This->read_only) return E_FAIL;
name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
switch (V_VT(&var))
{
case VT_NULL:
@ -1297,11 +1298,13 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri
static HRESULT WINAPI schema_cache_remove(IXMLDOMSchemaCollection2* iface, BSTR uri)
{
schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface);
xmlChar* name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
xmlChar* name;
TRACE("(%p)->(%s)\n", This, debugstr_w(uri));
if (This->version == MSXML6) return E_NOTIMPL;
name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
cache_remove_entry(This, name);
heap_free(name);
return S_OK;

File diff suppressed because it is too large Load diff

View file

@ -1,21 +1,19 @@
/* A Bison parser, made by GNU Bison 3.0.2. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
@ -28,55 +26,63 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
TOK_Parent = 258,
TOK_Self = 259,
TOK_DblFSlash = 260,
TOK_FSlash = 261,
TOK_Axis = 262,
TOK_Colon = 263,
TOK_OpAnd = 264,
TOK_OpOr = 265,
TOK_OpNot = 266,
TOK_OpEq = 267,
TOK_OpIEq = 268,
TOK_OpNEq = 269,
TOK_OpINEq = 270,
TOK_OpLt = 271,
TOK_OpILt = 272,
TOK_OpGt = 273,
TOK_OpIGt = 274,
TOK_OpLEq = 275,
TOK_OpILEq = 276,
TOK_OpGEq = 277,
TOK_OpIGEq = 278,
TOK_OpAll = 279,
TOK_OpAny = 280,
TOK_NCName = 281,
TOK_Literal = 282,
TOK_Number = 283
};
#ifndef YY_XSLPATTERN_XSLPATTERN_TAB_H_INCLUDED
# define YY_XSLPATTERN_XSLPATTERN_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int xslpattern_debug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
TOK_Parent = 258,
TOK_Self = 259,
TOK_DblFSlash = 260,
TOK_FSlash = 261,
TOK_Axis = 262,
TOK_Colon = 263,
TOK_OpAnd = 264,
TOK_OpOr = 265,
TOK_OpNot = 266,
TOK_OpEq = 267,
TOK_OpIEq = 268,
TOK_OpNEq = 269,
TOK_OpINEq = 270,
TOK_OpLt = 271,
TOK_OpILt = 272,
TOK_OpGt = 273,
TOK_OpIGt = 274,
TOK_OpLEq = 275,
TOK_OpILEq = 276,
TOK_OpGEq = 277,
TOK_OpIGEq = 278,
TOK_OpAll = 279,
TOK_OpAny = 280,
TOK_NCName = 281,
TOK_Literal = 282,
TOK_Number = 283
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
int xslpattern_parse (parser_param* p, void* scanner);
#endif /* !YY_XSLPATTERN_XSLPATTERN_TAB_H_INCLUDED */

View file

@ -186,6 +186,11 @@ static void xslpattern_error(parser_param* param, void const* scanner, char cons
$$=xmlStrcat($$,$2);
xmlFree($2);
}
| '@' '*'
{
TRACE("Got All attributes pattern: \"@*\"\n");
$$=xmlStrdup(U("@*"));
}
;
/* [2.3] Node Tests */

View file

@ -140,7 +140,7 @@ reactos/dll/win32/msvfw32 # Synced to Wine-1.7.27
reactos/dll/win32/msvidc32 # Synced to Wine-1.7.17
reactos/dll/win32/msxml # Synced to Wine-1.7.17
reactos/dll/win32/msxml2 # Synced to Wine-1.7.17
reactos/dll/win32/msxml3 # Synced to Wine-1.7.17
reactos/dll/win32/msxml3 # Synced to Wine-1.7.27
reactos/dll/win32/msxml4 # Synced to Wine-1.7.17
reactos/dll/win32/msxml6 # Synced to Wine-1.7.17
reactos/dll/win32/nddeapi # Synced to Wine-1.7.17