File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/PhpSpreadsheet/Worksheet Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,11 @@ public function rewind(): void
120
120
*/
121
121
public function current (): ?Cell
122
122
{
123
- return $ this ->worksheet ->getCellByColumnAndRow ($ this ->columnIndex , $ this ->currentRow );
123
+ $ cellAddress = Coordinate::stringFromColumnIndex ($ this ->columnIndex ) . $ this ->currentRow ;
124
+
125
+ return $ this ->worksheet ->getCellCollection ()->has ($ cellAddress )
126
+ ? $ this ->worksheet ->getCellCollection ()->get ($ cellAddress )
127
+ : $ this ->worksheet ->createNewCell ($ cellAddress );
124
128
}
125
129
126
130
/**
Original file line number Diff line number Diff line change @@ -123,7 +123,11 @@ public function rewind(): void
123
123
*/
124
124
public function current (): ?Cell
125
125
{
126
- return $ this ->worksheet ->getCellByColumnAndRow ($ this ->currentColumnIndex , $ this ->rowIndex );
126
+ $ cellAddress = Coordinate::stringFromColumnIndex ($ this ->currentColumnIndex ) . $ this ->rowIndex ;
127
+
128
+ return $ this ->worksheet ->getCellCollection ()->has ($ cellAddress )
129
+ ? $ this ->worksheet ->getCellCollection ()->get ($ cellAddress )
130
+ : $ this ->worksheet ->createNewCell ($ cellAddress );
127
131
}
128
132
129
133
/**
You can’t perform that action at this time.
0 commit comments