Skip to content

Commit

Permalink
numFmts element must be the first child
Browse files Browse the repository at this point in the history
  • Loading branch information
fchorney authored and felipenoris committed Sep 18, 2019
1 parent 349512a commit 33f04d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/styles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ function styles_add_numFmt(wb::Workbook, format_code::AbstractString) :: Integer
numfmts = findall("/xpath:styleSheet/xpath:numFmts", xroot, SPREADSHEET_NAMESPACE_XPATH_ARG)
if isempty(numfmts)
stylesheet = findfirst("/xpath:styleSheet", xroot, SPREADSHEET_NAMESPACE_XPATH_ARG)

# We need to add the numFmts node directly after the styleSheet node
child = EzXML.firstelement(stylesheet)
numfmts = EzXML.addelement!(stylesheet, "numFmts")
EzXML.unlink!(numfmts)
EzXML.linkprev!(child, numfmts)
else
numfmts = numfmts[1]
end
Expand Down

0 comments on commit 33f04d1

Please sign in to comment.