[GH-ISSUE #172] About the Known Issues and Bugs : Content is Unreadable. Open and Repair (with not repair at all) #139

Closed
opened 2026-05-05 11:46:03 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @Nipou on GitHub (Apr 27, 2018).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/172

Originally assigned to: @jmcnamara on GitHub.

Some structures require minimal initialization such as:
memset(&xline, 0, sizeof(lxw_chart_line));
memset(&yline, 0, sizeof(lxw_chart_line));

Others specific values like: lxw_chart_font need faceName != “” and a bad charset cause fatal error.

In C ++ a structure can have a constructor, this would always generate valid empty structures.

If you absolutely want C code, you would need initialization functions like
init_lxw_chart_font (lxw_chart_font *)
init_lxw_chart_line (lxw_chart_line *)

It would also be useful to have validation functions such as:
bool validate_lxw_chart_font (lxw_chart_font *)
bool validate_lxw_chart_line (lxw_chart_line *)

Who could correct a badly filled structure and return false in case of correction. Or at least false in case of error.

Originally created by @Nipou on GitHub (Apr 27, 2018). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/172 Originally assigned to: @jmcnamara on GitHub. Some structures require minimal initialization such as: memset(&xline, 0, sizeof(lxw_chart_line)); memset(&yline, 0, sizeof(lxw_chart_line)); Others specific values like: lxw_chart_font need faceName != “” and a bad charset cause fatal error. In C ++ a structure can have a constructor, this would always generate valid empty structures. If you absolutely want C code, you would need initialization functions like **init_lxw_chart_font** (lxw_chart_font *) **init_lxw_chart_line** (lxw_chart_line *) It would also be useful to have validation functions such as: bool **validate_lxw_chart_font** (lxw_chart_font *) bool **validate_lxw_chart_line** (lxw_chart_line *) Who could correct a badly filled structure and return false in case of correction. Or at least false in case of error.
Author
Owner

@jmcnamara commented on GitHub (Apr 27, 2018):

At some stage I may add functions that return initialised versions of structs used as parameters. But for now just initialise any structs that you are going to pass to libxlsxwriter functions:

lxw_chart_line line = {0); 

/* Or with  member initialisation. */
lxw_chart_line line = {.none      = LXW_FALSE,
                       .color     = LXW_COLOR_BLACK,
                       .width     = 2.25,
                       .dash_type = LXW_CHART_LINE_DASH_SOLID};
<!-- gh-comment-id:385062313 --> @jmcnamara commented on GitHub (Apr 27, 2018): At some stage I may add functions that return initialised versions of structs used as parameters. But for now just initialise any structs that you are going to pass to libxlsxwriter functions: ```C lxw_chart_line line = {0); /* Or with member initialisation. */ lxw_chart_line line = {.none = LXW_FALSE, .color = LXW_COLOR_BLACK, .width = 2.25, .dash_type = LXW_CHART_LINE_DASH_SOLID}; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#139
No description provided.