summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qlist.h2
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp4
-rw-r--r--src/xmlpatterns/expr/qevaluationcache.cpp4
-rw-r--r--src/xmlpatterns/expr/qevaluationcache_p.h2
-rw-r--r--src/xmlpatterns/expr/qexpressionvariablereference.cpp2
-rw-r--r--src/xmlpatterns/expr/qexpressionvariablereference_p.h8
-rw-r--r--src/xmlpatterns/expr/qtemplateparameterreference.cpp2
-rw-r--r--src/xmlpatterns/expr/qtemplateparameterreference_p.h8
-rw-r--r--src/xmlpatterns/expr/quserfunctioncallsite.cpp2
-rw-r--r--src/xmlpatterns/parser/qquerytransformparser.cpp8
10 files changed, 22 insertions, 20 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index e6f041f..4eb05d6 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -641,6 +641,8 @@ Q_OUTOFLINE_TEMPLATE QList<T> QList<T>::mid(int pos, int alength) const
if (pos == 0 && alength == size())
return *this;
QList<T> cpy;
+ if (alength <= 0)
+ return cpy;
cpy.reserve(alength);
cpy.d->end = alength;
QT_TRY {
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index ab40379..3423d2c 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -124,14 +124,14 @@ void QMeeGoGraphicsSystemSwitchHandler::addWidget(QWidget *widget)
void QMeeGoGraphicsSystemSwitchHandler::handleMapNotify()
{
- if (m_widgets.isEmpty() && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch)
+ if (QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch && visibleWidgets() == 0)
QTimer::singleShot(0, this, SLOT(switchToMeeGo()));
}
void QMeeGoGraphicsSystemSwitchHandler::removeWidget(QObject *object)
{
m_widgets.removeOne(static_cast<QWidget *>(object));
- if (m_widgets.isEmpty() && QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch)
+ if (QMeeGoGraphicsSystem::switchPolicy == QMeeGoGraphicsSystem::AutomaticSwitch && visibleWidgets() == 0)
QTimer::singleShot(0, this, SLOT(switchToRaster()));
}
diff --git a/src/xmlpatterns/expr/qevaluationcache.cpp b/src/xmlpatterns/expr/qevaluationcache.cpp
index 6a276a1..67109eb 100644
--- a/src/xmlpatterns/expr/qevaluationcache.cpp
+++ b/src/xmlpatterns/expr/qevaluationcache.cpp
@@ -47,9 +47,9 @@
template<bool IsForGlobal>
EvaluationCache<IsForGlobal>::EvaluationCache(const Expression::Ptr &op,
- const VariableDeclaration::Ptr &varDecl,
+ const VariableDeclaration *varDecl,
const VariableSlotID aSlot) : SingleContainer(op)
- , m_declaration(varDecl.constData())
+ , m_declaration(varDecl)
, m_varSlot(aSlot)
{
Q_ASSERT(m_declaration);
diff --git a/src/xmlpatterns/expr/qevaluationcache_p.h b/src/xmlpatterns/expr/qevaluationcache_p.h
index a831a94..4111634 100644
--- a/src/xmlpatterns/expr/qevaluationcache_p.h
+++ b/src/xmlpatterns/expr/qevaluationcache_p.h
@@ -97,7 +97,7 @@ namespace QPatternist
{
public:
EvaluationCache(const Expression::Ptr &operand,
- const VariableDeclaration::Ptr &varDecl,
+ const VariableDeclaration *varDecl,
const VariableSlotID slot);
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
diff --git a/src/xmlpatterns/expr/qexpressionvariablereference.cpp b/src/xmlpatterns/expr/qexpressionvariablereference.cpp
index 6976334..73586dd 100644
--- a/src/xmlpatterns/expr/qexpressionvariablereference.cpp
+++ b/src/xmlpatterns/expr/qexpressionvariablereference.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
using namespace QPatternist;
ExpressionVariableReference::ExpressionVariableReference(const VariableSlotID slotP,
- const VariableDeclaration::Ptr &varDecl) : VariableReference(slotP)
+ const VariableDeclaration *varDecl) : VariableReference(slotP)
, m_varDecl(varDecl)
{
}
diff --git a/src/xmlpatterns/expr/qexpressionvariablereference_p.h b/src/xmlpatterns/expr/qexpressionvariablereference_p.h
index 9f80684..7711689 100644
--- a/src/xmlpatterns/expr/qexpressionvariablereference_p.h
+++ b/src/xmlpatterns/expr/qexpressionvariablereference_p.h
@@ -77,7 +77,7 @@ namespace QPatternist
{
public:
ExpressionVariableReference(const VariableSlotID slot,
- const VariableDeclaration::Ptr &varDecl);
+ const VariableDeclaration *varDecl);
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const;
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
@@ -90,9 +90,9 @@ namespace QPatternist
virtual ExpressionVisitorResult::Ptr accept(const ExpressionVisitor::Ptr &visitor) const;
inline const Expression::Ptr &sourceExpression() const;
- inline const VariableDeclaration::Ptr &variableDeclaration() const;
+ inline const VariableDeclaration *variableDeclaration() const;
private:
- const VariableDeclaration::Ptr m_varDecl;
+ const VariableDeclaration *m_varDecl;
};
inline const Expression::Ptr &ExpressionVariableReference::sourceExpression() const
@@ -100,7 +100,7 @@ namespace QPatternist
return m_varDecl->expression();
}
- inline const VariableDeclaration::Ptr &ExpressionVariableReference::variableDeclaration() const
+ inline const VariableDeclaration *ExpressionVariableReference::variableDeclaration() const
{
return m_varDecl;
}
diff --git a/src/xmlpatterns/expr/qtemplateparameterreference.cpp b/src/xmlpatterns/expr/qtemplateparameterreference.cpp
index 2067371..9ebbfc4 100644
--- a/src/xmlpatterns/expr/qtemplateparameterreference.cpp
+++ b/src/xmlpatterns/expr/qtemplateparameterreference.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
using namespace QPatternist;
-TemplateParameterReference::TemplateParameterReference(const VariableDeclaration::Ptr &varDecl) : m_varDecl(varDecl)
+TemplateParameterReference::TemplateParameterReference(const VariableDeclaration *varDecl) : m_varDecl(varDecl)
{
}
diff --git a/src/xmlpatterns/expr/qtemplateparameterreference_p.h b/src/xmlpatterns/expr/qtemplateparameterreference_p.h
index c7d3d62..9b3803e 100644
--- a/src/xmlpatterns/expr/qtemplateparameterreference_p.h
+++ b/src/xmlpatterns/expr/qtemplateparameterreference_p.h
@@ -70,7 +70,7 @@ namespace QPatternist
class TemplateParameterReference : public EmptyContainer
{
public:
- TemplateParameterReference(const VariableDeclaration::Ptr &varDecl);
+ TemplateParameterReference(const VariableDeclaration *varDecl);
virtual bool evaluateEBV(const DynamicContext::Ptr &context) const;
virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const;
@@ -81,10 +81,10 @@ namespace QPatternist
virtual Properties properties() const;
inline const Expression::Ptr &sourceExpression() const;
- inline const VariableDeclaration::Ptr &variableDeclaration() const;
+ inline const VariableDeclaration *variableDeclaration() const;
private:
- const VariableDeclaration::Ptr m_varDecl;
+ const VariableDeclaration *m_varDecl;
};
inline const Expression::Ptr &TemplateParameterReference::sourceExpression() const
@@ -92,7 +92,7 @@ namespace QPatternist
return m_varDecl->expression();
}
- inline const VariableDeclaration::Ptr &TemplateParameterReference::variableDeclaration() const
+ inline const VariableDeclaration *TemplateParameterReference::variableDeclaration() const
{
return m_varDecl;
}
diff --git a/src/xmlpatterns/expr/quserfunctioncallsite.cpp b/src/xmlpatterns/expr/quserfunctioncallsite.cpp
index e68d731..d49777e 100644
--- a/src/xmlpatterns/expr/quserfunctioncallsite.cpp
+++ b/src/xmlpatterns/expr/quserfunctioncallsite.cpp
@@ -227,7 +227,7 @@ void UserFunctionCallsite::setSource(const UserFunction::Ptr &userFunction,
/* Note that we pass in cacheSlotOffset + i here instead of varDecls.at(i)->slot since
* we want independent caches for each callsite. */
m_operands[i] = Expression::Ptr(new EvaluationCache<false>(m_operands.at(i),
- varDecls.at(i),
+ varDecls.at(i).data(),
cacheSlotOffset + i));
}
}
diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp
index f93ec30..c9801c8 100644
--- a/src/xmlpatterns/parser/qquerytransformparser.cpp
+++ b/src/xmlpatterns/parser/qquerytransformparser.cpp
@@ -988,9 +988,9 @@ static Expression::Ptr pushVariable(const QXmlName name,
* In some cases the EvaluationCache instance isn't necessary, but in those cases EvaluationCache
* optimizes itself away. */
if(type == VariableDeclaration::ExpressionVariable)
- checked = create(new EvaluationCache<false>(checked, var, parseInfo->allocateCacheSlot()), sourceLocator, parseInfo);
+ checked = create(new EvaluationCache<false>(checked, var.data(), parseInfo->allocateCacheSlot()), sourceLocator, parseInfo);
else if(type == VariableDeclaration::GlobalVariable)
- checked = create(new EvaluationCache<true>(checked, var, parseInfo->allocateCacheSlot()), sourceLocator, parseInfo);
+ checked = create(new EvaluationCache<true>(checked, var.data(), parseInfo->allocateCacheSlot()), sourceLocator, parseInfo);
var->setExpression(checked);
@@ -1042,7 +1042,7 @@ static Expression::Ptr resolveVariable(const QXmlName &name,
* mechanism must. */
case VariableDeclaration::ExpressionVariable:
{
- retval = create(new ExpressionVariableReference(var->slot, var), sourceLocator, parseInfo);
+ retval = create(new ExpressionVariableReference(var->slot, var.data()), sourceLocator, parseInfo);
break;
}
case VariableDeclaration::FunctionArgument:
@@ -1057,7 +1057,7 @@ static Expression::Ptr resolveVariable(const QXmlName &name,
}
case VariableDeclaration::TemplateParameter:
{
- retval = create(new TemplateParameterReference(var), sourceLocator, parseInfo);
+ retval = create(new TemplateParameterReference(var.data()), sourceLocator, parseInfo);
break;
}
case VariableDeclaration::ExternalVariable: