summaryrefslogtreecommitdiffstats
path: root/src/xml/sax/qxml.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2014-06-22 13:57:26 +0200
committerDavid Faure <david.faure@kdab.com>2014-07-03 10:59:07 +0200
commitaabe80ae2895a4d7f115486c1e5f0033f33b6959 (patch)
tree446241d8c3d808264c1858f50dadb4c367ee1fd1 /src/xml/sax/qxml.cpp
parente26fa6d2066d76b295a71956f67cccc7941c3f32 (diff)
Make QDom/QXmlSimpleReader reentrant.
I moved the evil static bool to QXmlSimpleReaderPrivate, and used it from QDom, when the reader instance is a QXmlSimpleReader (if it's not, nothing happens, like before). Task-number: QTBUG-40015 Change-Id: I54ba89db334d7b086379c4a6840cf0de23f77027 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/xml/sax/qxml.cpp')
-rw-r--r--src/xml/sax/qxml.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index 7db8d5f503..50900c17f0 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -100,10 +100,6 @@ static const signed char cltDq = 12; // "
static const signed char cltSq = 13; // '
static const signed char cltUnknown = 14;
-// Hack for letting QDom know where the skipped entity occurred
-// ### the use of this variable means the code isn't reentrant.
-bool qt_xml_skipped_entity_in_content;
-
// character lookup table
static const signed char charLookupTable[256]={
cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x00 - 0x07
@@ -3230,7 +3226,7 @@ bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental)
return false;
}
}
- qt_xml_skipped_entity_in_content = false;
+ d->skipped_entity_in_content = false;
return d->parseBeginOrContinue(0, incremental);
}
@@ -7594,13 +7590,13 @@ bool QXmlSimpleReaderPrivate::processReference()
}
if (contentHnd) {
- qt_xml_skipped_entity_in_content = parseReference_context == InContent;
+ skipped_entity_in_content = parseReference_context == InContent;
if (!contentHnd->skippedEntity(reference)) {
- qt_xml_skipped_entity_in_content = false;
+ skipped_entity_in_content = false;
reportParseError(contentHnd->errorString());
return false; // error
}
- qt_xml_skipped_entity_in_content = false;
+ skipped_entity_in_content = false;
}
}
} else if ((*itExtern).notation.isNull()) {
@@ -7630,13 +7626,13 @@ bool QXmlSimpleReaderPrivate::processReference()
}
}
if (skipIt && contentHnd) {
- qt_xml_skipped_entity_in_content = true;
+ skipped_entity_in_content = true;
if (!contentHnd->skippedEntity(reference)) {
- qt_xml_skipped_entity_in_content = false;
+ skipped_entity_in_content = false;
reportParseError(contentHnd->errorString());
return false; // error
}
- qt_xml_skipped_entity_in_content = false;
+ skipped_entity_in_content = false;
}
parseReference_charDataRead = false;
} break;