Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-25104

Qt 5 to-do in QXmlSimpleReader

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 5.0.0 Beta 1
    • Component/s: XML: DOM
    • Labels:
      None
    • Technical Risk:
      Normal
    • Commits:
      0fc74370b2565f8570d0b8b9be21016f78707de8

      Description

      qtbase/src/xml/sax/qxml.cpp
      // Hack for letting QDom know where the skipped entity occurred
      // ### Qt5: the use of this variable means the code isn't reentrant.
      bool qt_xml_skipped_entity_in_content;
      ...
      QXmlInputSource::~QXmlInputSource()
      {
          // ### Qt 5: close the input device. See task 153111
      #ifndef QT_NO_TEXTCODEC
          delete d->encMapper;
      #endif
          delete d;
      }
      ...
      bool QXmlSimpleReader::feature(const QString& name, bool *ok) const
      {
          const QXmlSimpleReaderPrivate *d = d_func();
      
          // Qt5 ###: Change these strings to qt.nokia.com
          if (ok != 0)
              *ok = true;
          if (name == QLatin1String("http://xml.org/sax/features/namespaces")) {
              return d->useNamespaces;
          } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) {
              return d->useNamespacePrefixes;
          } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")) { // Shouldn't change in Qt 4
              return d->reportWhitespaceCharData;
          } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4
              return d->reportEntities;
          } else {
              qWarning("Unknown feature %s", name.toLatin1().data());
              if (ok != 0)
                  *ok = false;
          }
          return false;
      }
      ...
      void QXmlSimpleReader::setFeature(const QString& name, bool enable)
      {
          Q_D(QXmlSimpleReader);
          // Qt5 ###: Change these strings to qt.nokia.com
          if (name == QLatin1String("http://xml.org/sax/features/namespaces")) {
              d->useNamespaces = enable;
          } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) {
              d->useNamespacePrefixes = enable;
          } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")) { // Shouldn't change in Qt 4
              d->reportWhitespaceCharData = enable;
          } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4
              d->reportEntities = enable;
          } else {
              qWarning("Unknown feature %s", name.toLatin1().data());
          }
      }
      ...
      bool QXmlSimpleReader::hasFeature(const QString& name) const
      {
          // Qt5 ###: Change these strings to qt.nokia.com
          if (name == QLatin1String("http://xml.org/sax/features/namespaces")
              || name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
              || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // Shouldn't change in Qt 4
              || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4
              return true;
          } else {
              return false;
          }
      }
      
      qtbase/src/xml/sax/qxml.h
          // ### Qt 5: Conform to SAX by adding elementDecl
      

      Action for Qt 5.0.0 (if source-compatibility can be maintained), remove, or change to Qt 6 to-do's.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
              Reporter:
              jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes