#294: Support for paragraph with borders
This commit is contained in:
parent
689a7371cd
commit
33570f7cd4
|
|
@ -21,6 +21,7 @@ This release added form fields (textinput, checkbox, and dropdown), drawing shap
|
|||
- Setting: Ability to define document protection (readOnly, comments, trackedChanges, forms) - @ivanlanin
|
||||
- Setting: Ability to remove [Compatibility Mode] text in the MS Word title bar - @ivanlanin
|
||||
- SDT: Ability to add structured document tag elements (comboBox, dropDownList, date) - @ivanlanin
|
||||
- Paragraph: Support for paragraph with borders - @ivanlanin GH-294
|
||||
|
||||
### Bugfixes
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ use PhpOffice\PhpWord\Shared\String;
|
|||
*
|
||||
* @link http://www.schemacentral.com/sc/ooxml/t-w_CT_PPr.html
|
||||
*/
|
||||
class Paragraph extends AbstractStyle
|
||||
class Paragraph extends Border
|
||||
{
|
||||
/**
|
||||
* @const int One line height equals 240 twip
|
||||
|
|
|
|||
|
|
@ -108,6 +108,18 @@ class Paragraph extends AbstractStyle
|
|||
// Numbering
|
||||
$this->writeNumbering($xmlWriter, $styles['numbering']);
|
||||
|
||||
// Border
|
||||
if ($style->hasBorder()) {
|
||||
$xmlWriter->startElement('w:pBdr');
|
||||
|
||||
$styleWriter = new MarginBorder($xmlWriter);
|
||||
$styleWriter->setSizes($style->getBorderSize());
|
||||
$styleWriter->setColors($style->getBorderColor());
|
||||
$styleWriter->write();
|
||||
|
||||
$xmlWriter->endElement();
|
||||
}
|
||||
|
||||
if (!$this->withoutPPR) {
|
||||
$xmlWriter->endElement(); // w:pPr
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
|
|||
'align' => 'center',
|
||||
'tabs' => $tabs,
|
||||
'shading' => array('fill' => 'FFFF99'),
|
||||
'borderSize' => 4,
|
||||
)); // Style #1
|
||||
$phpWord->addFontStyle('fStyle', array('size' => '20', 'bold' => true, 'allCaps' => true,
|
||||
'scale' => 200, 'spacing' => 240, 'kerning' => 10)); // Style #2
|
||||
|
|
|
|||
Loading…
Reference in New Issue