Skip to content

Commit 33c4619

Browse files
devX2712Progi1984
authored andcommitted
EVOL-Allow different style of strick paragraph
Paragraph double strick were not supported, modification has been done to support different strick type
1 parent cef70f6 commit 33c4619

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/PhpPresentation/Reader/PowerPoint2007.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh
12351235
$oText->getFont()->setItalic('true' == $att || '1' == $att ? true : false);
12361236
}
12371237
if ($oElementrPr->hasAttribute('strike')) {
1238-
$oText->getFont()->setStrikethrough('noStrike' == $oElementrPr->getAttribute('strike') ? false : true);
1238+
$oText->getFont()->setStrikethrough($oElementrPr->getAttribute('strike'));
12391239
}
12401240
if ($oElementrPr->hasAttribute('sz')) {
12411241
$oText->getFont()->setSize((int) ((int) $oElementrPr->getAttribute('sz') / 100));

src/PhpPresentation/Style/Font.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class Font implements ComparableInterface
149149
public function __construct()
150150
{
151151
$this->color = new Color(Color::COLOR_BLACK);
152+
$this->strikethrough = 'noStrike';
152153
}
153154

154155
/**
@@ -344,8 +345,11 @@ public function isStrikethrough(): bool
344345
/**
345346
* Set Strikethrough.
346347
*/
347-
public function setStrikethrough(bool $pValue = false): self
348+
public function setStrikethrough($pValue = 'noStrike')
348349
{
350+
if ($pValue == '') {
351+
$pValue = 'noStrike';
352+
}
349353
$this->strikethrough = $pValue;
350354

351355
return $this;

src/PhpPresentation/Writer/PowerPoint2007/AbstractSlide.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ protected function writeRunStyles(XMLWriter $objWriter, RichText\Run $element):
649649

650650
$objWriter->writeAttributeIf($element->getFont()->isBold(), 'b', '1');
651651
$objWriter->writeAttributeIf($element->getFont()->isItalic(), 'i', '1');
652-
$objWriter->writeAttributeIf($element->getFont()->isStrikethrough(), 'strike', 'sngStrike');
652+
$objWriter->writeAttributeIf($element->getFont()->isStrikethrough(), 'strike', $element->getFont()->isStrikethrough());
653653

654654
// Size
655655
$objWriter->writeAttribute('sz', ($element->getFont()->getSize() * 100));

0 commit comments

Comments
 (0)