From b7fd62312151011bd0383c0e6e2e1df67eaecd78 Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 31 Mar 2014 17:07:58 +0200 Subject: [PATCH] Re-indent with spaces TOC Depth filter Travis said spaces, not tab. Meh. --- src/PhpWord/TOC.php | 90 ++++++++++++------------ src/PhpWord/Writer/Word2007/Document.php | 6 +- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/PhpWord/TOC.php b/src/PhpWord/TOC.php index ef5ddba0..a17fb7f1 100644 --- a/src/PhpWord/TOC.php +++ b/src/PhpWord/TOC.php @@ -67,19 +67,19 @@ class TOC */ private static $_bookmarkId = 0; - /** - * Min title depth to show - * - * @var int - */ - private $_minDepth = 1; - - /** - * Max title depth to show - * - * @var int - */ - private $_maxDepth = 9; + /** + * Min title depth to show + * + * @var int + */ + private $_minDepth = 1; + + /** + * Max title depth to show + * + * @var int + */ + private $_maxDepth = 9; /** * Create a new Table-of-Contents Element @@ -114,9 +114,9 @@ class TOC self::$_styleFont = $styleFont; } } - - $this->_minDepth = $minDepth; - $this->_maxDepth = $maxDepth; + + $this->_minDepth = $minDepth; + $this->_maxDepth = $maxDepth; } /** @@ -150,17 +150,17 @@ class TOC public function getTitles() { $titles = self::$_titles; - foreach ($titles as $i=>$title) { - if ($this->_minDepth > $title['depth']) { - unset($titles[$i]); - } - if (($this->_maxDepth != 0) && ($this->_maxDepth < $title['depth'])) { - unset($titles[$i]); - } - } - $titles = array_merge(array(), $titles); - - return $titles; + foreach ($titles as $i => $title) { + if ($this->_minDepth > $title['depth']) { + unset($titles[$i]); + } + if (($this->_maxDepth != 0) && ($this->_maxDepth < $title['depth'])) { + unset($titles[$i]); + } + } + $titles = array_merge(array(), $titles); + + return $titles; } /** @@ -182,22 +182,22 @@ class TOC { return self::$_styleFont; } - - /** - * Get Max Depth - * - * @return int Max depth of titles - */ - public function getMaxDepth() { - return $this->_maxDepth; - } - - /** - * Get Min Depth - * - * @return int Min depth of titles - */ - public function getMinDepth() { - return $this->_minDepth; - } + + /** + * Get Max Depth + * + * @return int Max depth of titles + */ + public function getMaxDepth() { + return $this->_maxDepth; + } + + /** + * Get Min Depth + * + * @return int Min depth of titles + */ + public function getMinDepth() { + return $this->_minDepth; + } } diff --git a/src/PhpWord/Writer/Word2007/Document.php b/src/PhpWord/Writer/Word2007/Document.php index 22cc8c0d..3ccc5f48 100644 --- a/src/PhpWord/Writer/Word2007/Document.php +++ b/src/PhpWord/Writer/Word2007/Document.php @@ -428,9 +428,9 @@ class Document extends Base $fIndent = $styleTOC->getIndent(); $tabLeader = $styleTOC->getTabLeader(); $tabPos = $styleTOC->getTabPos(); - - $maxDepth = $toc->getMaxDepth(); - $minDepth = $toc->getMinDepth(); + + $maxDepth = $toc->getMaxDepth(); + $minDepth = $toc->getMinDepth(); $isObject = ($styleFont instanceof Font) ? true : false;