Skip to content

engraving: Rename Pid::SUBTYPE #29384

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

juli27
Copy link
Contributor

@juli27 juli27 commented Aug 20, 2025

  • unused for Dynamic elements
  • only remaining use is for MeasureRepeat elements
    • rename to MEASURE_REPEAT_NUMBER to better fit its purpose
  • also rename the newly added subType API property
  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

- unused for Dynamic elements
- only remaining use is for MeasureRepeat elements
  - rename to MEASURE_REPEAT_NUMBER to better fit its purpose
- also rename the newly added subType API property
@juli27 juli27 marked this pull request as draft August 20, 2025 18:49
Default initialized TextStyleProperty objects in textstyle.cpp cause
the property with Pid = 0 to be set. (Which was the mostly unused
SUBTYPE Pid but is now SELECTED)
@juli27
Copy link
Contributor Author

juli27 commented Aug 20, 2025

Some textstyles don't have a TextStyleProperty entry for TextStylePropertyType::Position, e.g. tempo text here:

const TextStyle tempoTextStyle { {
{ TextStylePropertyType::FontFace, Sid::tempoFontFace, Pid::FONT_FACE },
{ TextStylePropertyType::FontSize, Sid::tempoFontSize, Pid::FONT_SIZE },
{ TextStylePropertyType::LineSpacing, Sid::tempoLineSpacing, Pid::TEXT_LINE_SPACING },
{ TextStylePropertyType::SizeSpatiumDependent, Sid::tempoFontSpatiumDependent, Pid::SIZE_SPATIUM_DEPENDENT },
{ TextStylePropertyType::FontStyle, Sid::tempoFontStyle, Pid::FONT_STYLE },
{ TextStylePropertyType::Color, Sid::tempoColor, Pid::COLOR },
{ TextStylePropertyType::TextAlign, Sid::tempoAlign, Pid::ALIGN },
{ TextStylePropertyType::Offset, Sid::tempoPosAbove, Pid::OFFSET },
{ TextStylePropertyType::FrameType, Sid::tempoFrameType, Pid::FRAME_TYPE },
{ TextStylePropertyType::FramePadding, Sid::tempoFramePadding, Pid::FRAME_PADDING },
{ TextStylePropertyType::FrameWidth, Sid::tempoFrameWidth, Pid::FRAME_WIDTH },
{ TextStylePropertyType::FrameRound, Sid::tempoFrameRound, Pid::FRAME_ROUND },
{ TextStylePropertyType::FrameBorderColor, Sid::tempoFrameFgColor, Pid::FRAME_FG_COLOR },
{ TextStylePropertyType::FrameFillColor, Sid::tempoFrameBgColor, Pid::FRAME_BG_COLOR },
{ TextStylePropertyType::MusicalSymbolsScale, Sid::dummyMusicalSymbolsScale, Pid::MUSICAL_SYMBOLS_SCALE },
} };

(Introduced in #28377 ; @miiizen is this intentional?)

This causes a default initialized TextStyleProperty to be use here:

for (const auto& p : *textStyle(textStyleType())) {
setProperty(p.pid, styleValue(p.pid, p.sid));
}

p.pid is then whatever Pid == 0 is. This used to be the mostly unused Pid::SUBTYPE, but is Pid::SELECTED with this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant