Merge branch 'support_for_xe_and_index_field' into develop
This commit is contained in:
commit
2d1b52bc90
@ -64,7 +64,7 @@ class Field extends Text
|
|||||||
$xmlWriter->endElement(); // w:r
|
$xmlWriter->endElement(); // w:r
|
||||||
|
|
||||||
if ($element->getText() != null) {
|
if ($element->getText() != null) {
|
||||||
if ($element->getText() instanceof PhpOffice\PhpWord\Element\TextRun) {
|
if ($element->getText() instanceof \PhpOffice\PhpWord\Element\TextRun) {
|
||||||
|
|
||||||
$containerWriter = new Container($xmlWriter, $element->getText(), true);
|
$containerWriter = new Container($xmlWriter, $element->getText(), true);
|
||||||
$containerWriter->write();
|
$containerWriter->write();
|
||||||
|
|||||||
@ -198,12 +198,12 @@ class ElementTest extends \PHPUnit_Framework_TestCase
|
|||||||
$phpWord = new PhpWord();
|
$phpWord = new PhpWord();
|
||||||
$section = $phpWord->addSection();
|
$section = $phpWord->addSection();
|
||||||
|
|
||||||
$section->addField('INDEX', [], ['\\c "3"']);
|
$section->addField('INDEX', array(), array('\\c "3"'));
|
||||||
$section->addField('XE', [], ['Bold', 'Italic'], 'Index Entry');
|
$section->addField('XE', array(), array('Bold', 'Italic'), 'Index Entry');
|
||||||
$section->addField('DATE', ['dateformat' => 'd-M-yyyy'], ['PreserveFormat', 'LastUsedFormat']);
|
$section->addField('DATE', array('dateformat' => 'd-M-yyyy'), array('PreserveFormat', 'LastUsedFormat'));
|
||||||
$section->addField('DATE', [], ['LunarCalendar']);
|
$section->addField('DATE', array(), array('LunarCalendar'));
|
||||||
$section->addField('DATE', [], ['SakaEraCalendar']);
|
$section->addField('DATE', array(), array('SakaEraCalendar'));
|
||||||
$section->addField('NUMPAGES', ['format' => 'roman', 'numformat' => '0,00'], ['SakaEraCalendar']);
|
$section->addField('NUMPAGES', array('format' => 'roman', 'numformat' => '0,00'), array('SakaEraCalendar'));
|
||||||
$doc = TestHelperDOCX::getDocument($phpWord);
|
$doc = TestHelperDOCX::getDocument($phpWord);
|
||||||
|
|
||||||
$element = '/w:document/w:body/w:p/w:r/w:instrText';
|
$element = '/w:document/w:body/w:p/w:r/w:instrText';
|
||||||
@ -219,7 +219,7 @@ class ElementTest extends \PHPUnit_Framework_TestCase
|
|||||||
$text = new TextRun();
|
$text = new TextRun();
|
||||||
$text->addText('test string', array('bold' => true));
|
$text->addText('test string', array('bold' => true));
|
||||||
|
|
||||||
$section->addField('XE', [], ['Bold', 'Italic'], $text);
|
$section->addField('XE', array(), array('Bold', 'Italic'), $text);
|
||||||
$doc = TestHelperDOCX::getDocument($phpWord);
|
$doc = TestHelperDOCX::getDocument($phpWord);
|
||||||
|
|
||||||
$element = '/w:document/w:body/w:p/w:r[2]/w:instrText';
|
$element = '/w:document/w:body/w:p/w:r[2]/w:instrText';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user