Exemplo n.º 1
0
 /**
  * Create a new \PhpOffice\PhpPresentation\Shape\Table instance
  *
  * @param int $columns Number of columns
  */
 public function __construct($columns = 1)
 {
     // Initialise variables
     $this->rows = array();
     $this->columnCount = $columns;
     // Initialize parent
     parent::__construct();
     // No resize proportional
     $this->resizeProportional = false;
 }
Exemplo n.º 2
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     return md5($this->path . parent::getHashCode() . __CLASS__);
 }
Exemplo n.º 3
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     return md5(parent::getHashCode() . $this->title->getHashCode() . $this->legend->getHashCode() . $this->plotArea->getHashCode() . $this->view3D->getHashCode() . ($this->includeSpreadsheet ? 1 : 0) . __CLASS__);
 }
Exemplo n.º 4
0
 /**
  * Write pic
  *
  * @param  \PhpOffice\Common\XMLWriter  $objWriter XML Writer
  * @param  \PhpOffice\PhpPresentation\Shape\AbstractDrawing $shape
  * @param  int $shapeId
  * @throws \Exception
  */
 private function writeShapePic(XMLWriter $objWriter, AbstractDrawing $shape, $shapeId)
 {
     // p:pic
     $objWriter->startElement('p:pic');
     // p:nvPicPr
     $objWriter->startElement('p:nvPicPr');
     // p:cNvPr
     $objWriter->startElement('p:cNvPr');
     $objWriter->writeAttribute('id', $shapeId);
     $objWriter->writeAttribute('name', $shape->getName());
     $objWriter->writeAttribute('descr', $shape->getDescription());
     // a:hlinkClick
     if ($shape->hasHyperlink()) {
         $this->writeHyperlink($objWriter, $shape);
     }
     $objWriter->endElement();
     // p:cNvPicPr
     $objWriter->startElement('p:cNvPicPr');
     // a:picLocks
     $objWriter->startElement('a:picLocks');
     $objWriter->writeAttribute('noChangeAspect', '1');
     $objWriter->endElement();
     $objWriter->endElement();
     // p:nvPr
     $objWriter->writeElement('p:nvPr', null);
     $objWriter->endElement();
     // p:blipFill
     $objWriter->startElement('p:blipFill');
     // a:blip
     $objWriter->startElement('a:blip');
     $objWriter->writeAttribute('r:embed', $shape->relationId);
     $objWriter->endElement();
     // a:stretch
     $objWriter->startElement('a:stretch');
     $objWriter->writeElement('a:fillRect', null);
     $objWriter->endElement();
     $objWriter->endElement();
     // p:spPr
     $objWriter->startElement('p:spPr');
     // a:xfrm
     $objWriter->startElement('a:xfrm');
     $objWriter->writeAttribute('rot', CommonDrawing::degreesToAngle($shape->getRotation()));
     // a:off
     $objWriter->startElement('a:off');
     $objWriter->writeAttribute('x', CommonDrawing::pixelsToEmu($shape->getOffsetX()));
     $objWriter->writeAttribute('y', CommonDrawing::pixelsToEmu($shape->getOffsetY()));
     $objWriter->endElement();
     // a:ext
     $objWriter->startElement('a:ext');
     $objWriter->writeAttribute('cx', CommonDrawing::pixelsToEmu($shape->getWidth()));
     $objWriter->writeAttribute('cy', CommonDrawing::pixelsToEmu($shape->getHeight()));
     $objWriter->endElement();
     $objWriter->endElement();
     // a:prstGeom
     $objWriter->startElement('a:prstGeom');
     $objWriter->writeAttribute('prst', 'rect');
     // a:avLst
     $objWriter->writeElement('a:avLst', null);
     $objWriter->endElement();
     if ($shape->getBorder()->getLineStyle() != Border::LINE_NONE) {
         $this->writeBorder($objWriter, $shape->getBorder(), '');
     }
     if ($shape->getShadow()->isVisible()) {
         $this->writeShadow($objWriter, $shape->getShadow());
     }
     $objWriter->endElement();
     $objWriter->endElement();
 }
Exemplo n.º 5
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     return md5($this->renderingFunction . $this->mimeType . $this->uniqueName . parent::getHashCode() . __CLASS__);
 }
Exemplo n.º 6
0
 /**
  * Write the default style information for an AbstractDrawing
  *
  * @param \PhpOffice\Common\XMLWriter $objWriter
  * @param \PhpOffice\PhpPresentation\Shape\AbstractDrawing $shape
  */
 public function writeDrawingStyle(XMLWriter $objWriter, AbstractDrawing $shape)
 {
     // style:style
     $objWriter->startElement('style:style');
     $objWriter->writeAttribute('style:name', 'gr' . $this->shapeId);
     $objWriter->writeAttribute('style:family', 'graphic');
     $objWriter->writeAttribute('style:parent-style-name', 'standard');
     // style:graphic-properties
     $objWriter->startElement('style:graphic-properties');
     $objWriter->writeAttribute('draw:stroke', 'none');
     $objWriter->writeAttribute('draw:fill', 'none');
     if ($shape->getShadow()->isVisible()) {
         $this->writeStylePartShadow($objWriter, $shape->getShadow());
     }
     $objWriter->endElement();
     $objWriter->endElement();
 }