Skip to content

Commit

Permalink
Add space in TOC index entry if numbered headings are configured. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lpaulsen93 committed Mar 29, 2017
1 parent 319b34e commit d8d36a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ODT/ODTIndex.php
Expand Up @@ -274,6 +274,9 @@ protected static function buildIndex(ODTDocument $doc, array $toc, array $settin
$content .= '<text:'.$tag.'-entry-template text:outline-level="'.$level.'" text:style-name="'.$p_styles [$level].'">';
$content .= '<text:index-entry-link-start text:style-name="'.$stylesLNames [$level].'"/>';
$content .= '<text:index-entry-chapter/>';
if ($settings ['numbered_headings'] == true) {
$content .= '<text:index-entry-span> </text:index-entry-span>';
}
$content .= '<text:index-entry-text/>';
$content .= '<text:index-entry-tab-stop style:type="right" style:leader-char="'.$leader_sign.'"/>';
$content .= '<text:index-entry-page-number/>';
Expand Down
5 changes: 5 additions & 0 deletions renderer/page.php
Expand Up @@ -426,6 +426,11 @@ protected function get_index_settings($type, $settings) {
$matches = array();
$data = array();

$data ['numbered_headings'] = false;
if ($this->config->getParam('outline_list_style') == 'Numbers') {
$data ['numbered_headings'] = true;
}

// It seems to be not supported in ODT to have a different start
// outline level than 1.
$data ['maxlevel'] = $this->config->getParam('toc_maxlevel');
Expand Down

0 comments on commit d8d36a8

Please sign in to comment.