[GH-ISSUE #231] worksheet_write_rich_string(): support 1 fragment #186

Closed
opened 2026-05-05 11:51:15 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @mewalig on GitHub (Jun 6, 2019).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/231

Originally assigned to: @jmcnamara on GitHub.

Rather than require the caller to check how many fragments there are and handle the 1 case differently from the 1+ case, it would be nice if worksheet_write_string() would do it:

if (i <= 2)
   /*  err = LXW_ERROR_PARAMETER_VALIDATION; */
  return worksheet_write_string(self, row, col, rich_strings[0]->string, rich_strings[0]->format);
Originally created by @mewalig on GitHub (Jun 6, 2019). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/231 Originally assigned to: @jmcnamara on GitHub. Rather than require the caller to check how many fragments there are and handle the 1 case differently from the 1+ case, it would be nice if worksheet_write_string() would do it: if (i <= 2) /* err = LXW_ERROR_PARAMETER_VALIDATION; */ return worksheet_write_string(self, row, col, rich_strings[0]->string, rich_strings[0]->format);
gitea-mirror 2026-05-05 11:51:15 -06:00
Author
Owner

@jmcnamara commented on GitHub (Jun 6, 2019):

Rather than require the caller to check how many fragments there are and handle the 1 case differently from the 1+ case,

I think this case should be handled by the user. If there aren't string fragments then it isn't a rich string.

So, unfortunately, this is a won't fix for me. But thanks for the suggestion.

<!-- gh-comment-id:499484214 --> @jmcnamara commented on GitHub (Jun 6, 2019): > Rather than require the caller to check how many fragments there are and handle the 1 case differently from the 1+ case, I think this case should be handled by the user. If there aren't string fragments then it isn't a rich string. So, unfortunately, this is a won't fix for me. But thanks for the suggestion.
Author
Owner

@jmcnamara commented on GitHub (Jun 6, 2019):

BTW, you are encountering a lot of edge case in the library (which is good). What are you working on?

<!-- gh-comment-id:499484425 --> @jmcnamara commented on GitHub (Jun 6, 2019): BTW, you are encountering a lot of edge case in the library (which is good). What are you working on?
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#186
No description provided.