From fdb875e20561a72c44e4b9d5a762493f388730d3 Mon Sep 17 00:00:00 2001 From: Joachim Schmitz Date: Wed, 2 Oct 2024 10:23:48 +0200 Subject: [PATCH] Fix GH#24998: cannot use shortcut (show-corrupted-measures) --- src/engraving/dom/check.cpp | 8 -------- src/engraving/dom/measure.h | 6 ------ src/engraving/iengravingconfiguration.h | 2 -- src/engraving/rendering/score/debugpaint.cpp | 2 -- 4 files changed, 18 deletions(-) diff --git a/src/engraving/dom/check.cpp b/src/engraving/dom/check.cpp index 04f54fcdf8938..b38345c9591ba 100644 --- a/src/engraving/dom/check.cpp +++ b/src/engraving/dom/check.cpp @@ -158,9 +158,7 @@ Ret Score::sanityCheckLocal() Rest* fmrest0 = nullptr; // full measure rest in voice 0 Fraction voices[VOICES]; -#ifndef NDEBUG m->setCorrupted(staffIdx, false); -#endif for (Segment* s = m->first(SegmentType::ChordRest); s; s = s->next(SegmentType::ChordRest)) { for (voice_idx_t v = 0; v < VOICES; ++v) { @@ -190,18 +188,14 @@ Ret Score::sanityCheckLocal() if (!repeatsIsValid) { errors << muse::mtrc("engraving", "Corrupted measure: %1, measure %2, staff %3.") .arg(excerptInfo()).arg(mNumber).arg(staffIdx + 1); -#ifndef NDEBUG m->setCorrupted(staffIdx, true); -#endif } if (voices[0] != mLen) { //: %1 describes in which score the corruption is (either `Full score` or `"[part name]" part score`) errors << muse::mtrc("engraving", "Incomplete measure: %1, measure %2, staff %3. Found: %4. Expected: %5.") .arg(excerptInfo()).arg(mNumber).arg(staffIdx + 1).arg(voices[0].toString(), mLen.toString()); -#ifndef NDEBUG m->setCorrupted(staffIdx, true); -#endif // try to fix a bad full measure rest if (fmrest0) { // fmrest0->setDuration(mLen * fmrest0->staff()->timeStretch(fmrest0->tick())); @@ -214,9 +208,7 @@ Ret Score::sanityCheckLocal() //: %1 describes in which score the corruption is (either `Full score` or `"[part name]" part score`) errors << muse::mtrc("engraving", "Voice too long: %1, measure %2, staff %3, voice %4. Found: %5. Expected: %6.") .arg(excerptInfo()).arg(mNumber).arg(staffIdx + 1).arg(v + 1).arg(voices[v].toString(), mLen.toString()); -#ifndef NDEBUG m->setCorrupted(staffIdx, true); -#endif } } } diff --git a/src/engraving/dom/measure.h b/src/engraving/dom/measure.h index a469f135dd982..40a1f5ca2dfab 100644 --- a/src/engraving/dom/measure.h +++ b/src/engraving/dom/measure.h @@ -107,10 +107,8 @@ class MStaff bool stemless() const { return m_stemless; } void setStemless(bool val) { m_stemless = val; } -#ifndef NDEBUG bool corrupted() const { return m_corrupted; } void setCorrupted(bool val) { m_corrupted = val; } -#endif int measureRepeatCount() const { return m_measureRepeatCount; } void setMeasureRepeatCount(int n) { m_measureRepeatCount = n; } @@ -125,9 +123,7 @@ class MStaff // this changes some layout rules bool m_visible = true; bool m_stemless = false; -#ifndef NDEBUG bool m_corrupted = false; -#endif int m_measureRepeatCount = 0; }; @@ -176,10 +172,8 @@ class Measure final : public MeasureBase Spacer* vspacerUp(staff_idx_t staffIdx) const; void setStaffVisible(staff_idx_t staffIdx, bool visible); void setStaffStemless(staff_idx_t staffIdx, bool stemless); -#ifndef NDEBUG bool corrupted(staff_idx_t staffIdx) const { return m_mstaves[staffIdx]->corrupted(); } void setCorrupted(staff_idx_t staffIdx, bool val) { m_mstaves[staffIdx]->setCorrupted(val); } -#endif MeasureNumber* noText(staff_idx_t staffIdx) const { return m_mstaves[staffIdx]->noText(); } void setNoText(staff_idx_t staffIdx, MeasureNumber* t) { m_mstaves[staffIdx]->setNoText(t); } diff --git a/src/engraving/iengravingconfiguration.h b/src/engraving/iengravingconfiguration.h index 986673444ba72..88d190dde0745 100644 --- a/src/engraving/iengravingconfiguration.h +++ b/src/engraving/iengravingconfiguration.h @@ -103,9 +103,7 @@ class IEngravingConfiguration : MODULE_EXPORT_INTERFACE || colorSegmentShapes || showSkylines || showSystemBoundingRects -#ifndef NDEBUG || showCorruptedMeasures -#endif ; } }; diff --git a/src/engraving/rendering/score/debugpaint.cpp b/src/engraving/rendering/score/debugpaint.cpp index a0a9ed4426b69..851b580262c9b 100644 --- a/src/engraving/rendering/score/debugpaint.cpp +++ b/src/engraving/rendering/score/debugpaint.cpp @@ -234,7 +234,6 @@ void DebugPaint::paintPageDebug(Painter& painter, const Page* page, const std::v } } -#ifndef NDEBUG if (options.showCorruptedMeasures) { painter.setPen(Pen(Color::RED, 4.0)); painter.setBrush(BrushStyle::NoBrush); @@ -256,7 +255,6 @@ void DebugPaint::paintPageDebug(Painter& painter, const Page* page, const std::v } } } -#endif painter.restore(); }