Fix getDimFromCell trailing space for XSSF in-cell picture anchors - #1211
Fix getDimFromCell trailing space for XSSF in-cell picture anchors#1211arimu1 wants to merge 2 commits into
Conversation
Revert the global XSSF trailSpace change (endD was wrong for multi-cell anchors). Handle only the degenerate same-cell case where endD - startD is zero or negative: use full cell size when both offsets are 0, otherwise remaining cell space (dim - leadSpace). Fixes apache#1201
cf967aa to
05307f0
Compare
|
Thanks for the review — you're right that the global What was wrong: For XSSF,
Actual fix (#1201): The bug is only the degenerate same-cell case ( Tests added:
Tip: |
| import org.apache.poi.ss.usermodel.ClientAnchor.AnchorType; | ||
| import org.apache.poi.ss.usermodel.Shape; | ||
| import org.apache.poi.ss.util.ImageUtils; | ||
| import org.apache.poi.hssf.HSSFITestDataProvider; |
|
Thanks @pjfanning — switched |
Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
2b9a8ab to
c3e08c5
Compare
Summary
ImageUtils.getDimFromCellwhenhssfUnits == 0(XSSF/OOXML anchors): useendDfor trailing space instead ofdim - endD, matching the semantics of the HSSF branch above it.picture.resize().Fixes #1201
Test plan
./gradlew :poi-ooxml:test --tests org.apache.poi.xssf.usermodel.TestXSSFPicture.testGetDimensionFromAnchorSingleCell./gradlew :poi:test --tests org.apache.poi.ss.util.TestImageUtilsMade with Cursor