diff -r 7516d6d86cf5 -r ed14f46c0e55 src/hbcore/inputfw/hbinputextrauserdictionary.cpp --- a/src/hbcore/inputfw/hbinputextrauserdictionary.cpp Mon Oct 04 17:49:30 2010 +0300 +++ b/src/hbcore/inputfw/hbinputextrauserdictionary.cpp Mon Oct 18 18:23:13 2010 +0300 @@ -36,8 +36,12 @@ const int HbExtraDictMaxFrequency = 255; +const QString RomanHundreds[10] = {"C","CC","CCC","CD","D","DC","DCC","DCCC","CM","M"}; +const QString RomanTens[9] = {"X","XX","XXX","XL","L","LX","LXX","LXXX","XC"}; +const QString RomanOnes[9] = {"I","II","III","IV","V","VI","VII","VIII","IX"}; + /*! -@proto +@stable @hbcore \class HbExtraUserDictionary \brief A generic implementation of HbUserDictionary class. @@ -99,9 +103,8 @@ QString HbExtraUserDictionaryPrivate::name() const { - QString num; - num.setNum(id); - + + QString num(convertToRomanNumerals(id)); return QString(KExtraUserDictKeyBase) + num; } @@ -110,6 +113,40 @@ return HbInputSettingProxy::extraDictionaryPath() + QDir::separator() + name() + QString(KExtraFileExt); } +QString HbExtraUserDictionaryPrivate::convertToRomanNumerals(int id) const +{ + int numId = id; + QString retNum; + + // Append Roman Thousand's to the string + int index = 10; + int count = numId/1000; + for (int i = 0; i < count; i++) { + retNum.append(RomanHundreds[index-1]); + } + + // Append Roman Hundred's to the string + numId = numId % 1000; + index = numId / 100; + if (index) { + retNum.append(RomanHundreds[index - 1]); + } + + // Append Roman Ten's to the string + numId = numId % 100; + index = numId / 10; + if (index) { + retNum.append(RomanTens[index - 1]); + } + // Append Roman single digit numerals to the string + numId = numId % 10; + index = numId / 1; + if (index) { + retNum.append(RomanOnes[index - 1]); + } + return retNum; +} + bool HbExtraUserDictionaryPrivate::save(QString fileName) { QFile file(fileName);