PowerPoint2007 Writer : Keep the borders a cell asked for - #906
Open
dkulyk wants to merge 1 commit into
Open
Conversation
dkulyk
force-pushed
the
fix/table-cell-borders
branch
from
August 22, 2026 10:27
2690cbf to
f4ed149
Compare
The block under "Fix PowerPoint implementation" hands a shared edge to one of the two cells that touch it, which is sound, but it inspects the opposite side of the neighbour from the one it then copies: the right border is replaced by the neighbour's left whenever the neighbour's *right* is non-default, and the bottom by the cell below's top whenever that cell's *bottom* is non-default. So a cell lost the borders it owns as soon as it had a neighbour on that side. Measured on a two-column, three-row table where every cell sets its own right and bottom rule: only the last column kept its right border and only the last row kept its bottom one, the other eight edges falling back to the default. Inspect the side that is copied -- the one facing this cell. The neighbour still wins the shared edge, but only when the neighbour is the one that asked for it.
dkulyk
force-pushed
the
fix/table-cell-borders
branch
from
August 23, 2026 12:12
f4ed149 to
018a371
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #808
AbstractSlide::writeShapeTable()hands the edge shared by two neighbouring cells to one of them, which is sound. But it inspects the opposite side of the neighbour from the one it then copies:So a cell loses the borders it owns as soon as it has a neighbour on that side, and the rule that replaces them is whatever the neighbour has on the facing side — usually the default. Left and top are never overridden, which is exactly the "left works, bottom does not" shape of the report.
Measured
A two-column, three-row table where every cell sets its own right and bottom rule (
LINE_THICKTHIN/LINE_DOUBLE):a:lnRbeforea:lnBbeforesngsngthickThin/dblthickThinsngthickThin/dblsngsngthickThin/dblthickThinsngthickThin/dblsngdblthickThin/dblthickThindblthickThin/dblEight of the twelve rules were dropped. Only the last column kept its right border and only the last row its bottom one — the two positions with no neighbour to be overridden by.
The fix
Inspect the side that is copied, the one facing this cell. The neighbour still wins the shared edge, but only when the neighbour is the one that asked for it — verified separately: a right neighbour that sets only its left border, and a cell below that sets only its top, both land on the top left cell as before.
Worth noting for anyone who worked around this: the old code required setting both sides of the neighbour — its right (to trip the guard) and its left (to supply the value). Setting just the facing side now works, and setting the border on the cell that owns it works too.
Checklist:
The existing
testTableWithBorderpasses unchanged, which is the problem — its XPath.../a:tr/a:tc/a:tcPrmatches any cell in any row, so default borders satisfied it.PptSlidesTest::testTableWithBorderOnEveryCellandtestTableWithBorderOwnedByTheNeighbouranchor ona:tr[1]/a:tc[1], the one cell that has both a neighbour to its right and a row below. Both fail on the current code and pass on the fix, and both are schema-validated.docs/usage/shapes/table.mdsaid nothing about borders at all. New Define the borders section, including the sharing rule — which is what tells a caller which cell to set.