Skip to content

Commit

Permalink
Restored the possibility of empty value of residence facts (fix #510)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Dec 14, 2023
1 parent 8e3581a commit 3652de0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Change log</h1>

<p>
<b>??.??.2024 [v2.29.0 &amp; v3.5.0]</b><ul>
<li>Restored the possibility of empty value of residence facts.
<li>Added localization to Japanese [Takashi Namba (難波鷹史)].
<li>Fixed encoding detection when reading CSV files [Alex Zaytsev].
</ul>
Expand Down
1 change: 1 addition & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>История версий</h1>

<p>
<b>??.??.2024 [v2.29.0 &amp; v3.5.0]</b><ul>
<li>Восстановлена возможность пустого значения фактов местожительства.
<li>Добавлена локализация на японский язык [Takashi Namba (難波鷹史)].
<li>Исправлено определение кодировки при чтении CSV-файлов [Alexander Zaytsev].
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public override bool Accept()
if (eventProps.Kind == PersonEventKind.ekFact) {
var attrValue = fView.Attribute.Text;

if (string.IsNullOrEmpty(attrValue)) {
if (string.IsNullOrEmpty(attrValue) && !eventProps.AcceptableEmpty) {
AppHost.StdDialogs.ShowError(LangMan.LS(LSID.FactValueIsInvalid));
throw new Exception();
}
Expand Down
6 changes: 4 additions & 2 deletions projects/GKCore/GKCore/GKData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ public sealed class EventStruct
public LSID Name;
public string Sign;
public PersonEventKind Kind;
public bool AcceptableEmpty;

public EventStruct(LSID name, string sign, PersonEventKind kind)
public EventStruct(LSID name, string sign, PersonEventKind kind, bool acceptableEmpty = false)
{
Name = name;
Sign = sign;
Kind = kind;
AcceptableEmpty = acceptableEmpty;
}
}

Expand Down Expand Up @@ -386,7 +388,7 @@ static GKData()
new EventStruct(LSID.Fact, GEDCOMTagName.FACT, PersonEventKind.ekFact),
new EventStruct(LSID.Religion, GEDCOMTagName.RELI, PersonEventKind.ekFact),
new EventStruct(LSID.Nationality, GEDCOMTagName.NATI, PersonEventKind.ekFact),
new EventStruct(LSID.Residence, GEDCOMTagName.RESI, PersonEventKind.ekFact),
new EventStruct(LSID.Residence, GEDCOMTagName.RESI, PersonEventKind.ekFact, true),
new EventStruct(LSID.PhysicalDesc, GEDCOMTagName.DSCR, PersonEventKind.ekFact),
new EventStruct(LSID.NationalIDNumber, GEDCOMTagName.IDNO, PersonEventKind.ekFact),
new EventStruct(LSID.SocialSecurityNumber, GEDCOMTagName.SSN, PersonEventKind.ekFact),
Expand Down

0 comments on commit 3652de0

Please sign in to comment.