]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/grob-scheme.cc (ly_get_parent): Don't dereference null
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 25 Jul 2002 09:26:10 +0000 (09:26 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 25 Jul 2002 09:26:10 +0000 (09:26 +0000)
parent. (Han-Wen)

* input/test/move-accidentals.ly: New file. (Han-Wen)

ChangeLog
input/test/move-accidentals.ly [new file with mode: 0644]
lily/grob-scheme.cc

index 0451f29dca186601bee313d256a6b0c98a2cdbc7..ae501af0701b5791bb2574436bc2e8c7c9e57b6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-25  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * lily/grob-scheme.cc (ly_get_parent): Don't dereference null
+       parent. (Han-Wen)
+
+       * input/test/move-accidentals.ly: New file. (Han-Wen)
+
 2002-07-25  Han-Wen  <hanwen@cs.uu.nl>
 
        * lily/slur.cc (get_first_notecolumn_y): robustness: don't crash
diff --git a/input/test/move-accidentals.ly b/input/test/move-accidentals.ly
new file mode 100644 (file)
index 0000000..ee2133b
--- /dev/null
@@ -0,0 +1,37 @@
+\header {
+
+        texidoc= "Positions of accidentals may be manually set. This
+involves some scheme code."
+
+}
+#(define (make-acc-position-checker pos)
+  (lambda (elt)
+   (and
+      (not (eq? #f (memq 'accidental-interface
+                    (ly-get-grob-property elt 'interfaces))))
+      (eq? (ly-get-grob-property
+           (ly-get-parent elt 1) 'staff-position) pos))))
+
+\score {
+  \context Voice \notes \relative c'' {
+    c2.
+    <
+\property Staff.AccidentalPlacement = \turnOff
+\context Staff \outputproperty #(make-acc-position-checker 9)
+                               #'extra-offset = #'(-1 . 0)
+\context Staff \outputproperty #(make-acc-position-checker 5)
+                               #'extra-offset = #'(-2 . 0)
+\context Staff \outputproperty #(make-acc-position-checker 3)
+                               #'extra-offset = #'(-3 . 0)
+\context Staff \outputproperty #(make-acc-position-checker 2)
+                               #'extra-offset = #'(-4 . 0)
+      d!4
+      eis
+      gis
+      d'!
+    >
+  }
+  \paper {
+    linewidth = -1
+  }
+}
index a7df394d329e9c6e8a41540fb094a92c02d216bb..6d1c8b771bfca82eb4bae6db5b82f300b491ef48 100644 (file)
@@ -99,6 +99,7 @@ for the Y-axis.")
   SCM_ASSERT_TYPE(sc, grob, SCM_ARG1, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE(ly_axis_p(axis), axis, SCM_ARG2, __FUNCTION__, "axis");
 
-  return sc->get_parent (Axis (gh_scm2int (axis)))->self_scm();
+  Grob * par = sc->get_parent (Axis (gh_scm2int (axis)));
+  return par ? par->self_scm() : SCM_EOL;
 }