MS Word report corrupted DOCX when there's more than 1 section and footnote applied not on the first section. OO is fine.
Bug source: [Content-Types].xml entry is different with document.xml.rels
This commit is contained in:
parent
645d237582
commit
d87fa2aa8b
@ -422,6 +422,9 @@ class PHPWord_Section
|
|||||||
*/
|
*/
|
||||||
public function getFooter()
|
public function getFooter()
|
||||||
{
|
{
|
||||||
|
if (!($this->_footer instanceOf PHPWord_Section_Footer)) {
|
||||||
|
$this->_footer = new PHPWord_Section_Footer($this->_sectionCount);
|
||||||
|
}
|
||||||
return $this->_footer;
|
return $this->_footer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -139,14 +139,12 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
|
|||||||
}
|
}
|
||||||
|
|
||||||
$_footer = $section->getFooter();
|
$_footer = $section->getFooter();
|
||||||
if (!is_null($_footer)) {
|
$_cFtrs++;
|
||||||
$_cFtrs++;
|
$_footer->setRelationId(++$rID);
|
||||||
$_footer->setRelationId(++$rID);
|
$_footerCount = $_footer->getFooterCount();
|
||||||
$_footerCount = $_footer->getFooterCount();
|
$_footerFile = 'footer' . $_footerCount . '.xml';
|
||||||
$_footerFile = 'footer' . $_footerCount . '.xml';
|
$sectionElements[] = array('target' => $_footerFile, 'type' => 'footer', 'rID' => $rID);
|
||||||
$sectionElements[] = array('target' => $_footerFile, 'type' => 'footer', 'rID' => $rID);
|
$objZip->addFromString('word/' . $_footerFile, $this->getWriterPart('footer')->writeFooter($_footer));
|
||||||
$objZip->addFromString('word/' . $_footerFile, $this->getWriterPart('footer')->writeFooter($_footer));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PHPWord_Footnote::countFootnoteElements() > 0) {
|
if (PHPWord_Footnote::countFootnoteElements() > 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user