diff options
author | Remi Collet <remi@remirepo.net> | 2019-11-18 10:28:34 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-11-18 10:28:34 +0100 |
commit | 2cd20b96dd9d8e67bf684e7eddf49bb148e92b3e (patch) | |
tree | c6879bc46bf8cdf054f4814d58cdfa6f32d567b9 /199.patch | |
parent | eacd54f11f4d6d9bb33f368fa6e17dd6b34d6e98 (diff) |
- rebuild with libxlsxwriter 0.8.8
- open https://github.com/viest/php-ext-excel-export/pull/199
fix compatibility with 0.8.8
Diffstat (limited to '199.patch')
-rw-r--r-- | 199.patch | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/199.patch b/199.patch new file mode 100644 index 0000000..738ea31 --- /dev/null +++ b/199.patch @@ -0,0 +1,78 @@ +From dc34e4de787085ae0cbca373fb064d89c841ba05 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Mon, 18 Nov 2019 09:42:20 +0100 +Subject: [PATCH] fix compatibility with libxlsxwriter 0.8.8 + +--- + config.m4 | 11 +++++++++++ + kernel/write.c | 12 ++++++++++++ + 2 files changed, 23 insertions(+) + +diff --git a/config.m4 b/config.m4 +index 56c26fb..c0121a6 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -113,6 +113,13 @@ if test "$PHP_XLSWRITER" != "no"; then + ],[ + -L$XLSXWRITER_DIR/$PHP_LIBDIR -lm + ]) ++ PHP_CHECK_LIBRARY(xlsxwriter, lxw_fopen, ++ [ ++ AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ]) ++ ],[ ++ ],[ ++ -L$XLSXWRITER_DIR/$PHP_LIBDIR -lm ++ ]) + fi + + AC_DEFINE(HAVE_LIBXLSXWRITER, 1, [ use system libxlsxwriter ]) +@@ -134,6 +141,10 @@ if test "$PHP_XLSWRITER" != "no"; then + if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 807; then + AC_DEFINE(HAVE_WORKBOOK_ADD_VBA_PROJECT, 1, [ workbook_add_vba_project available in 0.8.7 ]) + fi ++ ++ if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 808; then ++ AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ]) ++ fi + dnl see library/CMakeLists.txt + LIBOPT="-DNOCRYPT -DNOUNCRYPT" + fi +diff --git a/kernel/write.c b/kernel/write.c +index 099e176..c4c7e4b 100644 +--- a/kernel/write.c ++++ b/kernel/write.c +@@ -507,14 +507,22 @@ STATIC void + _prepare_drawings(lxw_workbook *self) + { + lxw_worksheet *worksheet; ++#ifdef HAVE_LXW_OPEN ++ lxw_object_properties *image_options; ++#else + lxw_image_options *image_options; ++#endif + uint16_t chart_ref_id = 0; + uint16_t image_ref_id = 0; + uint16_t drawing_id = 0; + + STAILQ_FOREACH(worksheet, self->worksheets, list_pointers) { + ++#ifdef HAVE_LXW_OPEN ++ if (STAILQ_EMPTY(worksheet->image_props) ++#else + if (STAILQ_EMPTY(worksheet->image_data) ++#endif + && STAILQ_EMPTY(worksheet->chart_data)) + continue; + +@@ -534,7 +542,11 @@ _prepare_drawings(lxw_workbook *self) + ordered_list_pointers); + } + ++#ifdef HAVE_LXW_OPEN ++ STAILQ_FOREACH(image_options, worksheet->image_props, list_pointers) { ++#else + STAILQ_FOREACH(image_options, worksheet->image_data, list_pointers) { ++#endif + + if (image_options->image_type == LXW_IMAGE_PNG) + self->has_png = LXW_TRUE; |