Added some missing code for LSS.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Fri, 24 Jan 2003 20:16:10 +0000 (20:16 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Fri, 24 Jan 2003 20:16:10 +0000 (20:16 +0000)
gom/lds_event.c

index 6a7be358df5267a88948c5eeeae7399800b8f73a..b922bd258992e95faed426cca02caa58877db402 100644 (file)
@@ -141,6 +141,8 @@ static int get_gedcom_elt(int parsed_tag)
       obj_elt = ELT_SUB_LIO_BAPL; break;
     case TAG_SLGC:
       obj_elt = ELT_SUB_LIO_SLGC; break;
+    case TAG_SLGS:
+      obj_elt = ELT_SUB_LSS_SLGS; break;
     default:
       gedcom_warning(_("Internal error: unknown evt tag %d"), parsed_tag);
   }
@@ -156,19 +158,28 @@ int write_lds_events(Gedcom_write_hndl hndl, int parent, struct lds_event *lds)
 
   for (obj = lds; obj; obj = obj->next) {
     int obj_elt = get_gedcom_elt(obj->event);
+    int lss = (obj_elt == ELT_SUB_LSS_SLGS);
     result |= gedcom_write_element_str(hndl, obj_elt, obj->event,
                                       parent, NULL);
     if (obj->date_status)
-      result |= gedcom_write_element_str(hndl, ELT_SUB_LIO_BAPL_STAT, 0,
+      result |= gedcom_write_element_str(hndl,
+                                        (lss ? ELT_SUB_LSS_SLGS_STAT :
+                                         ELT_SUB_LIO_BAPL_STAT), 0,
                                         obj_elt, obj->date_status);
     if (obj->date)
-      result |= gedcom_write_element_date(hndl, ELT_SUB_LIO_BAPL_DATE, 0,
+      result |= gedcom_write_element_date(hndl,
+                                         (lss ? ELT_SUB_LSS_SLGS_DATE :
+                                          ELT_SUB_LIO_BAPL_DATE), 0,
                                          obj_elt, obj->date);
     if (obj->temple_code)
-      result |= gedcom_write_element_str(hndl, ELT_SUB_LIO_BAPL_TEMP, 0,
+      result |= gedcom_write_element_str(hndl,
+                                        (lss ? ELT_SUB_LSS_SLGS_TEMP :
+                                         ELT_SUB_LIO_BAPL_TEMP), 0,
                                         obj_elt, obj->temple_code);
     if (obj->place_living_ordinance)
-      result |= gedcom_write_element_str(hndl, ELT_SUB_LIO_BAPL_PLAC, 0,
+      result |= gedcom_write_element_str(hndl,
+                                        (lss ? ELT_SUB_LSS_SLGS_PLAC :
+                                         ELT_SUB_LIO_BAPL_PLAC), 0,
                                         obj_elt, obj->place_living_ordinance);
     if (obj->family)
       result |= gedcom_write_element_xref(hndl, ELT_SUB_LIO_SLGC_FAMC, 0,