File tree Expand file tree Collapse file tree 2 files changed +166
-142
lines changed Expand file tree Collapse file tree 2 files changed +166
-142
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,14 @@ class PHPWord_Style_Paragraph {
64
64
private $ _spacing ;
65
65
66
66
67
+ /**
68
+ * Indent by how much
69
+ *
70
+ * @var int
71
+ */
72
+ private $ _indent ;
73
+
74
+
67
75
/**
68
76
* New Paragraph Style
69
77
*/
@@ -72,6 +80,7 @@ public function __construct() {
72
80
$ this ->_spaceBefore = null ;
73
81
$ this ->_spaceAfter = null ;
74
82
$ this ->_spacing = null ;
83
+ $ this ->_indent = null ;
75
84
}
76
85
77
86
/**
@@ -84,6 +93,9 @@ public function setStyleValue($key, $value) {
84
93
if ($ key == '_spacing ' ) {
85
94
$ value += 240 ; // because line height of 1 matches 240 twips
86
95
}
96
+ if ($ key == '_indent ' ) {
97
+ $ value = (int )$ value * 720 ; // 720 twips per indent
98
+ }
87
99
$ this ->$ key = $ value ;
88
100
}
89
101
@@ -170,5 +182,25 @@ public function setSpacing($pValue = null) {
170
182
$ this ->_spacing = $ pValue ;
171
183
return $ this ;
172
184
}
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
+ }
173
205
}
174
206
?>
You can’t perform that action at this time.
0 commit comments