~ubuntu-wine/ubuntu/lucid/wine1.2/wine1.2+winepulse

« back to all changes in this revision

Viewing changes to dlls/msxml3/saxreader.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Ritchie
  • Date: 2010-02-02 11:15:03 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100202111503-w4ayji21ei1ginjr
Tags: 1.1.37-0ubuntu1
* New upstream release
  - A number of fixes in AVI file support.
  - Several MSXML improvements.
  - A few MSI fixes.
  - Various bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
    return (saxattributes *)((char*)iface - FIELD_OFFSET(saxattributes, lpSAXAttributesVtbl));
127
127
}
128
128
 
 
129
static inline BOOL has_content_handler(const saxlocator *locator)
 
130
{
 
131
    return  (locator->vbInterface && locator->saxreader->vbcontentHandler) ||
 
132
           (!locator->vbInterface && locator->saxreader->contentHandler);
 
133
}
129
134
 
130
135
static HRESULT namespacePush(saxlocator *locator, int ns)
131
136
{
978
983
    saxlocator *This = ctx;
979
984
    HRESULT hr;
980
985
 
981
 
    if((This->vbInterface && This->saxreader->vbcontentHandler)
982
 
            || (!This->vbInterface && This->saxreader->contentHandler))
 
986
    if(has_content_handler(This))
983
987
    {
984
988
        if(This->vbInterface)
985
989
            hr = IVBSAXContentHandler_startDocument(This->saxreader->vbcontentHandler);
1003
1007
 
1004
1008
    if(This->ret != S_OK) return;
1005
1009
 
1006
 
    if((This->vbInterface && This->saxreader->vbcontentHandler)
1007
 
            || (!This->vbInterface && This->saxreader->contentHandler))
 
1010
    if(has_content_handler(This))
1008
1011
    {
1009
1012
        if(This->vbInterface)
1010
1013
            hr = IVBSAXContentHandler_endDocument(This->saxreader->vbcontentHandler);
1039
1042
        update_position(This, (xmlChar*)This->pParserCtxt->input->cur+1);
1040
1043
 
1041
1044
    hr = namespacePush(This, nb_namespaces);
1042
 
    if(hr==S_OK && ((This->vbInterface && This->saxreader->vbcontentHandler)
1043
 
                || (!This->vbInterface && This->saxreader->contentHandler)))
 
1045
    if(hr==S_OK && has_content_handler(This))
1044
1046
    {
1045
1047
        for(index=0; index<nb_namespaces; index++)
1046
1048
        {
1119
1121
 
1120
1122
    nsNr = namespacePop(This);
1121
1123
 
1122
 
    if((This->vbInterface && This->saxreader->vbcontentHandler)
1123
 
            || (!This->vbInterface && This->saxreader->contentHandler))
 
1124
    if(has_content_handler(This))
1124
1125
    {
1125
1126
        NamespaceUri = bstr_from_xmlChar(URI);
1126
1127
        LocalName = bstr_from_xmlChar(localname);
1186
1187
    xmlChar *end;
1187
1188
    BOOL lastEvent = FALSE;
1188
1189
 
1189
 
    if((This->vbInterface && !This->saxreader->vbcontentHandler)
1190
 
            || (!This->vbInterface && !This->saxreader->contentHandler))
1191
 
        return;
 
1190
    if(!(has_content_handler(This))) return;
1192
1191
 
1193
1192
    cur = (xmlChar*)ch;
1194
1193
    if(*(ch-1)=='\r') cur--;
1384
1383
 
1385
1384
        if(change) *end = '\n';
1386
1385
 
1387
 
        if((This->vbInterface && This->saxreader->vbcontentHandler) ||
1388
 
                (!This->vbInterface && This->saxreader->contentHandler))
 
1386
        if(has_content_handler(This))
1389
1387
        {
1390
1388
            Chars = bstr_from_xmlCharN(cur, end-cur+1);
1391
1389
            if(This->vbInterface)
1787
1785
        return E_FAIL;
1788
1786
    }
1789
1787
 
 
1788
    xmlFree(locator->pParserCtxt->sax);
1790
1789
    locator->pParserCtxt->sax = &locator->saxreader->sax;
1791
1790
    locator->pParserCtxt->userData = locator;
1792
1791
 
1852
1851
    }
1853
1852
    This->isParsing = FALSE;
1854
1853
 
1855
 
    locator->pParserCtxt->sax = NULL;
1856
1854
    xmlFreeParserCtxt(locator->pParserCtxt);
1857
1855
    locator->pParserCtxt = NULL;
1858
1856
    ISAXLocator_Release((ISAXLocator*)&locator->lpSAXLocatorVtbl);
2045
2043
                hr = internal_parseBuffer(This, (const char*)bstrData,
2046
2044
                        SysStringByteLen(bstrData), vbInterface);
2047
2045
                IXMLDOMDocument_Release(xmlDoc);
 
2046
                SysFreeString(bstrData);
2048
2047
                break;
2049
2048
            }
2050
2049
            if(IUnknown_QueryInterface(V_UNKNOWN(&varInput),