From 0427868992e01da3e410669c5859c1594326d057 Mon Sep 17 00:00:00 2001 From: Jan Hambrecht Date: Wed, 17 Dec 2008 23:40:40 +0000 Subject: [PATCH] SVN_SILENT krazy fixes svn path=/trunk/koffice/; revision=898329 --- libs/flake/KoDeviceRegistry.cpp | 4 ++-- libs/flake/KoShape.cpp | 10 +++++----- libs/flake/KoShapeFactory.cpp | 5 ++--- libs/flake/KoShapeRegistry.cpp | 2 +- libs/flake/KoSnapGuide.cpp | 6 +++--- libs/flake/KoSnapStrategy.cpp | 4 ++-- libs/flake/KoToolManager.cpp | 4 ++-- libs/flake/commands/KoPathPointMoveCommand.cpp | 2 +- 8 files changed, 18 insertions(+), 19 deletions(-) diff --git a/libs/flake/KoDeviceRegistry.cpp b/libs/flake/KoDeviceRegistry.cpp index ef30e18704..fc4e0b0181 100644 --- a/libs/flake/KoDeviceRegistry.cpp +++ b/libs/flake/KoDeviceRegistry.cpp @@ -35,7 +35,7 @@ void KoDeviceRegistry::init() KoPluginLoader::instance()->load(QString::fromLatin1("KOffice/Device"), QString::fromLatin1("[X-Flake-MinVersion] <= 0")); - foreach(QString id, keys()) { + foreach(const QString & id, keys()) { KoDevice * d = value(id); if (d) d->start(); @@ -44,7 +44,7 @@ void KoDeviceRegistry::init() KoDeviceRegistry::~KoDeviceRegistry() { - foreach(QString id, keys()) { + foreach(const QString & id, keys()) { KoDevice * d = value(id); if (d) d->stop(); diff --git a/libs/flake/KoShape.cpp b/libs/flake/KoShape.cpp index cbc8fb5952..e1318da8d1 100644 --- a/libs/flake/KoShape.cpp +++ b/libs/flake/KoShape.cpp @@ -437,8 +437,8 @@ void KoShape::copySettings(const KoShape *shape) { d->size = shape->size(); d->connectors.clear(); - foreach(QPointF point, shape->connectionPoints()) - addConnectionPoint(point); + foreach(const QPointF & point, shape->connectionPoints()) + addConnectionPoint(point); d->zIndex = shape->zIndex(); d->visible = shape->isVisible(); @@ -542,8 +542,8 @@ QList KoShape::connectionPoints() const QList points; QSizeF s = size(); // convert glue points to shape coordinates - foreach(QPointF cp, d->connectors) - points.append(QPointF(s.width() * cp.x(), s.height() * cp.y())); + foreach(const QPointF & cp, d->connectors) + points.append(QPointF(s.width() * cp.x(), s.height() * cp.y())); return points; } @@ -874,7 +874,7 @@ bool KoShape::loadOdfAttributes(const KoXmlElement & element, KoShapeLoadingCont if (attributes & OdfAdditionalAttributes) { QSet additionalAttributeData = KoShapeLoadingContext::additionalAttributeData(); - foreach(KoShapeLoadingContext::AdditionalAttributeData attributeData, additionalAttributeData) { + foreach(const KoShapeLoadingContext::AdditionalAttributeData & attributeData, additionalAttributeData) { if (element.hasAttributeNS(attributeData.ns, attributeData.tag)) { QString value = element.attributeNS(attributeData.ns, attributeData.tag); //kDebug(30006) << "load additional attribute" << attributeData.tag << value; diff --git a/libs/flake/KoShapeFactory.cpp b/libs/flake/KoShapeFactory.cpp index 0834d93484..ca9f6ccc43 100644 --- a/libs/flake/KoShapeFactory.cpp +++ b/libs/flake/KoShapeFactory.cpp @@ -36,8 +36,8 @@ public: } ~Private() { - foreach(KoShapeTemplate t, templates) - delete t.properties; + foreach(const KoShapeTemplate & t, templates) + delete t.properties; templates.clear(); } @@ -51,7 +51,6 @@ public: quint32 loadingPriority; QString odfNameSpace; QStringList odfElementNames; - }; diff --git a/libs/flake/KoShapeRegistry.cpp b/libs/flake/KoShapeRegistry.cpp index 53364ea090..5b5e0a64c3 100644 --- a/libs/flake/KoShapeRegistry.cpp +++ b/libs/flake/KoShapeRegistry.cpp @@ -107,7 +107,7 @@ void KoShapeRegistry::insertFactory(KoShapeFactory * factory) if (factory->odfNameSpace().isEmpty() || factory->odfElementNames().isEmpty()) { kDebug(30006) << "Shape factory" << factory->id() << " does not have OdfNamespace defined, ignoring"; } else { - foreach(QString elementName, factory->odfElementNames()) { + foreach(const QString & elementName, factory->odfElementNames()) { QPair p(factory->odfNameSpace(), elementName); diff --git a/libs/flake/KoSnapGuide.cpp b/libs/flake/KoSnapGuide.cpp index 821b5458e4..be2c724694 100644 --- a/libs/flake/KoSnapGuide.cpp +++ b/libs/flake/KoSnapGuide.cpp @@ -202,7 +202,7 @@ QList KoSnapProxy::pointsInRect(const QRectF &rect) QList points; QList shapes = shapesInRect(rect); foreach(KoShape * shape, shapes) { - foreach(QPointF point, pointsFromShape(shape)) { + foreach(const QPointF & point, pointsFromShape(shape)) { if (rect.contains(point)) points.append(point); } @@ -284,7 +284,7 @@ QList KoSnapProxy::segmentsInRect(const QRectF &rect) if (path) { shapeSegments = path->segmentsAt(rectOnShape); } else { - foreach(KoPathSegment s, shape->snapData().snapSegments()) { + foreach(const KoPathSegment & s, shape->snapData().snapSegments()) { QRectF controlRect = s.controlPointRect(); if (! rect.intersects(controlRect) && ! controlRect.contains(rect)) continue; @@ -297,7 +297,7 @@ QList KoSnapProxy::segmentsInRect(const QRectF &rect) QMatrix m = shape->absoluteTransformation(0); // transform segments to document coordinates - foreach(KoPathSegment s, shapeSegments) { + foreach(const KoPathSegment & s, shapeSegments) { if (ignoredPoints.contains(s.first()) || ignoredPoints.contains(s.second())) continue; segments.append(s.mapped(m)); diff --git a/libs/flake/KoSnapStrategy.cpp b/libs/flake/KoSnapStrategy.cpp index 2ae58bfc25..1d49cbd4a6 100644 --- a/libs/flake/KoSnapStrategy.cpp +++ b/libs/flake/KoSnapStrategy.cpp @@ -77,7 +77,7 @@ bool OrthogonalSnapStrategy::snap(const QPointF &mousePosition, KoSnapProxy * pr QList shapes = proxy->shapes(); foreach(KoShape * shape, shapes) { QList points = proxy->pointsFromShape(shape); - foreach(QPointF point, points) { + foreach(const QPointF & point, points) { qreal dx = fabs(point.x() - mousePosition.x()); if (dx < minHorzDist && dx < maxSnapDistance) { minHorzDist = dx; @@ -145,7 +145,7 @@ bool NodeSnapStrategy::snap(const QPointF &mousePosition, KoSnapProxy * proxy, q QPointF snappedPoint = mousePosition; - foreach(QPointF point, points) { + foreach(const QPointF & point, points) { qreal distance = fastDistance(mousePosition, point); if (distance < maxDistance && distance < minDistance) { snappedPoint = point; diff --git a/libs/flake/KoToolManager.cpp b/libs/flake/KoToolManager.cpp index 054d151abf..76d3aee87e 100644 --- a/libs/flake/KoToolManager.cpp +++ b/libs/flake/KoToolManager.cpp @@ -181,7 +181,7 @@ void KoToolManager::setup() KoShapeRegistry::instance(); KoToolRegistry *registry = KoToolRegistry::instance(); - foreach(QString id, registry->keys()) { + foreach(const QString & id, registry->keys()) { ToolHelper *t = new ToolHelper(registry->value(id)); d->tools.append(t); } @@ -244,7 +244,7 @@ void KoToolManager::registerTools(KActionCollection *ac, KoCanvasController *con CanvasData *cd = d->canvasses.value(controller).first(); foreach(KoTool *tool, cd->allTools) { QHash actions = tool->actions(); - foreach(QString name, actions.keys()) + foreach(const QString & name, actions.keys()) ac->addAction(name, actions[name]); } } diff --git a/libs/flake/commands/KoPathPointMoveCommand.cpp b/libs/flake/commands/KoPathPointMoveCommand.cpp index c65fc90e07..0ac868253a 100644 --- a/libs/flake/commands/KoPathPointMoveCommand.cpp +++ b/libs/flake/commands/KoPathPointMoveCommand.cpp @@ -69,7 +69,7 @@ void KoPathPointMoveCommand::applyOffset( const QPointF &offset ) // repaint old bounding rect path->update(); - foreach(const KoPathPointIndex index, it.value()) { + foreach(const KoPathPointIndex & index, it.value()) { KoPathPoint * p = path->pointByIndex(index); if ( p ) p->map(matrix, true); -- GitLab