add support for contextualSpacing attribute issue #1037
This commit is contained in:
parent
fd418e0746
commit
d5dbfb98b0
@ -158,6 +158,13 @@ class Paragraph extends Border
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,6 +107,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']);
|
||||
$this->writeChildStyle($xmlWriter, 'Spacing', $styles['spacing']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user