Skip to content

Commit

Permalink
fixes iliaal#120 ExcelSheet::addPictureDim() arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
johmue committed Mar 4, 2015
1 parent 88637e2 commit 31cc409
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[2015-??-??] - Version 1.0.2
* Fixed bug in ExcelSheet::addPictureDim() (see issue #120)

[2015-02-26] - Version 1.0.1
* Added methods
- ExcelBook::sheetType()
Expand Down
4 changes: 2 additions & 2 deletions excel.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ enum libXLPictureType {PICTURETYPE_PNG, PICTURETYPE_JPEG, PICTURETYPE_WMF, PICTU
#define PHP_EXCEL_FORMULA 2
#define PHP_EXCEL_NUMERIC_STRING 3

#define PHP_EXCEL_VERSION "1.0.1"
#define PHP_EXCEL_VERSION "1.0.2dev"

#ifdef COMPILE_DL_EXCEL
ZEND_GET_MODULE(excel)
Expand Down Expand Up @@ -2882,7 +2882,7 @@ EXCEL_METHOD(Sheet, addPictureDim)
long row, col, pic_id, w, h;
long x_offset = 0, y_offset = 0;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllll", &row, &col, &pic_id, &w, &h, &x_offset, &y_offset) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllll|ll", &row, &col, &pic_id, &w, &h, &x_offset, &y_offset) == FAILURE) {
RETURN_FALSE;
}

Expand Down
4 changes: 3 additions & 1 deletion tests/025.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ date.timezone=America/Toronto
$s->addPictureDim(40,40,$pic2,578/2,406/2);
var_dump($x->getError());


$s->addPictureDim(40,40,$pic2,578/2,406/2,1,2);
var_dump($x->getError());

echo "OK\n";
?>
Expand All @@ -48,4 +49,5 @@ bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
OK

0 comments on commit 31cc409

Please sign in to comment.