Skip to content

fix(table-patch): line spacing in cells holding tables and fresh numbers for copies of copies - #659

Merged
airmang merged 5 commits into
mainfrom
feat/nested-table-gaps
Nov 3, 2026
Merged

airmang merged 5 commits into
mainfrom
feat/nested-table-gaps

Conversation

@airmang

@airmang airmang commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Closes the three gaps left after #639 (nested tables).

Fixes

  • set_cell_line_spacing in a cell holding a table: changes the cell's own paragraphs (including the one holding the table) and drops only their line caches. A table or text box in the cell keeps its bytes. Before, choosing rows also changed the inner table's cells at the same address. An inner table is addressed by its own table_index.
  • Copies of copies never repeat a number: a copied table (whole, or nested in a copied cell) gets a fresh id unused in the document and a zOrder above the document's, as Hancom numbers a pasted table (observed through public COM: SelectAll/Copy/Paste/SaveAs, then comparing the saved HWPX). Paragraphs take ids unused in the document. Before, copying a row holding a table twice repeated the table id, and insert_block_by_clone twice repeated paragraph ids.
  • insert_block_by_clone numbers pictures, shapes, fields and memos as row clones do; a block holding a chart, linked text boxes or a header/footer defined in a cell refuses.
  • clone_table numbers the table and its nested tables and objects as a pasted table; before they kept the original's numbers.
  • split_cell_vertical leaves each new part one empty paragraph of the cell's format; before it copied the content, so pictures and shapes repeated their numbers.
  • Object model set_column_widths / equalize_column_widths refuse (TableStructureError) a width that leaves a cell narrower than the table nested in it, and leave the table as it was.
  • CHANGELOG: fix(pages): place a square-wrapped object from its paragraph's top above the spacing #647 and fix(pages): make the empty last line after a line break as tall as the run ending the paragraph #651 merged after the 6.11.0 tag, so their entries move to [Unreleased].

The 248 tables flagged unsafe before any edit

They come from 4 private documents only, whose originals already carry stale line caches (text positions past the text, or missing lines). The check is right; no code change.

Verification

  • Full suite: 7602 passed; the only failures are the 6 known Windows-only ones (symlink privilege ×3, CRLF ×2, latex2mathml ×1). Table tests 827 passed; after merging main, focused suites 1665 passed. mypy, ruff, hygiene clean.
  • 8 new tests fail on main and pass here.
  • Real documents, set_cell_line_spacing on every row, old (6.11.0) vs new, on tables holding tables or extra paragraph lists (970 tables, 221 documents):
    • 680 tables holding tables: new keeps every inner table byte for byte (680/680); old changed 607. Open-safety identical (514 safe in both).
    • 290 flat tables with memos, text boxes or captions: 131 byte-identical; the rest differ as intended (those objects' paragraphs are no longer restyled). Safety identical.
    • Nothing outside the edited table changed (0/970). The 177 tables unsafe in both come from 4 documents with stale caches in the original.
  • Desktop Hangul gate, 400 edited files (clone_table 118, line spacing 92, row/col copies 90, block ×2 89, vertical split 11): resave 400/400 opened and saved with no element lost; page images vs a cache-stripped copy show 0 differences caused by the edits (31 differing pages all in 10 documents whose originals differ the same way; 5 image errors checked by resave layout comparison, same as their originals).

🤖 Generated with Claude Code

airmang and others added 5 commits November 2, 2026 15:08
…ers for copies of copies

set_cell_line_spacing now changes a cell's own paragraphs when the cell holds a
table and never reaches into a table held by another cell. Nested tables copied
with a cell, insert_block_by_clone and clone_table number tables, objects and
paragraphs as Hancom numbers a pasted table, so copying a copy repeats no id.
split_cell_vertical leaves its new parts empty. The object model's column
width edits refuse to leave a cell narrower than the table nested in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both merged after the 6.11.0 tag (a405857), so they belong under [Unreleased].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit 5ca12c7 into main Nov 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant