summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-07-28 13:31:14 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-07-28 13:31:14 (GMT)
commit174e01a16aba71cfaa7b095be6430f8e4a89d0b8 (patch)
treedfa7379fef4603f3c9b3af8f3ae3fa4c7cb7125b
parentd599ec6e3e9b24a9ee781b60f684da9c35c91efb (diff)
parent22995948cd3f46780be5d8016708aeef0cd7b066 (diff)
downloadQt-174e01a16aba71cfaa7b095be6430f8e4a89d0b8.zip
Qt-174e01a16aba71cfaa7b095be6430f8e4a89d0b8.tar.gz
Qt-174e01a16aba71cfaa7b095be6430f8e4a89d0b8.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Revert binary search in QTextEngine::findItem
-rw-r--r--src/gui/text/qtextengine.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 6c13eae..cff3641 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1577,19 +1577,13 @@ bool QTextEngine::isRightToLeft() const
int QTextEngine::findItem(int strPos) const
{
itemize();
- int left = 0;
- int right = layoutData->items.size()-1;
- while(left <= right) {
- int middle = ((right-left)/2)+left;
- if (strPos > layoutData->items[middle].position)
- left = middle+1;
- else if(strPos < layoutData->items[middle].position)
- right = middle-1;
- else {
- return middle;
- }
+
+ int item;
+ for (item = layoutData->items.size()-1; item > 0; --item) {
+ if (layoutData->items[item].position <= strPos)
+ break;
}
- return right;
+ return item;
}
QFixed QTextEngine::width(int from, int len) const