Skip to content

Commit

Permalink
Temp fix for user defined name types (fix #550)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed May 26, 2024
1 parent 155780e commit c59e87e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions projects/GKCore/GDModel/GDMPersonalName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace GDModel
public enum GDMNameType
{
ntNone,
ntAdoption, // FIXME: user defined name types (gh#550)
ntAka,
ntBirth,
ntImmigrant,
Expand Down
2 changes: 1 addition & 1 deletion projects/GKCore/GDModel/Providers/GEDCOM/GEDCOMUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ public static string GetLanguageStr(GDMLanguageID value)


public static readonly string[] NameTypes = new string[] {
"", "aka", "birth", "immigrant", "maiden", "married" };
"", "adoption", "aka", "birth", "immigrant", "maiden", "married" };

public static GDMNameType GetNameTypeVal(string str)
{
Expand Down
1 change: 1 addition & 0 deletions projects/GKCore/GKCore/GKData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ static GKData()

NameTypes = new LSID[] {
LSID.DefaultValue,
LSID.Adoption, // FIXME: user defined name types (gh#550)
LSID.NTAka,
LSID.NTBirth,
LSID.NTImmigrant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ public void Test_GEDCOMEnumNT()
{
Assert.AreEqual(GDMNameType.ntNone, GEDCOMUtils.GetNameTypeVal("unk"));
Assert.AreEqual(GDMNameType.ntNone, GEDCOMUtils.GetNameTypeVal(GEDCOMUtils.GetNameTypeStr(GDMNameType.ntNone)));
Assert.AreEqual(GDMNameType.ntAdoption, GEDCOMUtils.GetNameTypeVal(GEDCOMUtils.GetNameTypeStr(GDMNameType.ntAdoption)));
Assert.AreEqual(GDMNameType.ntAka, GEDCOMUtils.GetNameTypeVal(GEDCOMUtils.GetNameTypeStr(GDMNameType.ntAka)));
Assert.AreEqual(GDMNameType.ntBirth, GEDCOMUtils.GetNameTypeVal(GEDCOMUtils.GetNameTypeStr(GDMNameType.ntBirth)));
Assert.AreEqual(GDMNameType.ntImmigrant, GEDCOMUtils.GetNameTypeVal(GEDCOMUtils.GetNameTypeStr(GDMNameType.ntImmigrant)));
Expand Down

0 comments on commit c59e87e

Please sign in to comment.