Skip to content

Commit b7fd623

Browse files
author
Louis
committed
Re-indent with spaces TOC Depth filter
Travis said spaces, not tab. Meh.
1 parent 88be3c9 commit b7fd623

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

src/PhpWord/TOC.php

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@ class TOC
6767
*/
6868
private static $_bookmarkId = 0;
6969

70-
/**
71-
* Min title depth to show
72-
*
73-
* @var int
74-
*/
75-
private $_minDepth = 1;
76-
77-
/**
78-
* Max title depth to show
79-
*
80-
* @var int
81-
*/
82-
private $_maxDepth = 9;
70+
/**
71+
* Min title depth to show
72+
*
73+
* @var int
74+
*/
75+
private $_minDepth = 1;
76+
77+
/**
78+
* Max title depth to show
79+
*
80+
* @var int
81+
*/
82+
private $_maxDepth = 9;
8383

8484
/**
8585
* Create a new Table-of-Contents Element
@@ -114,9 +114,9 @@ public function __construct($styleFont = null, $styleTOC = null, $minDepth = 1,
114114
self::$_styleFont = $styleFont;
115115
}
116116
}
117-
118-
$this->_minDepth = $minDepth;
119-
$this->_maxDepth = $maxDepth;
117+
118+
$this->_minDepth = $minDepth;
119+
$this->_maxDepth = $maxDepth;
120120
}
121121

122122
/**
@@ -150,17 +150,17 @@ public static function addTitle($text, $depth = 0)
150150
public function getTitles()
151151
{
152152
$titles = self::$_titles;
153-
foreach ($titles as $i=>$title) {
154-
if ($this->_minDepth > $title['depth']) {
155-
unset($titles[$i]);
156-
}
157-
if (($this->_maxDepth != 0) && ($this->_maxDepth < $title['depth'])) {
158-
unset($titles[$i]);
159-
}
160-
}
161-
$titles = array_merge(array(), $titles);
162-
163-
return $titles;
153+
foreach ($titles as $i => $title) {
154+
if ($this->_minDepth > $title['depth']) {
155+
unset($titles[$i]);
156+
}
157+
if (($this->_maxDepth != 0) && ($this->_maxDepth < $title['depth'])) {
158+
unset($titles[$i]);
159+
}
160+
}
161+
$titles = array_merge(array(), $titles);
162+
163+
return $titles;
164164
}
165165

166166
/**
@@ -182,22 +182,22 @@ public static function getStyleFont()
182182
{
183183
return self::$_styleFont;
184184
}
185-
186-
/**
187-
* Get Max Depth
188-
*
189-
* @return int Max depth of titles
190-
*/
191-
public function getMaxDepth() {
192-
return $this->_maxDepth;
193-
}
194-
195-
/**
196-
* Get Min Depth
197-
*
198-
* @return int Min depth of titles
199-
*/
200-
public function getMinDepth() {
201-
return $this->_minDepth;
202-
}
185+
186+
/**
187+
* Get Max Depth
188+
*
189+
* @return int Max depth of titles
190+
*/
191+
public function getMaxDepth() {
192+
return $this->_maxDepth;
193+
}
194+
195+
/**
196+
* Get Min Depth
197+
*
198+
* @return int Min depth of titles
199+
*/
200+
public function getMinDepth() {
201+
return $this->_minDepth;
202+
}
203203
}

src/PhpWord/Writer/Word2007/Document.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,9 @@ private function _writeTOC(XMLWriter $xmlWriter, TOC $toc)
428428
$fIndent = $styleTOC->getIndent();
429429
$tabLeader = $styleTOC->getTabLeader();
430430
$tabPos = $styleTOC->getTabPos();
431-
432-
$maxDepth = $toc->getMaxDepth();
433-
$minDepth = $toc->getMinDepth();
431+
432+
$maxDepth = $toc->getMaxDepth();
433+
$minDepth = $toc->getMinDepth();
434434

435435
$isObject = ($styleFont instanceof Font) ? true : false;
436436

0 commit comments

Comments
 (0)