diff --git a/src/PhpWord/Writer/Word2007/Element/Line.php b/src/PhpWord/Writer/Word2007/Element/Line.php index 41171205..ea202633 100644 --- a/src/PhpWord/Writer/Word2007/Element/Line.php +++ b/src/PhpWord/Writer/Word2007/Element/Line.php @@ -41,14 +41,14 @@ class Line extends AbstractElement $style = $element->getStyle(); $styleWriter = new LineStyleWriter($xmlWriter, $style); - $id=$element->getElementIndex(); + $elementId=$element->getElementIndex(); if (!$this->withoutP) { $xmlWriter->startElement('w:p'); $styleWriter->writeAlignment(); } $xmlWriter->startElement('w:r'); $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->writeAttribute('id', '_x0000_t32'); $xmlWriter->writeAttribute('coordsize', '21600,21600'); @@ -68,7 +68,7 @@ class Line extends AbstractElement $xmlWriter->endElement(); // v:shapetype } $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 $styleWriter->write(); $styleWriter->writeStroke(); diff --git a/tests/PhpWord/Tests/Style/LineTest.php b/tests/PhpWord/Tests/Style/LineTest.php index 92756e24..02d5ba16 100644 --- a/tests/PhpWord/Tests/Style/LineTest.php +++ b/tests/PhpWord/Tests/Style/LineTest.php @@ -35,7 +35,6 @@ class LineTest extends \PHPUnit_Framework_TestCase $object = new Line(); $properties = array( - 'flip' => true, 'connectorType' => \PhpOffice\PhpWord\Style\Line::CONNECTOR_TYPE_STRAIGHT, 'beginArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_BLOCK, 'endArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_OVAL, @@ -59,7 +58,6 @@ class LineTest extends \PHPUnit_Framework_TestCase $object = new Line(); $properties = array( - 'flip' => true, 'connectorType' => \PhpOffice\PhpWord\Style\Line::CONNECTOR_TYPE_STRAIGHT, 'beginArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_BLOCK, 'endArrow' => \PhpOffice\PhpWord\Style\Line::ARROW_STYLE_OVAL, @@ -82,7 +80,7 @@ class LineTest extends \PHPUnit_Framework_TestCase $expected=true; $object = new Line(); $object->setFlip($expected); - $this->assertEquals($expected, $object->getFlip()); + $this->assertEquals($expected, $object->isFlip()); } /**