summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Iacovitti <aiacovitti@libero.it>2012-06-10 20:58:39 (GMT)
committerAndrea Iacovitti <aiacovitti@libero.it>2012-06-10 20:58:39 (GMT)
commite14ac742e80e0b8a755fc49b50c7171f67e24700 (patch)
treeb95e3801688f09c966d9a8911be2f4897e1d147a
parent3b47c7db632719188921ce61c9e8f492454b334c (diff)
Use DOMString as key for CounterNode's hash implementation avoiding
QString/DOMString conversions
-rw-r--r--khtml/rendering/render_generated.cpp2
-rw-r--r--khtml/rendering/render_object.cpp18
-rw-r--r--khtml/rendering/render_object.h8
-rw-r--r--khtml/xml/dom_docimpl.h6
4 files changed, 17 insertions, 17 deletions
diff --git a/khtml/rendering/render_generated.cpp b/khtml/rendering/render_generated.cpp
index c54b23f..6d43efe 100644
--- a/khtml/rendering/render_generated.cpp
+++ b/khtml/rendering/render_generated.cpp
@@ -205,7 +205,7 @@ void RenderCounter::generateContent()
counters = !m_counter->separator().isNull();
if (!m_counterNode)
- m_counterNode = getCounter(m_counter->identifier().string(), true, counters);
+ m_counterNode = getCounter(m_counter->identifier(), true, counters);
int value = m_counterNode->count();
if (m_counterNode->isReset()) value = m_counterNode->value();
diff --git a/khtml/rendering/render_object.cpp b/khtml/rendering/render_object.cpp
index f4bed19..f37627c 100644
--- a/khtml/rendering/render_object.cpp
+++ b/khtml/rendering/render_object.cpp
@@ -2816,7 +2816,7 @@ InlineBox *RenderObject::inlineBox(long /*offset*/)
return 0;
}
-bool RenderObject::hasCounter(const QString& counter) const
+bool RenderObject::hasCounter(const DOMString& counter) const
{
if (style() && (!isText() || isCounter())) {
if (lookupCounter(counter)) return true;
@@ -2842,7 +2842,7 @@ bool RenderObject::hasCounter(const QString& counter) const
return false;
}
-CounterNode* RenderObject::getCounter(const QString& counter, bool view, bool counters)
+CounterNode* RenderObject::getCounter(const DOMString& counter, bool view, bool counters)
{
// kDebug( 6040 ) << renderName() << " getCounter(" << counter << ")";
@@ -2978,18 +2978,18 @@ CounterNode* RenderObject::getCounter(const QString& counter, bool view, bool co
return i;
}
-CounterNode* RenderObject::lookupCounter(const QString& counter) const
+CounterNode* RenderObject::lookupCounter(const DOMString& counter) const
{
- QHash<QString,khtml::CounterNode*>* counters = document()->counters(this);
+ QHash<DOMString,khtml::CounterNode*>* counters = document()->counters(this);
return counters ? counters->value(counter) : 0;
}
void RenderObject::detachCounters()
{
- QHash<QString,khtml::CounterNode*>* counters = document()->counters(this);
+ QHash<DOMString,khtml::CounterNode*>* counters = document()->counters(this);
if (!counters) return;
- QHashIterator<QString,khtml::CounterNode*> i(*counters);
+ QHashIterator<DOMString,khtml::CounterNode*> i(*counters);
while (i.hasNext()) {
i.next();
@@ -2999,12 +2999,12 @@ void RenderObject::detachCounters()
document()->removeCounters(this);
}
-void RenderObject::insertCounter(const QString& counter, CounterNode* val)
+void RenderObject::insertCounter(const DOMString& counter, CounterNode* val)
{
- QHash<QString,khtml::CounterNode*>* counters = document()->counters(this);
+ QHash<DOMString,khtml::CounterNode*>* counters = document()->counters(this);
if (!counters) {
- counters = new QHash<QString,khtml::CounterNode*>();
+ counters = new QHash<DOMString,khtml::CounterNode*>();
document()->setCounters(this, counters);
}
diff --git a/khtml/rendering/render_object.h b/khtml/rendering/render_object.h
index 4a2710b..a78092e 100644
--- a/khtml/rendering/render_object.h
+++ b/khtml/rendering/render_object.h
@@ -207,17 +207,17 @@ public:
RenderObject *objectAbove() const;
// Returns if an object has counter-increment or counter-reset
- bool hasCounter(const QString& counter) const;
+ bool hasCounter(const DOMString& counter) const;
// Calculates the value of the counter
- CounterNode* getCounter(const QString& counter, bool view = false, bool counters = false);
+ CounterNode* getCounter(const DOMString& counter, bool view = false, bool counters = false);
// Detaches all counterNodes
void detachCounters();
protected:
// Helper functions for counter-cache
- void insertCounter(const QString& counter, CounterNode* value);
- CounterNode* lookupCounter(const QString& counter) const;
+ void insertCounter(const DOMString& counter, CounterNode* value);
+ CounterNode* lookupCounter(const DOMString& counter) const;
public:
//////////////////////////////////////////
diff --git a/khtml/xml/dom_docimpl.h b/khtml/xml/dom_docimpl.h
index f2fd0a9..71bc13f 100644
--- a/khtml/xml/dom_docimpl.h
+++ b/khtml/xml/dom_docimpl.h
@@ -604,8 +604,8 @@ public:
JSEditor *jsEditor();
- QHash<QString,khtml::CounterNode*>* counters(const khtml::RenderObject* o) { return m_counterDict.value(o); }
- void setCounters(const khtml::RenderObject* o, QHash<QString,khtml::CounterNode*> *dict) { m_counterDict.insert(o, dict);}
+ QHash<DOMString,khtml::CounterNode*>* counters(const khtml::RenderObject* o) { return m_counterDict.value(o); }
+ void setCounters(const khtml::RenderObject* o, QHash<DOMString,khtml::CounterNode*> *dict) { m_counterDict.insert(o, dict);}
void removeCounters(const khtml::RenderObject* o) { delete m_counterDict.take(o); }
ElementMappingCache& underDocNamedCache() {
@@ -687,7 +687,7 @@ protected:
QList<NodeImpl*> m_maintainsState;
// ### evaluate for placement in RenderStyle
- QHash<const khtml::RenderObject*,QHash<QString,khtml::CounterNode*> *> m_counterDict;
+ QHash<const khtml::RenderObject*,QHash<DOMString,khtml::CounterNode*> *> m_counterDict;
khtml::DynamicDomRestyler *m_dynamicDomRestyler;