Skip to content
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

Fix unit tests for BESSEL functions #10

Merged
merged 1 commit into from
Aug 13, 2016
Merged

Fix unit tests for BESSEL functions #10

merged 1 commit into from
Aug 13, 2016

Conversation

PowerKiKi
Copy link
Member

Expected data were re-written by using LibreOffice 5 as a reference.
We kept only 8 decimals, because this is the precision used in tests,
and it's easier to read without scientific notation.

Also a few expected values were wrong so they were changed. The correct
expected values were confirmed by both LibreOffice 5 and wolframalpha.com.

Finally fixed an actual bug in code were a NaN value were returned instead of
the correct #NUM!.

Expected data were re-written by using LibreOffice 5 as a reference.
We kept only 8 decimals, because this is the precision used in tests,
and it's easier to read without scientific notation.

Also a few expected values were wrong so they were changed. The correct
expected values were confirmed by both LibreOffice 5 and wolframalpha.com.

Finally fixed an actual bug in code were a NaN value were returned instead of
the correct `#NUM!`.
@MarkBaker MarkBaker merged commit 9ecfc0c into PHPOffice:develop Aug 13, 2016
github-merge-queue bot pushed a commit that referenced this pull request May 5, 2024
Fix #4001. Thanks to @SlowFox71 who reported the problem and developed most of the solution. This PR adds Rich Text support to the XML reader. The Xml Spreadsheet stores Rich Text as Html tags, children of the ss:Data tag using a specific namespace. These can be parsed into a RichText object using existing method Helper/Html::toRichTextObject. There are 2 items which need special attention.

First, for attributes like bold or italic, Excel uses the appropriate Html tag (e.g. `<B>`). However, for an attribute like color, Excel uses `<Font html:Color="#FF0000">`, with a prefix on the Color tag. PhpSpreadsheet's Html parser cannot cope with the prefix. The parser is changed to strip `html:` from attribute names for the Font tag.

The example cited by the user used a `<BR />` to indicate a line break in the data. However, it appears that, at least some of the time, Excel will instead use `&#10;` to indicate a line break. The existing parser reduces one or more whitespace characters in the text to a single space, and so `&#10;` will wind up disappearing. I am not sure why the existing code does this, but I do know that I am not willing to break it. Instead, I've added an optional boolean parameter `$preserveWhiteSpace` to `toRichTextObject`. If false (default), the existing logic will be used; but if true, substitution for whitespace characters in the text will not happen.
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.

2 participants