Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GH#24998: cannot use shortcut (show-corrupted-measures) #25011

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/engraving/dom/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -190,18 +188,14 @@ Ret Score::sanityCheckLocal()
if (!repeatsIsValid) {
errors << muse::mtrc("engraving", "<b>Corrupted measure</b>: %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", "<b>Incomplete measure</b>: %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()));
Expand All @@ -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", "<b>Voice too long</b>: %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
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions src/engraving/dom/measure.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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;
};

Expand Down Expand Up @@ -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); }

Expand Down
2 changes: 0 additions & 2 deletions src/engraving/iengravingconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ class IEngravingConfiguration : MODULE_EXPORT_INTERFACE
|| colorSegmentShapes
|| showSkylines
|| showSystemBoundingRects
#ifndef NDEBUG
|| showCorruptedMeasures
#endif
;
}
};
Expand Down
2 changes: 0 additions & 2 deletions src/engraving/rendering/score/debugpaint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -256,7 +255,6 @@ void DebugPaint::paintPageDebug(Painter& painter, const Page* page, const std::v
}
}
}
#endif

painter.restore();
}
Expand Down