Final try to resolve Travis build errors

This commit is contained in:
Bas-Jan 't Jong 2014-05-29 18:07:01 +02:00
parent 0103787873
commit 748e16473d
2 changed files with 4 additions and 6 deletions

View File

@ -41,14 +41,14 @@ class Line extends AbstractElement
$style = $element->getStyle(); $style = $element->getStyle();
$styleWriter = new LineStyleWriter($xmlWriter, $style); $styleWriter = new LineStyleWriter($xmlWriter, $style);
$id=$element->getElementIndex(); $elementId=$element->getElementIndex();
if (!$this->withoutP) { if (!$this->withoutP) {
$xmlWriter->startElement('w:p'); $xmlWriter->startElement('w:p');
$styleWriter->writeAlignment(); $styleWriter->writeAlignment();
} }
$xmlWriter->startElement('w:r'); $xmlWriter->startElement('w:r');
$xmlWriter->startElement('w:pict'); $xmlWriter->startElement('w:pict');
if ($id==1) { //shapetype could be defined for each line separately, but then a unique id would be necessary if ($elementId==1) { //shapetype could be defined for each line separately, but then a unique id would be necessary
$xmlWriter->startElement('v:shapetype'); $xmlWriter->startElement('v:shapetype');
$xmlWriter->writeAttribute('id', '_x0000_t32'); $xmlWriter->writeAttribute('id', '_x0000_t32');
$xmlWriter->writeAttribute('coordsize', '21600,21600'); $xmlWriter->writeAttribute('coordsize', '21600,21600');
@ -68,7 +68,7 @@ class Line extends AbstractElement
$xmlWriter->endElement(); // v:shapetype $xmlWriter->endElement(); // v:shapetype
} }
$xmlWriter->startElement('v:shape'); $xmlWriter->startElement('v:shape');
$xmlWriter->writeAttribute('id', sprintf('_x0000_s1%1$03d', $id)); $xmlWriter->writeAttribute('id', sprintf('_x0000_s1%1$03d', $elementId));
$xmlWriter->writeAttribute('type', '#_x0000_t32'); //type should correspond to shapetype id $xmlWriter->writeAttribute('type', '#_x0000_t32'); //type should correspond to shapetype id
$styleWriter->write(); $styleWriter->write();
$styleWriter->writeStroke(); $styleWriter->writeStroke();

View File

@ -35,7 +35,6 @@ class LineTest extends \PHPUnit_Framework_TestCase
$object = new Line(); $object = new Line();
$properties = array( $properties = array(
'flip' => true,
'connectorType' => \PhpOffice\PhpWord\Style\Line::CONNECTOR_TYPE_STRAIGHT, 'connectorType' => \PhpOffice\PhpWord\Style\Line::CONNECTOR_TYPE_STRAIGHT,
'beginArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_BLOCK, 'beginArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_BLOCK,
'endArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_OVAL, 'endArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_OVAL,
@ -59,7 +58,6 @@ class LineTest extends \PHPUnit_Framework_TestCase
$object = new Line(); $object = new Line();
$properties = array( $properties = array(
'flip' => true,
'connectorType' => \PhpOffice\PhpWord\Style\Line::CONNECTOR_TYPE_STRAIGHT, 'connectorType' => \PhpOffice\PhpWord\Style\Line::CONNECTOR_TYPE_STRAIGHT,
'beginArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_BLOCK, 'beginArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_BLOCK,
'endArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_OVAL, 'endArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_OVAL,
@ -82,7 +80,7 @@ class LineTest extends \PHPUnit_Framework_TestCase
$expected=true; $expected=true;
$object = new Line(); $object = new Line();
$object->setFlip($expected); $object->setFlip($expected);
$this->assertEquals($expected, $object->getFlip()); $this->assertEquals($expected, $object->isFlip());
} }
/** /**