From 2ad2d2f3488077ec58ace8e1282951d764bde4d6 Mon Sep 17 00:00:00 2001 From: Aaron Sattely Date: Thu, 10 Feb 2022 12:14:38 -0500 Subject: [PATCH] score migration autoplace fix --- src/engraving/libmscore/score.cpp | 4 ++++ src/engraving/libmscore/score.h | 3 ++- src/project/internal/projectmigrator.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engraving/libmscore/score.cpp b/src/engraving/libmscore/score.cpp index 26dbc1bd47..11d71af741 100644 --- a/src/engraving/libmscore/score.cpp +++ b/src/engraving/libmscore/score.cpp @@ -5317,6 +5317,10 @@ void Score::doLayoutRange(const Fraction& st, const Fraction& et) m_layoutOptions.updateFromStyle(style()); m_layout.doLayoutRange(m_layoutOptions, st, et); + if (_resetAutoplace) { + _resetAutoplace = false; + resetAllPositions(); + } } UndoStack* Score::undoStack() const { return _masterScore->undoStack(); } diff --git a/src/engraving/libmscore/score.h b/src/engraving/libmscore/score.h index e7e0ead896..3c86618e76 100644 --- a/src/engraving/libmscore/score.h +++ b/src/engraving/libmscore/score.h @@ -455,7 +455,7 @@ private: ///< saves will not overwrite the backup file. bool _defaultsRead { false }; ///< defaults were read at MusicXML import, allow export of defaults in convertermode ScoreOrder _scoreOrder; ///< used for score ordering - + bool _resetAutoplace{ false }; int _mscVersion { MSCVERSION }; ///< version of current loading *.msc file QMap _metaTags; @@ -568,6 +568,7 @@ public: void removeStaff(Staff*); void addMeasure(MeasureBase*, MeasureBase*); void linkMeasures(Score* score); + void setResetAutoplace() { _resetAutoplace = true; } Excerpt* excerpt() { return _excerpt; } void setExcerpt(Excerpt* e) { _excerpt = e; } diff --git a/src/project/internal/projectmigrator.cpp b/src/project/internal/projectmigrator.cpp index 4f97435b4e..533e9f43e0 100644 --- a/src/project/internal/projectmigrator.cpp +++ b/src/project/internal/projectmigrator.cpp @@ -180,6 +180,6 @@ bool ProjectMigrator::applyEdwinStyle(Ms::MasterScore* score) bool ProjectMigrator::resetAllElementsPositions(Ms::MasterScore* score) { - score->resetAllPositions(); + score->setResetAutoplace(); return true; }