Skip to content

Commit

Permalink
Fix import/export gedcom, that was adding spurious 'Y'.
Browse files Browse the repository at this point in the history
  • Loading branch information
fablhx committed May 7, 2015
1 parent 9c8cabd commit 0ff7de3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
21 changes: 10 additions & 11 deletions ged2gwb/ged2gwb.ml
Expand Up @@ -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 ^ "<br>\n" ^ note
if name_info = "" || r.rval = "Y" then note
else name_info ^ "<br>\n" ^ note
in
let src =
match find_all_fields "SOUR" r.rsons with
Expand Down Expand Up @@ -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 ^ "<br>\n" ^ note
if name_info = "" || r.rval = "Y" then note
else name_info ^ "<br>\n" ^ note
in
let src =
match find_all_fields "SOUR" r.rsons with
Expand Down Expand Up @@ -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
[ [] -> ""
Expand Down Expand Up @@ -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 ^ "<br>\n" ^ note
if name_info = "" || r.rval = "Y" then note
else name_info ^ "<br>\n" ^ note
in
let src =
match find_all_fields "SOUR" r.rsons with
Expand Down Expand Up @@ -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 ^ "<br>\n" ^ note
if name_info = "" || r.rval = "Y" then note
else name_info ^ "<br>\n" ^ note
in
let src =
match find_all_fields "SOUR" r.rsons with
Expand Down
4 changes: 2 additions & 2 deletions gwb2ged/gwb2ged.ml
Expand Up @@ -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;
Expand Down

0 comments on commit 0ff7de3

Please sign in to comment.