arimu1 commented on PR #1211: URL: https://github.com/apache/poi/pull/1211#issuecomment-5274402233
Thanks for the review — you're right that the global `trailSpace = endD` change was incorrect. **What was wrong:** For XSSF, `endD` is the EMU offset from the left of the *end* cell, so trailing space must stay `dim - endD` (same fraction semantics as HSSF). Setting `trailSpace = endD` globally would: - add a full extra cell for multi-cell anchors with `dx2/dy2 == 0` - under-report normal in-cell anchors where `startD < endD` (`dim - startD - endD` instead of `endD - startD`) **Actual fix (#1201):** The bug is only the degenerate *same-cell* case (`col1==col2`, `dx1==dy1==dx2==dy2==0`) where `endD - startD == 0`, causing `picture.resize()` to fail. The updated commit reverts the global flip and handles only that case: when `startCell == endCell` and computed span `<= 0`, use full cell size if both offsets are 0, otherwise remaining cell space (`dim - leadSpace`). **Tests added:** 1. Degenerate in-cell `(0,0,0,0)` → full cell width/height (issue repro + resize) 2. Normal in-cell `startD < endD` → size == `endD - startD` 3. Multi-cell `dx2==0` → width == first column only (no extra cell) Tip: `05307f004acc5427f5c1164a37b6e1c299413757` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
