From a4e01d514ba2f01648dbc3027d4d23b2d39fbd20 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 23 Apr 2020 15:42:36 +0300 Subject: [PATCH] More issues with code style. --- src/app/puzzle/vpuzzlelayout.cpp | 9 ++++----- src/app/puzzle/xml/vpuzzlelayoutfilereader.cpp | 18 ++++++++++++------ src/app/puzzle/xml/vpuzzlelayoutfilewriter.cpp | 6 ++++-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/app/puzzle/vpuzzlelayout.cpp b/src/app/puzzle/vpuzzlelayout.cpp index 3db914201..d11f49f65 100644 --- a/src/app/puzzle/vpuzzlelayout.cpp +++ b/src/app/puzzle/vpuzzlelayout.cpp @@ -91,8 +91,8 @@ void VPuzzleLayout::SetLayoutSize(qreal width, qreal height) //--------------------------------------------------------------------------------------------------------------------- void VPuzzleLayout::SetLayoutSizeConverted(qreal width, qreal height) { - m_size.setWidth(UnitConvertor(width, m_unit,Unit::Px)); - m_size.setHeight(UnitConvertor(height, m_unit,Unit::Px)); + m_size.setWidth(UnitConvertor(width, m_unit, Unit::Px)); + m_size.setHeight(UnitConvertor(height, m_unit, Unit::Px)); } //--------------------------------------------------------------------------------------------------------------------- @@ -105,8 +105,8 @@ void VPuzzleLayout::SetLayoutSize(const QSizeF &size) void VPuzzleLayout::SetLayoutSizeConverted(const QSizeF &size) { m_size = QSizeF( - UnitConvertor(size.width(), m_unit,Unit::Px), - UnitConvertor(size.height(), m_unit,Unit::Px) + UnitConvertor(size.width(), m_unit, Unit::Px), + UnitConvertor(size.height(), m_unit, Unit::Px) ); } @@ -204,7 +204,6 @@ qreal VPuzzleLayout::GetPiecesGapConverted() const return UnitConvertor(m_piecesGap, Unit::Px, m_unit); } - //--------------------------------------------------------------------------------------------------------------------- void VPuzzleLayout::SetWarningSuperpositionOfPieces(bool state) { diff --git a/src/app/puzzle/xml/vpuzzlelayoutfilereader.cpp b/src/app/puzzle/xml/vpuzzlelayoutfilereader.cpp index bc650617f..5dbbca4c9 100644 --- a/src/app/puzzle/xml/vpuzzlelayoutfilereader.cpp +++ b/src/app/puzzle/xml/vpuzzlelayoutfilereader.cpp @@ -84,7 +84,8 @@ void VPuzzleLayoutFileReader::ReadLayout(VPuzzleLayout *layout) { Q_ASSERT(isStartElement() && name() == QString("layout")); - while (readNextStartElement()) { + while (readNextStartElement()) + { if (name() == QString("properties")) { ReadProperties(layout); @@ -105,7 +106,8 @@ void VPuzzleLayoutFileReader::ReadProperties(VPuzzleLayout *layout) { Q_ASSERT(isStartElement() && name() == QString("properties")); - while (readNextStartElement()) { + while (readNextStartElement()) + { qDebug(name().toString().toLatin1()); if (name() == QString("unit")) @@ -185,7 +187,8 @@ void VPuzzleLayoutFileReader::ReadTiles(VPuzzleLayout *layout) // attribs.value("visible"); // TODO // attribs.value("matchingMarks"); // TODO - while (readNextStartElement()) { + while (readNextStartElement()) + { if (name() == QString("size")) { QSizeF size = ReadSize(); @@ -213,7 +216,8 @@ void VPuzzleLayoutFileReader::ReadLayers(VPuzzleLayout *layout) { Q_ASSERT(isStartElement() && name() == QString("layers")); - while (readNextStartElement()) { + while (readNextStartElement()) + { if (name() == QString("unplacedPiecesLayer")) { ReadLayer(layout->GetUnplacedPiecesLayer()); @@ -240,7 +244,8 @@ void VPuzzleLayoutFileReader::ReadLayer(VPuzzleLayer *layer) layer->SetName(attribs.value("name").toString()); layer->SetIsVisible(attribs.value("visible") == "true"); - while (readNextStartElement()) { + while (readNextStartElement()) + { if (name() == QString("piece")) { VPuzzlePiece *piece = new VPuzzlePiece(); @@ -263,7 +268,8 @@ void VPuzzleLayoutFileReader::ReadPiece(VPuzzlePiece *piece) // TODO read the attributes - while (readNextStartElement()) { + while (readNextStartElement()) + { if (name() == QString("...")) { // TODO diff --git a/src/app/puzzle/xml/vpuzzlelayoutfilewriter.cpp b/src/app/puzzle/xml/vpuzzlelayoutfilewriter.cpp index 23549dc55..fbe03d183 100644 --- a/src/app/puzzle/xml/vpuzzlelayoutfilewriter.cpp +++ b/src/app/puzzle/xml/vpuzzlelayoutfilewriter.cpp @@ -195,12 +195,14 @@ void VPuzzleLayoutFileWriter::WriteSize(QSizeF size) { // maybe not necessary to test this, the writer should "stupidly write", the application should take care of these tests qreal width = size.width(); - if(width < 0) { + if(width < 0) + { width = 0; } qreal length = size.height(); - if(length < 0) { + if(length < 0) + { length = 0; }