Merge branch 'feature-paragraphBgColor' of github.com:lrobert/PHPWord-1 into develop
This commit is contained in:
commit
00c6b76d68
@ -152,6 +152,13 @@ class Paragraph extends AbstractStyle
|
|||||||
*/
|
*/
|
||||||
private $tabs = array();
|
private $tabs = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shading
|
||||||
|
*
|
||||||
|
* @var \PhpOffice\PhpWord\Style\Shading
|
||||||
|
*/
|
||||||
|
private $shading;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new instance
|
* Create new instance
|
||||||
*/
|
*/
|
||||||
@ -209,6 +216,7 @@ class Paragraph extends AbstractStyle
|
|||||||
'level' => $this->getNumLevel(),
|
'level' => $this->getNumLevel(),
|
||||||
),
|
),
|
||||||
'tabs' => $this->getTabs(),
|
'tabs' => $this->getTabs(),
|
||||||
|
'shading' => $this->getShading(),
|
||||||
);
|
);
|
||||||
|
|
||||||
return $styles;
|
return $styles;
|
||||||
@ -674,4 +682,27 @@ class Paragraph extends AbstractStyle
|
|||||||
{
|
{
|
||||||
return $this->hasPageBreakBefore();
|
return $this->hasPageBreakBefore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get shading
|
||||||
|
*
|
||||||
|
* @return \PhpOffice\PhpWord\Style\Shading
|
||||||
|
*/
|
||||||
|
public function getShading()
|
||||||
|
{
|
||||||
|
return $this->shading;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set shading
|
||||||
|
*
|
||||||
|
* @param mixed $value
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function setShading($value = null)
|
||||||
|
{
|
||||||
|
$this->setObjectVal($value, 'Shading', $this->shading);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,13 @@ class Paragraph extends AbstractStyle
|
|||||||
$this->writeChildStyle($xmlWriter, 'Indentation', $styles['indentation']);
|
$this->writeChildStyle($xmlWriter, 'Indentation', $styles['indentation']);
|
||||||
$this->writeChildStyle($xmlWriter, 'Spacing', $styles['spacing']);
|
$this->writeChildStyle($xmlWriter, 'Spacing', $styles['spacing']);
|
||||||
|
|
||||||
|
// Background-Color
|
||||||
|
$shading = $style->getShading();
|
||||||
|
if (!is_null($shading)) {
|
||||||
|
$styleWriter = new Shading($xmlWriter, $shading);
|
||||||
|
$styleWriter->write();
|
||||||
|
}
|
||||||
|
|
||||||
// Tabs
|
// Tabs
|
||||||
$this->writeTabs($xmlWriter, $styles['tabs']);
|
$this->writeTabs($xmlWriter, $styles['tabs']);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user