[trunk] Endless loop on entering (some) lyrics underscore

• Apr 30, 2011 - 13:56
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Setup: trunk rev. 4245 under Win XP, Qt SDK 10.4, Qt Lib 4.7.0 (but occurs also under Ubuntu, Qt lib 4.6.2)

Steps:

1) Load the attached score

2) Try to insert continuation underscores to lyric syllable "zo" in measure 13 to span the three following notes up to next syllable "cie"

Result: after pressing underscore the second time, the programme starts an endless loop and stops responding: the only way out is killing it.

Notes:

1) This issue occurs rather frequently (although not always), not only in the point described above. This is a point where it happens systematically.

2) As debug under Windows no longer works and my Ubuntu box is being replaced, I'm sorry I cannot provide more details.

3) The score itself is not finished, not even proof-read completely, so do not use it for any "real application"... ;-)

Attachment Size
Rore_1_trunk_1.mscz 28.23 KB

Comments

I got my Ubuntu box back: more details!

The issue happens in function void ScoreView::lyricsUnderscore() (file lyrics.cpp); the "search previous lyric" loop reads:

while (segment) {
    const QList* nll = segment->lyricsList(staffIdx);
    if (!nll)
        continue;
    oldLyrics = nll->value(verse);
    if (oldLyrics)
        break;
    segment = segment->prev1(SegChordRest | SegGrace);
    }

when it should read rather:

while (segment) {
    const QList* nll = segment->lyricsList(staffIdx);
    if (nll) {
        oldLyrics = nll->value(verse);
        if (oldLyrics)
            break;
        }
    segment = segment->prev1(SegChordRest | SegGrace);
    }

otherwise when var nll is 0, var segment is not modified and next while iterations will use the same value again and again, entering an endless loop.

This change is implemented in the attached patch.