Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidaty committed Dec 17, 2024
1 parent d9685e0 commit 91aa7ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/ext_example/mysheet_extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ static struct pivot_row *get_pivot_row_data(struct pivot_data *pd, size_t row_ix
}

// TO DO: return zsvsheet_status
static enum zsv_ext_status get_cell_attrs(void *pdh, int *attrs, size_t start_row, size_t row_count, size_t cols) {
static enum zsv_ext_status get_cell_attrs(void *pdh, zsvsheet_cell_attr_t *attrs, size_t start_row, size_t row_count, size_t cols) {
struct pivot_data *pd = pdh;
size_t end_row = start_row + row_count;
if (end_row > pd->rows.used)
end_row = pd->rows.used;
for (size_t i = start_row; i < end_row; i++)
attrs[i * cols] = zsv_cb.zsvsheet_cell_profile_attrs(zsvsheet_cell_profile_link);
attrs[i * cols] = zsv_cb.ext_sheet_cell_profile_attrs(zsvsheet_cell_attr_profile_link);
return zsv_ext_status_ok;
}

Expand Down
5 changes: 3 additions & 2 deletions app/sheet/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ enum zsv_ext_status zsvsheet_buffer_get_ctx(zsvsheet_buffer_t h, void **ctx_out)

/** Set callback for fetching cell attributes **/
void zsvsheet_buffer_set_cell_attrs(zsvsheet_buffer_t h,
enum zsv_ext_status (*get_cell_attrs)(void *ext_ctx, int *, size_t start_row,
size_t row_count, size_t col_count)) {
enum zsv_ext_status (*get_cell_attrs)(void *ext_ctx, zsvsheet_cell_attr_t *,
size_t start_row, size_t row_count,
size_t col_count)) {
if (h) {
struct zsvsheet_ui_buffer *buff = h;
buff->get_cell_attrs = get_cell_attrs;
Expand Down
5 changes: 3 additions & 2 deletions app/sheet/handlers_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ zsvsheet_status zsvsheet_buffer_get_selected_cell(zsvsheet_buffer_t h, struct zs
* Set custom cell attributes
*/
void zsvsheet_buffer_set_cell_attrs(zsvsheet_buffer_t h,
enum zsv_ext_status (*get_cell_attrs)(void *ext_ctx, int *, size_t start_row,
size_t row_count, size_t col_count));
enum zsv_ext_status (*get_cell_attrs)(void *ext_ctx, zsvsheet_cell_attr_t *,
size_t start_row, size_t row_count,
size_t col_count));

/** Get zsv_opts use to open the buffer's data file **/
struct zsv_opts zsvsheet_buffer_get_zsv_opts(zsvsheet_buffer_t h);
Expand Down

0 comments on commit 91aa7ae

Please sign in to comment.