OSDN Git Service

do not overwrite variable in QXmlInputSource::next()
authorIvailo Monev <xakepa10@gmail.com>
Wed, 8 Sep 2021 17:23:40 +0000 (20:23 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 8 Sep 2021 17:23:40 +0000 (20:23 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/xml/sax/qxml.cpp

index 74d8d0c..8df6c6f 100644 (file)
@@ -1090,20 +1090,21 @@ QChar QXmlInputSource::next()
             d->nextReturnedEndOfData = false;
             fetchData();
             if (d->pos >= d->length) {
             d->nextReturnedEndOfData = false;
             fetchData();
             if (d->pos >= d->length) {
-                return EndOfDocument;
+                return QXmlInputSource::EndOfDocument;
             }
             return next();
         }
         d->nextReturnedEndOfData = true;
             }
             return next();
         }
         d->nextReturnedEndOfData = true;
-        return EndOfData;
+        return QXmlInputSource::EndOfData;
     }
 
     // QXmlInputSource has no way to signal encoding errors. The best we can do
     // is return EndOfDocument. We do *not* return EndOfData, because the reader
     // will then just call this function again to get the next char.
     QChar c = d->unicode[d->pos++];
     }
 
     // QXmlInputSource has no way to signal encoding errors. The best we can do
     // is return EndOfDocument. We do *not* return EndOfData, because the reader
     // will then just call this function again to get the next char.
     QChar c = d->unicode[d->pos++];
-    if (c.unicode() == EndOfData)
-        c = EndOfDocument;
+    if (c.unicode() == QXmlInputSource::EndOfData) {
+        return QXmlInputSource::EndOfDocument;
+    }
     return c;
 }
 
     return c;
 }