add support for contextualSpacing attribute issue #1037
This commit is contained in:
parent
fd418e0746
commit
d5dbfb98b0
@ -157,6 +157,13 @@ class Paragraph extends Border
|
||||
* @var \PhpOffice\PhpWord\Style\Shading
|
||||
*/
|
||||
private $shading;
|
||||
|
||||
/**
|
||||
* Do not add an interval between paragraphs of the same style
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $contextualSpacing = true;
|
||||
|
||||
/**
|
||||
* Set Style value
|
||||
@ -208,6 +215,7 @@ class Paragraph extends Border
|
||||
),
|
||||
'tabs' => $this->getTabs(),
|
||||
'shading' => $this->getShading(),
|
||||
'contextualSpacing' => $this->getContextualSpacing(),
|
||||
);
|
||||
|
||||
return $styles;
|
||||
@ -731,4 +739,22 @@ class Paragraph extends Border
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function getContextualSpacing()
|
||||
{
|
||||
return $this->contextualSpacing;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $contextualSpacing
|
||||
*/
|
||||
public function setContextualSpacing($contextualSpacing)
|
||||
{
|
||||
$this->contextualSpacing = $contextualSpacing;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,6 +106,9 @@ class Paragraph extends AbstractStyle
|
||||
}
|
||||
$xmlWriter->endElement();
|
||||
}
|
||||
|
||||
//Paragraph contextualSpacing
|
||||
$xmlWriter->writeElementIf($styles['contextualSpacing'] === true, 'w:contextualSpacing');
|
||||
|
||||
// Child style: alignment, indentation, spacing, and shading
|
||||
$this->writeChildStyle($xmlWriter, 'Indentation', $styles['indentation']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user