summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/dom/qdom.cpp8
-rw-r--r--src/xml/sax/qxml.cpp6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 95fde4e4f6..766ca51ec3 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -5684,24 +5684,24 @@ static QByteArray encodeEntity(const QByteArray& str)
QByteArray tmp(str);
int len = tmp.size();
int i = 0;
- const char* d = tmp.data();
+ const char* d = tmp.constData();
while (i < len) {
if (d[i] == '%'){
tmp.replace(i, 1, "&#60;");
- d = tmp;
+ d = tmp.constData();
len += 4;
i += 5;
}
else if (d[i] == '"') {
tmp.replace(i, 1, "&#34;");
- d = tmp;
+ d = tmp.constData();
len += 4;
i += 5;
} else if (d[i] == '&' && i + 1 < len && d[i+1] == '#') {
// Dont encode &lt; or &quot; or &custom;.
// Only encode character references
tmp.replace(i, 1, "&#38;");
- d = tmp;
+ d = tmp.constData();
len += 4;
i += 5;
} else {
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index 2488d27807..c2205edb40 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -1612,7 +1612,7 @@ QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning)
d->encMapper = codec->makeDecoder();
}
- QString input = d->encMapper->toUnicode(data, data.size());
+ QString input = d->encMapper->toUnicode(data.constData(), data.size());
if (d->lookingForEncodingDecl) {
d->encodingDeclChars += input;
@@ -1633,9 +1633,9 @@ QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning)
input.clear();
// prime the decoder with the data so far
- d->encMapper->toUnicode(d->encodingDeclBytes, d->encodingDeclBytes.size());
+ d->encMapper->toUnicode(d->encodingDeclBytes.constData(), d->encodingDeclBytes.size());
// now feed it the new data
- input = d->encMapper->toUnicode(data, data.size());
+ input = d->encMapper->toUnicode(data.constData(), data.size());
}
}
}