-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Implement various missing features for the ODT writer #1796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implement a number of features implemented in PhpWord, but not yet supported in PhpWord ODT Writer. 1. Add default file to tests/PhpWord/_includes/XmlDocument.php to make it considerably easier to test ODT changes (and Word2007 changes involving files other that document.xml). 2. Page break before each section. 3. Page numbering start. 4. Font style for Headings. 5. Alignment for images. 6. Paragraph style for TextRun. 7. "Hide grammatical errors" for whole document. 8. Page layout for each section. 9. For each page layout, support user-specified page width, page height, orientation, margin top, margin bottom, margin left, margin right. 10. Page header and footer. 11. Named colors. 12. NoProof font style. 13. Paragraph Style - spaceBefore, spaceAfter, lineHeight, pageBreakBefore, indentation, text alignment. 14. Tab stops. 15. Basic support for some Fields (DATE, PAGE, NUMPAGES). 16. Link had an error in how it was handling internal links (needs leading #). 17. In addition to tests for all the above, added some tests for Tables. Item 11 above needs 1 module from Pull Request 1775, which is targeted for v0.18.0 but not yet merged, so the relevant module is also here. Item 15 above needs 1 module from Pull Request 1774, which is targeted for v0.18.0 but not yet merged, so the relevant module is also here. Testing change from Pull Request 1771 is included here, but was merged after my fork.
I do not understand one suggestion, and I believe one is wrong. I will add comments to my ticket once this is pushed. One that I can discuss up front PhpWord/Style/Paragraph indicates that Indentation must be of type \PhpOffice\PhpWord\Style\Indentation, but it can also be null. My test for instanceof ... is one of the Scrutinizer reports. I did not change PhpWord/Style/Paragraph, but this commit does so by updating @var for indentation.
Still one report that I don't understand at all, and one I'm not sure of.
I am completely baffled by the remaining Scrutinizer issue. In Writer\ODText\Element\Title, Two lesser Scrutinizer items that I may as well mention now. Writer/ODText/Style/Paragraph needs to test whether Indentation is null or not before using it. Scrutinizer reported a problem in Writer\ODText\Element\TextRun on the following code: |
Changes to improve test coverage based on Coveralls report.
Attempt to work around demonstrably incorrect Scrutinizer analysis (flags code as bug because "condition is always false" even though Coveralls reports that code which would be executed only if condition is true is indeed executed).
Cover one line previously omitted from coverage.
Coverage for Writer/ODText is now 100%.
Implement a number of features implemented in PhpWord,
but not yet supported in PhpWord ODT Writer.
considerably easier to test ODT changes (and Word2007 changes involving
files other that document.xml).
orientation, margin top, margin bottom, margin left, margin right.
indentation, text alignment.
Item 11 above needs 1 module from Pull Request 1775, which is targeted
for v0.18.0 but not yet merged, so the relevant module is also here.
Item 15 above needs 1 module from Pull Request 1774, which is targeted
for v0.18.0 but not yet merged, so the relevant module is also here.
Testing change from Pull Request 1771 is included here, but was
merged after my fork.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (issue)
Checklist:
composer run-script check --timeout=0
and no errors were reported