From e217d7e73ea26d8f768ba5990236b016a0fb6559 Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sun, 10 Mar 2024 15:41:35 +0000 Subject: [PATCH] Dateien nach "includes/PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Cell" hochladen --- .../Writer/OpenDocument/Cell/Comment.php | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 includes/PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Cell/Comment.php diff --git a/includes/PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Cell/Comment.php b/includes/PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Cell/Comment.php new file mode 100644 index 0000000..88406ed --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/Writer/OpenDocument/Cell/Comment.php @@ -0,0 +1,63 @@ + + */ +class PHPExcel_Writer_OpenDocument_Cell_Comment +{ + public static function write(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Cell $cell) + { + $comments = $cell->getWorksheet()->getComments(); + if (!isset($comments[$cell->getCoordinate()])) { + return; + } + $comment = $comments[$cell->getCoordinate()]; + + $objWriter->startElement('office:annotation'); + //$objWriter->writeAttribute('draw:style-name', 'gr1'); + //$objWriter->writeAttribute('draw:text-style-name', 'P1'); + $objWriter->writeAttribute('svg:width', $comment->getWidth()); + $objWriter->writeAttribute('svg:height', $comment->getHeight()); + $objWriter->writeAttribute('svg:x', $comment->getMarginLeft()); + $objWriter->writeAttribute('svg:y', $comment->getMarginTop()); + //$objWriter->writeAttribute('draw:caption-point-x', $comment->getMarginLeft()); + //$objWriter->writeAttribute('draw:caption-point-y', $comment->getMarginTop()); + $objWriter->writeElement('dc:creator', $comment->getAuthor()); + // TODO: Not realized in PHPExcel_Comment yet. + //$objWriter->writeElement('dc:date', $comment->getDate()); + $objWriter->writeElement('text:p', $comment->getText()->getPlainText()); + //$objWriter->writeAttribute('draw:text-style-name', 'P1'); + $objWriter->endElement(); + } +}