@@ -566,49 +566,49 @@ discard block |
||
566 | 566 | |
567 | 567 | // GKPIDDSI_CODEPAGE: CodePage |
568 | 568 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x01), |
569 | - 'offset' => array('pack' => 'V'), |
|
570 | - 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
571 | - 'data' => array('data' => 1252)); |
|
569 | + 'offset' => array('pack' => 'V'), |
|
570 | + 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
571 | + 'data' => array('data' => 1252)); |
|
572 | 572 | $dataSection_NumProps++; |
573 | 573 | |
574 | 574 | // GKPIDDSI_CATEGORY : Category |
575 | 575 | if ($this->spreadsheet->getProperties()->getCategory()) { |
576 | 576 | $dataProp = $this->spreadsheet->getProperties()->getCategory(); |
577 | 577 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), |
578 | - 'offset' => array('pack' => 'V'), |
|
579 | - 'type' => array('pack' => 'V', 'data' => 0x1E), |
|
580 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
578 | + 'offset' => array('pack' => 'V'), |
|
579 | + 'type' => array('pack' => 'V', 'data' => 0x1E), |
|
580 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
581 | 581 | $dataSection_NumProps++; |
582 | 582 | } |
583 | 583 | // GKPIDDSI_VERSION :Version of the application that wrote the property storage |
584 | 584 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x17), |
585 | - 'offset' => array('pack' => 'V'), |
|
586 | - 'type' => array('pack' => 'V', 'data' => 0x03), |
|
587 | - 'data' => array('pack' => 'V', 'data' => 0x000C0000)); |
|
585 | + 'offset' => array('pack' => 'V'), |
|
586 | + 'type' => array('pack' => 'V', 'data' => 0x03), |
|
587 | + 'data' => array('pack' => 'V', 'data' => 0x000C0000)); |
|
588 | 588 | $dataSection_NumProps++; |
589 | 589 | // GKPIDDSI_SCALE : FALSE |
590 | 590 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0B), |
591 | - 'offset' => array('pack' => 'V'), |
|
592 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
593 | - 'data' => array('data' => false)); |
|
591 | + 'offset' => array('pack' => 'V'), |
|
592 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
593 | + 'data' => array('data' => false)); |
|
594 | 594 | $dataSection_NumProps++; |
595 | 595 | // GKPIDDSI_LINKSDIRTY : True if any of the values for the linked properties have changed outside of the application |
596 | 596 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x10), |
597 | - 'offset' => array('pack' => 'V'), |
|
598 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
599 | - 'data' => array('data' => false)); |
|
597 | + 'offset' => array('pack' => 'V'), |
|
598 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
599 | + 'data' => array('data' => false)); |
|
600 | 600 | $dataSection_NumProps++; |
601 | 601 | // GKPIDDSI_SHAREDOC : FALSE |
602 | 602 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x13), |
603 | - 'offset' => array('pack' => 'V'), |
|
604 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
605 | - 'data' => array('data' => false)); |
|
603 | + 'offset' => array('pack' => 'V'), |
|
604 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
605 | + 'data' => array('data' => false)); |
|
606 | 606 | $dataSection_NumProps++; |
607 | 607 | // GKPIDDSI_HYPERLINKSCHANGED : True if any of the values for the _PID_LINKS (hyperlink text) have changed outside of the application |
608 | 608 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x16), |
609 | - 'offset' => array('pack' => 'V'), |
|
610 | - 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
611 | - 'data' => array('data' => false)); |
|
609 | + 'offset' => array('pack' => 'V'), |
|
610 | + 'type' => array('pack' => 'V', 'data' => 0x0B), |
|
611 | + 'data' => array('data' => false)); |
|
612 | 612 | $dataSection_NumProps++; |
613 | 613 | |
614 | 614 | // GKPIDDSI_DOCSPARTS |
@@ -618,50 +618,50 @@ discard block |
||
618 | 618 | $dataProp = pack('v', 0x0001); |
619 | 619 | $dataProp .= pack('v', 0x0000); |
620 | 620 | // array of UnalignedLpstr |
621 | - // cch |
|
622 | - $dataProp .= pack('v', 0x000A); |
|
623 | - $dataProp .= pack('v', 0x0000); |
|
624 | - // value |
|
625 | - $dataProp .= 'Worksheet'.chr(0); |
|
621 | + // cch |
|
622 | + $dataProp .= pack('v', 0x000A); |
|
623 | + $dataProp .= pack('v', 0x0000); |
|
624 | + // value |
|
625 | + $dataProp .= 'Worksheet'.chr(0); |
|
626 | 626 | |
627 | 627 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), |
628 | - 'offset' => array('pack' => 'V'), |
|
629 | - 'type' => array('pack' => 'V', 'data' => 0x101E), |
|
630 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
628 | + 'offset' => array('pack' => 'V'), |
|
629 | + 'type' => array('pack' => 'V', 'data' => 0x101E), |
|
630 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
631 | 631 | $dataSection_NumProps++; |
632 | 632 | |
633 | 633 | // GKPIDDSI_HEADINGPAIR |
634 | 634 | // VtVecHeadingPairValue |
635 | - // cElements |
|
636 | - $dataProp = pack('v', 0x0002); |
|
637 | - $dataProp .= pack('v', 0x0000); |
|
638 | - // Array of vtHeadingPair |
|
635 | + // cElements |
|
636 | + $dataProp = pack('v', 0x0002); |
|
637 | + $dataProp .= pack('v', 0x0000); |
|
638 | + // Array of vtHeadingPair |
|
639 | 639 | // vtUnalignedString - headingString |
640 | - // stringType |
|
641 | - $dataProp .= pack('v', 0x001E); |
|
642 | - // padding |
|
643 | - $dataProp .= pack('v', 0x0000); |
|
644 | - // UnalignedLpstr |
|
640 | + // stringType |
|
641 | + $dataProp .= pack('v', 0x001E); |
|
642 | + // padding |
|
643 | + $dataProp .= pack('v', 0x0000); |
|
644 | + // UnalignedLpstr |
|
645 | 645 | // cch |
646 | 646 | $dataProp .= pack('v', 0x0013); |
647 | 647 | $dataProp .= pack('v', 0x0000); |
648 | 648 | // value |
649 | 649 | $dataProp .= 'Feuilles de calcul'; |
650 | 650 | // vtUnalignedString - headingParts |
651 | - // wType : 0x0003 = 32 bit signed integer |
|
652 | - $dataProp .= pack('v', 0x0300); |
|
653 | - // padding |
|
654 | - $dataProp .= pack('v', 0x0000); |
|
655 | - // value |
|
656 | - $dataProp .= pack('v', 0x0100); |
|
657 | - $dataProp .= pack('v', 0x0000); |
|
658 | - $dataProp .= pack('v', 0x0000); |
|
659 | - $dataProp .= pack('v', 0x0000); |
|
651 | + // wType : 0x0003 = 32 bit signed integer |
|
652 | + $dataProp .= pack('v', 0x0300); |
|
653 | + // padding |
|
654 | + $dataProp .= pack('v', 0x0000); |
|
655 | + // value |
|
656 | + $dataProp .= pack('v', 0x0100); |
|
657 | + $dataProp .= pack('v', 0x0000); |
|
658 | + $dataProp .= pack('v', 0x0000); |
|
659 | + $dataProp .= pack('v', 0x0000); |
|
660 | 660 | |
661 | 661 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), |
662 | - 'offset' => array('pack' => 'V'), |
|
663 | - 'type' => array('pack' => 'V', 'data' => 0x100C), |
|
664 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
662 | + 'offset' => array('pack' => 'V'), |
|
663 | + 'type' => array('pack' => 'V', 'data' => 0x100C), |
|
664 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
665 | 665 | $dataSection_NumProps++; |
666 | 666 | |
667 | 667 | // 4 Section Length |
@@ -762,88 +762,88 @@ discard block |
||
762 | 762 | |
763 | 763 | // CodePage : CP-1252 |
764 | 764 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x01), |
765 | - 'offset' => array('pack' => 'V'), |
|
766 | - 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
767 | - 'data' => array('data' => 1252)); |
|
765 | + 'offset' => array('pack' => 'V'), |
|
766 | + 'type' => array('pack' => 'V', 'data' => 0x02), // 2 byte signed integer |
|
767 | + 'data' => array('data' => 1252)); |
|
768 | 768 | $dataSection_NumProps++; |
769 | 769 | |
770 | 770 | // Title |
771 | 771 | if ($this->spreadsheet->getProperties()->getTitle()) { |
772 | 772 | $dataProp = $this->spreadsheet->getProperties()->getTitle(); |
773 | 773 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), |
774 | - 'offset' => array('pack' => 'V'), |
|
775 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
776 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
774 | + 'offset' => array('pack' => 'V'), |
|
775 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
776 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
777 | 777 | $dataSection_NumProps++; |
778 | 778 | } |
779 | 779 | // Subject |
780 | 780 | if ($this->spreadsheet->getProperties()->getSubject()) { |
781 | 781 | $dataProp = $this->spreadsheet->getProperties()->getSubject(); |
782 | 782 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x03), |
783 | - 'offset' => array('pack' => 'V'), |
|
784 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
785 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
783 | + 'offset' => array('pack' => 'V'), |
|
784 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
785 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
786 | 786 | $dataSection_NumProps++; |
787 | 787 | } |
788 | 788 | // Author (Creator) |
789 | 789 | if ($this->spreadsheet->getProperties()->getCreator()) { |
790 | 790 | $dataProp = $this->spreadsheet->getProperties()->getCreator(); |
791 | 791 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x04), |
792 | - 'offset' => array('pack' => 'V'), |
|
793 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
794 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
792 | + 'offset' => array('pack' => 'V'), |
|
793 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
794 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
795 | 795 | $dataSection_NumProps++; |
796 | 796 | } |
797 | 797 | // Keywords |
798 | 798 | if ($this->spreadsheet->getProperties()->getKeywords()) { |
799 | 799 | $dataProp = $this->spreadsheet->getProperties()->getKeywords(); |
800 | 800 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x05), |
801 | - 'offset' => array('pack' => 'V'), |
|
802 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
803 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
801 | + 'offset' => array('pack' => 'V'), |
|
802 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
803 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
804 | 804 | $dataSection_NumProps++; |
805 | 805 | } |
806 | 806 | // Comments (Description) |
807 | 807 | if ($this->spreadsheet->getProperties()->getDescription()) { |
808 | 808 | $dataProp = $this->spreadsheet->getProperties()->getDescription(); |
809 | 809 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x06), |
810 | - 'offset' => array('pack' => 'V'), |
|
811 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
812 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
810 | + 'offset' => array('pack' => 'V'), |
|
811 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
812 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
813 | 813 | $dataSection_NumProps++; |
814 | 814 | } |
815 | 815 | // Last Saved By (LastModifiedBy) |
816 | 816 | if ($this->spreadsheet->getProperties()->getLastModifiedBy()) { |
817 | 817 | $dataProp = $this->spreadsheet->getProperties()->getLastModifiedBy(); |
818 | 818 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x08), |
819 | - 'offset' => array('pack' => 'V'), |
|
820 | - 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
821 | - 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
819 | + 'offset' => array('pack' => 'V'), |
|
820 | + 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length |
|
821 | + 'data' => array('data' => $dataProp, 'length' => strlen($dataProp))); |
|
822 | 822 | $dataSection_NumProps++; |
823 | 823 | } |
824 | 824 | // Created Date/Time |
825 | 825 | if ($this->spreadsheet->getProperties()->getCreated()) { |
826 | 826 | $dataProp = $this->spreadsheet->getProperties()->getCreated(); |
827 | 827 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), |
828 | - 'offset' => array('pack' => 'V'), |
|
829 | - 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
830 | - 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
828 | + 'offset' => array('pack' => 'V'), |
|
829 | + 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
830 | + 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
831 | 831 | $dataSection_NumProps++; |
832 | 832 | } |
833 | 833 | // Modified Date/Time |
834 | 834 | if ($this->spreadsheet->getProperties()->getModified()) { |
835 | 835 | $dataProp = $this->spreadsheet->getProperties()->getModified(); |
836 | 836 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), |
837 | - 'offset' => array('pack' => 'V'), |
|
838 | - 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
839 | - 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
837 | + 'offset' => array('pack' => 'V'), |
|
838 | + 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) |
|
839 | + 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); |
|
840 | 840 | $dataSection_NumProps++; |
841 | 841 | } |
842 | 842 | // Security |
843 | 843 | $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x13), |
844 | - 'offset' => array('pack' => 'V'), |
|
845 | - 'type' => array('pack' => 'V', 'data' => 0x03), // 4 byte signed integer |
|
846 | - 'data' => array('data' => 0x00)); |
|
844 | + 'offset' => array('pack' => 'V'), |
|
845 | + 'type' => array('pack' => 'V', 'data' => 0x03), // 4 byte signed integer |
|
846 | + 'data' => array('data' => 0x00)); |
|
847 | 847 | $dataSection_NumProps++; |
848 | 848 | |
849 | 849 |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | // XML header |
46 | 46 | $objWriter->startDocument('1.0', 'UTF-8', 'yes'); |
47 | 47 | |
48 | - // Comments cache |
|
49 | - $comments = $pWorksheet->getComments(); |
|
48 | + // Comments cache |
|
49 | + $comments = $pWorksheet->getComments(); |
|
50 | 50 | |
51 | - // Authors cache |
|
52 | - $authors = array(); |
|
53 | - $authorId = 0; |
|
51 | + // Authors cache |
|
52 | + $authors = array(); |
|
53 | + $authorId = 0; |
|
54 | 54 | foreach ($comments as $comment) { |
55 | 55 | if (!isset($authors[$comment->getAuthor()])) { |
56 | 56 | $authors[$comment->getAuthor()] = $authorId++; |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | // XML header |
126 | 126 | $objWriter->startDocument('1.0', 'UTF-8', 'yes'); |
127 | 127 | |
128 | - // Comments cache |
|
129 | - $comments = $pWorksheet->getComments(); |
|
128 | + // Comments cache |
|
129 | + $comments = $pWorksheet->getComments(); |
|
130 | 130 | |
131 | 131 | // xml |
132 | 132 | $objWriter->startElement('xml'); |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | */ |
188 | 188 | private function writeVMLComment(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpSpreadsheet\Comment $pComment = null) |
189 | 189 | { |
190 | - // Metadata |
|
191 | - list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($pCellReference); |
|
192 | - $column = \PhpSpreadsheet\Cell::columnIndexFromString($column); |
|
193 | - $id = 1024 + $column + $row; |
|
194 | - $id = substr($id, 0, 4); |
|
190 | + // Metadata |
|
191 | + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($pCellReference); |
|
192 | + $column = \PhpSpreadsheet\Cell::columnIndexFromString($column); |
|
193 | + $id = 1024 + $column + $row; |
|
194 | + $id = substr($id, 0, 4); |
|
195 | 195 | |
196 | 196 | // v:shape |
197 | 197 | $objWriter->startElement('v:shape'); |
@@ -50,17 +50,17 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * Method for saving the whole OLE container (including files). |
|
54 | - * In fact, if called with an empty argument (or '-'), it saves to a |
|
55 | - * temporary file and then outputs it's contents to stdout. |
|
56 | - * If a resource pointer to a stream created by fopen() is passed |
|
57 | - * it will be used, but you have to close such stream by yourself. |
|
58 | - * |
|
59 | - * @param string|resource $filename The name of the file or stream where to save the OLE container. |
|
60 | - * @access public |
|
61 | - * @return mixed true on success |
|
62 | - * @throws \PhpSpreadsheet\Writer\Exception |
|
63 | - */ |
|
53 | + * Method for saving the whole OLE container (including files). |
|
54 | + * In fact, if called with an empty argument (or '-'), it saves to a |
|
55 | + * temporary file and then outputs it's contents to stdout. |
|
56 | + * If a resource pointer to a stream created by fopen() is passed |
|
57 | + * it will be used, but you have to close such stream by yourself. |
|
58 | + * |
|
59 | + * @param string|resource $filename The name of the file or stream where to save the OLE container. |
|
60 | + * @access public |
|
61 | + * @return mixed true on success |
|
62 | + * @throws \PhpSpreadsheet\Writer\Exception |
|
63 | + */ |
|
64 | 64 | public function save($filename) |
65 | 65 | { |
66 | 66 | // Initial Setting for saving |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * Calculate some numbers |
|
120 | - * |
|
121 | - * @access public |
|
122 | - * @param array $raList Reference to an array of PPS's |
|
123 | - * @return array The array of numbers |
|
124 | - */ |
|
119 | + * Calculate some numbers |
|
120 | + * |
|
121 | + * @access public |
|
122 | + * @param array $raList Reference to an array of PPS's |
|
123 | + * @return array The array of numbers |
|
124 | + */ |
|
125 | 125 | public function _calcSize(&$raList) |
126 | 126 | { |
127 | 127 | // Calculate Basic Setting |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
157 | - * Helper function for caculating a magic value for block sizes |
|
158 | - * |
|
159 | - * @access public |
|
160 | - * @param integer $i2 The argument |
|
161 | - * @see save() |
|
162 | - * @return integer |
|
163 | - */ |
|
157 | + * Helper function for caculating a magic value for block sizes |
|
158 | + * |
|
159 | + * @access public |
|
160 | + * @param integer $i2 The argument |
|
161 | + * @see save() |
|
162 | + * @return integer |
|
163 | + */ |
|
164 | 164 | private static function adjust2($i2) |
165 | 165 | { |
166 | 166 | $iWk = log($i2)/log(2); |
@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
171 | - * Save OLE header |
|
172 | - * |
|
173 | - * @access public |
|
174 | - * @param integer $iSBDcnt |
|
175 | - * @param integer $iBBcnt |
|
176 | - * @param integer $iPPScnt |
|
177 | - */ |
|
171 | + * Save OLE header |
|
172 | + * |
|
173 | + * @access public |
|
174 | + * @param integer $iSBDcnt |
|
175 | + * @param integer $iBBcnt |
|
176 | + * @param integer $iPPScnt |
|
177 | + */ |
|
178 | 178 | public function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt) |
179 | 179 | { |
180 | 180 | $FILE = $this->_FILEH_; |
@@ -249,12 +249,12 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | /** |
252 | - * Saving big data (PPS's with data bigger than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) |
|
253 | - * |
|
254 | - * @access public |
|
255 | - * @param integer $iStBlk |
|
256 | - * @param array &$raList Reference to array of PPS's |
|
257 | - */ |
|
252 | + * Saving big data (PPS's with data bigger than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) |
|
253 | + * |
|
254 | + * @access public |
|
255 | + * @param integer $iStBlk |
|
256 | + * @param array &$raList Reference to array of PPS's |
|
257 | + */ |
|
258 | 258 | public function _saveBigData($iStBlk, &$raList) |
259 | 259 | { |
260 | 260 | $FILE = $this->_FILEH_; |
@@ -297,11 +297,11 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | /** |
300 | - * get small data (PPS's with data smaller than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) |
|
301 | - * |
|
302 | - * @access public |
|
303 | - * @param array &$raList Reference to array of PPS's |
|
304 | - */ |
|
300 | + * get small data (PPS's with data smaller than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) |
|
301 | + * |
|
302 | + * @access public |
|
303 | + * @param array &$raList Reference to array of PPS's |
|
304 | + */ |
|
305 | 305 | public function _makeSmallData(&$raList) |
306 | 306 | { |
307 | 307 | $sRes = ''; |
@@ -354,11 +354,11 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | /** |
357 | - * Saves all the PPS's WKs |
|
358 | - * |
|
359 | - * @access public |
|
360 | - * @param array $raList Reference to an array with all PPS's |
|
361 | - */ |
|
357 | + * Saves all the PPS's WKs |
|
358 | + * |
|
359 | + * @access public |
|
360 | + * @param array $raList Reference to an array with all PPS's |
|
361 | + */ |
|
362 | 362 | public function _savePps(&$raList) |
363 | 363 | { |
364 | 364 | // Save each PPS WK |
@@ -375,13 +375,13 @@ discard block |
||
375 | 375 | } |
376 | 376 | |
377 | 377 | /** |
378 | - * Saving Big Block Depot |
|
379 | - * |
|
380 | - * @access public |
|
381 | - * @param integer $iSbdSize |
|
382 | - * @param integer $iBsize |
|
383 | - * @param integer $iPpsCnt |
|
384 | - */ |
|
378 | + * Saving Big Block Depot |
|
379 | + * |
|
380 | + * @access public |
|
381 | + * @param integer $iSbdSize |
|
382 | + * @param integer $iBsize |
|
383 | + * @param integer $iPpsCnt |
|
384 | + */ |
|
385 | 385 | public function _saveBbd($iSbdSize, $iBsize, $iPpsCnt) |
386 | 386 | { |
387 | 387 | $FILE = $this->_FILEH_; |
@@ -32,98 +32,98 @@ discard block |
||
32 | 32 | class PPS |
33 | 33 | { |
34 | 34 | /** |
35 | - * The PPS index |
|
36 | - * @var integer |
|
37 | - */ |
|
35 | + * The PPS index |
|
36 | + * @var integer |
|
37 | + */ |
|
38 | 38 | public $No; |
39 | 39 | |
40 | 40 | /** |
41 | - * The PPS name (in Unicode) |
|
42 | - * @var string |
|
43 | - */ |
|
41 | + * The PPS name (in Unicode) |
|
42 | + * @var string |
|
43 | + */ |
|
44 | 44 | public $Name; |
45 | 45 | |
46 | 46 | /** |
47 | - * The PPS type. Dir, Root or File |
|
48 | - * @var integer |
|
49 | - */ |
|
47 | + * The PPS type. Dir, Root or File |
|
48 | + * @var integer |
|
49 | + */ |
|
50 | 50 | public $Type; |
51 | 51 | |
52 | 52 | /** |
53 | - * The index of the previous PPS |
|
54 | - * @var integer |
|
55 | - */ |
|
53 | + * The index of the previous PPS |
|
54 | + * @var integer |
|
55 | + */ |
|
56 | 56 | public $PrevPps; |
57 | 57 | |
58 | 58 | /** |
59 | - * The index of the next PPS |
|
60 | - * @var integer |
|
61 | - */ |
|
59 | + * The index of the next PPS |
|
60 | + * @var integer |
|
61 | + */ |
|
62 | 62 | public $NextPps; |
63 | 63 | |
64 | 64 | /** |
65 | - * The index of it's first child if this is a Dir or Root PPS |
|
66 | - * @var integer |
|
67 | - */ |
|
65 | + * The index of it's first child if this is a Dir or Root PPS |
|
66 | + * @var integer |
|
67 | + */ |
|
68 | 68 | public $DirPps; |
69 | 69 | |
70 | 70 | /** |
71 | - * A timestamp |
|
72 | - * @var integer |
|
73 | - */ |
|
71 | + * A timestamp |
|
72 | + * @var integer |
|
73 | + */ |
|
74 | 74 | public $Time1st; |
75 | 75 | |
76 | 76 | /** |
77 | - * A timestamp |
|
78 | - * @var integer |
|
79 | - */ |
|
77 | + * A timestamp |
|
78 | + * @var integer |
|
79 | + */ |
|
80 | 80 | public $Time2nd; |
81 | 81 | |
82 | 82 | /** |
83 | - * Starting block (small or big) for this PPS's data inside the container |
|
84 | - * @var integer |
|
85 | - */ |
|
83 | + * Starting block (small or big) for this PPS's data inside the container |
|
84 | + * @var integer |
|
85 | + */ |
|
86 | 86 | public $startBlock; |
87 | 87 | |
88 | 88 | /** |
89 | - * The size of the PPS's data (in bytes) |
|
90 | - * @var integer |
|
91 | - */ |
|
89 | + * The size of the PPS's data (in bytes) |
|
90 | + * @var integer |
|
91 | + */ |
|
92 | 92 | public $Size; |
93 | 93 | |
94 | 94 | /** |
95 | - * The PPS's data (only used if it's not using a temporary file) |
|
96 | - * @var string |
|
97 | - */ |
|
95 | + * The PPS's data (only used if it's not using a temporary file) |
|
96 | + * @var string |
|
97 | + */ |
|
98 | 98 | public $_data; |
99 | 99 | |
100 | 100 | /** |
101 | - * Array of child PPS's (only used by Root and Dir PPS's) |
|
102 | - * @var array |
|
103 | - */ |
|
101 | + * Array of child PPS's (only used by Root and Dir PPS's) |
|
102 | + * @var array |
|
103 | + */ |
|
104 | 104 | public $children = array(); |
105 | 105 | |
106 | 106 | /** |
107 | - * Pointer to OLE container |
|
108 | - * @var OLE |
|
109 | - */ |
|
107 | + * Pointer to OLE container |
|
108 | + * @var OLE |
|
109 | + */ |
|
110 | 110 | public $ole; |
111 | 111 | |
112 | 112 | /** |
113 | - * The constructor |
|
114 | - * |
|
115 | - * @access public |
|
116 | - * @param integer $No The PPS index |
|
117 | - * @param string $name The PPS name |
|
118 | - * @param integer $type The PPS type. Dir, Root or File |
|
119 | - * @param integer $prev The index of the previous PPS |
|
120 | - * @param integer $next The index of the next PPS |
|
121 | - * @param integer $dir The index of it's first child if this is a Dir or Root PPS |
|
122 | - * @param integer $time_1st A timestamp |
|
123 | - * @param integer $time_2nd A timestamp |
|
124 | - * @param string $data The (usually binary) source data of the PPS |
|
125 | - * @param array $children Array containing children PPS for this PPS |
|
126 | - */ |
|
113 | + * The constructor |
|
114 | + * |
|
115 | + * @access public |
|
116 | + * @param integer $No The PPS index |
|
117 | + * @param string $name The PPS name |
|
118 | + * @param integer $type The PPS type. Dir, Root or File |
|
119 | + * @param integer $prev The index of the previous PPS |
|
120 | + * @param integer $next The index of the next PPS |
|
121 | + * @param integer $dir The index of it's first child if this is a Dir or Root PPS |
|
122 | + * @param integer $time_1st A timestamp |
|
123 | + * @param integer $time_2nd A timestamp |
|
124 | + * @param string $data The (usually binary) source data of the PPS |
|
125 | + * @param array $children Array containing children PPS for this PPS |
|
126 | + */ |
|
127 | 127 | public function __construct($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children) |
128 | 128 | { |
129 | 129 | $this->No = $No; |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * Returns the amount of data saved for this PPS |
|
148 | - * |
|
149 | - * @access public |
|
150 | - * @return integer The amount of data (in bytes) |
|
151 | - */ |
|
147 | + * Returns the amount of data saved for this PPS |
|
148 | + * |
|
149 | + * @access public |
|
150 | + * @return integer The amount of data (in bytes) |
|
151 | + */ |
|
152 | 152 | public function getDataLen() |
153 | 153 | { |
154 | 154 | if (!isset($this->_data)) { |
@@ -164,43 +164,43 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
167 | - * Returns a string with the PPS's WK (What is a WK?) |
|
168 | - * |
|
169 | - * @access public |
|
170 | - * @return string The binary string |
|
171 | - */ |
|
167 | + * Returns a string with the PPS's WK (What is a WK?) |
|
168 | + * |
|
169 | + * @access public |
|
170 | + * @return string The binary string |
|
171 | + */ |
|
172 | 172 | public function _getPpsWk() |
173 | 173 | { |
174 | 174 | $ret = str_pad($this->Name, 64, "\x00"); |
175 | 175 | |
176 | 176 | $ret .= pack("v", strlen($this->Name) + 2) // 66 |
177 | - . pack("c", $this->Type) // 67 |
|
178 | - . pack("c", 0x00) //UK // 68 |
|
179 | - . pack("V", $this->PrevPps) //Prev // 72 |
|
180 | - . pack("V", $this->NextPps) //Next // 76 |
|
181 | - . pack("V", $this->DirPps) //Dir // 80 |
|
182 | - . "\x00\x09\x02\x00" // 84 |
|
183 | - . "\x00\x00\x00\x00" // 88 |
|
184 | - . "\xc0\x00\x00\x00" // 92 |
|
185 | - . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root |
|
186 | - . "\x00\x00\x00\x00" // 100 |
|
187 | - . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time1st) // 108 |
|
188 | - . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
|
189 | - . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 |
|
190 | - . pack("V", $this->Size) // 124 |
|
191 | - . pack("V", 0); // 128 |
|
177 | + . pack("c", $this->Type) // 67 |
|
178 | + . pack("c", 0x00) //UK // 68 |
|
179 | + . pack("V", $this->PrevPps) //Prev // 72 |
|
180 | + . pack("V", $this->NextPps) //Next // 76 |
|
181 | + . pack("V", $this->DirPps) //Dir // 80 |
|
182 | + . "\x00\x09\x02\x00" // 84 |
|
183 | + . "\x00\x00\x00\x00" // 88 |
|
184 | + . "\xc0\x00\x00\x00" // 92 |
|
185 | + . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root |
|
186 | + . "\x00\x00\x00\x00" // 100 |
|
187 | + . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time1st) // 108 |
|
188 | + . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
|
189 | + . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 |
|
190 | + . pack("V", $this->Size) // 124 |
|
191 | + . pack("V", 0); // 128 |
|
192 | 192 | return $ret; |
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
196 | - * Updates index and pointers to previous, next and children PPS's for this |
|
197 | - * PPS. I don't think it'll work with Dir PPS's. |
|
198 | - * |
|
199 | - * @access public |
|
200 | - * @param array &$raList Reference to the array of PPS's for the whole OLE |
|
201 | - * container |
|
202 | - * @return integer The index for this PPS |
|
203 | - */ |
|
196 | + * Updates index and pointers to previous, next and children PPS's for this |
|
197 | + * PPS. I don't think it'll work with Dir PPS's. |
|
198 | + * |
|
199 | + * @access public |
|
200 | + * @param array &$raList Reference to the array of PPS's for the whole OLE |
|
201 | + * container |
|
202 | + * @return integer The index for this PPS |
|
203 | + */ |
|
204 | 204 | public static function _savePpsSetPnt(&$raList, $to_save, $depth = 0) |
205 | 205 | { |
206 | 206 | if (!is_array($to_save) || (empty($to_save))) { |
@@ -49,43 +49,43 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * The file handle for reading an OLE container |
51 | 51 | * @var resource |
52 | - */ |
|
52 | + */ |
|
53 | 53 | public $_file_handle; |
54 | 54 | |
55 | 55 | /** |
56 | - * Array of PPS's found on the OLE container |
|
57 | - * @var array |
|
58 | - */ |
|
56 | + * Array of PPS's found on the OLE container |
|
57 | + * @var array |
|
58 | + */ |
|
59 | 59 | public $_list = array(); |
60 | 60 | |
61 | 61 | /** |
62 | 62 | * Root directory of OLE container |
63 | 63 | * @var OLE_PPS_Root |
64 | - */ |
|
64 | + */ |
|
65 | 65 | public $root; |
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Big Block Allocation Table |
69 | 69 | * @var array (blockId => nextBlockId) |
70 | - */ |
|
70 | + */ |
|
71 | 71 | public $bbat; |
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Short Block Allocation Table |
75 | 75 | * @var array (blockId => nextBlockId) |
76 | - */ |
|
76 | + */ |
|
77 | 77 | public $sbat; |
78 | 78 | |
79 | 79 | /** |
80 | 80 | * Size of big blocks. This is usually 512. |
81 | 81 | * @var int number of octets per block. |
82 | - */ |
|
82 | + */ |
|
83 | 83 | public $bigBlockSize; |
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Size of small blocks. This is usually 64. |
87 | 87 | * @var int number of octets per block |
88 | - */ |
|
88 | + */ |
|
89 | 89 | public $smallBlockSize; |
90 | 90 | |
91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param string $file |
96 | 96 | * @return mixed true on success, PEAR_Error on failure |
97 | 97 | * @throws \PhpSpreadsheet\Reader\Exception |
98 | - */ |
|
98 | + */ |
|
99 | 99 | public function read($file) |
100 | 100 | { |
101 | 101 | $fh = fopen($file, "r"); |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
195 | - * Returns a stream for use with fread() etc. External callers should |
|
196 | - * use \PhpSpreadsheet\Shared\OLE\PPS\File::getStream(). |
|
197 | - * @param int|PPS block id or PPS |
|
198 | - * @return resource read-only stream |
|
199 | - */ |
|
195 | + * Returns a stream for use with fread() etc. External callers should |
|
196 | + * use \PhpSpreadsheet\Shared\OLE\PPS\File::getStream(). |
|
197 | + * @param int|PPS block id or PPS |
|
198 | + * @return resource read-only stream |
|
199 | + */ |
|
200 | 200 | public function getStream($blockIdOrPps) |
201 | 201 | { |
202 | 202 | static $isRegistered = false; |
@@ -258,13 +258,13 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
261 | - * Gets information about all PPS's on the OLE container from the PPS WK's |
|
262 | - * creates an OLE_PPS object for each one. |
|
263 | - * |
|
264 | - * @access public |
|
265 | - * @param integer the block id of the first block |
|
266 | - * @return mixed true on success, PEAR_Error on failure |
|
267 | - */ |
|
261 | + * Gets information about all PPS's on the OLE container from the PPS WK's |
|
262 | + * creates an OLE_PPS object for each one. |
|
263 | + * |
|
264 | + * @access public |
|
265 | + * @param integer the block id of the first block |
|
266 | + * @return mixed true on success, PEAR_Error on failure |
|
267 | + */ |
|
268 | 268 | public function _readPpsWks($blockId) |
269 | 269 | { |
270 | 270 | $fh = $this->getStream($blockId); |
@@ -332,13 +332,13 @@ discard block |
||
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
335 | - * It checks whether the PPS tree is complete (all PPS's read) |
|
336 | - * starting with the given PPS (not necessarily root) |
|
337 | - * |
|
338 | - * @access public |
|
339 | - * @param integer $index The index of the PPS from which we are checking |
|
340 | - * @return boolean Whether the PPS tree for the given PPS is complete |
|
341 | - */ |
|
335 | + * It checks whether the PPS tree is complete (all PPS's read) |
|
336 | + * starting with the given PPS (not necessarily root) |
|
337 | + * |
|
338 | + * @access public |
|
339 | + * @param integer $index The index of the PPS from which we are checking |
|
340 | + * @return boolean Whether the PPS tree for the given PPS is complete |
|
341 | + */ |
|
342 | 342 | public function _ppsTreeComplete($index) |
343 | 343 | { |
344 | 344 | return isset($this->_list[$index]) && |
@@ -352,13 +352,13 @@ discard block |
||
352 | 352 | } |
353 | 353 | |
354 | 354 | /** |
355 | - * Checks whether a PPS is a File PPS or not. |
|
356 | - * If there is no PPS for the index given, it will return false. |
|
357 | - * |
|
358 | - * @access public |
|
359 | - * @param integer $index The index for the PPS |
|
360 | - * @return bool true if it's a File PPS, false otherwise |
|
361 | - */ |
|
355 | + * Checks whether a PPS is a File PPS or not. |
|
356 | + * If there is no PPS for the index given, it will return false. |
|
357 | + * |
|
358 | + * @access public |
|
359 | + * @param integer $index The index for the PPS |
|
360 | + * @return bool true if it's a File PPS, false otherwise |
|
361 | + */ |
|
362 | 362 | public function isFile($index) |
363 | 363 | { |
364 | 364 | if (isset($this->_list[$index])) { |
@@ -368,13 +368,13 @@ discard block |
||
368 | 368 | } |
369 | 369 | |
370 | 370 | /** |
371 | - * Checks whether a PPS is a Root PPS or not. |
|
372 | - * If there is no PPS for the index given, it will return false. |
|
373 | - * |
|
374 | - * @access public |
|
375 | - * @param integer $index The index for the PPS. |
|
376 | - * @return bool true if it's a Root PPS, false otherwise |
|
377 | - */ |
|
371 | + * Checks whether a PPS is a Root PPS or not. |
|
372 | + * If there is no PPS for the index given, it will return false. |
|
373 | + * |
|
374 | + * @access public |
|
375 | + * @param integer $index The index for the PPS. |
|
376 | + * @return bool true if it's a Root PPS, false otherwise |
|
377 | + */ |
|
378 | 378 | public function isRoot($index) |
379 | 379 | { |
380 | 380 | if (isset($this->_list[$index])) { |
@@ -384,28 +384,28 @@ discard block |
||
384 | 384 | } |
385 | 385 | |
386 | 386 | /** |
387 | - * Gives the total number of PPS's found in the OLE container. |
|
388 | - * |
|
389 | - * @access public |
|
390 | - * @return integer The total number of PPS's found in the OLE container |
|
391 | - */ |
|
387 | + * Gives the total number of PPS's found in the OLE container. |
|
388 | + * |
|
389 | + * @access public |
|
390 | + * @return integer The total number of PPS's found in the OLE container |
|
391 | + */ |
|
392 | 392 | public function ppsTotal() |
393 | 393 | { |
394 | 394 | return count($this->_list); |
395 | 395 | } |
396 | 396 | |
397 | 397 | /** |
398 | - * Gets data from a PPS |
|
399 | - * If there is no PPS for the index given, it will return an empty string. |
|
400 | - * |
|
401 | - * @access public |
|
402 | - * @param integer $index The index for the PPS |
|
403 | - * @param integer $position The position from which to start reading |
|
404 | - * (relative to the PPS) |
|
405 | - * @param integer $length The amount of bytes to read (at most) |
|
406 | - * @return string The binary string containing the data requested |
|
407 | - * @see OLE_PPS_File::getStream() |
|
408 | - */ |
|
398 | + * Gets data from a PPS |
|
399 | + * If there is no PPS for the index given, it will return an empty string. |
|
400 | + * |
|
401 | + * @access public |
|
402 | + * @param integer $index The index for the PPS |
|
403 | + * @param integer $position The position from which to start reading |
|
404 | + * (relative to the PPS) |
|
405 | + * @param integer $length The amount of bytes to read (at most) |
|
406 | + * @return string The binary string containing the data requested |
|
407 | + * @see OLE_PPS_File::getStream() |
|
408 | + */ |
|
409 | 409 | public function getData($index, $position, $length) |
410 | 410 | { |
411 | 411 | // if position is not valid return empty string |
@@ -419,13 +419,13 @@ discard block |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | /** |
422 | - * Gets the data length from a PPS |
|
423 | - * If there is no PPS for the index given, it will return 0. |
|
424 | - * |
|
425 | - * @access public |
|
426 | - * @param integer $index The index for the PPS |
|
427 | - * @return integer The amount of bytes in data the PPS has |
|
428 | - */ |
|
422 | + * Gets the data length from a PPS |
|
423 | + * If there is no PPS for the index given, it will return 0. |
|
424 | + * |
|
425 | + * @access public |
|
426 | + * @param integer $index The index for the PPS |
|
427 | + * @return integer The amount of bytes in data the PPS has |
|
428 | + */ |
|
429 | 429 | public function getDataLength($index) |
430 | 430 | { |
431 | 431 | if (isset($this->_list[$index])) { |
@@ -435,13 +435,13 @@ discard block |
||
435 | 435 | } |
436 | 436 | |
437 | 437 | /** |
438 | - * Utility function to transform ASCII text to Unicode |
|
439 | - * |
|
440 | - * @access public |
|
441 | - * @static |
|
442 | - * @param string $ascii The ASCII string to transform |
|
443 | - * @return string The string in Unicode |
|
444 | - */ |
|
438 | + * Utility function to transform ASCII text to Unicode |
|
439 | + * |
|
440 | + * @access public |
|
441 | + * @static |
|
442 | + * @param string $ascii The ASCII string to transform |
|
443 | + * @return string The string in Unicode |
|
444 | + */ |
|
445 | 445 | public static function ascToUcs($ascii) |
446 | 446 | { |
447 | 447 | $rawname = ''; |
@@ -452,14 +452,14 @@ discard block |
||
452 | 452 | } |
453 | 453 | |
454 | 454 | /** |
455 | - * Utility function |
|
456 | - * Returns a string for the OLE container with the date given |
|
457 | - * |
|
458 | - * @access public |
|
459 | - * @static |
|
460 | - * @param integer $date A timestamp |
|
461 | - * @return string The string for the OLE container |
|
462 | - */ |
|
455 | + * Utility function |
|
456 | + * Returns a string for the OLE container with the date given |
|
457 | + * |
|
458 | + * @access public |
|
459 | + * @static |
|
460 | + * @param integer $date A timestamp |
|
461 | + * @return string The string for the OLE container |
|
462 | + */ |
|
463 | 463 | public static function localDateToOLE($date = null) |
464 | 464 | { |
465 | 465 | if (!isset($date)) { |
@@ -497,13 +497,13 @@ discard block |
||
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
500 | - * Returns a timestamp from an OLE container's date |
|
501 | - * |
|
502 | - * @access public |
|
503 | - * @static |
|
504 | - * @param integer $string A binary string with the encoded date |
|
505 | - * @return string The timestamp corresponding to the string |
|
506 | - */ |
|
500 | + * Returns a timestamp from an OLE container's date |
|
501 | + * |
|
502 | + * @access public |
|
503 | + * @static |
|
504 | + * @param integer $string A binary string with the encoded date |
|
505 | + * @return string The timestamp corresponding to the string |
|
506 | + */ |
|
507 | 507 | public static function OLE2LocalDate($string) |
508 | 508 | { |
509 | 509 | if (strlen($string) != 8) { |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | 'NULL' => null |
262 | 262 | ); |
263 | 263 | |
264 | - // PhpSpreadsheet functions |
|
264 | + // PhpSpreadsheet functions |
|
265 | 265 | private static $phpSpreadsheetFunctions = array( |
266 | 266 | 'ABS' => array( |
267 | 267 | 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, |
@@ -3136,13 +3136,13 @@ discard block |
||
3136 | 3136 | $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null; |
3137 | 3137 | |
3138 | 3138 | $regexpMatchString = '/^('.self::CALCULATION_REGEXP_FUNCTION. |
3139 | - '|'.self::CALCULATION_REGEXP_CELLREF. |
|
3140 | - '|'.self::CALCULATION_REGEXP_NUMBER. |
|
3141 | - '|'.self::CALCULATION_REGEXP_STRING. |
|
3142 | - '|'.self::CALCULATION_REGEXP_OPENBRACE. |
|
3143 | - '|'.self::CALCULATION_REGEXP_NAMEDRANGE. |
|
3144 | - '|'.self::CALCULATION_REGEXP_ERROR. |
|
3145 | - ')/si'; |
|
3139 | + '|'.self::CALCULATION_REGEXP_CELLREF. |
|
3140 | + '|'.self::CALCULATION_REGEXP_NUMBER. |
|
3141 | + '|'.self::CALCULATION_REGEXP_STRING. |
|
3142 | + '|'.self::CALCULATION_REGEXP_OPENBRACE. |
|
3143 | + '|'.self::CALCULATION_REGEXP_NAMEDRANGE. |
|
3144 | + '|'.self::CALCULATION_REGEXP_ERROR. |
|
3145 | + ')/si'; |
|
3146 | 3146 | |
3147 | 3147 | // Start with initialisation |
3148 | 3148 | $index = 0; |
@@ -99,65 +99,65 @@ discard block |
||
99 | 99 | private $cellStyleXfCollection = array(); |
100 | 100 | |
101 | 101 | /** |
102 | - * hasMacros : this workbook have macros ? |
|
103 | - * |
|
104 | - * @var bool |
|
105 | - */ |
|
102 | + * hasMacros : this workbook have macros ? |
|
103 | + * |
|
104 | + * @var bool |
|
105 | + */ |
|
106 | 106 | private $hasMacros = false; |
107 | 107 | |
108 | 108 | /** |
109 | - * macrosCode : all macros code (the vbaProject.bin file, this include form, code, etc.), null if no macro |
|
110 | - * |
|
111 | - * @var binary |
|
112 | - */ |
|
109 | + * macrosCode : all macros code (the vbaProject.bin file, this include form, code, etc.), null if no macro |
|
110 | + * |
|
111 | + * @var binary |
|
112 | + */ |
|
113 | 113 | private $macrosCode; |
114 | 114 | /** |
115 | - * macrosCertificate : if macros are signed, contains vbaProjectSignature.bin file, null if not signed |
|
116 | - * |
|
117 | - * @var binary |
|
118 | - */ |
|
115 | + * macrosCertificate : if macros are signed, contains vbaProjectSignature.bin file, null if not signed |
|
116 | + * |
|
117 | + * @var binary |
|
118 | + */ |
|
119 | 119 | private $macrosCertificate; |
120 | 120 | |
121 | 121 | /** |
122 | - * ribbonXMLData : null if workbook is'nt Excel 2007 or not contain a customized UI |
|
123 | - * |
|
124 | - * @var null|string |
|
125 | - */ |
|
122 | + * ribbonXMLData : null if workbook is'nt Excel 2007 or not contain a customized UI |
|
123 | + * |
|
124 | + * @var null|string |
|
125 | + */ |
|
126 | 126 | private $ribbonXMLData; |
127 | 127 | |
128 | 128 | /** |
129 | - * ribbonBinObjects : null if workbook is'nt Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements |
|
130 | - * ignored if $ribbonXMLData is null |
|
131 | - * |
|
132 | - * @var null|array |
|
133 | - */ |
|
129 | + * ribbonBinObjects : null if workbook is'nt Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements |
|
130 | + * ignored if $ribbonXMLData is null |
|
131 | + * |
|
132 | + * @var null|array |
|
133 | + */ |
|
134 | 134 | private $ribbonBinObjects; |
135 | 135 | |
136 | 136 | /** |
137 | - * The workbook has macros ? |
|
138 | - * |
|
139 | - * @return true if workbook has macros, false if not |
|
140 | - */ |
|
137 | + * The workbook has macros ? |
|
138 | + * |
|
139 | + * @return true if workbook has macros, false if not |
|
140 | + */ |
|
141 | 141 | public function hasMacros() |
142 | 142 | { |
143 | 143 | return $this->hasMacros; |
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * Define if a workbook has macros |
|
148 | - * |
|
149 | - * @param boolean $hasMacros true|false |
|
150 | - */ |
|
147 | + * Define if a workbook has macros |
|
148 | + * |
|
149 | + * @param boolean $hasMacros true|false |
|
150 | + */ |
|
151 | 151 | public function setHasMacros($hasMacros = false) |
152 | 152 | { |
153 | 153 | $this->hasMacros = (bool) $hasMacros; |
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
157 | - * Set the macros code |
|
158 | - * |
|
159 | - * @param string $macroCode string|null |
|
160 | - */ |
|
157 | + * Set the macros code |
|
158 | + * |
|
159 | + * @param string $macroCode string|null |
|
160 | + */ |
|
161 | 161 | public function setMacrosCode($macroCode = null) |
162 | 162 | { |
163 | 163 | $this->macrosCode = $macroCode; |
@@ -165,49 +165,49 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
168 | - * Return the macros code |
|
169 | - * |
|
170 | - * @return string|null |
|
171 | - */ |
|
168 | + * Return the macros code |
|
169 | + * |
|
170 | + * @return string|null |
|
171 | + */ |
|
172 | 172 | public function getMacrosCode() |
173 | 173 | { |
174 | 174 | return $this->macrosCode; |
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
178 | - * Set the macros certificate |
|
179 | - * |
|
180 | - * @param string|null $Certificate |
|
181 | - */ |
|
178 | + * Set the macros certificate |
|
179 | + * |
|
180 | + * @param string|null $Certificate |
|
181 | + */ |
|
182 | 182 | public function setMacrosCertificate($certificate = null) |
183 | 183 | { |
184 | 184 | $this->macrosCertificate = $certificate; |
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
188 | - * Is the project signed ? |
|
189 | - * |
|
190 | - * @return boolean true|false |
|
191 | - */ |
|
188 | + * Is the project signed ? |
|
189 | + * |
|
190 | + * @return boolean true|false |
|
191 | + */ |
|
192 | 192 | public function hasMacrosCertificate() |
193 | 193 | { |
194 | 194 | return !is_null($this->macrosCertificate); |
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
198 | - * Return the macros certificate |
|
199 | - * |
|
200 | - * @return string|null |
|
201 | - */ |
|
198 | + * Return the macros certificate |
|
199 | + * |
|
200 | + * @return string|null |
|
201 | + */ |
|
202 | 202 | public function getMacrosCertificate() |
203 | 203 | { |
204 | 204 | return $this->macrosCertificate; |
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
208 | - * Remove all macros, certificate from spreadsheet |
|
209 | - * |
|
210 | - */ |
|
208 | + * Remove all macros, certificate from spreadsheet |
|
209 | + * |
|
210 | + */ |
|
211 | 211 | public function discardMacros() |
212 | 212 | { |
213 | 213 | $this->hasMacros = false; |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
219 | - * set ribbon XML data |
|
220 | - * |
|
221 | - */ |
|
219 | + * set ribbon XML data |
|
220 | + * |
|
221 | + */ |
|
222 | 222 | public function setRibbonXMLData($target = null, $xmlData = null) |
223 | 223 | { |
224 | 224 | if (!is_null($target) && !is_null($xmlData)) { |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | - * retrieve ribbon XML Data |
|
233 | - * |
|
234 | - * return string|null|array |
|
235 | - */ |
|
232 | + * retrieve ribbon XML Data |
|
233 | + * |
|
234 | + * return string|null|array |
|
235 | + */ |
|
236 | 236 | public function getRibbonXMLData($what = 'all') //we need some constants here... |
237 | 237 | { |
238 | 238 | $returnData = null; |
@@ -253,9 +253,9 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
256 | - * store binaries ribbon objects (pictures) |
|
257 | - * |
|
258 | - */ |
|
256 | + * store binaries ribbon objects (pictures) |
|
257 | + * |
|
258 | + */ |
|
259 | 259 | public function setRibbonBinObjects($BinObjectsNames = null, $BinObjectsData = null) |
260 | 260 | { |
261 | 261 | if (!is_null($BinObjectsNames) && !is_null($BinObjectsData)) { |
@@ -265,18 +265,18 @@ discard block |
||
265 | 265 | } |
266 | 266 | } |
267 | 267 | /** |
268 | - * return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function) |
|
269 | - * |
|
270 | - */ |
|
268 | + * return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function) |
|
269 | + * |
|
270 | + */ |
|
271 | 271 | private function getExtensionOnly($ThePath) |
272 | 272 | { |
273 | 273 | return pathinfo($ThePath, PATHINFO_EXTENSION); |
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
277 | - * retrieve Binaries Ribbon Objects |
|
278 | - * |
|
279 | - */ |
|
277 | + * retrieve Binaries Ribbon Objects |
|
278 | + * |
|
279 | + */ |
|
280 | 280 | public function getRibbonBinObjects($What = 'all') |
281 | 281 | { |
282 | 282 | $ReturnData = null; |
@@ -305,20 +305,20 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
308 | - * This workbook have a custom UI ? |
|
309 | - * |
|
310 | - * @return true|false |
|
311 | - */ |
|
308 | + * This workbook have a custom UI ? |
|
309 | + * |
|
310 | + * @return true|false |
|
311 | + */ |
|
312 | 312 | public function hasRibbon() |
313 | 313 | { |
314 | 314 | return !is_null($this->ribbonXMLData); |
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
318 | - * This workbook have additionnal object for the ribbon ? |
|
319 | - * |
|
320 | - * @return true|false |
|
321 | - */ |
|
318 | + * This workbook have additionnal object for the ribbon ? |
|
319 | + * |
|
320 | + * @return true|false |
|
321 | + */ |
|
322 | 322 | public function hasRibbonBinObjects() |
323 | 323 | { |
324 | 324 | return !is_null($this->ribbonBinObjects); |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | return null; |
354 | 354 | } |
355 | 355 | |
356 | - /** |
|
357 | - * Create a new PhpSpreadsheet with one Worksheet |
|
358 | - */ |
|
356 | + /** |
|
357 | + * Create a new PhpSpreadsheet with one Worksheet |
|
358 | + */ |
|
359 | 359 | public function __construct() |
360 | 360 | { |
361 | 361 | $this->uniqueID = uniqid(); |