[GH-ISSUE #277] Will worksheet_merge_range() work for current row with 'constant_memory'? #221

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

Originally created by @znakeeye on GitHub (Mar 23, 2020).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/277

Originally assigned to: @jmcnamara on GitHub.

In worksheet.h I see the following alarming comment:

 /*
 * @note Merged ranges generally don’t work in libxlsxwriter when the Workbook
 * #lxw_workbook_options `constant_memory` mode is enabled.
 */
lxw_error worksheet_merge_range(lxw_worksheet *worksheet, lxw_row_t first_row,
                                lxw_col_t first_col, lxw_row_t last_row,
                                lxw_col_t last_col, const char *string,
                                lxw_format *format);

But what if first_row and last_row both equal the current row (in constant memory mode). Won't that work? I had some success with this restriction. Was it a mere coincidence or can you expect this API to work in that case?

If looping each row, and then each column... when can I expect this API to fail?

Originally created by @znakeeye on GitHub (Mar 23, 2020). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/277 Originally assigned to: @jmcnamara on GitHub. In `worksheet.h` I see the following alarming comment: ```c /* * @note Merged ranges generally don’t work in libxlsxwriter when the Workbook * #lxw_workbook_options `constant_memory` mode is enabled. */ lxw_error worksheet_merge_range(lxw_worksheet *worksheet, lxw_row_t first_row, lxw_col_t first_col, lxw_row_t last_row, lxw_col_t last_col, const char *string, lxw_format *format); ``` But what if `first_row` and `last_row` both equal the current row (in constant memory mode). Won't that work? I had some success with this restriction. Was it a mere coincidence or can you expect this API to work in that case? If looping each row, and then each column... when can I expect this API to fail?
gitea-mirror 2026-05-05 11:58:44 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jmcnamara commented on GitHub (Mar 23, 2020):

But what if first_row and last_row both equal the current row (in constant memory mode)

Yes. That will work.

<!-- gh-comment-id:602801011 --> @jmcnamara commented on GitHub (Mar 23, 2020): > But what if first_row and last_row both equal the current row (in constant memory mode) Yes. That will work.
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#221
No description provided.