Fix #2526. Most of that issue has already been fixed. The one remaining problem was a deprecation message handling font size. The code used dechex($operand / 2), and issued the deprecation message whenever $operand was odd because dechex is designed only for integer conversion. $operand is actually 2 times the point size, so it will be odd only when the point size is some integer plus half a point (no other fractions are allowed). At any rate, it seems that dechex should not be used here in the first place; font size is a numeric value, not a hex string.
There are many problems with MsDoc Reader at the moment. This PR is narrowly focused on the problem at hand. Its test is, at least, more detailed than the existing MsDoc Reader test, which does nothing more than confirm that read successfully creates a PhpWord object. The new test verifies that the font size is as expected, but does not validate any other aspect of the read.
Fix #2526
Checklist:
[x] I have run composer run-script check --timeout=0 and no errors were reported
[x] The new code is covered by unit tests (check build/coverage for coverage report)
[ ] I have updated the documentation to describe the changes
coverage: 97.212% (+1.7%) from 95.532%
when pulling 0709ae36dd79d49ab3b91bf0cde5e65d0b28c9eb on oleibman:word2526
into e76b701ef538cb749641514fcbc31a68078550fa on PHPOffice:master.
Description
Fix #2526. Most of that issue has already been fixed. The one remaining problem was a deprecation message handling font size. The code used
dechex($operand / 2)
, and issued the deprecation message whenever$operand
was odd becausedechex
is designed only for integer conversion.$operand
is actually 2 times the point size, so it will be odd only when the point size is some integer plus half a point (no other fractions are allowed). At any rate, it seems thatdechex
should not be used here in the first place; font size is a numeric value, not a hex string.There are many problems with MsDoc Reader at the moment. This PR is narrowly focused on the problem at hand. Its test is, at least, more detailed than the existing MsDoc Reader test, which does nothing more than confirm that read successfully creates a PhpWord object. The new test verifies that the font size is as expected, but does not validate any other aspect of the read.
Fix #2526
Checklist:
composer run-script check --timeout=0
and no errors were reported