summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xmlpatterns/api/qabstractxmlnodemodel.cpp14
-rw-r--r--src/xmlpatterns/api/qabstractxmlreceiver.cpp2
-rw-r--r--src/xmlpatterns/api/qxmlquery.cpp4
-rw-r--r--src/xmlpatterns/doc/src/xquery-introduction.qdoc2
-rw-r--r--src/xmlpatterns/expr/qorderby.cpp24
-rw-r--r--src/xmlpatterns/parser/qtokenlookup.cpp10
-rw-r--r--src/xmlpatterns/schema/qxsdschemahelper.cpp19
-rw-r--r--src/xmlpatterns/schema/qxsdschemaresolver.cpp2
8 files changed, 35 insertions, 42 deletions
diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp
index 1a24dcc..f419eb5 100644
--- a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp
+++ b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp
@@ -441,9 +441,6 @@ namespace QPatternist
class MergeIterator
{
public:
- inline MergeIterator()
- {
- }
inline
QXmlNodeModelIndexIteratorPointer
@@ -452,12 +449,9 @@ namespace QPatternist
{
return it;
}
-
- private:
- Q_DISABLE_COPY(MergeIterator)
};
- static const MergeIterator mergeIterator;
+ static const MergeIterator mergeIterator = {};
/**
* One might wonder, why not use makeVectorIterator() directly on a QVector
@@ -483,8 +477,9 @@ namespace QPatternist
virtual QAbstractXmlForwardIterator<QXmlNodeModelIndexIteratorPointer>::Ptr copy() const
{
ItVector result;
-
- for(int i = 0; i < m_list.count(); ++i)
+ const int count = m_list.count();
+ result.reserve(count);
+ for (int i = 0; i < count; ++i)
result.append(m_list.at(i)->copy());
return Ptr(new IteratorVector(result));
@@ -501,6 +496,7 @@ static inline QXmlNodeModelIndexIteratorPointer mergeIterators(const QXmlNodeMod
const QXmlNodeModelIndexIteratorPointer &it2)
{
QVector<QXmlNodeModelIndexIteratorPointer> iterators;
+ iterators.reserve(2);
iterators.append(makeSingletonIterator(node));
iterators.append(it2);
diff --git a/src/xmlpatterns/api/qabstractxmlreceiver.cpp b/src/xmlpatterns/api/qabstractxmlreceiver.cpp
index ed5ce2d..3f5b443 100644
--- a/src/xmlpatterns/api/qabstractxmlreceiver.cpp
+++ b/src/xmlpatterns/api/qabstractxmlreceiver.cpp
@@ -340,7 +340,7 @@ allow null QUrls.
This callback is called when a namespace binding is in scope of an
element. A namespace is defined by a URI. In the \l {QXmlName}
\a name, the value of \l {QXmlName::namespaceUri()} is that URI. The
- value of \l {QXmlName::prefix()} is the prefix that the URI is bound
+ value of \l {QXmlName::prefix}() is the prefix that the URI is bound
to. The local name is insignificant and can be an arbitrary value.
*/
diff --git a/src/xmlpatterns/api/qxmlquery.cpp b/src/xmlpatterns/api/qxmlquery.cpp
index dd8faae..718b9c8 100644
--- a/src/xmlpatterns/api/qxmlquery.cpp
+++ b/src/xmlpatterns/api/qxmlquery.cpp
@@ -1100,7 +1100,7 @@ void QXmlQuery::setInitialTemplateName(const QXmlName &name)
\overload
Sets the name of the initial template to \a localName, which must be
- a valid \l{QXmlName::localName()} {local name}. The initial template
+ a valid \l{QXmlName::localName}{local name}. The initial template
is the one the processor calls first, instead of attempting to match
a template to the context node (if any). If an initial template is
not set, the standard order of template invocation will be used.
@@ -1109,7 +1109,7 @@ void QXmlQuery::setInitialTemplateName(const QXmlName &name)
stylesheets. The name becomes part of the compiled stylesheet.
Therefore, this function must be called before calling setQuery().
- If \a localName is not a valid \l{QXmlName::localName()} {local
+ If \a localName is not a valid \l{QXmlName::localName} {local
name}, the effect is undefined. If the stylesheet has no template
named \a localName, the processor will use the standard order of
template invocation.
diff --git a/src/xmlpatterns/doc/src/xquery-introduction.qdoc b/src/xmlpatterns/doc/src/xquery-introduction.qdoc
index 6117424..49458ac 100644
--- a/src/xmlpatterns/doc/src/xquery-introduction.qdoc
+++ b/src/xmlpatterns/doc/src/xquery-introduction.qdoc
@@ -31,7 +31,7 @@
\pagekeywords XPath XQuery
\startpage XQuery
-\target XQuery-introduction
+\keyword XQuery-introduction
XQuery is a language for querying XML data or non-XML data that can be
modeled as XML. XQuery is specified by the \l{http://www.w3.org}{W3C}.
diff --git a/src/xmlpatterns/expr/qorderby.cpp b/src/xmlpatterns/expr/qorderby.cpp
index ba6bcb2..7dbf320 100644
--- a/src/xmlpatterns/expr/qorderby.cpp
+++ b/src/xmlpatterns/expr/qorderby.cpp
@@ -44,6 +44,7 @@
#include "qorderby_p.h"
#include <algorithm>
+#include <functional>
QT_BEGIN_NAMESPACE
@@ -72,11 +73,17 @@ void OrderBy::OrderSpec::prepare(const Expression::Ptr &source,
* @short Functor used by Qt's qSort() and qStableSort(). Used for FLWOR's
* <tt>order by</tt> expression.
*
- * This must be in the global namespace, since it is specializing qLess(), which
- * is in the global namespace. Hence it can't be in QPatternist.
+ * This must be in the std namespace, since it is specializing std::less(), which
+ * is in the std namespace. Hence it can't be in QPatternist.
*/
+
+QT_END_NAMESPACE
+
+QT_USE_NAMESPACE
+
+namespace std {
template<>
-class qLess<Item::List>
+struct less<Item::List>
{
private:
@@ -87,9 +94,9 @@ private:
}
public:
- inline qLess(const OrderBy::OrderSpec::Vector &orderspecs,
- const DynamicContext::Ptr &context) : m_orderSpecs(orderspecs)
- , m_context(context)
+ inline less(const OrderBy::OrderSpec::Vector &orderspecs,
+ const DynamicContext::Ptr &context) : m_orderSpecs(orderspecs)
+ , m_context(context)
{
Q_ASSERT(!m_orderSpecs.isEmpty());
Q_ASSERT(context);
@@ -158,6 +165,9 @@ private:
const OrderBy::OrderSpec::Vector & m_orderSpecs;
const DynamicContext::Ptr & m_context;
};
+} // namespace std
+
+QT_BEGIN_NAMESPACE
Item::Iterator::Ptr OrderBy::mapToSequence(const Item &i,
const DynamicContext::Ptr &) const
@@ -169,7 +179,7 @@ Item::Iterator::Ptr OrderBy::evaluateSequence(const DynamicContext::Ptr &context
{
Item::List tuples(m_operand->evaluateSequence(context)->toList());
- const qLess<Item::List> sorter(m_orderSpecs, context);
+ const std::less<Item::List> sorter(m_orderSpecs, context);
Q_ASSERT(m_stability == StableOrder || m_stability == UnstableOrder);
diff --git a/src/xmlpatterns/parser/qtokenlookup.cpp b/src/xmlpatterns/parser/qtokenlookup.cpp
index 42ccff3..f92ebe4 100644
--- a/src/xmlpatterns/parser/qtokenlookup.cpp
+++ b/src/xmlpatterns/parser/qtokenlookup.cpp
@@ -91,7 +91,7 @@ public:
};
inline unsigned int
-TokenLookup::hash (register const char *str, register unsigned int len)
+TokenLookup::hash (const char *str, unsigned int len)
{
static const unsigned char asso_values[] =
{
@@ -122,7 +122,7 @@ TokenLookup::hash (register const char *str, register unsigned int len)
230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
230, 230, 230, 230, 230, 230
};
- register int hval = len;
+ int hval = len;
switch (hval)
{
@@ -138,7 +138,7 @@ TokenLookup::hash (register const char *str, register unsigned int len)
}
const struct TokenMap *
-TokenLookup::value (register const char *str, register unsigned int len)
+TokenLookup::value (const char *str, unsigned int len)
{
enum
{
@@ -416,11 +416,11 @@ TokenLookup::value (register const char *str, register unsigned int len)
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = hash (str, len);
+ int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ const char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
diff --git a/src/xmlpatterns/schema/qxsdschemahelper.cpp b/src/xmlpatterns/schema/qxsdschemahelper.cpp
index b0fbf31..8a8314d 100644
--- a/src/xmlpatterns/schema/qxsdschemahelper.cpp
+++ b/src/xmlpatterns/schema/qxsdschemahelper.cpp
@@ -150,19 +150,6 @@ bool XsdSchemaHelper::wildcardAllowsExpandedName(const QXmlName &name, const Xsd
return true;
}
-// small helper function that should be available in Qt 4.6
-template<class T>
-static inline bool containsSet(const QSet<T> &super, const QSet<T> &sub)
-{
- QSetIterator<T> it(sub);
- while (it.hasNext()) {
- if (!super.contains(it.next()))
- return false;
- }
-
- return true;
-}
-
bool XsdSchemaHelper::isWildcardSubset(const XsdWildcard::Ptr &wildcard, const XsdWildcard::Ptr &otherWildcard)
{
// @see http://www.w3.org/TR/xmlschema11-1/#cos-ns-subset
@@ -178,19 +165,19 @@ bool XsdSchemaHelper::isWildcardSubset(const XsdWildcard::Ptr &wildcard, const X
// 2
if ((constraint->variety() == XsdWildcard::NamespaceConstraint::Enumeration) && (otherConstraint->variety() == XsdWildcard::NamespaceConstraint::Enumeration)) {
- if (containsSet<QString>(otherConstraint->namespaces(), constraint->namespaces()))
+ if (otherConstraint->namespaces().contains(constraint->namespaces()))
return true;
}
// 3
if ((constraint->variety() == XsdWildcard::NamespaceConstraint::Enumeration) && (otherConstraint->variety() == XsdWildcard::NamespaceConstraint::Not)) {
- if (constraint->namespaces().intersect(otherConstraint->namespaces()).isEmpty())
+ if (!constraint->namespaces().intersects(otherConstraint->namespaces()))
return true;
}
// 4
if ((constraint->variety() == XsdWildcard::NamespaceConstraint::Not) && (otherConstraint->variety() == XsdWildcard::NamespaceConstraint::Not)) {
- if (containsSet<QString>(constraint->namespaces(), otherConstraint->namespaces()))
+ if (constraint->namespaces().contains(otherConstraint->namespaces()))
return true;
}
diff --git a/src/xmlpatterns/schema/qxsdschemaresolver.cpp b/src/xmlpatterns/schema/qxsdschemaresolver.cpp
index 469a239..14109d6 100644
--- a/src/xmlpatterns/schema/qxsdschemaresolver.cpp
+++ b/src/xmlpatterns/schema/qxsdschemaresolver.cpp
@@ -1413,7 +1413,7 @@ bool isValidWildcardRestriction(const XsdWildcard::Ptr &wildcard, const XsdWildc
}
if (baseWildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Not &&
wildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Enumeration) {
- if (!baseWildcard->namespaceConstraint()->namespaces().intersect(wildcard->namespaceConstraint()->namespaces()).isEmpty())
+ if (baseWildcard->namespaceConstraint()->namespaces().intersects(wildcard->namespaceConstraint()->namespaces()))
return false;
}
if (baseWildcard->namespaceConstraint()->variety() == XsdWildcard::NamespaceConstraint::Enumeration &&