Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Add consistency using getCellXML() (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrilo authored Sep 7, 2016
1 parent 435a9a0 commit d4e57b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Spout/Writer/ODS/Internal/Worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function addRow($dataRow, $style)
$currentCellValue !== $dataRowWithNumericIndexes[$nextCellIndex]) {

$numTimesValueRepeated = ($nextCellIndex - $currentCellIndex);
$data .= $this->getCellContent($currentCellValue, $styleIndex, $numTimesValueRepeated);
$data .= $this->getCellXML($currentCellValue, $styleIndex, $numTimesValueRepeated);

$currentCellIndex = $nextCellIndex;
}
Expand Down Expand Up @@ -183,7 +183,7 @@ public function addRow($dataRow, $style)
* @return string The cell XML content
* @throws \Box\Spout\Common\Exception\InvalidArgumentException If a cell value's type is not supported
*/
protected function getCellContent($cellValue, $styleIndex, $numTimesValueRepeated)
protected function getCellXML($cellValue, $styleIndex, $numTimesValueRepeated)
{
$data = '<table:table-cell table:style-name="ce' . $styleIndex . '"';

Expand Down
4 changes: 2 additions & 2 deletions src/Spout/Writer/XLSX/Internal/Worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function addRow($dataRow, $style)
$rowXML = '<row r="' . $rowIndex . '" spans="1:' . $numCells . '">';

foreach($dataRow as $cellValue) {
$rowXML .= $this->getCellXml($rowIndex, $cellNumber, $cellValue, $style->getId());
$rowXML .= $this->getCellXML($rowIndex, $cellNumber, $cellValue, $style->getId());
$cellNumber++;
}

Expand All @@ -159,7 +159,7 @@ public function addRow($dataRow, $style)
* @return string
* @throws InvalidArgumentException
*/
private function getCellXml($rowIndex, $cellNumber, $cellValue, $styleId)
private function getCellXML($rowIndex, $cellNumber, $cellValue, $styleId)
{
$columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber);
$cellXML = '<c r="' . $columnIndex . $rowIndex . '"';
Expand Down

0 comments on commit d4e57b1

Please sign in to comment.