@@ -29,24 +29,22 @@ protected function getStyles()
29
29
/** @var \PhpOffice\PhpWord\Element\Title $element Type hint */
30
30
$ element = $ this ->element ;
31
31
$ style = $ element ->getStyle ();
32
- if (is_string ($ style )) {
33
- $ style = str_replace ('Heading ' , 'Heading_ ' , $ style );
34
- $ style = \PhpOffice \PhpWord \Style::getStyle ($ style );
35
- if ($ style instanceof \PhpOffice \PhpWord \Style \Font) {
36
- $ this ->fontStyle = $ style ;
37
- $ pstyle = $ style ->getParagraph ();
38
- if ($ pstyle instanceof \PhpOffice \PhpWord \Style \Paragraph && $ pstyle ->hasPageBreakBefore ()) {
39
- $ sect = $ element ->getParent ();
40
- if ($ sect instanceof \PhpOffice \PhpWord \Element \Section) {
41
- $ elems = $ sect ->getElements ();
42
- if ($ elems [0 ] === $ element ) {
43
- $ pstyle = clone $ pstyle ;
44
- $ pstyle ->setPageBreakBefore (false );
45
- }
32
+ $ style = str_replace ('Heading ' , 'Heading_ ' , $ style );
33
+ $ style = \PhpOffice \PhpWord \Style::getStyle ($ style );
34
+ if ($ style instanceof \PhpOffice \PhpWord \Style \Font) {
35
+ $ this ->fontStyle = $ style ;
36
+ $ pstyle = $ style ->getParagraph ();
37
+ if ($ pstyle instanceof \PhpOffice \PhpWord \Style \Paragraph && $ pstyle ->hasPageBreakBefore ()) {
38
+ $ sect = $ element ->getParent ();
39
+ if ($ sect instanceof \PhpOffice \PhpWord \Element \Section) {
40
+ $ elems = $ sect ->getElements ();
41
+ if ($ elems [0 ] === $ element ) {
42
+ $ pstyle = clone $ pstyle ;
43
+ $ pstyle ->setPageBreakBefore (false );
46
44
}
47
45
}
48
- $ this ->paragraphStyle = $ pstyle ;
49
46
}
47
+ $ this ->paragraphStyle = $ pstyle ;
50
48
}
51
49
}
52
50
@@ -57,7 +55,7 @@ protected function getStyles()
57
55
*/
58
56
public function write ()
59
57
{
60
- /** @var \PhpOffice\PhpWord\Element\Text $element Type hint */
58
+ /** @var \PhpOffice\PhpWord\Element\Title $element Type hint */
61
59
$ element = $ this ->element ;
62
60
$ elementClass = str_replace ('\\Writer \\RTF ' , '' , get_class ($ this ));
63
61
if (!$ element instanceof $ elementClass || !is_string ($ element ->getText ())) {
0 commit comments