Page settings in parts are initialized incorrectly in dialog if using pre-3.5.2 defaults

• Feb 10, 2021 - 02:10
Reported version
3.6
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
  1. Load a MuseScore file and choose a part(one of Guitar 1, Guitar 2, ...)

  2. In menu, choose Format and Page Settings.

  3. In Page Settings window, change Odd Pager margins(15mm/5mm to 10mm), Even page margins(15mm/5mm to 10mm), or Two sided(uncheck) and OK(or Apply).

  4. In menu, choose Save.

  5. Close MuseScore.

  6. Open the MuseScore file and check if Page Settings are not stored(stayed as default - 15mm/5mm and Two sided cheded).

Attachment Size
danse_macabre_r3.mscz 217.89 KB

Comments

Priority P0 - Critical

Confirmed. Somehow this would seem to relate to the issue fixed in 3.6.2 where style settings from the score would apply to the parts on reload, but that might be just coincidence that the symptom seems vauegly similar.

Something else, though - while the left/right margins are not being saved properly, somehow the top margin was changed even though I didn't change it. It still says 15, but somehow it does look different before/after.

Title Page settings are not saved. I experienced Page margins and Two sided option are not saved in version 3.6.0 and 3.6.2 Page settings like margins and Two sided option are not saved in version 3.6.x

So far I'm struggling to reproduce this in a score I create myself, so I am thinking somehow the trigger has to be something about how this one was created. Was it originally written in an earlier then imported into 3.6? Anything else unusual you can think of that could explain why i see the problem here but not elsewhere?

Here's another strange thing in this score: when you load it into 3.6.2, even without making changes, the margins in the parts really are 10mm already. You can see it's equal on the left and right side of each page. The dialog appears to be completely lying about the margins when it reports them as 15 & 5. Also, if I change the margins to anything but 10 & 10, they take just fine - you see the effect, and it survives save / reload. Only setting them to 10 & 10 fails in this way. It can't be coincidence that 10 & 10 are the margins in the score itself.

Again, I can't reproduce any of this in a score I create myself, not yet anyhow.

Did you import this directly from 2.x into 3.6? If so, can you attach the 2.x version? Or, if you imported it into a previous 3.x version, can you attach a version from before you imported into 3.6?

Right now I can still don't understand if this problem is unique to this score - like I said, I cannot reproduce it with any other - or if it's a problem that will occur with any score in which the same steps were followed. That's why understanding the steps that led to this is so important.

Righr now what I can tell you is the page settings dialog is lying to you - the margins really are correct already, 10mm on both sides. And the page settings will allow you to change the margins to any other value you want - 15 mm, 50 mm, even 10.01mm. The only value they refuse to show in my testing are 10mm, and I assume that's related to the fact that these are also the score margins. But again, where the dialog shows it or not, the margins are correct, so it's hopefully not quite as serious an issue as it first appears.

@Marc Sabatella the OP wrote The first creation of this was using version 2.x. I have been editing using v3.x and I didn't experience this issue before using v3.6.
so created in 2.x, imported into 3.x, pre 3.6, then 'imported' into 3.6...

Title Page settings like margins and Two sided option are not saved in version 3.6.x Page settings in parts are initialized incorrectly in dialog if using pre-3.5.2 defaults
Priority P0 - Critical P1 - High

Thanks, this gives me a better idea as to what is going on. I'm not 100% there yet, but I note a few things here:

  • loading the v2 file into 3.6.2, if I answer "yes" to the reset question, I get the same problem (page settings preview does not reflect reality, for the parts)
  • if I choose to Reset All Styles to Default, the problem goes away, or at least goes into hiding (there may be a way to reproduce still)

I think the fact that 10mm is the current margin in the score is not the reason this one value seems to cause problems in the parts. I think it is the fact that 10mm was the default value prior to 3.6 that is causing this setting to not show in the dialog correct. My guess is we're seeing this value as being the default and are thus not bothering to copy it to the preview score in the dialog (and the preview score is the key, everything in the dialogs works on that).

So I can now reproduce this from scratch. It's just a matter of creating the score and parts in 3.5.2 or older and leaving all margins at their defaults. Loading the score into 3.6 and keeping old style, you'll see the score shows correctly as 10mm in page settings, but the parts report as 15mm even though that isn't really true. And if you then try to change to 10mm and save, on reload you'd see the lopsided 15/5. That's because MuseScore is getting the printable width right but getting the left margin wrong - 15 instead of 5 - then using those two values to calculate the right margin.

But it's important to emphasize - the margins in the parts are actually correct at all times, it's only the dialog that is wrong. That is, if you don't open the page settings dialog, the parts will have the same margins they did in older versions. If you do open the dialog, any settings you make there do apply to the parts, and they do get saved. So when you reopen the score, those margins are correct. It will just look like it's wrong if you open the dialog again.

So if want to keep the original margins, you are good - just don't bother opening the dialog. If you do choose to open the dialog for whatever reason, though, you need to be careful to set all values to what they should be before hitting OK, otherwise the new wrong values will now take effect. So, you can't just change the left margin, you need to change all margins to the values you want, since the values being shown in the dialog are incorrect.

Attachment Size
parts-page-352.mscx 30.13 KB
Status PR created fixed

Fixed in branch 3.x, commit 1874603fb7

_fix #317272: page settings dialog shows wrong values in pre-3.6 parts

Resolves: https://musescore.org/en/node/317272

When displaying the page settings dialog,
we create a preview by cloning the score,
and the dialog actually manipulates the preview's values.
However, the clone is always forced to current style defaults,
so for pre-3.6 scores that, the preview and the spinboxes show
new 3.6 defaults as opposed to the old.
This causes the preview to display completely unlike the actual score,
and it also means the default values for the margins are wrong.

A full fix for this would involve re-examining the logic used
in the clone() methods for both Score and MasterScore.
But there could be any numebr of side effects to this.
So the fix here is very conservative:
it just overrides the clone's style with the original style
after the fact.
Thus is can only affect the page settings dialog.

It should also be noted this bug only affects parts, not parent scores.
That is because the process of reading/writing the parent score
resets the style again based on version tags encountered.
So probably there is another fix here involving that logic.
This too would almost certain have side effects._