Skip to content

Commit 6b2511e

Browse files
committed
Merge develop
2 parents e345d86 + f58524b commit 6b2511e

File tree

2 files changed

+166
-142
lines changed

2 files changed

+166
-142
lines changed

src/PHPWord/Style/Paragraph.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ class PHPWord_Style_Paragraph {
6464
private $_spacing;
6565

6666

67+
/**
68+
* Indent by how much
69+
*
70+
* @var int
71+
*/
72+
private $_indent;
73+
74+
6775
/**
6876
* New Paragraph Style
6977
*/
@@ -72,6 +80,7 @@ public function __construct() {
7280
$this->_spaceBefore = null;
7381
$this->_spaceAfter = null;
7482
$this->_spacing = null;
83+
$this->_indent = null;
7584
}
7685

7786
/**
@@ -84,6 +93,9 @@ public function setStyleValue($key, $value) {
8493
if($key == '_spacing') {
8594
$value += 240; // because line height of 1 matches 240 twips
8695
}
96+
if($key == '_indent') {
97+
$value = (int)$value * 720; // 720 twips per indent
98+
}
8799
$this->$key = $value;
88100
}
89101

@@ -170,5 +182,25 @@ public function setSpacing($pValue = null) {
170182
$this->_spacing = $pValue;
171183
return $this;
172184
}
185+
186+
/**
187+
* Get indentation
188+
*
189+
* @return int
190+
*/
191+
public function getIndent() {
192+
return $this->_indent;
193+
}
194+
195+
/**
196+
* Set indentation
197+
*
198+
* @param int $pValue
199+
* @return PHPWord_Style_Paragraph
200+
*/
201+
public function setIndent($pValue = null) {
202+
$this->_indent = $pValue;
203+
return $this;
204+
}
173205
}
174206
?>

0 commit comments

Comments
 (0)