Skip to content

Conversation

Samuel-BF
Copy link
Contributor

Description

In #1493 fix, only page dimensions where rounded for RTF writers. But every numerical value should be rounded, as per the spec(v1.5, more recent versions say the same) :

The delimiter marks the end of an RTF control word, and can be one of the following : [...]

  • A digit or a hyphen (-), which indicates that a numeric parameter follows. The subsequent digital sequence is then delimited by a space or any character other than a letter or a digit.

This PR fixes that by rounding every numerical values used in formatting RTF documents (I hope i did not forget any value ...).

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • [-] The new code is covered by unit tests (check build/coverage for coverage report) (no new code)
  • [-] I have updated the documentation to describe the changes (not relevant)

…oat.

This is specified in the spec, for example here :
http://www.biblioscape.com/rtf15_spec.htm#Heading2
« The delimiter marks the end of an RTF control word, and can be one of the following : [...]
* A digit or a hyphen (-), which indicates that a numeric parameter follows. The subsequent digital sequence is then delimited by a space or any character other than a letter or a digit. »
@coveralls
Copy link

coveralls commented Dec 18, 2018

Coverage Status

Coverage decreased (-0.1%) to 94.538% when pulling 10b106c on Samuel-BF:fix-RTF-numerals into 0db21ae on PHPOffice:develop.

@troosan troosan changed the title Fixing RTF writers : numbers should be printed as integers and not float For RTF writers, sizes should should never have decimals Dec 26, 2018
@troosan troosan added this to the v0.16.0 milestone Dec 26, 2018
@troosan troosan merged commit 0f963e4 into PHPOffice:develop Dec 26, 2018
@Samuel-BF Samuel-BF deleted the fix-RTF-numerals branch December 30, 2018 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants