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

QDomAttr QDomElement::setAttributeNode ( const QDomAttr & newAttr ) does NOT replaces attribute with the same name as newAttr.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.7.0
    • XML: DOM
    • None
    • OS: Windows 7 Pro x64
      Destination : Desktop

    Description

      Manual says
      "QDomAttr QDomElement::setAttributeNode ( const QDomAttr & newAttr )
      Adds the attribute newAttr to this element.
      If the element has another attribute that has the same name as newAttr, this function replaces that attribute and returns it; otherwise the function returns a null attribute.",

      but it seems it adds newAttr regardless of earlier presence of an attribute with the same name - after using it referenced QDomElement has two attributes with the same name and different values.

      Attachments

        1. main.cpp
          0.6 kB
          Maciej Węglarczyk
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            fenix_voltres Maciej Węglarczyk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes