@@ -2350,7 +2350,7 @@ void MusicXMLParserPass2::attributes(const QString& partId, Measure* measure, co
2350
2350
} else if (_e.name () == " measure-style" ) {
2351
2351
measureStyle (measure);
2352
2352
} else if (_e.name () == " staff-details" ) {
2353
- staffDetails (partId);
2353
+ staffDetails (partId, measure );
2354
2354
} else if (_e.name () == " time" ) {
2355
2355
time (partId, measure, tick);
2356
2356
} else if (_e.name () == " transpose" ) {
@@ -2383,7 +2383,7 @@ static void setStaffLines(Score* score, staff_idx_t staffIdx, int stafflines)
2383
2383
Parse the /score-partwise/part/measure/attributes/staff-details node.
2384
2384
*/
2385
2385
2386
- void MusicXMLParserPass2::staffDetails (const QString& partId)
2386
+ void MusicXMLParserPass2::staffDetails (const QString& partId, Measure* measure )
2387
2387
{
2388
2388
// logDebugTrace("MusicXMLParserPass2::staffDetails");
2389
2389
@@ -2414,7 +2414,12 @@ void MusicXMLParserPass2::staffDetails(const QString& partId)
2414
2414
2415
2415
QString visible = _e.attributes ().value (" print-object" ).toString ();
2416
2416
if (visible == " no" ) {
2417
- _score->staff (staffIdx)->setVisible (false );
2417
+ if (measure) {
2418
+ // if measure is supplied, print-object applies to the measure instead of the staff
2419
+ measure->setStaffVisible (staffIdx, false );
2420
+ } else {
2421
+ _score->staff (staffIdx)->setVisible (false );
2422
+ }
2418
2423
} else if (!visible.isEmpty () && visible != " yes" ) {
2419
2424
_logger->logError (QString (" print-object should be \" yes\" or \" no\" " ));
2420
2425
}
0 commit comments