Update changelog and unit test for #264

This commit is contained in:
Ivan Lanin 2014-06-05 22:41:58 +07:00
parent 00c6b76d68
commit 479713da55
3 changed files with 8 additions and 9 deletions

View File

@ -8,6 +8,7 @@ This is the changelog between releases of PHPWord. Releases are listed in revers
- Element: Ability to add drawing shapes (arc, curve, line, polyline, rect, oval) using new `Shape` element - @ivanlanin GH-123
- Font: New `scale`, `spacing`, and `kerning` property of font style - @ivanlanin
- Paragraph: Added shading to the paragraph style for full width shading - @lrobert GH-264
### Bugfixes

View File

@ -95,16 +95,10 @@ class Paragraph extends AbstractStyle
$xmlWriter->writeElementIf($styles['pagination']['keepLines'] === true, 'w:keepLines', 'w:val', '1');
$xmlWriter->writeElementIf($styles['pagination']['pageBreak'] === true, 'w:pageBreakBefore', 'w:val', '1');
// Indentation & spacing
// Child style: indentation, spacing, and shading
$this->writeChildStyle($xmlWriter, 'Indentation', $styles['indentation']);
$this->writeChildStyle($xmlWriter, 'Spacing', $styles['spacing']);
// Background-Color
$shading = $style->getShading();
if (!is_null($shading)) {
$styleWriter = new Shading($xmlWriter, $shading);
$styleWriter->write();
}
$this->writeChildStyle($xmlWriter, 'Shading', $styles['shading']);
// Tabs
$this->writeTabs($xmlWriter, $styles['tabs']);

View File

@ -135,7 +135,11 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
$tabs = array(new \PhpOffice\PhpWord\Style\Tab('right', 9090));
$phpWord = new PhpWord();
$phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'tabs' => $tabs)); // Style #1
$phpWord->addParagraphStyle('pStyle', array(
'align' => 'center',
'tabs' => $tabs,
'shading' => array('fill' => 'FFFF99'),
)); // Style #1
$phpWord->addFontStyle('fStyle', array('size' => '20', 'bold' => true, 'allCaps' => true,
'scale' => 200, 'spacing' => 240, 'kerning' => 10)); // Style #2
$phpWord->addTitleStyle(1, array('color' => '333333', 'doubleStrikethrough' => true)); // Style #3