File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -422,6 +422,9 @@ public function createFooter()
422
422
*/
423
423
public function getFooter ()
424
424
{
425
+ if (!($ this ->_footer instanceOf PHPWord_Section_Footer)) {
426
+ $ this ->_footer = new PHPWord_Section_Footer ($ this ->_sectionCount );
427
+ }
425
428
return $ this ->_footer ;
426
429
}
427
430
Original file line number Diff line number Diff line change @@ -139,14 +139,12 @@ public function save($pFilename = null)
139
139
}
140
140
141
141
$ _footer = $ section ->getFooter ();
142
- if (!is_null ($ _footer )) {
143
- $ _cFtrs ++;
144
- $ _footer ->setRelationId (++$ rID );
145
- $ _footerCount = $ _footer ->getFooterCount ();
146
- $ _footerFile = 'footer ' . $ _footerCount . '.xml ' ;
147
- $ sectionElements [] = array ('target ' => $ _footerFile , 'type ' => 'footer ' , 'rID ' => $ rID );
148
- $ objZip ->addFromString ('word/ ' . $ _footerFile , $ this ->getWriterPart ('footer ' )->writeFooter ($ _footer ));
149
- }
142
+ $ _cFtrs ++;
143
+ $ _footer ->setRelationId (++$ rID );
144
+ $ _footerCount = $ _footer ->getFooterCount ();
145
+ $ _footerFile = 'footer ' . $ _footerCount . '.xml ' ;
146
+ $ sectionElements [] = array ('target ' => $ _footerFile , 'type ' => 'footer ' , 'rID ' => $ rID );
147
+ $ objZip ->addFromString ('word/ ' . $ _footerFile , $ this ->getWriterPart ('footer ' )->writeFooter ($ _footer ));
150
148
}
151
149
152
150
if (PHPWord_Footnote::countFootnoteElements () > 0 ) {
You can’t perform that action at this time.
0 commit comments