pjfanning opened a new pull request, #1336:
URL: https://github.com/apache/poi/pull/1336

   Follow-up to #1334 (bug 69977), which noted this related asymmetry.
   
   `POIXMLUnits.parsePercent(STHoleSize)` scaled a unit-less value by 1 but a 
value with a trailing percent sign by 1000 — unlike every other chart overload 
(`STGapAmount`, `STOverlap`, `STDepthPercent`, `STHPercent`) and unlike the 
documented contract of all `parsePercent` methods ("the percent scaled by 
1000"). So `XDDFDoughnutChartData.getHoleSize()` returned `50` for `<c:holeSize 
val="50"/>` but `50000` for `<c:holeSize val="50%"/>`, the form Office also 
writes.
   
   This aligns the overload with its siblings (scale 1000) and divides by 1000 
in `getHoleSize()`, its only caller in POI, so the getter returns the 
percentage the setter takes for both forms.
   
   Note: `parsePercent(STHoleSize)` is public, so its return value for 
unit-less input changes from `n` to `n * 1000`; that brings it in line with its 
Javadoc and the other overloads.
   
   Test in `TestXDDFChart` covers the round trip, the `"75%"` form, and 
unsetting.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to