@@ 215-229 (lines=15) @@ | ||
212 | * @param int $beforeRow Number of the row we're inserting/deleting before |
|
213 | * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion) |
|
214 | */ |
|
215 | protected function adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) |
|
216 | { |
|
217 | $aHyperlinkCollection = $pSheet->getHyperlinkCollection(); |
|
218 | ($pNumCols > 0 || $pNumRows > 0) ? |
|
219 | uksort($aHyperlinkCollection, ['self', 'cellReverseSort']) : uksort($aHyperlinkCollection, ['self', 'cellSort']); |
|
220 | ||
221 | foreach ($aHyperlinkCollection as $key => $value) { |
|
222 | $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); |
|
223 | if ($key != $newReference) { |
|
224 | $pSheet->setHyperlink($newReference, $value); |
|
225 | $pSheet->setHyperlink($key, null); |
|
226 | } |
|
227 | } |
|
228 | } |
|
229 | ||
230 | /** |
|
231 | * Update data validations when inserting/deleting rows/columns. |
|
232 | * |
|
@@ 240-254 (lines=15) @@ | ||
237 | * @param int $beforeRow Number of the row we're inserting/deleting before |
|
238 | * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion) |
|
239 | */ |
|
240 | protected function adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) |
|
241 | { |
|
242 | $aDataValidationCollection = $pSheet->getDataValidationCollection(); |
|
243 | ($pNumCols > 0 || $pNumRows > 0) ? |
|
244 | uksort($aDataValidationCollection, ['self', 'cellReverseSort']) : uksort($aDataValidationCollection, ['self', 'cellSort']); |
|
245 | ||
246 | foreach ($aDataValidationCollection as $key => $value) { |
|
247 | $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); |
|
248 | if ($key != $newReference) { |
|
249 | $pSheet->setDataValidation($newReference, $value); |
|
250 | $pSheet->setDataValidation($key, null); |
|
251 | } |
|
252 | } |
|
253 | } |
|
254 | ||
255 | /** |
|
256 | * Update merged cells when inserting/deleting rows/columns. |
|
257 | * |