Skip to content

doc-codec: a table column boundary every row merges across identically cannot be recovered on read #992

Description

@Mearman

table/read.ts's assembleBlocks reconstructs a table's shared column grid as the union of every row's own rgdxaCenter boundaries (the union itself, and its twip-drift tolerance, are #895 and #898). When literally every row in a table merges across the identical column boundary -- the simplest case being a single-row table with one merged cell, which has no other row in the table to compare against -- no row's own rgdxaCenter ever states that boundary, so it cannot be recovered on read at all: columnWidthsPt narrows to however many columns the physical bytes actually distinguish, and the merged cell's own colSpan comes back undefined instead of the value it was written with.

This is inherent to [MS-DOC]'s own physical-cell model rather than a gap in the union/tolerance logic #898 added -- there is no byte anywhere in the file stating the missing boundary, so nothing short of stashing extra structural metadata outside ContentTable itself could recover it. write.test.ts's own "narrows columnWidthsPt to what the physical bytes can actually support when no row in the table ever states the boundary a merge crosses" test pins the exact behaviour, and the README's Tables section already documents it as a known limitation of the physical model rather than an approximation this package chooses to make.

Originally named in #959's own body alongside the double-line border-width factor-of-three bug that issue was actually opened for (fixed by #984). Filing this half separately since #984's "Fixes #959" auto-closes #959 on merge, and this part of it is untouched by that PR.

Affected package: doc-codec.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions