Skip to content

WIP Do Not Install - #2567

Draft
oleibman wants to merge 283 commits into
PHPOffice:masterfrom
oleibman:wordunimplemented2
Draft

oleibman wants to merge 283 commits into
PHPOffice:masterfrom
oleibman:wordunimplemented2

Conversation

@oleibman

@oleibman oleibman commented Feb 6, 2024

Copy link
Copy Markdown
Contributor

All my unimplemented changes. Not intended for install.

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

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)
  • I have updated the documentation to describe the changes

@oleibman
oleibman marked this pull request as draft February 6, 2024 23:25
@coveralls

coveralls commented Feb 6, 2024 •

Copy link
Copy Markdown

Coverage Status

coverage: 98.553% (+2.0%) from 96.582% — oleibman:wordunimplemented2 into PHPOffice:master

JSON is used in exactly 2 places in the code and should not be used in either.

XMLWriter uses it to cast a float to string. Aside from being silly, this actually causes a problem in Shared/HtmlTest, where one of the results should be 4000 but is instead tested for 3999.9999... The error should have been immaterial (a simple cast will give the correct answer), but the test was wrong, insisting on an exact match for a floating point answer. It should use assertEqualsWithDelta. Next, the reason why JSON got it "wrong" was because the conversions in Shared/Converter use the wrong order of operations - multiplications should be performed before divisions to help avoid rounding problems, but Converter was doing the divisions first. All the conversions there are changed to multiply before dividing. Finally, Shared/Html checks for width units of points or pixels, but should check for inches and centimers as well.

Writer/Html outputs tracking properties as a JSON string for some unfathomable reason. It is changed to output each of the three (author, id, and date) as its own discrete property. Tests didn't actually confirm the value of the properties; they do now. Oh, yes, htmlspecialchars is needed for author and id, otherwise the html may wind up broken.

Some simple changes are made to TestHelperDOCX to avoid intermittent problems on Windows, and to make the code a little cleaner.
Nominally redundant, but makes things easier for Html Reader.
Couldn't resolve a good version for mpdf.
Dompdf (temporary till 8.5-compatible release available), `chr` in Reader/MsDoc, `setAccessible` in AbstractStyleTest.

This branch has not been deployed

No deployments
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