Skip to content

Commit

Permalink
update libxlsx to 0.8.4 November 10 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
j2doll committed Nov 17, 2018
1 parent 758af59 commit 7d5e212
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libxlsxwriter/include/xlsxwriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
#include "xlsxwriter/format.h"
#include "xlsxwriter/utility.h"

#define LXW_VERSION "0.8.3"
#define LXW_VERSION "0.8.4"

#endif /* __LXW_XLSXWRITER_H__ */
4 changes: 2 additions & 2 deletions libxlsxwriter/include/xlsxwriter/workbook.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ typedef struct lxw_doc_properties {
* to assembling the final XLSX file. The temporary files are created in the
* system's temp directory. If the default temporary directory isn't
* accessible to your application, or doesn't contain enough space, you can
* specify an alternative location using the `tempdir` option.
* specify an alternative location using the `tmpdir` option.
*/
typedef struct lxw_workbook_options {
/** Optimize the workbook to use constant memory for worksheets */
Expand Down Expand Up @@ -334,7 +334,7 @@ lxw_workbook *workbook_new(const char *filename);
* to assembling the final XLSX file. The temporary files are created in the
* system's temp directory. If the default temporary directory isn't
* accessible to your application, or doesn't contain enough space, you can
* specify an alternative location using the `tempdir` option.*
* specify an alternative location using the `tmpdir` option.*
*
* See @ref working_with_memory for more details.
*
Expand Down
7 changes: 7 additions & 0 deletions libxlsxwriter/src/styles.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ _write_num_fmts(lxw_styles *self)
struct xml_attribute_list attributes;
struct xml_attribute *attribute;
lxw_format *format;
uint16_t last_format_index = 0;

if (!self->num_format_count)
return;
Expand All @@ -171,7 +172,13 @@ _write_num_fmts(lxw_styles *self)
if (format->num_format_index < 164)
continue;

/* Ignore duplicates which have an already used index. */
if (format->num_format_index <= last_format_index)
continue;

_write_num_fmt(self, format->num_format_index, format->num_format);

last_format_index = format->num_format_index;
}

lxw_xml_end_tag(self->file, "numFmts");
Expand Down
2 changes: 1 addition & 1 deletion libxlsxwriter/src/workbook.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ _prepare_num_formats(lxw_workbook *self)
num_format_index = calloc(1, sizeof(uint16_t));
*num_format_index = index;
format->num_format_index = index;
lxw_insert_hash_element(num_formats, num_format,
lxw_insert_hash_element(num_formats, format->num_format,
num_format_index,
LXW_FORMAT_FIELD_LEN);
index++;
Expand Down

0 comments on commit 7d5e212

Please sign in to comment.