|
@@ -36,6 +36,7 @@
|
|
|
#include "exception.h"
|
|
|
#include "format.h"
|
|
|
#include "chart.h"
|
|
|
+#include "rich_string.h"
|
|
|
#include "help.h"
|
|
|
|
|
|
#ifdef ENABLE_READER
|
|
@@ -95,6 +96,10 @@ typedef struct {
|
|
|
lxw_chart_series *series;
|
|
|
} xls_resource_chart_t;
|
|
|
|
|
|
+typedef struct {
|
|
|
+ lxw_rich_string_tuple *tuple;
|
|
|
+} xls_resource_rich_string_t;
|
|
|
+
|
|
|
typedef struct _vtiful_xls_object {
|
|
|
xls_resource_read_t read_ptr;
|
|
|
xls_resource_write_t write_ptr;
|
|
@@ -118,16 +123,22 @@ typedef struct _vtiful_validation_object {
|
|
|
zend_object zo;
|
|
|
} validation_object;
|
|
|
|
|
|
+typedef struct _vtiful_rich_string_object {
|
|
|
+ xls_resource_rich_string_t ptr;
|
|
|
+ zend_object zo;
|
|
|
+} rich_string_object;
|
|
|
+
|
|
|
#define REGISTER_CLASS_CONST_LONG(class_name, const_name, value) \
|
|
|
zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value);
|
|
|
|
|
|
#define REGISTER_CLASS_PROPERTY_NULL(class_name, property_name, acc) \
|
|
|
zend_declare_property_null(class_name, ZEND_STRL(property_name), acc);
|
|
|
|
|
|
-#define Z_XLS_P(zv) php_vtiful_xls_fetch_object(Z_OBJ_P(zv));
|
|
|
-#define Z_CHART_P(zv) php_vtiful_chart_fetch_object(Z_OBJ_P(zv));
|
|
|
-#define Z_FORMAT_P(zv) php_vtiful_format_fetch_object(Z_OBJ_P(zv));
|
|
|
-#define Z_VALIDATION_P(zv) php_vtiful_validation_fetch_object(Z_OBJ_P(zv));
|
|
|
+#define Z_XLS_P(zv) php_vtiful_xls_fetch_object(Z_OBJ_P(zv));
|
|
|
+#define Z_CHART_P(zv) php_vtiful_chart_fetch_object(Z_OBJ_P(zv));
|
|
|
+#define Z_FORMAT_P(zv) php_vtiful_format_fetch_object(Z_OBJ_P(zv));
|
|
|
+#define Z_VALIDATION_P(zv) php_vtiful_validation_fetch_object(Z_OBJ_P(zv));
|
|
|
+#define Z_RICH_STR_P(zv) php_vtiful_rich_string_fetch_object(Z_OBJ_P(zv));
|
|
|
|
|
|
#define WORKBOOK_NOT_INITIALIZED(xls_object_t) \
|
|
|
do { \
|
|
@@ -254,6 +265,14 @@ static inline validation_object *php_vtiful_validation_fetch_object(zend_object
|
|
|
return (validation_object *)((char *)(obj) - XtOffsetOf(validation_object, zo));
|
|
|
}
|
|
|
|
|
|
+static inline rich_string_object *php_vtiful_rich_string_fetch_object(zend_object *obj) {
|
|
|
+ if (obj == NULL) {
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (rich_string_object *)((char *)(obj) - XtOffsetOf(validation_object, zo));
|
|
|
+}
|
|
|
+
|
|
|
static inline void php_vtiful_close_resource(zend_object *obj) {
|
|
|
if (obj == NULL) {
|
|
|
return;
|
|
@@ -287,10 +306,11 @@ static inline void php_vtiful_close_resource(zend_object *obj) {
|
|
|
intern->read_ptr.data_type_default = READ_TYPE_EMPTY;
|
|
|
}
|
|
|
|
|
|
-lxw_format * zval_get_format(zval *handle);
|
|
|
-lxw_data_validation * zval_get_validation(zval *resource);
|
|
|
-xls_resource_write_t * zval_get_resource(zval *handle);
|
|
|
-xls_resource_chart_t * zval_get_chart(zval *resource);
|
|
|
+lxw_format * zval_get_format(zval *handle);
|
|
|
+lxw_data_validation * zval_get_validation(zval *resource);
|
|
|
+lxw_rich_string_tuple * zval_get_rich_string(zval *resource);
|
|
|
+xls_resource_write_t * zval_get_resource(zval *handle);
|
|
|
+xls_resource_chart_t * zval_get_chart(zval *resource);
|
|
|
|
|
|
STATIC lxw_error _store_defined_name(lxw_workbook *self, const char *name, const char *app_name, const char *formula, int16_t index, uint8_t hidden);
|
|
|
|
|
@@ -327,6 +347,7 @@ void worksheet_set_rows(lxw_row_t start, lxw_row_t end, double height, xls_resou
|
|
|
void image_writer(zval *value, zend_long row, zend_long columns, double width, double height, xls_resource_write_t *res);
|
|
|
void formula_writer(zend_string *value, zend_long row, zend_long columns, xls_resource_write_t *res, lxw_format *format);
|
|
|
void type_writer(zval *value, zend_long row, zend_long columns, xls_resource_write_t *res, zend_string *format, lxw_format *format_handle);
|
|
|
+void rich_string_writer(zend_long row, zend_long columns, xls_resource_write_t *res, zval *rich_strings, lxw_format *format);
|
|
|
void datetime_writer(lxw_datetime *datetime, zend_long row, zend_long columns, zend_string *format, xls_resource_write_t *res, lxw_format *format_handle);
|
|
|
void url_writer(zend_long row, zend_long columns, xls_resource_write_t *res, zend_string *url, zend_string *text, zend_string *tool_tip, lxw_format *format);
|
|
|
|