diff --git a/sheets/Condition.cpp b/sheets/Condition.cpp --- a/sheets/Condition.cpp +++ b/sheets/Condition.cpp @@ -381,6 +381,8 @@ bool Conditions::operator==(const Conditions& other) const { + if (d->defaultStyle != other.d->defaultStyle) + return false; if (d->conditionList.count() != other.d->conditionList.count()) return false; QLinkedList::ConstIterator end(d->conditionList.end()); @@ -399,7 +401,7 @@ uint Calligra::Sheets::qHash(const Conditions &c) { - uint res = 0; + uint res = qHash(c.defaultStyle()); foreach (const Conditional& co, c.conditionList()) { res ^= qHash(co); } diff --git a/sheets/RectStorage.h b/sheets/RectStorage.h --- a/sheets/RectStorage.h +++ b/sheets/RectStorage.h @@ -570,19 +570,15 @@ QList > treeData; typedef QPair TRegion; - QMap indexCache; foreach (const TRegion& tr, m_data) { const QRegion& reg = tr.first; const T& d = tr.second; - typename QMap::iterator idx = indexCache.find(d); - int index = idx != indexCache.end() ? idx.value() : m_storage->m_storedData.indexOf(d); + int index = m_storage->m_storedData.indexOf(d); if (index != -1) { treeData.append(qMakePair(reg, m_storage->m_storedData[index])); - if (idx == indexCache.end()) indexCache.insert(d, index); } else { treeData.append(tr); - if (idx == indexCache.end()) indexCache.insert(d, m_storage->m_storedData.size()); m_storage->m_storedData.append(d); } }