diff --git a/src/container/vcontainer.cpp b/src/container/vcontainer.cpp index a3319346c..d78ca5b30 100644 --- a/src/container/vcontainer.cpp +++ b/src/container/vcontainer.cpp @@ -218,20 +218,20 @@ void VContainer::UpdateId(qint64 newId) QVector VContainer::CorrectEquidistantPoints(const QVector &points) { QVector correctPoints; - if(points.size()<4)//Better don't check if only three points. We can destroy equidistant. + if (points.size()<4)//Better don't check if only three points. We can destroy equidistant. { qWarning()<<"Only three points."; return points; } //Clear equivalent points - for(qint32 i = 0; i VContainer::CorrectEquidistantPoints(const QVector &po correctPoints.append(points.at(i)); } } - if(correctPoints.size()<3) + if (correctPoints.size()<3) { return correctPoints; } //Remove point on line QPointF point; - for(qint32 i = 1; i lineEditNamePoint->setText(pointName); } - diff --git a/src/dialogs/dialogcutarc.h b/src/dialogs/dialogcutarc.h index eaaad7012..0baf2dcbc 100644 --- a/src/dialogs/dialogcutarc.h +++ b/src/dialogs/dialogcutarc.h @@ -31,8 +31,9 @@ #include "dialogtool.h" -namespace Ui { -class DialogCutArc; +namespace Ui +{ + class DialogCutArc; } /** diff --git a/src/geometry/varc.cpp b/src/geometry/varc.cpp index cdb83f0f9..af91b0396 100644 --- a/src/geometry/varc.cpp +++ b/src/geometry/varc.cpp @@ -129,14 +129,13 @@ QVector VArc::GetPoints() const line.setAngle(line.angle()+i); points.append(line.p2()); i = i + s; - if(i > angle) + if (i > angle) { QLineF line(center.toQPointF(), GetP1()); line.setAngle(line.angle()+angle); points.append(line.p2()); } - } - while(i <= angle); + } while (i <= angle); return points; } diff --git a/src/geometry/vdetail.cpp b/src/geometry/vdetail.cpp index 61b112d47..d5e089ffb 100644 --- a/src/geometry/vdetail.cpp +++ b/src/geometry/vdetail.cpp @@ -113,7 +113,7 @@ void VDetail::setId(const qint64 &id) bool VDetail::OnEdge(const qint64 &p1, const qint64 &p2) const { QVector list = listNodePoint(); - if(list.size() < 3) + if (list.size() < 3) { qWarning()<<"Not enough points."; return false; @@ -198,9 +198,9 @@ VDetail VDetail::RemoveEdge(const ptrdiff_t &index) const QVector list = this->listNodePoint(); qint32 edge = list.size(); ptrdiff_t k = 0; - for(ptrdiff_t i=0; iat(k)); ++k; @@ -212,17 +212,17 @@ VDetail VDetail::RemoveEdge(const ptrdiff_t &index) const this->NodeOnEdge(i, p1, p2); ptrdiff_t j1 = this->indexOfNode(p1.getId()); ptrdiff_t j2 = this->indexOfNode(p2.getId()); - if(j2 == 0) + if (j2 == 0) { j2 = this->CountNode()-1; - if(j1 == j2) + if (j1 == j2) { det.append(this->at(j1)); ++k; continue; } } - for(ptrdiff_t j=j1; jat(j)); ++k; @@ -235,15 +235,15 @@ VDetail VDetail::RemoveEdge(const ptrdiff_t &index) const QList VDetail::Missing(const VDetail &det) const { QList list; - if(nodes.size() == det.CountNode()) + if (nodes.size() == det.CountNode()) { return list; } qint32 j = 0; - for(qint32 i = 0; i < nodes.size(); ++i) + for (qint32 i = 0; i < nodes.size(); ++i) { - if(nodes[i].getId() == det.at(j).getId()) + if (nodes[i].getId() == det.at(j).getId()) { ++j; } diff --git a/src/geometry/vsplinepath.cpp b/src/geometry/vsplinepath.cpp index 18c525373..db8c401b3 100644 --- a/src/geometry/vsplinepath.cpp +++ b/src/geometry/vsplinepath.cpp @@ -212,4 +212,3 @@ void VSplinePath::setMaxCountPoints(const qint32 &value) { maxCountPoints = value; } - diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e2d5fd966..47a15daa6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -93,7 +93,8 @@ MainWindow::MainWindow(QWidget *parent) { ui->setupUi(this); static const char * GENERIC_ICON_TO_CHECK = "document-open"; - if (!QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK)) { + if (QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK) == false) + { //If there is no default working icon theme then we should //use an icon theme that we provide via a .qrc file //This case happens under Windows and Mac OS X @@ -728,7 +729,7 @@ void MainWindow::currentDrawChanged( int index ) { doc->setCurrentData(); doc->ChangeActivDraw(comboBoxDraws->itemText(index)); - if(drawMode) + if (drawMode) { ArrowTool(); qint64 id = doc->SPointActiveDraw(); @@ -1241,7 +1242,7 @@ bool MainWindow::ValidatePattern(const QString &schema, const QString &fileName, errorColumn = -1; return false; } - if(schema.isEmpty()) + if (schema.isEmpty()) { errorMsg = QString(tr("Empty schema path.")); errorLine = -1; @@ -1249,7 +1250,7 @@ bool MainWindow::ValidatePattern(const QString &schema, const QString &fileName, return false; } QFile fileSchema(schema); - if(fileSchema.open(QIODevice::ReadOnly) == false) + if (fileSchema.open(QIODevice::ReadOnly) == false) { errorMsg = QString(tr("Can't open schema file.")); errorLine = -1; @@ -1263,14 +1264,14 @@ bool MainWindow::ValidatePattern(const QString &schema, const QString &fileName, sch.load(&fileSchema, QUrl::fromLocalFile(fileSchema.fileName())); bool errorOccurred = false; - if (!sch.isValid()) + if (sch.isValid() == false) { errorOccurred = true; } else { QXmlSchemaValidator validator(sch); - if (!validator.validate(&pattern, QUrl::fromLocalFile(pattern.fileName()))) + if (validator.validate(&pattern, QUrl::fromLocalFile(pattern.fileName())) == false) { errorOccurred = true; } @@ -1400,7 +1401,7 @@ void MainWindow::OpenPattern(const QString &fileName) qint64 errorColumn = 0; if (file.open(QIODevice::ReadOnly)) { - if(ValidatePattern("://schema/pattern.xsd", fileName, errorMsg, errorLine, errorColumn)) + if (ValidatePattern("://schema/pattern.xsd", fileName, errorMsg, errorLine, errorColumn)) { qint32 errorLine = 0; qint32 errorColumn = 0; diff --git a/src/tablewindow.cpp b/src/tablewindow.cpp index 3add1bef2..8c3ff9fa1 100644 --- a/src/tablewindow.cpp +++ b/src/tablewindow.cpp @@ -174,7 +174,9 @@ void TableWindow::saveScene() i.next(); saveMessage += i.key(); if (i.hasNext()) + { saveMessage += ";;"; + } } QString sf; @@ -446,8 +448,9 @@ void TableWindow::PdfFile(const QString &name) const printer.setResolution(PrintDPI); printer.setPaperSize ( QSizeF(toMM(w), toMM(h)), QPrinter::Millimeter ); QPainter painter; - if (! painter.begin( &printer )) { // failed to open file - qCritical("Can't open printer %s",qPrintable(name)); + if (painter.begin( &printer ) == false) + { // failed to open file + qCritical("Can't open printer %s", qPrintable(name)); return; } painter.setFont( QFont( "Arial", 8, QFont::Normal ) ); diff --git a/src/tools/drawTools/vtoolalongline.h b/src/tools/drawTools/vtoolalongline.h index 49829c133..4c62d27bb 100644 --- a/src/tools/drawTools/vtoolalongline.h +++ b/src/tools/drawTools/vtoolalongline.h @@ -113,7 +113,7 @@ protected: * @brief contextMenuEvent handle context menu events. handle context menu event. * @param event context menu event. */ - virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); + virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ); /** * @brief AddToFile add tag with informations about tool into file. */ diff --git a/src/tools/drawTools/vtoolpoint.cpp b/src/tools/drawTools/vtoolpoint.cpp index 0e2efcde6..0f33e5bd9 100644 --- a/src/tools/drawTools/vtoolpoint.cpp +++ b/src/tools/drawTools/vtoolpoint.cpp @@ -159,7 +159,7 @@ void VToolPoint::RefreshLine() LineIntersectCircle(QPointF(), radius/factor, QLineF(QPointF(), nameRec.center()- scenePos()), p1, p2); QPointF pRec = LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); lineName->setLine(QLineF(p1, pRec - scenePos())); - if(currentColor == Qt::gray) + if (currentColor == Qt::gray) { lineName->setPen(QPen(currentColor, widthHairLine/factor)); } diff --git a/src/tools/drawTools/vtoolspline.h b/src/tools/drawTools/vtoolspline.h index fbb918ba8..db1dac16a 100644 --- a/src/tools/drawTools/vtoolspline.h +++ b/src/tools/drawTools/vtoolspline.h @@ -95,8 +95,8 @@ signals: * @param controlPoint new position control point. * @param splinePoint new position spline point. */ - void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, const QPointF &controlPoint, - const QPointF &splinePoint ); + void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, + const QPointF &controlPoint, const QPointF &splinePoint ); /** * @brief setEnabledPoint disable control points. * @param enable enable or diasable points. diff --git a/src/tools/nodeDetails/vnodearc.cpp b/src/tools/nodeDetails/vnodearc.cpp index c2375e625..8eeb63a37 100644 --- a/src/tools/nodeDetails/vnodearc.cpp +++ b/src/tools/nodeDetails/vnodearc.cpp @@ -59,7 +59,7 @@ void VNodeArc::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idA VNodeArc *arc = new VNodeArc(doc, data, id, idArc, typeCreation, idTool, parent); Q_ASSERT(arc != 0); doc->AddTool(id, arc); - if(idTool != 0) + if (idTool != 0) { doc->IncrementReferens(idTool); //Some nodes we don't show on scene. Tool that create this nodes must free memory. diff --git a/src/tools/nodeDetails/vnodepoint.cpp b/src/tools/nodeDetails/vnodepoint.cpp index f28b82e96..63946d64f 100644 --- a/src/tools/nodeDetails/vnodepoint.cpp +++ b/src/tools/nodeDetails/vnodepoint.cpp @@ -70,7 +70,7 @@ void VNodePoint::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 i VNodePoint *point = new VNodePoint(doc, data, id, idPoint, typeCreation, idTool, parent); Q_ASSERT(point != 0); doc->AddTool(id, point); - if(idTool != 0) + if (idTool != 0) { doc->IncrementReferens(idTool); //Some nodes we don't show on scene. Tool that create this nodes must free memory. diff --git a/src/tools/nodeDetails/vnodespline.cpp b/src/tools/nodeDetails/vnodespline.cpp index 2746cd11e..51687667a 100644 --- a/src/tools/nodeDetails/vnodespline.cpp +++ b/src/tools/nodeDetails/vnodespline.cpp @@ -61,7 +61,7 @@ VNodeSpline *VNodeSpline::Create(VDomDocument *doc, VContainer *data, qint64 id, { spl = new VNodeSpline(doc, data, id, idSpline, typeCreation, idTool, parent); doc->AddTool(id, spl); - if(idTool != 0) + if (idTool != 0) { doc->IncrementReferens(idTool); //Some nodes we don't show on scene. Tool that create this nodes must free memory. diff --git a/src/tools/nodeDetails/vnodesplinepath.cpp b/src/tools/nodeDetails/vnodesplinepath.cpp index 58c998da9..06a801413 100644 --- a/src/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/tools/nodeDetails/vnodesplinepath.cpp @@ -65,7 +65,7 @@ void VNodeSplinePath::Create(VDomDocument *doc, VContainer *data, qint64 id, qin const QVector *points = path->GetPoint(); for (qint32 i = 0; isize(); ++i) { - if(idTool != 0) + if (idTool != 0) { doc->IncrementReferens(idTool); //Some nodes we don't show on scene. Tool that create this nodes must free memory. diff --git a/src/tools/vabstracttool.cpp b/src/tools/vabstracttool.cpp index 3b4d41b43..26af3c6c8 100644 --- a/src/tools/vabstracttool.cpp +++ b/src/tools/vabstracttool.cpp @@ -84,7 +84,7 @@ void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view) QTransform t = view->transform(); QRectF rec1; - if(t.m11() < 1) + if (t.m11() < 1) { rec1 = QRect(0, 0, rec0.width()/t.m11(), rec0.height()/t.m22()); @@ -227,7 +227,7 @@ void VAbstractTool::DeleteTool(QGraphicsItem *tool) RemoveReferens();//deincrement referens element.removeChild(domElement);//remove form file QGraphicsScene *scene = tool->scene(); - if(scene != 0)//some tools haven't scene + if (scene != 0)//some tools haven't scene { scene->removeItem(tool);//remove form scene } diff --git a/src/tools/vtooldetail.cpp b/src/tools/vtooldetail.cpp index d96629519..0a8632066 100644 --- a/src/tools/vtooldetail.cpp +++ b/src/tools/vtooldetail.cpp @@ -188,9 +188,9 @@ void VToolDetail::FullUpdateFromGui(int result) VDetail detail = VAbstractTool::data.GetDetail(id); QList list = detail.Missing(det); QHash* tools = doc->getTools(); - if(list.size()>0) + if (list.size()>0) { - for(qint32 i = 0; i < list.size(); ++i) + for (qint32 i = 0; i < list.size(); ++i) { VAbstractNode *node = qobject_cast(tools->value(list[i])); node->DeleteNode(); diff --git a/src/tools/vtooldetail.h b/src/tools/vtooldetail.h index 51a291393..51d1ac78f 100644 --- a/src/tools/vtooldetail.h +++ b/src/tools/vtooldetail.h @@ -93,7 +93,7 @@ public: */ static void Create(const qint64 &_id, const VDetail &newDetail, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, const Document::Documents &parse, - const Tool::Sources &typeCreation); + const Tool::Sources &typeCreation); static const QString TagName; static const QString TagNode; static const QString AttrSupplement; diff --git a/src/tools/vtooluniondetails.cpp b/src/tools/vtooluniondetails.cpp index 570fa8caf..550fd3708 100644 --- a/src/tools/vtooluniondetails.cpp +++ b/src/tools/vtooluniondetails.cpp @@ -213,7 +213,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VDomDocument *doc, VContai path->append(VSplinePoint(*p4, splinePath->at(i).KAsm1(), spl.GetAngle2()+180, splinePath->at(i).KAsm2())); } - while(k>=0) + while (k>=0) { data->getNextId(); --k; @@ -371,7 +371,7 @@ void VToolUnionDetails::UpdatePoints(const qint64 &idDetail, VContainer *data, c splinePath->at(i).KAsm2())); } - while(k>=0) + while (k>=0) { data->getNextId(); --k; @@ -522,7 +522,7 @@ void VToolUnionDetails::Create(const qint64 _id, const VDetail &d1, const VDetai ++j; } while (pointsD2 < nD2); } - }while(i(sender()); Q_ASSERT(spinBox != 0); qreal value = spinBox->value(); - if(qFuzzyCompare ( lastValue, value ) == false) + if (qFuzzyCompare ( lastValue, value ) == false) { lastValue = value; emit commitData(spinBox); diff --git a/src/xml/vdomdocument.cpp b/src/xml/vdomdocument.cpp index 1d86ad8d2..2ba893dab 100644 --- a/src/xml/vdomdocument.cpp +++ b/src/xml/vdomdocument.cpp @@ -1428,7 +1428,7 @@ void VDomDocument::DecrementReferens(qint64 id) const { Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0"); VDataTool *tool = tools.value(id); - if(tool != 0) + if (tool != 0) { tool->decrementReferens(); }