Repository navigation
Conversation
| * | ||
| * @return string | ||
| */ | ||
| public function getUnderlineColor() |
There was a problem hiding this comment.
| public function getUnderlineColor() | |
| public function getUnderlineColor(): string |
| * | ||
| * @return self | ||
| */ | ||
| public function setUnderlineColor(?string $value = null) |
There was a problem hiding this comment.
| public function setUnderlineColor(?string $value = null) | |
| public function setUnderlineColor(string $value = ''): self |
| * | ||
| * @param string|null $value | ||
| * | ||
| * @return self |
There was a problem hiding this comment.
| * | |
| * @param string|null $value | |
| * | |
| * @return self |
| * | ||
| * @return string |
There was a problem hiding this comment.
| * | |
| * @return string |
| */ | ||
| private $underline = self::UNDERLINE_NONE; | ||
|
|
||
| private $underlineColor; |
There was a problem hiding this comment.
| private $underlineColor; | |
| /** | |
| * Underline color. | |
| * | |
| * @var string | |
| */ | |
| private $underlineColor = ''; |
| $css['vertical-align'] .= $this->getValueIf($style->isSubScript(), 'sub'); | ||
| $css['text-decoration'] = ''; | ||
| $css['text-decoration'] .= $this->getValueIf($underline, 'underline '); | ||
| $css['text-decoration-color'] .= $this->getValueIf($underlineColor !== null, "#{$underlineColor}"); |
There was a problem hiding this comment.
| $css['text-decoration-color'] .= $this->getValueIf($underlineColor !== null, "#{$underlineColor}"); | |
| $css['text-decoration-color'] .= $this->getValueIf($underlineColor !== '', '#' .$underlineColor); |
| $xmlWriter->writeElementIf($style->getUnderline() != 'none', 'w:u', 'w:val', $style->getUnderline()); | ||
|
|
||
| // UnderlineColor | ||
| $xmlWriter->writeElementIf($style->getUnderlineColor() !== null, 'w:u', 'w:color', $style->getUnderlineColor()); |
There was a problem hiding this comment.
| $xmlWriter->writeElementIf($style->getUnderlineColor() !== null, 'w:u', 'w:color', $style->getUnderlineColor()); | |
| $xmlWriter->writeElementIf($style->getUnderlineColor() !== '', 'w:u', 'w:color', $style->getUnderlineColor()); |
| 'bold' => false, | ||
| 'italic' => false, | ||
| 'underline' => Font::UNDERLINE_NONE, | ||
| 'underlineColor' => null, |
There was a problem hiding this comment.
| 'underlineColor' => null, | |
| 'underlineColor' => '', |
|
@Progi1984 Hi, to check you feedback, should I use the Button "resolve conversation" if it's ok? I think your code changes are OK. I based my changes on the existing code, especially color and underline. |
Adapted from PR PHPOffice#2862 by @ger82. Corrected some errors (Word2007 should not write 2 `w:u` entries when `underlineColor` is specified, Html needs to be more careful about when to prepend `#`). Added read support for Word2007 and Html. Add RTF Reader support for various underline styles. RTF Reader does not appear to support colors at all; that will have to be the subject of another PR. ODText Reader does not appear to support any styles; that will have to be the subject of at least one far more complicated PR.
|
@ger82 Hi Could you rebase your PR ? & Fix CI ? |
|
Yes, but I need some days. |
| $css['vertical-align'] .= $this->getValueIf($style->isSubScript(), 'sub'); | ||
| $css['text-decoration'] = ''; | ||
| $css['text-decoration'] .= $this->getValueIf($underline, 'underline '); | ||
| $css['text-decoration-color'] .= $this->getValueIf($underlineColor !== null, "#{$underlineColor}"); |
There was a problem hiding this comment.
Do not use concatenation. Just assign. Or define empty value as for 'text-decoration'
There was a problem hiding this comment.
You are right, sorry my misstake, I made this changes mouth ago.
|
@Progi1984 done, I include your changes and fix the bugs that the CI sad and a few logical errors as well I’ve just noticed that there’s also a request from oleibman that might cause conflicts; should I merge that with my code and make another pull request? |
|
@ger82 Rebase on your PR againt the master branch and that should resolve conflicts. |
|
@Progi1984 rebase is done, the phpunit Errors seems to be not from code ??? |
SOrry @ger82, but I think yes
|
|
@Progi1984 thank you, when I open the error message I get only this: |
|
@Progi1984 finally it looks good. I have set up Unittest locally on my computer so that I can receive the error messages. |


Description
implement underlineColor in Word2007, ODText, and HTML
Checklist: