]> git.cworth.org Git - scherzo/blobdiff - score.c
Fix bugs in mismatched spelling of chord name and notes
[scherzo] / score.c
diff --git a/score.c b/score.c
index 5c0e0b023545b15c1a5f48c69c94fd6ca5aaa026..ecfc2352662194790ec40b39577146fca64c08ee 100644 (file)
--- a/score.c
+++ b/score.c
@@ -596,26 +596,21 @@ score_add_chord (score_staff_t *staff,
 }
 
 void
-score_remove_chord (score_chord_t *chord)
+score_staff_remove_chords (score_staff_t *staff)
 {
-    score_staff_t *staff = chord->staff;
-    int i;
-
-    for (i = 0; i < staff->num_chords; i++)
-       if (staff->chords[i] == chord)
-           break;
+    talloc_free (staff->chords);
+    staff->chords = NULL;
 
-    if (i == staff->num_chords)
-       return;
+    staff->num_chords = 0;
+}
 
-    if (i < staff->num_chords - 1)
-    {
-       memmove (staff->chords + i,
-                staff->chords + i + 1, 
-                (staff->num_chords - 1 - i) * sizeof (score_chord_t *));
-    }
+void
+score_remove_chords (score_t *score)
+{
+    int i;
 
-    staff->num_chords -= 1;
+    for (i = 0; i < score->num_staves; i++)
+       score_staff_remove_chords (score->staves[i]);
 }
 
 void