From 6c2cd1c66af64d8866b8eb2e16d560e9437d3060 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 30 Aug 2025 17:09:48 -0500 Subject: [PATCH 1/3] Update Tab.php - add TAB_LEADER --- src/PhpWord/Writer/RTF/Style/Tab.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PhpWord/Writer/RTF/Style/Tab.php b/src/PhpWord/Writer/RTF/Style/Tab.php index 95e1f10a5c..f448401c50 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 => '\tleq', ]; $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; From a96b3c9d7c8a345ce0d96b3e003d19d3bff16747 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 30 Aug 2025 17:18:12 -0500 Subject: [PATCH 2/3] Update Tab.php Fix Mdot --- src/PhpWord/Writer/RTF/Style/Tab.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Writer/RTF/Style/Tab.php b/src/PhpWord/Writer/RTF/Style/Tab.php index f448401c50..a6b26ded7f 100644 --- a/src/PhpWord/Writer/RTF/Style/Tab.php +++ b/src/PhpWord/Writer/RTF/Style/Tab.php @@ -42,7 +42,7 @@ public function write() \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 => '\tleq', + \PhpOffice\PhpWord\Style\Tab::TAB_LEADER_MIDDLEDOT => '\tlmdot', ]; $content = ''; if (isset($tabs[$style->getType()])) { From 7f02c9c3355887a708b3ceb8679e0ca003aef6c3 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 30 Aug 2025 20:05:39 -0500 Subject: [PATCH 3/3] Update TextBreak.php FIXES no new paragraph in TextRun. --- src/PhpWord/Writer/RTF/Element/TextBreak.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; + } } }