xlsxwriter 0.2.1.pre.2 → 0.2.3.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -3
  3. data/ext/xlsxwriter/chart.c +84 -20
  4. data/ext/xlsxwriter/chart.h +1 -0
  5. data/ext/xlsxwriter/chartsheet.c +34 -13
  6. data/ext/xlsxwriter/common.h +5 -5
  7. data/ext/xlsxwriter/extconf.rb +8 -8
  8. data/ext/xlsxwriter/libxlsxwriter/License.txt +24 -2
  9. data/ext/xlsxwriter/libxlsxwriter/Makefile +46 -12
  10. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/app.h +1 -1
  11. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/chart.h +196 -30
  12. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/chartsheet.h +3 -3
  13. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/comment.h +76 -0
  14. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/common.h +24 -5
  15. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/content_types.h +5 -1
  16. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/core.h +1 -1
  17. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/custom.h +1 -1
  18. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/drawing.h +6 -17
  19. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/format.h +20 -6
  20. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/hash_table.h +1 -1
  21. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/packager.h +3 -1
  22. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/relationships.h +1 -1
  23. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/shared_strings.h +1 -1
  24. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/styles.h +11 -5
  25. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/theme.h +1 -1
  26. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/third_party/md5.h +43 -0
  27. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/utility.h +42 -3
  28. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/vml.h +55 -0
  29. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/workbook.h +83 -18
  30. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/worksheet.h +1519 -109
  31. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter/xmlwriter.h +4 -2
  32. data/ext/xlsxwriter/libxlsxwriter/include/xlsxwriter.h +3 -2
  33. data/ext/xlsxwriter/libxlsxwriter/src/Makefile +25 -7
  34. data/ext/xlsxwriter/libxlsxwriter/src/app.c +1 -1
  35. data/ext/xlsxwriter/libxlsxwriter/src/chart.c +332 -48
  36. data/ext/xlsxwriter/libxlsxwriter/src/chartsheet.c +20 -19
  37. data/ext/xlsxwriter/libxlsxwriter/src/comment.c +443 -0
  38. data/ext/xlsxwriter/libxlsxwriter/src/content_types.c +20 -1
  39. data/ext/xlsxwriter/libxlsxwriter/src/core.c +2 -2
  40. data/ext/xlsxwriter/libxlsxwriter/src/custom.c +1 -1
  41. data/ext/xlsxwriter/libxlsxwriter/src/drawing.c +58 -20
  42. data/ext/xlsxwriter/libxlsxwriter/src/format.c +98 -25
  43. data/ext/xlsxwriter/libxlsxwriter/src/hash_table.c +1 -1
  44. data/ext/xlsxwriter/libxlsxwriter/src/packager.c +269 -12
  45. data/ext/xlsxwriter/libxlsxwriter/src/relationships.c +1 -1
  46. data/ext/xlsxwriter/libxlsxwriter/src/shared_strings.c +2 -4
  47. data/ext/xlsxwriter/libxlsxwriter/src/styles.c +334 -48
  48. data/ext/xlsxwriter/libxlsxwriter/src/theme.c +1 -1
  49. data/ext/xlsxwriter/libxlsxwriter/src/utility.c +71 -8
  50. data/ext/xlsxwriter/libxlsxwriter/src/vml.c +1032 -0
  51. data/ext/xlsxwriter/libxlsxwriter/src/workbook.c +343 -27
  52. data/ext/xlsxwriter/libxlsxwriter/src/worksheet.c +3759 -478
  53. data/ext/xlsxwriter/libxlsxwriter/src/xmlwriter.c +81 -2
  54. data/ext/xlsxwriter/libxlsxwriter/third_party/md5/Makefile +42 -0
  55. data/ext/xlsxwriter/libxlsxwriter/third_party/md5/md5.c +291 -0
  56. data/ext/xlsxwriter/libxlsxwriter/third_party/md5/md5.h +43 -0
  57. data/ext/xlsxwriter/rich_string.c +28 -9
  58. data/ext/xlsxwriter/shared_strings.c +75 -0
  59. data/ext/xlsxwriter/shared_strings.h +15 -0
  60. data/ext/xlsxwriter/workbook.c +87 -13
  61. data/ext/xlsxwriter/workbook.h +1 -0
  62. data/ext/xlsxwriter/workbook_properties.c +2 -2
  63. data/ext/xlsxwriter/worksheet.c +75 -23
  64. data/ext/xlsxwriter/worksheet.h +1 -0
  65. data/ext/xlsxwriter/xlsxwriter.c +2 -0
  66. data/lib/xlsxwriter/rich_string.rb +0 -2
  67. data/lib/xlsxwriter/version.rb +1 -1
  68. data/lib/xlsxwriter/worksheet.rb +2 -2
  69. data/test/{run-test.rb → run_test.rb} +3 -3
  70. data/test/support/chart_test.rb +3 -3
  71. data/test/support/with_xlsx_file.rb +4 -2
  72. data/test/support/xlsx_comparable.rb +40 -26
  73. data/test/test_array_formula.rb +42 -0
  74. data/test/test_autofilter.rb +72 -0
  75. data/test/{test-chart-area.rb → test_chart_area.rb} +2 -2
  76. data/test/{test-chart-axis.rb → test_chart_axis.rb} +16 -16
  77. data/test/test_chart_bar.rb +382 -0
  78. data/test/test_chart_blank.rb +27 -0
  79. data/test/{test-chart-column.rb → test_chart_column.rb} +2 -2
  80. data/test/{test-chart-doughnut.rb → test_chart_doughnut.rb} +2 -2
  81. data/test/{test-chart-legend.rb → test_chart_legend.rb} +2 -2
  82. data/test/{test-chart-pie.rb → test_chart_pie.rb} +2 -2
  83. data/test/{test-chart-scatter.rb → test_chart_scatter.rb} +3 -4
  84. data/test/{test-chart-size.rb → test_chart_size.rb} +2 -2
  85. data/test/{test-chart-title.rb → test_chart_title.rb} +3 -3
  86. data/test/{test-chartsheet.rb → test_chartsheet.rb} +2 -2
  87. data/test/{test-data.rb → test_data.rb} +1 -1
  88. data/test/{test-data-validation.rb → test_data_validation.rb} +23 -24
  89. data/test/{test-default-row.rb → test_default_row.rb} +1 -1
  90. data/test/{test-defined-name.rb → test_defined_name.rb} +12 -12
  91. data/test/{test-escapes.rb → test_escapes.rb} +5 -2
  92. data/test/{test-fit-to-pages.rb → test_fit_to_pages.rb} +6 -6
  93. data/test/{test-formatting.rb → test_formatting.rb} +10 -10
  94. data/test/{test-gridlines.rb → test_gridlines.rb} +3 -3
  95. data/test/{test-hyperlink.rb → test_hyperlink.rb} +22 -11
  96. data/test/{test-image.rb → test_image.rb} +6 -4
  97. data/test/{test-macro.rb → test_macro.rb} +1 -1
  98. data/test/{test-merge-range.rb → test_merge_range.rb} +1 -1
  99. data/test/{test-misc.rb → test_misc.rb} +2 -2
  100. data/test/{test-optimize.rb → test_optimize.rb} +2 -4
  101. data/test/{test-outline.rb → test_outline.rb} +14 -14
  102. data/test/{test-page-breaks.rb → test_page_breaks.rb} +2 -2
  103. data/test/{test-page-setup.rb → test_page_setup.rb} +2 -2
  104. data/test/{test-panes.rb → test_panes.rb} +1 -1
  105. data/test/{test-print-area.rb → test_print_area.rb} +3 -3
  106. data/test/{test-print-options.rb → test_print_options.rb} +7 -7
  107. data/test/{test-print-scale.rb → test_print_scale.rb} +2 -2
  108. data/test/{test-properties.rb → test_properties.rb} +2 -2
  109. data/test/{test-protect.rb → test_protect.rb} +3 -3
  110. data/test/{test-repeat.rb → test_repeat.rb} +3 -3
  111. data/test/{test-rich-string.rb → test_rich_string.rb} +5 -9
  112. data/test/{test-row-col-format.rb → test_row_col_format.rb} +1 -1
  113. data/test/{test-ruby-worksheet.rb → test_ruby_worksheet.rb} +2 -2
  114. data/test/{test-set-selection.rb → test_set_selection.rb} +2 -2
  115. data/test/{test-set-start-page.rb → test_set_start_page.rb} +2 -2
  116. data/test/{test-simple.rb → test_simple.rb} +10 -10
  117. data/test/{test-types.rb → test_types.rb} +1 -1
  118. data/test/{xlsx-func-testcase.rb → xlsx_func_testcase.rb} +1 -0
  119. metadata +127 -106
  120. data/test/test-array-formula.rb +0 -35
  121. data/test/test-autofilter.rb +0 -72
  122. data/test/test-chart-bar.rb +0 -74
  123. /data/test/{test-errors.rb → test_errors.rb} +0 -0
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * libxlsxwriter
3
3
  *
4
- * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
4
+ * Copyright 2014-2020, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
5
5
  *
6
6
  * xmlwriter - A libxlsxwriter library for creating Excel XLSX
7
7
  * XML files.
@@ -24,7 +24,7 @@
24
24
  #include <stdint.h>
25
25
  #include "utility.h"
26
26
 
27
- #define LXW_MAX_ATTRIBUTE_LENGTH 256
27
+ #define LXW_MAX_ATTRIBUTE_LENGTH 2080 /* Max URL length. */
28
28
  #define LXW_ATTR_32 32
29
29
 
30
30
  #define LXW_ATTRIBUTE_COPY(dst, src) \
@@ -167,7 +167,9 @@ void lxw_xml_data_element(FILE * xmlfile,
167
167
 
168
168
  void lxw_xml_rich_si_element(FILE * xmlfile, const char *string);
169
169
 
170
+ uint8_t lxw_has_control_characters(const char *string);
170
171
  char *lxw_escape_control_characters(const char *string);
172
+ char *lxw_escape_url_characters(const char *string, uint8_t escape_hash);
171
173
 
172
174
  char *lxw_escape_data(const char *data);
173
175
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * libxlsxwriter
3
3
  *
4
- * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
4
+ * Copyright 2014-2020, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
5
5
  */
6
6
 
7
7
  /**
@@ -18,6 +18,7 @@
18
18
  #include "xlsxwriter/format.h"
19
19
  #include "xlsxwriter/utility.h"
20
20
 
21
- #define LXW_VERSION "0.8.7"
21
+ #define LXW_VERSION "1.0.0"
22
+ #define LXW_VERSION_ID 100
22
23
 
23
24
  #endif /* __LXW_XLSXWRITER_H__ */
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # Makefile for libxlsxwriter library.
4
4
  #
5
- # Copyright 2014-2019, John McNamara, jmcnamara@cpan.org
5
+ # Copyright 2014-2020, John McNamara, jmcnamara@cpan.org
6
6
  #
7
7
 
8
8
  # Keep the output quiet by default.
@@ -11,6 +11,10 @@ ifdef V
11
11
  Q=
12
12
  endif
13
13
 
14
+ DESTDIR ?=
15
+ PREFIX ?= /usr/local
16
+ OPT_LEVEL ?= -O3
17
+
14
18
  # Directory variables.
15
19
  OBJS_DIR = .
16
20
  INC_DIR = ../include
@@ -27,7 +31,6 @@ MINIZIP_OBJ = $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o
27
31
  MINIZIP_SO = $(MINIZIP_DIR)/ioapi.so $(MINIZIP_DIR)/zip.so
28
32
  endif
29
33
 
30
-
31
34
  ifdef USE_STANDARD_TMPFILE
32
35
  # Use standard/C tmpfile().
33
36
  CFLAGS += -DUSE_STANDARD_TMPFILE
@@ -38,6 +41,16 @@ TMPFILEPLUS_OBJ = $(TMPFILEPLUS_DIR)/tmpfileplus.o
38
41
  TMPFILEPLUS_SO = $(TMPFILEPLUS_DIR)/tmpfileplus.so
39
42
  endif
40
43
 
44
+ ifdef USE_NO_MD5
45
+ # Don't use MD5 to avoid duplicate image files.
46
+ CFLAGS += -DUSE_NO_MD5
47
+ else
48
+ # Use md5 (the default).
49
+ MD5_DIR = ../third_party/md5
50
+ MD5_OBJ = $(MD5_DIR)/md5.o
51
+ MD5_SO = $(MD5_DIR)/md5.so
52
+ endif
53
+
41
54
  # Set flag for big endian architecture.
42
55
  ifdef USE_BIG_ENDIAN
43
56
  CFLAGS += -DLXW_BIG_ENDIAN
@@ -48,8 +61,13 @@ ifdef USE_DOUBLE_FUNCTION
48
61
  CFLAGS += -DUSE_DOUBLE_FUNCTION
49
62
  endif
50
63
 
64
+ # Use fmemopen() to avoid creating certain temporary files
65
+ ifdef USE_FMEMOPEN
66
+ CFLAGS += -DUSE_FMEMOPEN
67
+ endif
68
+
51
69
  # Flags passed to compiler.
52
- CFLAGS += -g -O3 -Wall -Wextra -pedantic -ansi
70
+ CFLAGS += -g $(OPT_LEVEL) -Wall -Wextra -Wstrict-prototypes -pedantic -ansi
53
71
 
54
72
 
55
73
  # Ignore icc remarks about inlining limits.
@@ -77,7 +95,7 @@ UNAME := $(shell uname)
77
95
  # Change make options on OS X.
78
96
  ifeq ($(UNAME), Darwin)
79
97
  LIBXLSXWRITER_SO = libxlsxwriter.dylib
80
- SOFLAGS = -dynamiclib $(FPIC) -install_name /usr/lib/$(LIBXLSXWRITER_SO)
98
+ SOFLAGS = -dynamiclib $(FPIC) -install_name $(PREFIX)/lib/$(LIBXLSXWRITER_SO)
81
99
  endif
82
100
 
83
101
  # Check for MinGW/MinGW64/Cygwin environments.
@@ -117,7 +135,7 @@ test_lib : libxlsxwriter_test.a
117
135
 
118
136
  # The static library.
119
137
  $(LIBXLSXWRITER_A) : $(OBJS)
120
- $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_OBJ) $(TMPFILEPLUS_OBJ) $^
138
+ $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_OBJ) $(TMPFILEPLUS_OBJ) $(MD5_OBJ) $^
121
139
 
122
140
  # The dynamic library.
123
141
  ifeq ($(findstring m32,$(CFLAGS)),m32)
@@ -125,11 +143,11 @@ ARCH = -m32
125
143
  endif
126
144
 
127
145
  $(LIBXLSXWRITER_SO) : $(SOBJS)
128
- $(Q)$(CC) $(LDFLAGS) $(SOFLAGS) $(ARCH) -o $@ $(MINIZIP_SO) $(TMPFILEPLUS_SO) $^ $(LIBS)
146
+ $(Q)$(CC) $(LDFLAGS) $(SOFLAGS) $(ARCH) -o $@ $(MINIZIP_SO) $(TMPFILEPLUS_SO) $(MD5_SO) $^ $(LIBS)
129
147
 
130
148
  # The test library.
131
149
  $(LIBXLSXWRITER_TO) : $(TOBJS)
132
- $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_OBJ) $(TMPFILEPLUS_OBJ) $^
150
+ $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_OBJ) $(TMPFILEPLUS_OBJ) $(MD5_OBJ) $^
133
151
 
134
152
  # Minimal target for quick compile without creating the libs.
135
153
  test_compile : $(OBJS)
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Used in conjunction with the libxlsxwriter library.
5
5
  *
6
- * Copyright 2014-2019, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
6
+ * Copyright 2014-2020, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
7
7
  *
8
8
  */
9
9