Differences Between: [Versions 310 and 311] [Versions 39 and 311]
1 <?php 2 3 namespace PhpOffice\PhpSpreadsheet\Writer\Ods\Cell; 4 5 use PhpOffice\PhpSpreadsheet\Cell\Cell; 6 use PhpOffice\PhpSpreadsheet\Shared\XMLWriter; 7 8 /** 9 * @author Alexander Pervakov <frost-nzcr4@jagmort.com> 10 */ 11 class Comment 12 { 13 public static function write(XMLWriter $objWriter, Cell $cell): void 14 { 15 $comments = $cell->getWorksheet()->getComments(); 16 if (!isset($comments[$cell->getCoordinate()])) { 17 return; 18 } 19 $comment = $comments[$cell->getCoordinate()]; 20 21 $objWriter->startElement('office:annotation'); 22 $objWriter->writeAttribute('svg:width', $comment->getWidth()); 23 $objWriter->writeAttribute('svg:height', $comment->getHeight()); 24 $objWriter->writeAttribute('svg:x', $comment->getMarginLeft()); 25 $objWriter->writeAttribute('svg:y', $comment->getMarginTop()); 26 $objWriter->writeElement('dc:creator', $comment->getAuthor()); 27 $objWriter->writeElement('text:p', $comment->getText()->getPlainText()); 28 $objWriter->endElement(); 29 } 30 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body