getStyle())) { $this->writeStyle(); $this->writeBorder(); } } /** * Write w10 wrapping * * @return array */ public function writeW10Wrap() { if (is_null($this->w10wrap)) { return; } $relativePositions = array( TextBoxStyle::POSITION_RELATIVE_TO_MARGIN => 'margin', TextBoxStyle::POSITION_RELATIVE_TO_PAGE => 'page', TextBoxStyle::POSITION_RELATIVE_TO_TMARGIN => 'margin', TextBoxStyle::POSITION_RELATIVE_TO_BMARGIN => 'page', TextBoxStyle::POSITION_RELATIVE_TO_LMARGIN => 'margin', TextBoxStyle::POSITION_RELATIVE_TO_RMARGIN => 'page', ); $pos = $style->getPositioning(); $vPos = $style->getPosVerticalRel(); $hPos = $style->getPosHorizontalRel(); $xmlWriter = $this->getXmlWriter(); $xmlWriter->startElement('w10:wrap'); $xmlWriter->writeAttribute('type', $this->w10wrap); if ($pos == TextBoxStyle::POSITION_ABSOLUTE) { $xmlWriter->writeAttribute('anchorx', "page"); $xmlWriter->writeAttribute('anchory', "page"); } elseif ($pos == TextBoxStyle::POSITION_RELATIVE) { if (array_key_exists($vPos, $relativePositions)) { $xmlWriter->writeAttribute('anchory', $relativePositions[$vPos]); } if (array_key_exists($hPos, $relativePositions)) { $xmlWriter->writeAttribute('anchorx', $relativePositions[$hPos]); } } $xmlWriter->endElement(); // w10:wrap } /** * Writer border */ private function writeBorder() { $xmlWriter = $this->getXmlWriter(); $style = $this->getStyle(); // Border size $borderSize = $style->getBorderSize(); if ($borderSize !== null) { $xmlWriter->writeAttribute('strokeweight', $borderSize . 'pt'); } // Border color $borderColor = $style->getBorderColor(); if (empty($borderColor)) { $xmlWriter->writeAttribute('stroked', 'f'); } else { $xmlWriter->writeAttribute('strokecolor', $borderColor); } //@todo } }