From 32be26beeff03b1fc2619810bc0100720d925316 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 27 Sep 2021 11:47:09 +0300 Subject: [PATCH] GCC warnings. --- src/app/puzzle/layout/vpsheet.cpp | 5 +++++ src/app/puzzle/scene/vpgraphicspiececontrols.cpp | 5 +++++ src/app/puzzle/undocommands/vpundomovepieceonsheet.cpp | 5 +++++ src/app/puzzle/vpmainwindow.cpp | 6 ++++++ src/app/puzzle/xml/vplayoutfilereader.cpp | 10 ++++++++++ 5 files changed, 31 insertions(+) diff --git a/src/app/puzzle/layout/vpsheet.cpp b/src/app/puzzle/layout/vpsheet.cpp index 907faea35..ba6b9ad22 100644 --- a/src/app/puzzle/layout/vpsheet.cpp +++ b/src/app/puzzle/layout/vpsheet.cpp @@ -467,10 +467,15 @@ void VPSheet::SetTransformationOrigin(const VPTransformationOrigon &newTransform //--------------------------------------------------------------------------------------------------------------------- void VPSheet::Clear() { + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wnoexcept") + m_name.clear(); m_visible = true; m_transformationOrigin = VPTransformationOrigon(); m_trashSheet = false; + + QT_WARNING_POP } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp index 37c669b9e..684686e92 100644 --- a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp +++ b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp @@ -80,10 +80,15 @@ auto TransformationOrigin(const VPLayoutPtr &layout, const QRectF &boundingRect) return sheet->TransformationOrigin(); } + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wnoexcept") + VPTransformationOrigon origin; origin.origin = boundingRect.center(); origin.custom = false; + QT_WARNING_POP + return origin; } } // namespace diff --git a/src/app/puzzle/undocommands/vpundomovepieceonsheet.cpp b/src/app/puzzle/undocommands/vpundomovepieceonsheet.cpp index 009654ca4..85c2159f4 100644 --- a/src/app/puzzle/undocommands/vpundomovepieceonsheet.cpp +++ b/src/app/puzzle/undocommands/vpundomovepieceonsheet.cpp @@ -118,9 +118,14 @@ void VPUndoMovePieceOnSheet::redo() if (m_followGrainline) { + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wnoexcept") + VPTransformationOrigon origin; origin.custom = true; + QT_WARNING_POP + piece->RotateToGrainline(origin); } diff --git a/src/app/puzzle/vpmainwindow.cpp b/src/app/puzzle/vpmainwindow.cpp index 8d8c708eb..a9a14014f 100644 --- a/src/app/puzzle/vpmainwindow.cpp +++ b/src/app/puzzle/vpmainwindow.cpp @@ -2191,8 +2191,14 @@ void VPMainWindow::RotatePiecesToGrainline() { if (not piece.isNull() && piece->IsGrainlineEnabled()) { + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wnoexcept") + VPTransformationOrigon origin; origin.custom = true; + + QT_WARNING_POP + piece->RotateToGrainline(origin); emit m_layout->PieceTransformationChanged(piece); } diff --git a/src/app/puzzle/xml/vplayoutfilereader.cpp b/src/app/puzzle/xml/vplayoutfilereader.cpp index fc3abd790..21e1cc1ca 100644 --- a/src/app/puzzle/xml/vplayoutfilereader.cpp +++ b/src/app/puzzle/xml/vplayoutfilereader.cpp @@ -600,6 +600,9 @@ auto VPLayoutFileReader::ReadNotch() -> VLayoutPassmark QXmlStreamAttributes attribs = attributes(); + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wnoexcept") + VLayoutPassmark passmark; passmark.isBuiltIn = ReadAttributeBool(attribs, ML::AttrBuiltIn, falseStr); passmark.baseLine = StringToLine(ReadAttributeEmptyString(attribs, ML::AttrBaseLine)); @@ -608,6 +611,8 @@ auto VPLayoutFileReader::ReadNotch() -> VLayoutPassmark QString defaultType = QString::number(static_cast(PassmarkLineType::OneLine)); passmark.type = static_cast(ReadAttributeUInt(attribs, ML::AttrType, defaultType)); + QT_WARNING_POP + readElementText(); return passmark; @@ -686,6 +691,9 @@ auto VPLayoutFileReader::ReadMarker() -> VLayoutPlaceLabel { AssertRootTag(ML::TagMarker); + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wnoexcept") + VLayoutPlaceLabel marker; QXmlStreamAttributes attribs = attributes(); @@ -705,6 +713,8 @@ auto VPLayoutFileReader::ReadMarker() -> VLayoutPlaceLabel marker.shape = shape; + QT_WARNING_POP + return marker; }