--- a/src/hbcore/core/hblayoutparameters.cpp Thu Sep 02 20:44:51 2010 +0300
+++ b/src/hbcore/core/hblayoutparameters.cpp Fri Sep 17 08:32:10 2010 +0300
@@ -28,6 +28,7 @@
#include "hbmemoryutils_p.h"
#include "hbdeviceprofile.h"
#include "hbmemorymanager_p.h"
+#include "hbhash_p.h"
#include <QtAlgorithms>
static const QString GLOBAL_PARAMETERS_LOCATION =
@@ -140,7 +141,7 @@
for (int j = 0; j < declsCount; ++j) {
const HbCss::Declaration &decl = decls.at(j);
QString parameterName(decl.property);
- quint32 hash = HbSharedCache::hash(QStringRef(¶meterName));
+ quint32 hash = hbHash(QStringRef(¶meterName));
qptrdiff valueOffset = manager->alloc(sizeof(HbCss::Value));
new ((char*)manager->base() + valueOffset) HbCss::Value(decl.values.at(0));
mItems.append(HbParameterItem(hash, valueOffset, mNames.size(), false));
@@ -150,7 +151,7 @@
}
//add special variables
for(int i = 0; i < specialVariables.count(); ++i) {
- quint32 hash = HbSharedCache::hash(QStringRef(&specialVariables.at(i)));
+ quint32 hash = hbHash(QStringRef(&specialVariables.at(i)));
mItems.append(HbParameterItem(hash, i, mNames.size(), true));
QByteArray latinName(specialVariables.at(0).toLatin1());
mNames.append(latinName.constData(), latinName.length() + 1);
@@ -186,8 +187,12 @@
HbLayoutParameters::const_iterator HbLayoutParameters::find(const QString ¶meter) const
{
- quint32 parameterHash = HbSharedCache::hash(QStringRef(¶meter));
- return qBinaryFind(begin(), end(), HbParameterItem(parameterHash, 0, 0, 0));
+ return find(hbHash(parameter));
+}
+
+HbLayoutParameters::const_iterator HbLayoutParameters::find(quint32 hashValue) const
+{
+ return qBinaryFind(begin(), end(), HbParameterItem(hashValue, 0, 0, 0));
}
#endif //#ifndef HB_BIN_CSS