diff --git a/src/PhpWord/Writer/RTF/Element/TextBreak.php b/src/PhpWord/Writer/RTF/Element/TextBreak.php index d74bf23dcb..c7924b0f8d 100644 --- a/src/PhpWord/Writer/RTF/Element/TextBreak.php +++ b/src/PhpWord/Writer/RTF/Element/TextBreak.php @@ -36,6 +36,10 @@ public function write() $parentWriter = $this->parentWriter; $parentWriter->setLastParagraphStyle(); - return '\pard\par' . PHP_EOL; + if ($this->withoutP) { + return '\line' . PHP_EOL; + } else { + return '\pard\par' . PHP_EOL; + } } } diff --git a/src/PhpWord/Writer/RTF/Style/Tab.php b/src/PhpWord/Writer/RTF/Style/Tab.php index 95e1f10a5c..a6b26ded7f 100644 --- a/src/PhpWord/Writer/RTF/Style/Tab.php +++ b/src/PhpWord/Writer/RTF/Style/Tab.php @@ -38,11 +38,19 @@ public function write() \PhpOffice\PhpWord\Style\Tab::TAB_STOP_RIGHT => '\tqr', \PhpOffice\PhpWord\Style\Tab::TAB_STOP_CENTER => '\tqc', \PhpOffice\PhpWord\Style\Tab::TAB_STOP_DECIMAL => '\tqdec', + \PhpOffice\PhpWord\Style\Tab::TAB_LEADER_DOT => '\tldot', + \PhpOffice\PhpWord\Style\Tab::TAB_LEADER_HYPHEN => '\tlhyph', + \PhpOffice\PhpWord\Style\Tab::TAB_LEADER_UNDERSCORE => '\tlul', + \PhpOffice\PhpWord\Style\Tab::TAB_LEADER_HEAVY => '\tlth', + \PhpOffice\PhpWord\Style\Tab::TAB_LEADER_MIDDLEDOT => '\tlmdot', ]; $content = ''; if (isset($tabs[$style->getType()])) { $content .= $tabs[$style->getType()]; } + if (isset($tabs[$style->getLeader()])) { + $content .= $tabs[$style->getLeader()]; + } $content .= '\tx' . round($style->getPosition()); return $content;