Merge pull request #1329 from eweso/patch-1

Adding setNumId method for ListItem style
This commit is contained in:
troosan 2019-08-08 07:13:03 +02:00 committed by GitHub
commit 85e9144822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -139,6 +139,16 @@ class ListItem extends AbstractStyle
return $this->numId; return $this->numId;
} }
/**
* Set numbering Id. Same numId means same list
* @param mixed $numInt
*/
public function setNumId($numInt)
{
$this->numId = $numInt;
$this->getListTypeStyle();
}
/** /**
* Get legacy numbering definition * Get legacy numbering definition
* *
@ -148,7 +158,12 @@ class ListItem extends AbstractStyle
private function getListTypeStyle() private function getListTypeStyle()
{ {
// Check if legacy style already registered in global Style collection // Check if legacy style already registered in global Style collection
$numStyle = "PHPWordList{$this->listType}"; $numStyle = 'PHPWordListType' . $this->listType;
if ($this->numId) {
$numStyle .= 'NumId' . $this->numId;
}
if (Style::getStyle($numStyle) !== null) { if (Style::getStyle($numStyle) !== null) {
$this->setNumStyle($numStyle); $this->setNumStyle($numStyle);