Skip to content

Commit

Permalink
Fix kekule support after final test
Browse files Browse the repository at this point in the history
  • Loading branch information
divinity666 authored May 24, 2020
1 parent 3743ab9 commit 5f4ed72
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/Report/ReportParserGenerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,7 @@ protected function generationStartHandler(): void
}

/**
* Handle <kekule_number />
* Handle <kekuleNumber />
* Prints the kekule order number
*
* @return void
Expand Down Expand Up @@ -2730,7 +2730,7 @@ private function addAncestors(array &$list, string $pid, bool $children = false,
$list[$pid]->kekule_number = 1;
while (count($genlist) > 0) {
$id = array_shift($genlist);
$kekule_number = array_shift($kekulelist);
$kekule_number = array_shift($kekulelist) + 1;
if (strpos($id, 'empty') === 0) {
continue; // id can be something like “empty7”
}
Expand All @@ -2743,7 +2743,6 @@ private function addAncestors(array &$list, string $pid, bool $children = false,
$list[$husband->xref()]->generation = $list[$id]->generation + 1;
$list[$husband->xref()]->kekule_number = $kekule_number;
}
$list[$husband->xref()]->generation = $list[$id]->generation + 1;
if ($wife) {
$list[$wife->xref()] = $wife;
$list[$wife->xref()]->generation = $list[$id]->generation + 1;
Expand All @@ -2752,11 +2751,11 @@ private function addAncestors(array &$list, string $pid, bool $children = false,
if ($generations == -1 || $list[$id]->generation + 1 < $generations) {
if ($husband) {
$genlist[] = $husband->xref();
$kekulelist[] = $kekule_number * 2;
$kekulelist[] = ($kekule_number) * 2 - 1;
}
if ($wife) {
$genlist[] = $wife->xref();
$kekulelist[] = ($kekule_number + 1) * 2;
$kekulelist[] = ($kekule_number + 1) * 2 - 1;
}
}
if ($children) {
Expand Down

0 comments on commit 5f4ed72

Please sign in to comment.