mirror of https://github.com/qt/qtbase.git
Use constFind()/constEnd() for const_iterator-s
to make the strict iterators happy. Change-Id: Ief4ec309b815f18dc4b2017d4f34c063db510c31 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
This commit is contained in:
parent
faac9bbaf9
commit
0ca57a89a2
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue