summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp6
-rw-r--r--doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp5
-rw-r--r--src/xmlpatterns/functions/qstringvaluefns.cpp4
-rw-r--r--tests/auto/xmlpatternssdk/TestBaseLine.cpp13
-rw-r--r--tests/auto/xmlpatternssdk/XMLWriter.cpp3
5 files changed, 18 insertions, 13 deletions
diff --git a/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp b/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp
index 9cd0ad1..fce0e30 100644
--- a/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp
+++ b/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp
@@ -133,8 +133,10 @@
}
}
else if (item.isNode()) {
+#ifdef qdoc
QXmlNodeModelIndex i = item.toNodeModelIndex();
// process node
+#endif // qdoc
}
item = result.next();
}
@@ -163,8 +165,10 @@
break;
default:
if (v.userType() == qMetaTypeId<QXmlName>()) {
+#ifdef qdoc
QXmlName n = qvariant_cast<QXmlName>(v);
// process QXmlName n...
+#endif // qdoc
}
else {
// error
@@ -173,8 +177,10 @@
}
}
else if (item.isNode()) {
+#ifdef qdoc
QXmlNodeModelIndex i = item.toNodeModelIndex();
// process node
+#endif // qdoc
}
item = result.next();
}
diff --git a/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp b/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp
index 64b6398..baca131 100644
--- a/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp
+++ b/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp
@@ -50,7 +50,8 @@ if (query.isValid()) {
// use item
item = result.next();
}
- if (result.hasError())
- /* Runtime error! */;
+ if (result.hasError()) {
+ /* Runtime error! */
+ }
}
//! [0]
diff --git a/src/xmlpatterns/functions/qstringvaluefns.cpp b/src/xmlpatterns/functions/qstringvaluefns.cpp
index 0656721..2343737 100644
--- a/src/xmlpatterns/functions/qstringvaluefns.cpp
+++ b/src/xmlpatterns/functions/qstringvaluefns.cpp
@@ -345,8 +345,8 @@ Item EncodeString::evaluateSingleton(const DynamicContext::Ptr &context) const
if(!item)
return CommonValues::EmptyString;
- return AtomicString::fromValue(item.stringValue().toUtf8().toPercentEncoding(m_excludeChars,
- m_includeChars).constData());
+ const QByteArray value = item.stringValue().toUtf8().toPercentEncoding(m_excludeChars, m_includeChars);
+ return AtomicString::fromValue(QLatin1String(value));
}
const char *const EncodeForURIFN::include = "#!*'()";
diff --git a/tests/auto/xmlpatternssdk/TestBaseLine.cpp b/tests/auto/xmlpatternssdk/TestBaseLine.cpp
index f8b62d3..5168565 100644
--- a/tests/auto/xmlpatternssdk/TestBaseLine.cpp
+++ b/tests/auto/xmlpatternssdk/TestBaseLine.cpp
@@ -179,12 +179,11 @@ void TestBaseLine::toXML(XMLWriter &receiver) const
bool TestBaseLine::isChildrenDeepEqual(const QDomNodeList &cl1, const QDomNodeList &cl2)
{
- const unsigned int len = cl1.length();
+ const int len = cl1.length();
if(len == cl2.length())
{
- for(unsigned int i = 0; i < len; ++i)
- {
+ for (int i = 0; i < len; ++i) {
if(!isDeepEqual(cl1.at(i), cl2.at(i)))
return false;
}
@@ -197,21 +196,19 @@ bool TestBaseLine::isChildrenDeepEqual(const QDomNodeList &cl1, const QDomNodeLi
bool TestBaseLine::isAttributesEqual(const QDomNamedNodeMap &cl1, const QDomNamedNodeMap &cl2)
{
- const unsigned int len = cl1.length();
+ const int len = cl1.length();
pDebug() << "LEN:" << len;
if(len == cl2.length())
{
- for(unsigned int i1 = 0; i1 < len; ++i1)
- {
+ for (int i1 = 0; i1 < len; ++i1) {
const QDomNode attr1(cl1.item(i1));
Q_ASSERT(!attr1.isNull());
/* This is set if attr1 cannot be found at all in cl2. */
bool earlyExit = false;
- for(unsigned int i2 = 0; i2 < len; ++i2)
- {
+ for (int i2 = 0; i2 < len; ++i2) {
const QDomNode attr2(cl2.item(i2));
Q_ASSERT(!attr2.isNull());
pDebug() << "ATTR1:" << attr1.localName() << attr1.namespaceURI() << attr1.prefix() << attr1.nodeName();
diff --git a/tests/auto/xmlpatternssdk/XMLWriter.cpp b/tests/auto/xmlpatternssdk/XMLWriter.cpp
index 40f4a4e..a81a986 100644
--- a/tests/auto/xmlpatternssdk/XMLWriter.cpp
+++ b/tests/auto/xmlpatternssdk/XMLWriter.cpp
@@ -571,8 +571,9 @@ bool XMLWriter::startDTD(const QString &name,
if(!systemId.isEmpty())
{
- if(publicId.isEmpty())
+ if (publicId.isEmpty()) {
serialize(" SYSTEM");
+ }
serialize(" \"");
serialize(systemId);