Commit 689f6507 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Avoid searching three times in the hash

parent 99b39065
......@@ -1893,25 +1893,19 @@ void TextPagePrivate::breakWordIntoCharacters(const QHash<QRect, RegionText> &wo
tmp.append( new TinyTextEntity(ent->text(),ent->area) );
else
{
RegionText word_text = word_chars_map.value(rect);
TextList list = word_text.text();
RegionText word_text;
const int count = word_chars_map.count(rect);
if(count > 1)
{
QHash<QRect, RegionText>::const_iterator it = word_chars_map.find(rect);
while( it != word_chars_map.end() && it.key() == rect )
{
word_text = it.value();
list = word_text.text();
if(word_text.area() == rect && ent->text() == word_text.string())
if (ent->text() == word_text.string())
break;
++it;
}
}
tmp.append(list);
tmp.append(word_text.text());
}
}
setWordList(tmp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment