Skip to content

Commit 234a6ae

Browse files
committed
Merge remote-tracking branch 'origin/master' into dev
2 parents caf3d93 + 3ac6f8c commit 234a6ae

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

config.m4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ if test "$PHP_XLSWRITER" != "no"; then
113113
],[
114114
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
115115
])
116+
PHP_CHECK_LIBRARY(xlsxwriter, lxw_fopen,
117+
[
118+
AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ])
119+
],[
120+
],[
121+
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
122+
])
116123
fi
117124

118125
AC_DEFINE(HAVE_LIBXLSXWRITER, 1, [ use system libxlsxwriter ])
@@ -134,6 +141,10 @@ if test "$PHP_XLSWRITER" != "no"; then
134141
if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 807; then
135142
AC_DEFINE(HAVE_WORKBOOK_ADD_VBA_PROJECT, 1, [ workbook_add_vba_project available in 0.8.7 ])
136143
fi
144+
145+
if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 808; then
146+
AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ])
147+
fi
137148
dnl see library/CMakeLists.txt
138149
LIBOPT="-DNOCRYPT -DNOUNCRYPT"
139150
fi

kernel/write.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,14 +507,22 @@ STATIC void
507507
_prepare_drawings(lxw_workbook *self)
508508
{
509509
lxw_worksheet *worksheet;
510+
#ifdef HAVE_LXW_OPEN
511+
lxw_object_properties *image_options;
512+
#else
510513
lxw_image_options *image_options;
514+
#endif
511515
uint16_t chart_ref_id = 0;
512516
uint16_t image_ref_id = 0;
513517
uint16_t drawing_id = 0;
514518

515519
STAILQ_FOREACH(worksheet, self->worksheets, list_pointers) {
516520

521+
#ifdef HAVE_LXW_OPEN
522+
if (STAILQ_EMPTY(worksheet->image_props)
523+
#else
517524
if (STAILQ_EMPTY(worksheet->image_data)
525+
#endif
518526
&& STAILQ_EMPTY(worksheet->chart_data))
519527
continue;
520528

@@ -534,7 +542,11 @@ _prepare_drawings(lxw_workbook *self)
534542
ordered_list_pointers);
535543
}
536544

545+
#ifdef HAVE_LXW_OPEN
546+
STAILQ_FOREACH(image_options, worksheet->image_props, list_pointers) {
547+
#else
537548
STAILQ_FOREACH(image_options, worksheet->image_data, list_pointers) {
549+
#endif
538550

539551
if (image_options->image_type == LXW_IMAGE_PNG)
540552
self->has_png = LXW_TRUE;

0 commit comments

Comments
 (0)