Skip to content

Fix a MSVC compiler warning and multiple build errors #27950

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

Merged
merged 3 commits into from
May 6, 2025
Merged
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
7 changes: 3 additions & 4 deletions src/engraving/rw/read460/measureread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ void MeasureRead::readMeasure(Measure* measure, XmlReader& e, ReadContext& ctx,
return;
}

double _spatium = measure->spatium();
ctx.setCurrentMeasure(measure);
int nextTrack = staffIdx * VOICES;
ctx.setTrack(nextTrack);
Expand Down Expand Up @@ -140,23 +139,23 @@ void MeasureRead::readMeasure(Measure* measure, XmlReader& e, ReadContext& ctx,
spacer->setTrack(staffIdx * VOICES);
measure->add(spacer);
}
measure->m_mstaves[staffIdx]->vspacerDown()->setGap(Millimetre(e.readDouble() * _spatium));
measure->m_mstaves[staffIdx]->vspacerDown()->setGap(Spatium(e.readDouble()));
} else if (tag == "vspacerFixed") {
if (!measure->m_mstaves[staffIdx]->vspacerDown()) {
Spacer* spacer = Factory::createSpacer(measure);
spacer->setSpacerType(SpacerType::FIXED);
spacer->setTrack(staffIdx * VOICES);
measure->add(spacer);
}
measure->m_mstaves[staffIdx]->vspacerDown()->setGap(Millimetre(e.readDouble() * _spatium));
measure->m_mstaves[staffIdx]->vspacerDown()->setGap(Spatium(e.readDouble()));
} else if (tag == "vspacerUp") {
if (!measure->m_mstaves[staffIdx]->vspacerUp()) {
Spacer* spacer = Factory::createSpacer(measure);
spacer->setSpacerType(SpacerType::UP);
spacer->setTrack(staffIdx * VOICES);
measure->add(spacer);
}
measure->m_mstaves[staffIdx]->vspacerUp()->setGap(Millimetre(e.readDouble() * _spatium));
measure->m_mstaves[staffIdx]->vspacerUp()->setGap(Spatium(e.readDouble()));
} else if (tag == "visible") {
measure->m_mstaves[staffIdx]->setVisible(e.readInt());
} else if ((tag == "slashStyle") || (tag == "stemless")) {
Expand Down
6 changes: 3 additions & 3 deletions src/engraving/rw/read460/staffread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void StaffRead::readStaff(Score* score, XmlReader& e, ReadContext& ctx)
MeasureRead::readMeasure(measure, e, ctx, staff);
measure->checkMeasure(staff);
if (!measure->isMMRest()) {
score->measures()->add(measure);
score->measures()->append(measure);
if (m && m->mmRest()) {
m->mmRest()->setNext(measure);
}
Expand All @@ -86,7 +86,7 @@ void StaffRead::readStaff(Score* score, XmlReader& e, ReadContext& ctx)
} else if (tag == "HBox" || tag == "VBox" || tag == "TBox" || tag == "FBox") {
MeasureBase* mb = toMeasureBase(Factory::createItemByName(tag, ctx.dummy()));
mb->setTick(ctx.tick());
score->measures()->add(mb);
score->measures()->append(mb);
// This default value needs initialising after being added to the score, as it depends on whether this is the title frame
if (mb->score()->mscVersion() >= 440) {
mb->setSizeIsSpatiumDependent(mb->propertyDefault(Pid::SIZE_SPATIUM_DEPENDENT).toBool());
Expand All @@ -109,7 +109,7 @@ void StaffRead::readStaff(Score* score, XmlReader& e, ReadContext& ctx)
LOGD("Score::readStaff(): missing measure!");
measure = Factory::createMeasure(ctx.dummy()->system());
measure->setTick(ctx.tick());
score->measures()->add(measure);
score->measures()->append(measure);
}
ctx.setTick(measure->tick());
ctx.setCurrentMeasureIndex(measureIdx++);
Expand Down
5 changes: 2 additions & 3 deletions src/engraving/rw/read460/tread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4056,12 +4056,11 @@ void TRead::read(Spacer* s, XmlReader& e, ReadContext& ctx)
if (tag == "subtype") {
s->setSpacerType(SpacerType(e.readInt()));
} else if (tag == "space") {
s->setGap(Millimetre(e.readDouble() * s->spatium()));
s->setGap(Spatium(e.readDouble()));
} else if (!readItemProperties(s, e, ctx)) {
e.unknown();
}
}
s->layout0();
}

void TRead::read(StaffType* t, XmlReader& e, ReadContext&)
Expand Down Expand Up @@ -4227,7 +4226,7 @@ bool TRead::readProperties(Staff* s, XmlReader& e, ReadContext& ctx)
} else if (tag == "barLineSpanTo") {
s->setBarLineTo(e.readInt());
} else if (tag == "distOffset") {
s->setUserDist(Millimetre(e.readDouble() * s->style().spatium()));
s->setUserDist(Spatium(e.readDouble()));
} else if (tag == "mag") {
/*_userMag =*/
e.readDouble(0.1, 10.0);
Expand Down
1 change: 0 additions & 1 deletion src/notation/view/widgets/editstaff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ void EditStaff::setStaff(Staff* s, const Fraction& tick)
}

Part* part = m_orgStaff->part();
mu::engraving::Score* score = part->score();

auto it = muse::findLessOrEqual(part->instruments(), tick.ticks());
if (it == part->instruments().cend()) {
Expand Down
Loading