Skip to content

Commit 6301143

Browse files
committed
Feat: exception in const memory mode, you cannot modify the placed cells
1 parent c4e886c commit 6301143

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kernel/write.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,14 @@ void auto_filter(zend_string *range, xls_resource_write_t *res)
201201
*/
202202
void merge_cells(zend_string *range, zend_string *value, xls_resource_write_t *res, lxw_format *format)
203203
{
204-
worksheet_merge_range(res->worksheet, RANGE(ZSTR_VAL(range)), ZSTR_VAL(value), format);
204+
int error = worksheet_merge_range(res->worksheet, RANGE(ZSTR_VAL(range)), ZSTR_VAL(value), format);
205+
206+
// Cells that have been placed cannot be modified using optimization mode
207+
if(res->worksheet->optimize && error == LXW_ERROR_WORKSHEET_INDEX_OUT_OF_RANGE)
208+
{
209+
zend_throw_exception(vtiful_exception_ce, "In const memory mode, you cannot modify the placed cells", 170);
210+
return;
211+
}
205212
}
206213

207214
/*

0 commit comments

Comments
 (0)