File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public function getPreviousCell(): ?XlsxFastEditorCell
71
71
if ($ c ->localName === 'c ' ) {
72
72
return new XlsxFastEditorCell ($ this ->editor , $ this ->sheetNumber , $ c );
73
73
}
74
- $ c = $ this -> c ->previousElementSibling ;
74
+ $ c = $ c ->previousElementSibling ;
75
75
}
76
76
return null ;
77
77
}
@@ -84,10 +84,10 @@ public function getNextCell(): ?XlsxFastEditorCell
84
84
{
85
85
$ c = $ this ->c ->nextElementSibling ;
86
86
while ($ c !== null ) {
87
- if ($ c ->localName === 'r ' ) {
87
+ if ($ c ->localName === 'c ' ) {
88
88
return new XlsxFastEditorCell ($ this ->editor , $ this ->sheetNumber , $ c );
89
89
}
90
- $ c = $ this -> c ->nextElementSibling ;
90
+ $ c = $ c ->nextElementSibling ;
91
91
}
92
92
return null ;
93
93
}
Original file line number Diff line number Diff line change @@ -56,10 +56,10 @@ public function getPreviousRow(): ?XlsxFastEditorRow
56
56
{
57
57
$ r = $ this ->r ->previousElementSibling ;
58
58
while ($ r !== null ) {
59
- if ($ r ->localName === 'r ' ) {
59
+ if ($ r ->localName === 'row ' ) {
60
60
return new XlsxFastEditorRow ($ this ->editor , $ this ->sheetNumber , $ r );
61
61
}
62
- $ r = $ this -> r ->previousElementSibling ;
62
+ $ r = $ r ->previousElementSibling ;
63
63
}
64
64
return null ;
65
65
}
@@ -72,10 +72,10 @@ public function getNextRow(): ?XlsxFastEditorRow
72
72
{
73
73
$ r = $ this ->r ->nextElementSibling ;
74
74
while ($ r !== null ) {
75
- if ($ r ->localName === 'r ' ) {
75
+ if ($ r ->localName === 'row ' ) {
76
76
return new XlsxFastEditorRow ($ this ->editor , $ this ->sheetNumber , $ r );
77
77
}
78
- $ r = $ this -> r ->nextElementSibling ;
78
+ $ r = $ r ->nextElementSibling ;
79
79
}
80
80
return null ;
81
81
}
Original file line number Diff line number Diff line change 64
64
65
65
$ row4 = $ xlsxFastEditor ->getRow ($ sheet1 , 4 );
66
66
assert ($ row4 !== null );
67
+ assert ($ row4 ->getPreviousRow ()?->getNextRow()?->number() === 4 );
67
68
assert ($ row4 ->getCellOrNull ('D4 ' )?->name() === 'D4 ' );
68
69
assert ($ row4 ->getCellOrNull ('d4 ' )?->name() === 'D4 ' );
69
70
assert ($ row4 ->getCellOrNull ('D ' )?->name() === 'D4 ' );
75
76
}
76
77
assert ($ ex instanceof \InvalidArgumentException);
77
78
79
+ $ cellD4 = $ row4 ->getCell ('D4 ' );
80
+ assert ($ cellD4 !== null );
81
+ assert ($ cellD4 ->getPreviousCell ()?->getNextCell()?->name() === 'D4 ' );
82
+
78
83
assert (XlsxFastEditor::cellOrderCompare ('B3 ' , 'AA23 ' ) < 0 );
79
84
assert (XlsxFastEditor::cellOrderCompare ('AA23 ' , 'AB23 ' ) < 0 );
80
85
assert (XlsxFastEditor::cellOrderCompare ('BB22 ' , 'BB123 ' ) < 0 );
You can’t perform that action at this time.
0 commit comments