Allow elements out of context in GOM.
[gedcom-parse.git] / gom / note_sub.c
index 7facc415060bb3786be424a282952525be452b3b..f8dedefa46ff1496b7a7d6ee1d48e2060dbe0f08 100644 (file)
@@ -54,10 +54,11 @@ Gedcom_ctxt sub_note_start(_ELT_PARAMS_)
   else {
     struct note_sub *note = SUB_MAKEFUNC(note_sub)();
     if (note) {
+      int type = ctxt_type(ctxt);
       if (GEDCOM_IS_XREF_PTR(parsed_value))
        note->reference = GEDCOM_XREF_PTR(parsed_value);
 
-      switch (ctxt->ctxt_type) {
+      switch (type) {
        case ELT_SUB_PLAC:
          ADDFUNC2(place,note_sub)(ctxt, note); break;
        case ELT_SUB_FAM_EVT:
@@ -101,7 +102,7 @@ Gedcom_ctxt sub_note_start(_ELT_PARAMS_)
        case REC_SOUR:
          ADDFUNC2(source,note_sub)(ctxt, note); break;
        default:
-         UNEXPECTED_CONTEXT(ctxt->ctxt_type);
+         UNEXPECTED_CONTEXT(type);
       }
       result = MAKE_GOM_CTXT(elt, note_sub, note);
     }