Commit 5709565b authored by Laurent Montel's avatar Laurent Montel 😁

Fix iterator

svn path=/trunk/koffice/; revision=911274
parent 4120cd67
......@@ -122,7 +122,7 @@ QList<KoEventAction*> KoEventActionRegistry::createEventActionsFromOdf(const KoX
QString action(element.attributeNS(KoXmlNS::presentation, "action", QString()));
QHash<QString, KoEventActionFactory *>::const_iterator it(d->presentationEventActions.find(action));
if (it != d->presentationEventActions.end()) {
if (it != d->presentationEventActions.constEnd()) {
KoEventAction * eventAction = it.value()->createEventAction();
if (eventAction) {
if (eventAction->loadOdf(element, context)) {
......
......@@ -86,8 +86,8 @@ void KoParameterShape::paintHandles(QPainter & painter, const KoViewConverter &
QPolygonF poly(handleRect(QPointF(0, 0), handleRadius));
poly = matrix.map(poly);
QList<QPointF>::const_iterator it(m_handles.begin());
for (; it != m_handles.end(); ++it) {
QList<QPointF>::const_iterator it(m_handles.constBegin());
for (; it != m_handles.constEnd(); ++it) {
QPointF moveVector = worldMatrix.map(*it);
poly.translate(moveVector.x(), moveVector.y());
painter.drawPolygon(poly);
......
......@@ -97,7 +97,7 @@ bool KoPathShape::loadOdf(const KoXmlElement & element, KoShapeLoadingContext &c
points.remove('\n');
bool firstPoint = true;
const QStringList coordinateList = points.split(' ');
for (QStringList::ConstIterator it = coordinateList.begin(); it != coordinateList.end(); ++it) {
for (QStringList::ConstIterator it = coordinateList.constBegin(); it != coordinateList.constEnd(); ++it) {
QPointF point;
point.setX((*it).toDouble());
++it;
......@@ -228,15 +228,15 @@ void KoPathShape::paint(QPainter &painter, const KoViewConverter &converter)
#ifndef NDEBUG
void KoPathShape::paintDebug(QPainter &painter)
{
KoSubpathList::const_iterator pathIt(m_subpaths.begin());
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
int i = 0;
QPen pen(Qt::black);
painter.save();
painter.setPen(pen);
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->begin());
for (; it != (*pathIt)->end(); ++it) {
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
for (; it != (*pathIt)->constEnd(); ++it) {
++i;
KoPathPoint *point = (*it);
QRectF r(point->point(), QSizeF(5, 5));
......@@ -265,10 +265,10 @@ void KoPathShape::paintDebug(QPainter &painter)
void KoPathShape::debugPath()
{
KoSubpathList::iterator pathIt(m_subpaths.begin());
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->begin());
for (; it != (*pathIt)->end(); ++it) {
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
for (; it != (*pathIt)->constEnd(); ++it) {
kDebug(30006) << "p:" << (*pathIt) << "," << *it << "," << (*it)->point() << "," << (*it)->properties() << "," << (*it)->group();
}
}
......@@ -279,13 +279,13 @@ void KoPathShape::paintPoints(QPainter &painter, const KoViewConverter &converte
{
applyConversion(painter, converter);
KoSubpathList::const_iterator pathIt(m_subpaths.begin());
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
QRectF handle = converter.viewToDocument(handleRect(QPoint(0, 0), handleRadius));
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->begin());
for (; it != (*pathIt)->end(); ++it)
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
for (; it != (*pathIt)->constEnd(); ++it)
(*it)->paint(painter, handleRadius, KoPathPoint::Node);
}
}
......@@ -564,10 +564,10 @@ QPointF KoPathShape::normalize()
void KoPathShape::map(const QMatrix &matrix)
{
KoSubpathList::iterator pathIt(m_subpaths.begin());
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::iterator it((*pathIt)->begin());
for (; it != (*pathIt)->end(); ++it) {
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
for (; it != (*pathIt)->constEnd(); ++it) {
(*it)->map(matrix);
}
}
......@@ -609,10 +609,10 @@ QList<KoPathPoint*> KoPathShape::pointsAt(const QRectF &r)
{
QList<KoPathPoint*> result;
KoSubpathList::iterator pathIt(m_subpaths.begin());
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::iterator it((*pathIt)->begin());
for (; it != (*pathIt)->end(); ++it) {
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
for (; it != (*pathIt)->constEnd(); ++it) {
if (r.contains((*it)->point()))
result.append(*it);
else if ((*it)->activeControlPoint1() && r.contains((*it)->controlPoint1()))
......@@ -697,8 +697,8 @@ KoPathSegment KoPathShape::segmentByIndex(const KoPathPointIndex &pointIndex) co
int KoPathShape::pointCount() const
{
int i = 0;
KoSubpathList::const_iterator pathIt(m_subpaths.begin());
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
i += (*pathIt)->size();
}
......@@ -1079,14 +1079,14 @@ QString KoPathShape::toString(const QMatrix &matrix) const
{
QString d;
KoSubpathList::const_iterator pathIt(m_subpaths.begin());
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->begin());
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
KoPathPoint * lastPoint(*it);
bool activeCP = false;
for (; it != (*pathIt)->end(); ++it) {
for (; it != (*pathIt)->constEnd(); ++it) {
// first point of subpath ?
if (it == (*pathIt)->begin()) {
if (it == (*pathIt)->constBegin()) {
if ((*it)->properties() & KoPathPoint::StartSubpath) {
QPointF p = matrix.map((*it)->point());
d += QString("M%1 %2").arg(p.x()).arg(p.y());
......@@ -1149,11 +1149,11 @@ char nodeType( const KoPathPoint * point )
QString KoPathShape::nodeTypes() const
{
QString types;
KoSubpathList::const_iterator pathIt(m_subpaths.begin());
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->begin());
for (; it != (*pathIt)->end(); ++it) {
if (it == (*pathIt)->begin()) {
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
for (; it != (*pathIt)->constEnd(); ++it) {
if (it == (*pathIt)->constBegin()) {
types.append( 'c' );
}
else {
......@@ -1184,18 +1184,18 @@ void KoPathShape::loadNodeTypes(const KoXmlElement & element)
{
if (element.hasAttributeNS(KoXmlNS::koffice, "nodeTypes")) {
QString nodeTypes = element.attributeNS(KoXmlNS::koffice, "nodeTypes");
QString::const_iterator nIt(nodeTypes.begin());
KoSubpathList::const_iterator pathIt(m_subpaths.begin());
for (; pathIt != m_subpaths.end(); ++pathIt) {
KoSubpath::iterator it((*pathIt)->begin());
for (; it != (*pathIt)->end(); ++it, nIt++) {
QString::const_iterator nIt(nodeTypes.constBegin());
KoSubpathList::const_iterator pathIt(m_subpaths.constBegin());
for (; pathIt != m_subpaths.constEnd(); ++pathIt) {
KoSubpath::const_iterator it((*pathIt)->constBegin());
for (; it != (*pathIt)->constEnd(); ++it, nIt++) {
// be sure not to crash if there are not enough nodes in nodeTypes
if (nIt == nodeTypes.end()) {
if (nIt == nodeTypes.constEnd()) {
kWarning(30006) << "not enough nodes in koffice:nodeTypes";
return;
}
// the first node is always of type 'c'
if (it != (*pathIt)->begin()) {
if (it != (*pathIt)->constBegin()) {
updateNodeType(*it, *nIt);
}
......
......@@ -975,8 +975,8 @@ QMatrix KoShape::parseOdfTransform(const QString &transform)
// Split string for handling 1 transform statement at a time
QStringList subtransforms = transform.split(')', QString::SkipEmptyParts);
QStringList::ConstIterator it = subtransforms.begin();
QStringList::ConstIterator end = subtransforms.end();
QStringList::ConstIterator it = subtransforms.constBegin();
QStringList::ConstIterator end = subtransforms.constEnd();
for (; it != end; ++it) {
QStringList subtransform = (*it).split('(', QString::SkipEmptyParts);
......
......@@ -132,7 +132,7 @@ KoSharedLoadingData * KoShapeLoadingContext::sharedData(const QString & id) cons
{
KoSharedLoadingData * data = 0;
QMap<QString, KoSharedLoadingData*>::const_iterator it(d->sharedData.find(id));
if (it != d->sharedData.end()) {
if (it != d->sharedData.constEnd()) {
data = it.value();
}
return data;
......
......@@ -98,8 +98,8 @@ void KoShapeSavingContext::removeOption(ShapeSavingOption option)
const QString KoShapeSavingContext::drawId(const KoShape * shape, bool insert)
{
QMap<const KoShape *, QString>::const_iterator it(m_drawIds.find(shape));
if (it == m_drawIds.constEnd()) {
QMap<const KoShape *, QString>::iterator it(m_drawIds.find(shape));
if (it == m_drawIds.end()) {
if (insert == true) {
it = m_drawIds.insert(shape, QString("shape%1").arg(++m_drawId));
} else {
......
......@@ -137,8 +137,8 @@ void KoDocumentInfoPropsPage::applyChanges()
bool docInfoSaved = false;
QStringList entries = root->entries();
QStringList::ConstIterator it = entries.begin();
QStringList::ConstIterator end = entries.end();
QStringList::ConstIterator it = entries.constBegin();
QStringList::ConstIterator end = entries.constEnd();
for (; it != end; ++it) {
const KArchiveEntry *entry = root->entry(*it);
......@@ -193,8 +193,8 @@ void KoDocumentInfoPropsPage::copy(const QString &path, const KArchiveEntry *ent
}
QStringList entries = dir->entries();
QStringList::ConstIterator it = entries.begin();
QStringList::ConstIterator end = entries.end();
QStringList::ConstIterator it = entries.constBegin();
QStringList::ConstIterator end = entries.constEnd();
for (; it != end; ++it)
copy(p, dir->entry(*it));
}
......
......@@ -127,16 +127,16 @@ void KoEmbeddingFilter::endInternalEmbedding()
int KoEmbeddingFilter::internalPartReference(const QString& key) const
{
QMap<QString, PartReference>::const_iterator it = d->partStack.top()->m_partReferences.find(key);
if (it == d->partStack.top()->m_partReferences.end())
QMap<QString, PartReference>::const_iterator it = d->partStack.top()->m_partReferences.constFind(key);
if (it == d->partStack.top()->m_partReferences.constEnd())
return -1;
return it.value().m_index;
}
QByteArray KoEmbeddingFilter::internalPartMimeType(const QString& key) const
{
QMap<QString, PartReference>::const_iterator it = d->partStack.top()->m_partReferences.find(key);
if (it == d->partStack.top()->m_partReferences.end())
QMap<QString, PartReference>::const_iterator it = d->partStack.top()->m_partReferences.constFind(key);
if (it == d->partStack.top()->m_partReferences.constEnd())
return QByteArray();
return it.value().m_mimeType;
}
......
......@@ -588,8 +588,8 @@ KoStoreDevice* KoFilterChain::storageCreateFirstStream(const QString& streamName
// have to perform a little hack in case we're used by any ole-style
// filter which utilizes internal embedding. Ugly, but well...
if (!m_internalEmbeddingDirectories.isEmpty()) {
QStringList::ConstIterator it = m_internalEmbeddingDirectories.begin();
QStringList::ConstIterator end = m_internalEmbeddingDirectories.end();
QStringList::ConstIterator it = m_internalEmbeddingDirectories.constBegin();
QStringList::ConstIterator end = m_internalEmbeddingDirectories.constEnd();
while (it != end && (*storage)->enterDirectory(*it))
++it;
}
......@@ -811,14 +811,14 @@ void Graph::buildGraph()
{
// Make sure that all available parts are added to the graph
const QList<KoDocumentEntry> parts(KoDocumentEntry::query(KoDocumentEntry::AllEntries));
QList<KoDocumentEntry>::ConstIterator partIt(parts.begin());
QList<KoDocumentEntry>::ConstIterator partEnd(parts.end());
QList<KoDocumentEntry>::ConstIterator partIt(parts.constBegin());
QList<KoDocumentEntry>::ConstIterator partEnd(parts.constEnd());
while (partIt != partEnd) {
QStringList nativeMimeTypes = (*partIt).service()->property("X-KDE-ExtraNativeMimeTypes").toStringList();
nativeMimeTypes += (*partIt).service()->property("X-KDE-NativeMimeType").toString();
QStringList::ConstIterator it = nativeMimeTypes.begin();
QStringList::ConstIterator end = nativeMimeTypes.end();
QStringList::ConstIterator it = nativeMimeTypes.constBegin();
QStringList::ConstIterator end = nativeMimeTypes.constEnd();
for (; it != end; ++it)
if (!(*it).isEmpty())
m_vertices.insert((*it).toLatin1(), new Vertex((*it).toLatin1()));
......@@ -827,13 +827,13 @@ void Graph::buildGraph()
// no constraint here - we want *all* :)
const QList<KoFilterEntry::Ptr> filters(KoFilterEntry::query());
QList<KoFilterEntry::Ptr>::ConstIterator it = filters.begin();
QList<KoFilterEntry::Ptr>::ConstIterator end = filters.end();
QList<KoFilterEntry::Ptr>::ConstIterator it = filters.constBegin();
QList<KoFilterEntry::Ptr>::ConstIterator end = filters.constEnd();
for (; it != end; ++it) {
// First add the "starting points" to the dict
QStringList::ConstIterator importIt = (*it)->import.begin();
QStringList::ConstIterator importEnd = (*it)->import.end();
QStringList::ConstIterator importIt = (*it)->import.constBegin();
QStringList::ConstIterator importEnd = (*it)->import.constEnd();
for (; importIt != importEnd; ++importIt) {
const QByteArray key = (*importIt).toLatin1(); // latin1 is okay here (werner)
// already there?
......@@ -843,8 +843,8 @@ void Graph::buildGraph()
// Are we allowed to use this filter at all?
if (KoFilterManager::filterAvailable(*it)) {
QStringList::ConstIterator exportIt = (*it)->export_.begin();
QStringList::ConstIterator exportEnd = (*it)->export_.end();
QStringList::ConstIterator exportIt = (*it)->export_.constBegin();
QStringList::ConstIterator exportEnd = (*it)->export_.constEnd();
for (; exportIt != exportEnd; ++exportIt) {
// First make sure the export vertex is in place
......@@ -855,7 +855,7 @@ void Graph::buildGraph()
m_vertices.insert(key, exp);
}
// Then create the appropriate edges
importIt = (*it)->import.begin();
importIt = (*it)->import.constBegin();
for (; importIt != importEnd; ++importIt)
m_vertices[(*importIt).toLatin1()]->addEdge(new Edge(exp, *it));
}
......@@ -899,8 +899,8 @@ QByteArray Graph::findKOfficePart() const
{
// Here we simply try to find the closest KOffice mimetype
const QList<KoDocumentEntry> parts(KoDocumentEntry::query(KoDocumentEntry::AllEntries));
QList<KoDocumentEntry>::ConstIterator partIt(parts.begin());
QList<KoDocumentEntry>::ConstIterator partEnd(parts.end());
QList<KoDocumentEntry>::ConstIterator partIt(parts.constBegin());
QList<KoDocumentEntry>::ConstIterator partEnd(parts.constEnd());
const Vertex *v = 0;
......@@ -908,8 +908,8 @@ QByteArray Graph::findKOfficePart() const
while (!v && partIt != partEnd) {
QStringList nativeMimeTypes = (*partIt).service()->property("X-KDE-ExtraNativeMimeTypes").toStringList();
nativeMimeTypes += (*partIt).service()->property("X-KDE-NativeMimeType").toString();
QStringList::ConstIterator it = nativeMimeTypes.begin();
QStringList::ConstIterator end = nativeMimeTypes.end();
QStringList::ConstIterator it = nativeMimeTypes.constBegin();
QStringList::ConstIterator end = nativeMimeTypes.constEnd();
for (; !v && it != end; ++it)
if (!(*it).isEmpty())
v = m_vertices[(*it).toLatin1()];
......@@ -922,8 +922,8 @@ QByteArray Graph::findKOfficePart() const
while (partIt != partEnd) {
QStringList nativeMimeTypes = (*partIt).service()->property("X-KDE-ExtraNativeMimeTypes").toStringList();
nativeMimeTypes += (*partIt).service()->property("X-KDE-NativeMimeType").toString();
QStringList::ConstIterator it = nativeMimeTypes.begin();
QStringList::ConstIterator end = nativeMimeTypes.end();
QStringList::ConstIterator it = nativeMimeTypes.constBegin();
QStringList::ConstIterator end = nativeMimeTypes.constEnd();
for (; !v && it != end; ++it) {
QString key = *it;
if (!key.isEmpty()) {
......
......@@ -76,8 +76,8 @@ KoFilterChooser::KoFilterChooser(QWidget *parent, const QStringList &mimeTypes,
page->setLayout(layout);
Q_ASSERT(!m_mimeTypes.isEmpty());
for (QStringList::ConstIterator it = m_mimeTypes.begin();
it != m_mimeTypes.end();
for (QStringList::ConstIterator it = m_mimeTypes.constBegin();
it != m_mimeTypes.constEnd();
it++) {
KMimeType::Ptr mime = KMimeType::mimeType(*it);
const QString name = mime ? mime->comment() : *it;
......@@ -256,8 +256,8 @@ KoFilter::ConversionStatus KoFilterManager::exportDocument(const QString& url, Q
QStringList nativeMimeTypes;
nativeMimeTypes.append(m_document->nativeFormatMimeType());
nativeMimeTypes += m_document->extraNativeMimeTypes();
QStringList::ConstIterator it = nativeMimeTypes.begin();
const QStringList::ConstIterator end = nativeMimeTypes.end();
QStringList::ConstIterator it = nativeMimeTypes.constBegin();
const QStringList::ConstIterator end = nativeMimeTypes.constEnd();
for (; !chain && it != end; ++it) {
m_graph.setSourceMimeType((*it).toLatin1());
if (m_graph.isValid())
......@@ -356,14 +356,14 @@ void buildGraph(Q3AsciiDict<Vertex>& vertices, KoFilterManager::Direction direct
// partly copied from build graph, but I don't see any other
// way without crude hacks, as we have to obey the direction here
Q3ValueList<KoDocumentEntry> parts(KoDocumentEntry::query(false, QString()));
Q3ValueList<KoDocumentEntry>::ConstIterator partIt(parts.begin());
Q3ValueList<KoDocumentEntry>::ConstIterator partEnd(parts.end());
Q3ValueList<KoDocumentEntry>::ConstIterator partIt(parts.constBegin());
Q3ValueList<KoDocumentEntry>::ConstIterator partEnd(parts.constEnd());
while (partIt != partEnd) {
QStringList nativeMimeTypes = (*partIt).service()->property("X-KDE-ExtraNativeMimeTypes").toStringList();
nativeMimeTypes += (*partIt).service()->property("X-KDE-NativeMimeType").toString();
QStringList::ConstIterator it = nativeMimeTypes.begin();
const QStringList::ConstIterator end = nativeMimeTypes.end();
QStringList::ConstIterator it = nativeMimeTypes.constBegin();
const QStringList::ConstIterator end = nativeMimeTypes.constEnd();
for (; it != end; ++it)
if (!(*it).isEmpty())
vertices.insert((*it).toLatin1(), new Vertex((*it).toLatin1()));
......@@ -371,8 +371,8 @@ void buildGraph(Q3AsciiDict<Vertex>& vertices, KoFilterManager::Direction direct
}
Q3ValueList<KoFilterEntry::Ptr> filters = KoFilterEntry::query(); // no constraint here - we want *all* :)
Q3ValueList<KoFilterEntry::Ptr>::ConstIterator it = filters.begin();
const Q3ValueList<KoFilterEntry::Ptr>::ConstIterator end = filters.end();
Q3ValueList<KoFilterEntry::Ptr>::ConstIterator it = filters.constBegin();
const Q3ValueList<KoFilterEntry::Ptr>::ConstIterator end = filters.constEnd();
for (; it != end; ++it) {
......@@ -405,8 +405,8 @@ void buildGraph(Q3AsciiDict<Vertex>& vertices, KoFilterManager::Direction direct
}
// First add the "starting points" to the dict
QStringList::ConstIterator importIt = impList.begin();
const QStringList::ConstIterator importEnd = impList.end();
QStringList::ConstIterator importIt = impList.constBegin();
const QStringList::ConstIterator importEnd = impList.constEnd();
for (; importIt != importEnd; ++importIt) {
const QByteArray key = (*importIt).toLatin1(); // latin1 is okay here (werner)
// already there?
......@@ -416,8 +416,8 @@ void buildGraph(Q3AsciiDict<Vertex>& vertices, KoFilterManager::Direction direct
// Are we allowed to use this filter at all?
if (KoFilterManager::filterAvailable(*it)) {
QStringList::ConstIterator exportIt = expList.begin();
const QStringList::ConstIterator exportEnd = expList.end();
QStringList::ConstIterator exportIt = expList.constBegin();
const QStringList::ConstIterator exportEnd = expList.constEnd();
for (; exportIt != exportEnd; ++exportIt) {
// First make sure the export vertex is in place
......@@ -431,7 +431,7 @@ void buildGraph(Q3AsciiDict<Vertex>& vertices, KoFilterManager::Direction direct
// direction (import/export)
// This is the chunk of code which actually differs from the
// graph stuff (apart from the different vertex class)
importIt = impList.begin(); // ### TODO: why only the first one?
importIt = impList.constBegin(); // ### TODO: why only the first one?
if (direction == KoFilterManager::Import) {
for (; importIt != importEnd; ++importIt)
exp->addEdge(vertices[(*importIt).toLatin1()]);
......@@ -515,8 +515,8 @@ QStringList KoFilterManager::mimeFilter()
buildGraph(vertices, KoFilterManager::Import);
Q3ValueList<KoDocumentEntry> parts(KoDocumentEntry::query(false, QString()));
Q3ValueList<KoDocumentEntry>::ConstIterator partIt(parts.begin());
Q3ValueList<KoDocumentEntry>::ConstIterator partEnd(parts.end());
Q3ValueList<KoDocumentEntry>::ConstIterator partIt(parts.constBegin());
Q3ValueList<KoDocumentEntry>::ConstIterator partEnd(parts.constEnd());
if (partIt == partEnd)
return QStringList();
......@@ -531,8 +531,8 @@ QStringList KoFilterManager::mimeFilter()
while (partIt != partEnd) {
QStringList nativeMimeTypes = (*partIt).service()->property("X-KDE-ExtraNativeMimeTypes").toStringList();
nativeMimeTypes += (*partIt).service()->property("X-KDE-NativeMimeType").toString();
QStringList::ConstIterator it = nativeMimeTypes.begin();
const QStringList::ConstIterator end = nativeMimeTypes.end();
QStringList::ConstIterator it = nativeMimeTypes.constBegin();
const QStringList::ConstIterator end = nativeMimeTypes.constEnd();
for (; it != end; ++it)
if (!(*it).isEmpty())
v->addEdge(vertices[(*it).toLatin1()]);
......
......@@ -676,8 +676,8 @@ QMatrix KoOdfGraphicStyles::loadTransformation(const QString &transformation)
// Split string for handling 1 transform statement at a time
QStringList subtransforms = transformation.split(')', QString::SkipEmptyParts);
QStringList::ConstIterator it = subtransforms.begin();
QStringList::ConstIterator end = subtransforms.end();
QStringList::ConstIterator it = subtransforms.constBegin();
QStringList::ConstIterator end = subtransforms.constEnd();
for (; it != end; ++it) {
QStringList subtransform = (*it).split('(', QString::SkipEmptyParts);
......
......@@ -293,8 +293,8 @@ void KoPictureCollection::readFromStore(KoStore * store, const StoreMap & storeM
KoPicture KoPictureCollection::findOrLoad(const QString& fileName, const QDateTime& dateTime)
{
// As now all KoPictureKey objects have a valid QDateTime, we must do it without a date/time check.
ConstIterator it = find(KoPictureKey(fileName, dateTime));
if (it == end()) {
ConstIterator it = constFind(KoPictureKey(fileName, dateTime));
if (it == constEnd()) {
return loadPicture(fileName);
}
return *it;
......
......@@ -136,8 +136,8 @@ void KoProperties::setProperty(const QString & name, const QVariant & value)
bool KoProperties::property(const QString & name, QVariant & value) const
{
QMap<QString, QVariant>::const_iterator it = d->properties.find(name);
if (it == d->properties.end()) {
QMap<QString, QVariant>::const_iterator it = d->properties.constFind(name);
if (it == d->properties.constEnd()) {
return false;
} else {
value = *it;
......
......@@ -184,7 +184,7 @@ QList<KoFilterEntry::Ptr> KoFilterEntry::query(const QString & _constr)
KService::List offers = KServiceTypeTrader::self()->query("KOfficeFilter", _constr);
KService::List::ConstIterator it = offers.begin();
KService::List::ConstIterator it = offers.constBegin();
unsigned int max = offers.count();
//kDebug(30500) <<"Query returned" << max <<" offers";
for (unsigned int i = 0; i < max; i++) {
......
......@@ -257,7 +257,7 @@ void KoTemplateTree::readTemplates()
Q3PtrListIterator<KoTemplateGroup> groupIt(m_groups);
for (; groupIt.current() != 0L; ++groupIt) {
QStringList dirs = groupIt.current()->dirs();
for (QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
for (QStringList::ConstIterator it = dirs.constBegin(); it != dirs.constEnd(); ++it) {
QDir d(*it);
if (!d.exists())
continue;
......
......@@ -226,8 +226,8 @@ QList<KoGenStyles::NamedStyle> KoGenStyles::styles(int type, bool markedForStyle
{
QList<KoGenStyles::NamedStyle> lst;
const NameMap& nameMap = markedForStylesXml ? d->autoStylesInStylesDotXml : d->styleNames;
StyleArray::const_iterator it = d->styleArray.begin();
const StyleArray::const_iterator end = d->styleArray.end();
StyleArray::const_iterator it = d->styleArray.constBegin();
const StyleArray::const_iterator end = d->styleArray.constEnd();
for (; it != end ; ++it) {
// Look up if it's marked for styles.xml or not by looking up in the corresponding style map.
if ((*it).style->type() == type && nameMap.find((*it).name) != nameMap.end()) {
......@@ -239,8 +239,8 @@ QList<KoGenStyles::NamedStyle> KoGenStyles::styles(int type, bool markedForStyle
const KoGenStyle* KoGenStyles::style(const QString& name) const
{
StyleArray::const_iterator it = d->styleArray.begin();
const StyleArray::const_iterator end = d->styleArray.end();
StyleArray::const_iterator it = d->styleArray.constBegin();
const StyleArray::const_iterator end = d->styleArray.constEnd();
for (; it != end ; ++it) {
if ((*it).name == name)
return (*it).style;
......@@ -264,15 +264,15 @@ void KoGenStyles::markStyleForStylesXml(const QString& name)
void KoGenStyles::dump()
{
kDebug(30003) << "Style array:";
StyleArray::const_iterator it = d->styleArray.begin();
const StyleArray::const_iterator end = d->styleArray.end();
StyleArray::const_iterator it = d->styleArray.constBegin();
const StyleArray::const_iterator end = d->styleArray.constEnd();
for (; it != end ; ++it) {
kDebug(30003) << (*it).name;
}
for (NameMap::const_iterator it = d->styleNames.begin(); it != d->styleNames.end(); ++it) {
for (NameMap::const_iterator it = d->styleNames.constBegin(); it != d->styleNames.constEnd(); ++it) {
kDebug(30003) << "style:" << *it;
}
for (NameMap::const_iterator it = d->autoStylesInStylesDotXml.begin(); it != d->autoStylesInStylesDotXml.end(); ++it) {
for (NameMap::const_iterator it = d->autoStylesInStylesDotXml.constBegin(); it != d->autoStylesInStylesDotXml.constEnd(); ++it) {
kDebug(30003) << "auto style for style.xml:" << *it;
const KoGenStyle* s = style(*it);
Q_ASSERT(s);
......@@ -316,8 +316,8 @@ void KoGenStyles::saveOdfAutomaticStyles(KoXmlWriter* xmlWriter, bool stylesDotX
for (uint i = 0; i < numAutoStyleData; ++i) {
QList<KoGenStyles::NamedStyle> stylesList = styles(int(autoStyleData[i].m_type), stylesDotXml);
QList<KoGenStyles::NamedStyle>::const_iterator it = stylesList.begin();
for (; it != stylesList.end() ; ++it) {
QList<KoGenStyles::NamedStyle>::const_iterator it = stylesList.constBegin();
for (; it != stylesList.constEnd() ; ++it) {
(*it).style->writeStyle(xmlWriter, *this, autoStyleData[i].m_elementName, (*it).name,
autoStyleData[i].m_propertiesElementName, true, autoStyleData[i].m_drawElement);
}
......@@ -341,8 +341,8 @@ void KoGenStyles::saveOdfDocumentStyles(KoXmlWriter* xmlWriter) const
for (uint i = 0; i < numStyleData; ++i) {
QList<KoGenStyles::NamedStyle> stylesList = styles(int(styleData[i].m_type));
QList<KoGenStyles::NamedStyle>::const_iterator it = stylesList.begin();
for (; it != stylesList.end() ; ++it) {
QList<KoGenStyles::NamedStyle>::const_iterator it = stylesList.constBegin();
for (; it != stylesList.constEnd() ; ++it) {
(*it).style->writeStyle(xmlWriter, *this, styleData[i].m_elementName, (*it).name,
styleData[i].m_propertiesElementName, true, styleData[i].m_drawElement);
}
......@@ -356,8 +356,8 @@ void KoGenStyles::saveOdfMasterStyles(KoXmlWriter* xmlWriter) const
xmlWriter->startElement("office:master-styles");
QList<KoGenStyles::NamedStyle> stylesList = styles(KoGenStyle::StyleMaster);
QList<KoGenStyles::NamedStyle>::const_iterator it = stylesList.begin();
for (; it != stylesList.end() ; ++it) {
QList<KoGenStyles::NamedStyle>::const_iterator it = stylesList.constBegin();
for (; it != stylesList.constEnd() ; ++it) {
(*it).style->writeStyle(xmlWriter, *this, "style:master-page", (*it).name, 0);
}
......@@ -369,9 +369,9 @@ void KoGenStyles::saveOdfFontFaceDecls(KoXmlWriter* xmlWriter) const
if (!d->fontFaces.isEmpty()) {
xmlWriter->startElement("office:font-face-decls");
QSet<QString>::const_iterator it(d->fontFaces.begin());
QSet<QString>::const_iterator it(d->fontFaces.constBegin());
for (; it != d->fontFaces.end(); ++it) {
for (; it != d->fontFaces.constEnd(); ++it) {
xmlWriter->startElement("style:font-face");
xmlWriter->addAttribute("style:name", *it);
xmlWriter->addAttribute("svg:font-family", *it);
......
......@@ -186,8 +186,8 @@ void KoColor::dump() const
//dbgPigment <<"KoColor (" << this <<")," << d->colorSpace->id().name() <<"";
QList<KoChannelInfo *> channels = d->colorSpace->channels();
QList<KoChannelInfo *>::const_iterator begin = channels.begin();
QList<KoChannelInfo *>::const_iterator end = channels.end();
QList<KoChannelInfo *>::const_iterator begin = channels.constBegin();
QList<KoChannelInfo *>::const_iterator end = channels.constEnd();
for (QList<KoChannelInfo *>::const_iterator it = begin; it != end; ++it)
{
......
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