Skip to content

Commit

Permalink
Fix last row missed issue and infinite loop problem
Browse files Browse the repository at this point in the history
  • Loading branch information
suexcxine committed Jul 24, 2021
1 parent 090c96e commit 225bc96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/exoffice/parser/excel_2003.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defmodule Exoffice.Parser.Excel2003 do
"""
def count_rows(pid) do
Xlsxir.get_multi_info(pid, :rows)
:ets.info(pid, :size)
end

@doc """
Expand Down
6 changes: 3 additions & 3 deletions lib/exoffice/parser/excel_2003/loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ defmodule Exoffice.Parser.Excel2003.Loader do
# add cell
case :ets.match(pid, {row, :"$1"}) do
[[cells]] ->
:ets.insert(pid, {row, cells ++ [[column_string <> to_string(row), value]]})
:ets.insert(pid, {row, [[column_string <> to_string(row), value]] ++ cells})

_ ->
:ets.insert(pid, {row, [[column_string <> to_string(row), value]]})
Expand All @@ -218,7 +218,7 @@ defmodule Exoffice.Parser.Excel2003.Loader do
# add cell
case :ets.match(pid, {row, :"$1"}) do
[[cells]] ->
:ets.insert(pid, {row, cells ++ [[column_string <> to_string(row), value]]})
:ets.insert(pid, {row, [[column_string <> to_string(row), value]] ++ cells})

_ ->
:ets.insert(pid, {row, [[column_string <> to_string(row), value]]})
Expand All @@ -241,7 +241,7 @@ defmodule Exoffice.Parser.Excel2003.Loader do
# add cell
case :ets.match(pid, {row, :"$1"}) do
[[cells]] ->
:ets.insert(pid, {row, cells ++ [[column_string <> to_string(row), nil]]})
:ets.insert(pid, {row, [[column_string <> to_string(row), nil]] ++ cells})

_ ->
:ets.insert(pid, {row, [[column_string <> to_string(row), nil]]})
Expand Down

0 comments on commit 225bc96

Please sign in to comment.