Skip to content

Commit

Permalink
Fix GH#17625: Sync figured bass between parts & score
Browse files Browse the repository at this point in the history
Backport of musescore#20139 (of its pretty minimal first version, the rest introduces a crash on undo, and apparently Mu3 doesn't have the undo issue of Mu4/master)
  • Loading branch information
miiizen authored and Jojo-Schmitz committed Dec 8, 2023
1 parent e08a17e commit e60c639
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions libmscore/figuredbass.cpp
Expand Up @@ -295,7 +295,7 @@ int FiguredBassItem::parseParenthesis(QString& str, int parenthIdx)
code = Parenthesis::ROUNDCLOSED;
break;
case '[':
code =Parenthesis::SQUAREDOPEN;
code = Parenthesis::SQUAREDOPEN;
break;
case ']':
code = Parenthesis::SQUAREDCLOSED;
Expand Down Expand Up @@ -1415,11 +1415,11 @@ qreal FiguredBass::additionalContLineX(qreal pagePosY) const
// if item has cont.line but nothing before it
// and item Y coord near enough to pagePosY
if(fbi->contLine() != FiguredBassItem::ContLine::NONE
&& fbi->digit() == FBIDigitNone
&& fbi->prefix() == FiguredBassItem::Modifier::NONE
&& fbi->suffix() == FiguredBassItem::Modifier::NONE
&& fbi->parenth4() == FiguredBassItem::Parenthesis::NONE
&& qAbs(pgPos.y() + fbi->ipos().y() - pagePosY) < 0.05)
&& fbi->digit() == FBIDigitNone
&& fbi->prefix() == FiguredBassItem::Modifier::NONE
&& fbi->suffix() == FiguredBassItem::Modifier::NONE
&& fbi->parenth4() == FiguredBassItem::Parenthesis::NONE
&& qAbs(pgPos.y() + fbi->ipos().y() - pagePosY) < 0.05)
return pgPos.x() + fbi->ipos().x();

return 0.0; // no suitable line
Expand Down
4 changes: 2 additions & 2 deletions libmscore/figuredbass.h
Expand Up @@ -140,7 +140,7 @@ class FiguredBassItem final : public Element {

void setDisplayText(const QString& s) { _displayText = s; }
// read / write MusicXML support
QString Modifier2MusicXML(FiguredBassItem::Modifier prefix) const;
QString Modifier2MusicXML(FiguredBassItem::Modifier prefix) const;

public:
FiguredBassItem(Score * s = 0, int line = 0);
Expand All @@ -164,7 +164,7 @@ class FiguredBassItem final : public Element {
bool startsWithParenthesis() const;

// specific API
const FiguredBass * figuredBass() const { return (FiguredBass*)(parent()); }
const FiguredBass* figuredBass() const { return (FiguredBass*)(parent()); }
bool parse(QString& text);

// getters / setters
Expand Down
2 changes: 1 addition & 1 deletion libmscore/scoreElement.cpp
Expand Up @@ -25,7 +25,7 @@ namespace Ms {
ElementStyle const ScoreElement::emptyStyle;

//
// list has to be synchronized with ElementType enum
// list has to be synchronized with ElementType enum in types.h
//
static const ElementName elementNames[] = {
{ ElementType::INVALID, "invalid", QT_TRANSLATE_NOOP("elementName", "Invalid") },
Expand Down

0 comments on commit e60c639

Please sign in to comment.