From 0ff7de3c95306f05c3e73dcfd8ad98baa8b1be55 Mon Sep 17 00:00:00 2001 From: ipfix Date: Wed, 29 Apr 2015 10:49:32 +0200 Subject: [PATCH] Fix import/export gedcom, that was adding spurious 'Y'. --- ged2gwb/ged2gwb.ml | 21 ++++++++++----------- gwb2ged/gwb2ged.ml | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ged2gwb/ged2gwb.ml b/ged2gwb/ged2gwb.ml index e97dfbf8b6..b84a2deebf 100644 --- a/ged2gwb/ged2gwb.ml +++ b/ged2gwb/ged2gwb.ml @@ -1854,7 +1854,8 @@ value treat_indi_pevent gen ip r = (* Si le tag 1 XXX a des infos, on les ajoutes. *) let note = let name_info = strip_spaces r.rval in - if name_info = "" then note else name_info ^ "
\n" ^ note + if name_info = "" || r.rval = "Y" then note + else name_info ^ "
\n" ^ note in let src = match find_all_fields "SOUR" r.rsons with @@ -1920,7 +1921,8 @@ value treat_indi_pevent gen ip r = (* Si le tag 1 XXX a des infos, on les ajoutes. *) let note = let name_info = strip_spaces r.rval in - if name_info = "" then note else name_info ^ "
\n" ^ note + if name_info = "" || r.rval = "Y" then note + else name_info ^ "
\n" ^ note in let src = match find_all_fields "SOUR" r.rsons with @@ -2214,13 +2216,8 @@ value add_indi gen r = [ Some r -> Some (fam_index gen r.rval) | None -> None ] in - let occupation = - match find_all_fields "OCCU" r.rsons with - [ [r :: rl] -> - List.fold_left (fun s r -> s ^ ", " ^ strip_spaces r.rval) - (strip_spaces r.rval) rl - | [] -> "" ] - in + (* Les professions seront importées dans les événements. *) + let occupation = "" in let notes = match find_all_fields "NOTE" r.rsons with [ [] -> "" @@ -2597,7 +2594,8 @@ value treat_fam_fevent gen ifath imoth r = (* Si le tag 1 XXX a des infos, on les ajoutes. *) let note = let name_info = strip_spaces r.rval in - if name_info = "" then note else name_info ^ "
\n" ^ note + if name_info = "" || r.rval = "Y" then note + else name_info ^ "
\n" ^ note in let src = match find_all_fields "SOUR" r.rsons with @@ -2674,7 +2672,8 @@ value treat_fam_fevent gen ifath imoth r = (* Si le tag 1 XXX a des infos, on les ajoutes. *) let note = let name_info = strip_spaces r.rval in - if name_info = "" then note else name_info ^ "
\n" ^ note + if name_info = "" || r.rval = "Y" then note + else name_info ^ "
\n" ^ note in let src = match find_all_fields "SOUR" r.rsons with diff --git a/gwb2ged/gwb2ged.ml b/gwb2ged/gwb2ged.ml index 61f23be3c2..660f18cc00 100644 --- a/gwb2ged/gwb2ged.ml +++ b/gwb2ged/gwb2ged.ml @@ -278,8 +278,8 @@ value ged_date oc = value ged_ev_detail oc n typ d pl note src = do { - match (typ, d, pl) with - [ ("", None, "") -> fprintf oc " Y" + match (typ, d, pl, note, src) with + [ ("", None, "", "", "") -> fprintf oc " Y" | _ -> () ]; fprintf oc "\n"; if typ = "" then () else fprintf oc "%d TYPE %s\n" n typ;