summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/dom/qdom.cpp10
-rw-r--r--src/xml/sax/qxml.cpp14
2 files changed, 14 insertions, 10 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 91796106a2..5893d8448e 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -49,7 +49,9 @@
#include <qiodevice.h>
#include <qlist.h>
#include <qregexp.h>
+#if QT_CONFIG(textcodec)
#include <qtextcodec.h>
+#endif
#include <qtextstream.h>
#include <qxml.h>
#include "private/qxml_p.h"
@@ -4149,7 +4151,7 @@ static QString encodeText(const QString &str,
const bool performAVN = false,
const bool encodeEOLs = false)
{
-#ifdef QT_NO_TEXTCODEC
+#if !QT_CONFIG(textcodec)
Q_UNUSED(s);
#else
const QTextCodec *const codec = s.codec();
@@ -4191,7 +4193,7 @@ static QString encodeText(const QString &str,
len += 4;
i += 5;
} else {
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
if(codec->canEncode(ati))
++i;
else
@@ -6428,7 +6430,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod
const QDomNodePrivate* n = first;
if(encUsed == QDomNode::EncodingFromDocument) {
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
const QDomNodePrivate* n = first;
QTextCodec *codec = 0;
@@ -6464,7 +6466,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod
else {
// Write out the XML declaration.
-#ifdef QT_NO_TEXTCODEC
+#if !QT_CONFIG(textcodec)
const QLatin1String codecName("iso-8859-1");
#else
const QTextCodec *const codec = s.codec();
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index 168e8c3cb4..7b6669b057 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -39,7 +39,9 @@
#include "qxml.h"
#include "qxml_p.h"
+#if QT_CONFIG(textcodec)
#include "qtextcodec.h"
+#endif
#include "qbuffer.h"
#include "qregexp.h"
#include "qmap.h"
@@ -237,7 +239,7 @@ public:
int pos;
int length;
bool nextReturnedEndOfData;
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
QTextDecoder *encMapper;
#endif
@@ -1075,7 +1077,7 @@ void QXmlInputSource::init()
d->inputStream = 0;
setData(QString());
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
d->encMapper = 0;
#endif
d->nextReturnedEndOfData = true; // first call to next() will call fetchData()
@@ -1121,7 +1123,7 @@ QXmlInputSource::QXmlInputSource(QIODevice *dev)
QXmlInputSource::~QXmlInputSource()
{
// ### close the input device.
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
delete d->encMapper;
#endif
delete d;
@@ -1284,7 +1286,7 @@ void QXmlInputSource::fetchData()
}
}
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
static QString extractEncodingDecl(const QString &text, bool *needMoreText)
{
*needMoreText = false;
@@ -1326,7 +1328,7 @@ static QString extractEncodingDecl(const QString &text, bool *needMoreText)
return encoding;
}
-#endif // QT_NO_TEXTCODEC
+#endif // textcodec
/*!
This function reads the XML file from \a data and tries to
@@ -1341,7 +1343,7 @@ static QString extractEncodingDecl(const QString &text, bool *needMoreText)
*/
QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning)
{
-#ifdef QT_NO_TEXTCODEC
+#if !QT_CONFIG(textcodec)
Q_UNUSED(beginning);
return QString::fromLatin1(data.constData(), data.size());
#else