summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-10-12 07:08:18 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-13 13:49:23 +0200
commit0ca57a89a2512e62178b44cdcd2653adc3924dd0 (patch)
treef4bc261dd9356de2a29d77751e74ea4a47b81ada /src/gui/text
parentfaac9bbaf9d7b96df1f92fd89f0ba6ba8c253476 (diff)
Use constFind()/constEnd() for const_iterator-s
to make the strict iterators happy. Change-Id: Ief4ec309b815f18dc4b2017d4f34c063db510c31 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfont.cpp6
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/gui/text/qtextformat.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index a2132f0fea..24423ee4af 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2648,9 +2648,9 @@ void QFontCache::clear()
QFontEngineData *QFontCache::findEngineData(const QFontDef &def) const
{
- EngineDataCache::ConstIterator it = engineDataCache.find(def),
- end = engineDataCache.end();
- if (it == end) return 0;
+ EngineDataCache::ConstIterator it = engineDataCache.constFind(def);
+ if (it == engineDataCache.constEnd())
+ return 0;
// found
return it.value();
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index cff1487278..33f2bba988 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2741,13 +2741,13 @@ void QTextEngine::resolveAdditionalFormats() const
const QScriptItem *si = &layoutData->items.at(i);
int end = si->position + length(si);
- while (startIt != addFormatSortedByStart.end() &&
+ while (startIt != addFormatSortedByStart.constEnd() &&
specialData->addFormats.at(*startIt).start <= si->position) {
currentFormats.insert(std::upper_bound(currentFormats.begin(), currentFormats.end(), *startIt),
*startIt);
++startIt;
}
- while (endIt != addFormatSortedByEnd.end() &&
+ while (endIt != addFormatSortedByEnd.constEnd() &&
specialData->addFormats.at(*endIt).start + specialData->addFormats.at(*endIt).length < end) {
currentFormats.remove(qBinaryFind(currentFormats, *endIt) - currentFormats.begin());
++endIt;
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 6607c427f5..90cdd7e072 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -3358,8 +3358,8 @@ int QTextFormatCollection::indexForFormat(const QTextFormat &format)
bool QTextFormatCollection::hasFormatCached(const QTextFormat &format) const
{
uint hash = getHash(format.d, format.format_type);
- QMultiHash<uint, int>::const_iterator i = hashes.find(hash);
- while (i != hashes.end() && i.key() == hash) {
+ QMultiHash<uint, int>::const_iterator i = hashes.constFind(hash);
+ while (i != hashes.constEnd() && i.key() == hash) {
if (formats.value(i.value()) == format) {
return true;
}