File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/PhpSpreadsheet/Writer Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use PhpOffice \PhpSpreadsheet \Calculation \Calculation ;
6
6
use PhpOffice \PhpSpreadsheet \Calculation \Functions ;
7
+ use PhpOffice \PhpSpreadsheet \Cell \Cell ;
7
8
use PhpOffice \PhpSpreadsheet \Cell \Coordinate ;
8
9
use PhpOffice \PhpSpreadsheet \RichText \RichText ;
9
10
use PhpOffice \PhpSpreadsheet \RichText \Run ;
@@ -161,8 +162,9 @@ public function save($filename, int $flags = 0): void
161
162
162
163
// add fonts from rich text eleemnts
163
164
for ($ i = 0 ; $ i < $ countSheets ; ++$ i ) {
164
- foreach ($ this ->writerWorksheets [$ i ]->phpSheet ->getCoordinates () as $ coordinate ) {
165
- $ cell = $ this ->writerWorksheets [$ i ]->phpSheet ->getCell ($ coordinate );
165
+ foreach ($ this ->writerWorksheets [$ i ]->phpSheet ->getCellCollection ()->getCoordinates () as $ coordinate ) {
166
+ /** @var Cell $cell */
167
+ $ cell = $ this ->writerWorksheets [$ i ]->phpSheet ->getCellCollection ()->get ($ coordinate );
166
168
$ cVal = $ cell ->getValue ();
167
169
if ($ cVal instanceof RichText) {
168
170
$ elements = $ cVal ->getRichTextElements ();
Original file line number Diff line number Diff line change 3
3
namespace PhpOffice \PhpSpreadsheet \Writer \Xls ;
4
4
5
5
use GdImage ;
6
+ use PhpOffice \PhpSpreadsheet \Cell \Cell ;
6
7
use PhpOffice \PhpSpreadsheet \Cell \Coordinate ;
7
8
use PhpOffice \PhpSpreadsheet \Cell \DataType ;
8
9
use PhpOffice \PhpSpreadsheet \Exception as PhpSpreadsheetException ;
@@ -406,8 +407,9 @@ public function close(): void
406
407
}
407
408
408
409
// Write Cells
409
- foreach ($ phpSheet ->getCoordinates () as $ coordinate ) {
410
- $ cell = $ phpSheet ->getCell ($ coordinate );
410
+ foreach ($ phpSheet ->getCellCollection ()->getSortedCoordinates () as $ coordinate ) {
411
+ /** @var Cell $cell */
412
+ $ cell = $ phpSheet ->getCellCollection ()->get ($ coordinate );
411
413
$ row = $ cell ->getRow () - 1 ;
412
414
$ column = Coordinate::columnIndexFromString ($ cell ->getColumn ()) - 1 ;
413
415
You can’t perform that action at this time.
0 commit comments