@@ -893,7 +893,7 @@ void NotationInteraction::doSelect(const std::vector<EngravingItem*>& elements,
893
893
TRACEFUNC;
894
894
895
895
if (needEndTextEditing (elements)) {
896
- endEditText ();
896
+ endEditText (/* startNonTextualEdit */ false );
897
897
} else if (needEndElementEditing (elements)) {
898
898
endEditElement ();
899
899
}
@@ -4188,21 +4188,19 @@ bool NotationInteraction::handleKeyPress(QKeyEvent* event)
4188
4188
return true ;
4189
4189
}
4190
4190
4191
- void NotationInteraction::endEditText ()
4191
+ void NotationInteraction::endEditText (bool startNonTextualEdit )
4192
4192
{
4193
4193
if (!isTextEditingStarted ()) {
4194
4194
return ;
4195
4195
}
4196
4196
4197
- EngravingItem * editedElement = m_editData.element ;
4197
+ TextBase * editedElement = toTextBase ( m_editData.element ) ;
4198
4198
doEndEditElement ();
4199
+ notifyAboutTextEditingEnded (editedElement);
4199
4200
4200
- if (editedElement) {
4201
- notifyAboutTextEditingEnded (toTextBase (editedElement));
4202
- // When textual edit is finished, non-textual edit can still happen, so we need to start the non-textual edit mode here
4203
- if (editedElement->isTextBase () && toTextBase (editedElement)->supportsNonTextualEdit ()) {
4204
- startEditElement (editedElement, false );
4205
- }
4201
+ // When textual edit is finished, non-textual edit can still happen, so we need to start the non-textual edit mode here
4202
+ if (startNonTextualEdit && editedElement->supportsNonTextualEdit ()) {
4203
+ startEditElement (editedElement, false );
4206
4204
}
4207
4205
4208
4206
notifyAboutTextEditingChanged ();
@@ -6263,7 +6261,7 @@ void NotationInteraction::navigateToLyrics(bool back, bool moveOnly, bool end)
6263
6261
return ;
6264
6262
}
6265
6263
6266
- endEditText ();
6264
+ endEditText (/* startNonTextualEdit */ false );
6267
6265
6268
6266
// look for the lyrics we are moving from; may be the current lyrics or a previous one
6269
6267
// if we are skipping several chords with spaces
@@ -6413,7 +6411,7 @@ void NotationInteraction::navigateToNextSyllable()
6413
6411
return ;
6414
6412
}
6415
6413
6416
- endEditText ();
6414
+ endEditText (/* startNonTextualEdit */ false );
6417
6415
6418
6416
// look for the lyrics we are moving from; may be the current lyrics or a previous one
6419
6417
// we are extending with several dashes
@@ -6657,7 +6655,7 @@ void NotationInteraction::navigateToLyricsVerse(MoveDirection direction)
6657
6655
}
6658
6656
}
6659
6657
6660
- endEditText ();
6658
+ endEditText (/* startNonTextualEdit */ false );
6661
6659
6662
6660
lyrics = cr->lyrics (verse, placement);
6663
6661
if (!lyrics) {
@@ -7239,7 +7237,7 @@ void NotationInteraction::addMelisma()
7239
7237
FontStyle fStyle = lyrics->fontStyle ();
7240
7238
PropertyFlags fFlags = lyrics->propertyFlags (Pid::FONT_STYLE);
7241
7239
Fraction endTick = segment->tick (); // a previous melisma cannot extend beyond this point
7242
- endEditText ();
7240
+ endEditText (/* startNonTextualEdit */ false );
7243
7241
7244
7242
// search next chord
7245
7243
Segment* nextSegment = segment;
@@ -7444,7 +7442,7 @@ void NotationInteraction::addLyricsVerse()
7444
7442
mu::engraving::FontStyle fStyle = oldLyrics->fontStyle ();
7445
7443
mu::engraving::PropertyFlags fFlags = oldLyrics->propertyFlags (mu::engraving::Pid::FONT_STYLE);
7446
7444
7447
- endEditText ();
7445
+ endEditText (/* startNonTextualEdit */ false );
7448
7446
7449
7447
score ()->startCmd (TranslatableString (" undoableAction" , " Add lyrics verse" ));
7450
7448
int newVerse = oldLyrics->no () + 1 ;
0 commit comments