Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/xmlpatterns/schema/qxsdschemaparser.cpp

    r651 r769  
    265265}
    266266
     267void XsdSchemaParser::addIncludedSchemas(const NamespaceSet &schemas)
     268{
     269    m_includedSchemas += schemas;
     270}
     271
    267272void XsdSchemaParser::setIncludedSchemas(const NamespaceSet &schemas)
    268273{
     
    270275}
    271276
     277void XsdSchemaParser::addImportedSchemas(const NamespaceSet &schemas)
     278{
     279    m_importedSchemas += schemas;
     280}
     281
    272282void XsdSchemaParser::setImportedSchemas(const NamespaceSet &schemas)
    273283{
    274284    m_importedSchemas = schemas;
     285}
     286
     287void XsdSchemaParser::addRedefinedSchemas(const NamespaceSet &schemas)
     288{
     289    m_redefinedSchemas += schemas;
    275290}
    276291
     
    298313    m_includedSchemas.insert(uri);
    299314    m_importedSchemas.insert(uri);
     315    m_redefinedSchemas.insert(uri);
    300316}
    301317
     
    595611            parser.setImportedSchemas(m_importedSchemas);
    596612            parser.setRedefinedSchemas(m_redefinedSchemas);
    597             if (!parser.parse(XsdSchemaParser::IncludeParser))
     613            if (!parser.parse(XsdSchemaParser::IncludeParser)) {
    598614                return;
     615            } else {
     616                // add indirectly loaded schemas to the list of already loaded ones
     617                addIncludedSchemas(parser.m_includedSchemas);
     618                addImportedSchemas(parser.m_importedSchemas);
     619                addRedefinedSchemas(parser.m_redefinedSchemas);
     620            }
    599621        }
    600622    }
     
    685707                parser.setImportedSchemas(m_importedSchemas);
    686708                parser.setRedefinedSchemas(m_redefinedSchemas);
    687                 if (!parser.parse(XsdSchemaParser::ImportParser))
     709                if (!parser.parse(XsdSchemaParser::ImportParser)) {
    688710                    return;
     711                } else {
     712                    // add indirectly loaded schemas to the list of already loaded ones
     713                    addIncludedSchemas(parser.m_includedSchemas);
     714                    addImportedSchemas(parser.m_importedSchemas);
     715                    addRedefinedSchemas(parser.m_redefinedSchemas);
     716                }
    689717            }
    690718        }
     
    703731                    parser.setImportedSchemas(m_importedSchemas);
    704732                    parser.setRedefinedSchemas(m_redefinedSchemas);
    705                     if (!parser.parse(XsdSchemaParser::ImportParser))
     733                    if (!parser.parse(XsdSchemaParser::ImportParser)) {
    706734                        return;
     735                    } else {
     736                        // add indirectly loaded schemas to the list of already loaded ones
     737                        addIncludedSchemas(parser.m_includedSchemas);
     738                        addImportedSchemas(parser.m_importedSchemas);
     739                        addRedefinedSchemas(parser.m_redefinedSchemas);
     740                    }
    707741                }
    708742            }
     
    840874            parser.setImportedSchemas(m_importedSchemas);
    841875            parser.setRedefinedSchemas(m_redefinedSchemas);
    842             if (!parser.parse(XsdSchemaParser::RedefineParser))
     876            if (!parser.parse(XsdSchemaParser::RedefineParser)) {
    843877                return;
     878            } else {
     879                // add indirectly loaded schemas to the list of already loaded ones
     880                addIncludedSchemas(parser.m_includedSchemas);
     881                addImportedSchemas(parser.m_importedSchemas);
     882                addRedefinedSchemas(parser.m_redefinedSchemas);
     883            }
    844884
    845885            delete reply;
     
    48334873            if (isSchemaTag(XsdSchemaToken::Annotation, token, namespaceToken)) {
    48344874                const XsdAnnotation::Ptr annotation = parseAnnotation();
    4835                 element->addAnnotation(annotation);
     4875                term->addAnnotation(annotation);
    48364876            } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) {
    48374877                if (hasRefAttribute) {
  • trunk/src/xmlpatterns/schema/qxsdschemaparser_p.h

    r561 r769  
    121121
    122122            /**
     123             * Adds @p schemas to the list of already included schemas, so the parser
     124             * can detect multiple includes of the same schema.
     125             */
     126            void addIncludedSchemas(const NamespaceSet &schemas);
     127
     128            /**
    123129             * Sets which @p schemas have been included already, so the parser
    124              * can detect circular includes.
     130             * can detect multiple includes of the same schema.
    125131             */
    126132            void setIncludedSchemas(const NamespaceSet &schemas);
     133
     134            /**
     135             * Adds @p schemas to the list of already imported schemas, so the parser
     136             * can detect multiple imports of the same schema.
     137             */
     138            void addImportedSchemas(const NamespaceSet &schemas);
    127139
    128140            /**
     
    133145
    134146            /**
     147             * Adds @p schemas to the list of already redefined schemas, so the parser
     148             * can detect multiple redefines of the same schema.
     149             */
     150            void addRedefinedSchemas(const NamespaceSet &schemas);
     151
     152            /**
    135153             * Sets which @p schemas have been redefined already, so the parser
    136              * can detect circular redefines.
     154             * can detect multiple redefines of the same schema.
    137155             */
    138156            void setRedefinedSchemas(const NamespaceSet &schemas);
  • trunk/src/xmlpatterns/schema/qxsdschemaresolver.cpp

    r561 r769  
    633633                    // 1.2
    634634                    const XsdSimpleType::Ptr anonType(new XsdSimpleType());
    635                     anonType->setCategory(complexBaseType->contentType()->simpleType()->category());
     635                    XsdSimpleType::TypeCategory baseCategory = complexBaseType->contentType()->simpleType()->category();
     636                    anonType->setCategory(baseCategory);
     637
     638                    if (baseCategory == XsdSimpleType::SimpleTypeList) {
     639                        const XsdSimpleType::Ptr baseSimpleType = complexBaseType->contentType()->simpleType();
     640                        anonType->setItemType(baseSimpleType->itemType());
     641                    }
     642
    636643                    anonType->setDerivationMethod(XsdSimpleType::DerivationRestriction);
    637644                    anonType->setWxsSuperType(complexBaseType->contentType()->simpleType());
Note: See TracChangeset for help on using the changeset viewer.