Phpspreadsheet lấy chỉ mục cột

.. .. @@ -1123,15 +1123,15 @@ class Worksheet implements IComparable 1123 1123 /** 1124 1124 * Set a cell value by using numeric cell coordinates. 1125 1125 * 1126 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 1127 - * @param int $pRow Numeric row coordinate of the cell 1128 - * @param mixed $pValue Value of the cell 1126 + * @param int $columnIndex Numeric column coordinate of the cell 1127 + * @param int $row Numeric row coordinate of the cell 1128 + * @param mixed $value Value of the cell 1129 1129 * 1130 1130 * @return Worksheet 1131 1131 */ 1132 - public function setCellValueByColumnAndRow[$pColumn, $pRow, $pValue] 1132 + public function setCellValueByColumnAndRow[$columnIndex, $row, $value] 1133 1133 { 1134 - $this->getCellByColumnAndRow[$pColumn, $pRow]->setValue[$pValue]; 1134 + $this->getCellByColumnAndRow[$columnIndex, $row]->setValue[$value]; 1135 1135 1136 1136 return $this; 1137 1137 } .. .. @@ -1156,16 +1156,16 @@ class Worksheet implements IComparable 1156 1156 /** 1157 1157 * Set a cell value by using numeric cell coordinates. 1158 1158 * 1159 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 1160 - * @param int $pRow Numeric row coordinate of the cell 1161 - * @param mixed $pValue Value of the cell 1162 - * @param string $pDataType Explicit data type, see DataType::TYPE_* 1159 + * @param int $columnIndex Numeric column coordinate of the cell 1160 + * @param int $row Numeric row coordinate of the cell 1161 + * @param mixed $value Value of the cell 1162 + * @param string $dataType Explicit data type, see DataType::TYPE_* 1163 1163 * 1164 1164 * @return Worksheet 1165 1165 */ 1166 - public function setCellValueExplicitByColumnAndRow[$pColumn, $pRow, $pValue, $pDataType] 1166 + public function setCellValueExplicitByColumnAndRow[$columnIndex, $row, $value, $dataType] 1167 1167 { 1168 - $this->getCellByColumnAndRow[$pColumn, $pRow]->setValueExplicit[$pValue, $pDataType]; 1168 + $this->getCellByColumnAndRow[$columnIndex, $row]->setValueExplicit[$value, $dataType]; 1169 1169 1170 1170 return $this; 1171 1171 } .. .. @@ -1222,17 +1222,17 @@ class Worksheet implements IComparable 1222 1222 /** 1223 1223 * Get cell at a specific coordinate by using numeric cell coordinates. 1224 1224 * 1225 - * @param string $pColumn Numeric column coordinate of the cell 1226 - * @param string $pRow Numeric row coordinate of the cell 1225 + * @param int $columnIndex Numeric column coordinate of the cell 1226 + * @param int $row Numeric row coordinate of the cell 1227 1227 * @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't 1228 1228 * already exist, or a null should be returned instead 1229 1229 * 1230 1230 * @return null|Cell Cell that was found/created or null 1231 1231 */ 1232 - public function getCellByColumnAndRow[$pColumn, $pRow, $createIfNotExists = true] 1232 + public function getCellByColumnAndRow[$columnIndex, $row, $createIfNotExists = true] 1233 1233 { 1234 - $columnLetter = Coordinate::stringFromColumnIndex[$pColumn]; 1235 - $coordinate = $columnLetter . $pRow; 1234 + $columnLetter = Coordinate::stringFromColumnIndex[$columnIndex]; 1235 + $coordinate = $columnLetter . $row; 1236 1236 1237 1237 if [$this->cellCollection->has[$coordinate]] { 1238 1238 return $this->cellCollection->get[$coordinate]; .. .. @@ -1330,14 +1330,14 @@ class Worksheet implements IComparable 1330 1330 /** 1331 1331 * Cell at a specific coordinate by using numeric cell coordinates exists? 1332 1332 * 1333 - * @param string $pColumn Numeric column coordinate of the cell [A = 0] 1334 - * @param string $pRow Numeric row coordinate of the cell 1333 + * @param int $columnIndex Numeric column coordinate of the cell 1334 + * @param int $row Numeric row coordinate of the cell 1335 1335 * 1336 1336 * @return bool 1337 1337 */ 1338 - public function cellExistsByColumnAndRow[$pColumn, $pRow] 1338 + public function cellExistsByColumnAndRow[$columnIndex, $row] 1339 1339 { 1340 - return $this->cellExists[Coordinate::stringFromColumnIndex[$pColumn] . $pRow]; 1340 + return $this->cellExists[Coordinate::stringFromColumnIndex[$columnIndex] . $row]; 1341 1341 } 1342 1342 1343 1343 /** .. .. @@ -1397,13 +1397,13 @@ class Worksheet implements IComparable 1397 1397 /** 1398 1398 * Get column dimension at a specific column by using numeric cell coordinates. 1399 1399 * 1400 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 1400 + * @param int $columnIndex Numeric column coordinate of the cell 1401 1401 * 1402 1402 * @return ColumnDimension 1403 1403 */ 1404 - public function getColumnDimensionByColumn[$pColumn] 1404 + public function getColumnDimensionByColumn[$columnIndex] 1405 1405 { 1406 - return $this->getColumnDimension[Coordinate::stringFromColumnIndex[$pColumn]]; 1406 + return $this->getColumnDimension[Coordinate::stringFromColumnIndex[$columnIndex]]; 1407 1407 } 1408 1408 1409 1409 /** .. .. @@ -1511,24 +1511,24 @@ class Worksheet implements IComparable 1511 1511 /** 1512 1512 * Get style for cell by using numeric cell coordinates. 1513 1513 * 1514 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 1515 - * @param int $pRow Numeric row coordinate of the cell 1516 - * @param int pColumn2 Numeric column coordinate of the range cell [A = 0] 1517 - * @param int pRow2 Numeric row coordinate of the range cell 1518 - * @param null|mixed $pColumn2 1519 - * @param null|mixed $pRow2 1514 + * @param int $columnIndex1 Numeric column coordinate of the cell 1515 + * @param int $row1 Numeric row coordinate of the cell 1516 + * @param int $columnIndex2 Numeric column coordinate of the range cell 1517 + * @param int $row2 Numeric row coordinate of the range cell 1518 + * @param null|int $columnIndex2 1519 + * @param null|int $row2 1520 1520 * 1521 1521 * @return Style 1522 1522 */ 1523 - public function getStyleByColumnAndRow[$pColumn, $pRow, $pColumn2 = null, $pRow2 = null] 1523 + public function getStyleByColumnAndRow[$columnIndex1, $row1, $columnIndex2 = null, $row2 = null] 1524 1524 { 1525 - if [$pColumn2 !== null && $pRow2 !== null] { 1526 - $cellRange = Coordinate::stringFromColumnIndex[$pColumn] . $pRow . ':' . Coordinate::stringFromColumnIndex[$pColumn2] . $pRow2; 1525 + if [$columnIndex2 !== null && $row2 !== null] { 1526 + $cellRange = Coordinate::stringFromColumnIndex[$columnIndex1] . $row1 . ':' . Coordinate::stringFromColumnIndex[$columnIndex2] . $row2; 1527 1527 1528 1528 return $this->getStyle[$cellRange]; 1529 1529 } 1530 1530 1531 - return $this->getStyle[Coordinate::stringFromColumnIndex[$pColumn] . $pRow]; 1531 + return $this->getStyle[Coordinate::stringFromColumnIndex[$columnIndex1] . $row1]; 1532 1532 } 1533 1533 1534 1534 /** .. .. @@ -1569,7 +1569,7 @@ class Worksheet implements IComparable 1569 1569 // Loop through cells and apply styles 1570 1570 for [$col = $rangeStart[0]; $col setXfIndex[$xfIndex]; 1572 + $this->getCell[Coordinate::stringFromColumnIndex[$col] . $row]->setXfIndex[$xfIndex]; 1573 1573 } 1574 1574 } 1575 1575 .. .. @@ -1609,7 +1609,7 @@ class Worksheet implements IComparable 1609 1609 // Loop through cells and apply styles 1610 1610 for [$col = $rangeStart[0]; $col setConditionalStyles[Coordinate::stringFromColumnIndex[$col] . $row, $pCellStyle]; 1613 1613 } 1614 1614 } 1615 1615 .. .. @@ -1649,15 +1649,15 @@ class Worksheet implements IComparable 1649 1649 /** 1650 1650 * Set break on a cell by using numeric cell coordinates. 1651 1651 * 1652 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 1653 - * @param int $pRow Numeric row coordinate of the cell 1654 - * @param int $pBreak Break type [type of Worksheet::BREAK_*] 1652 + * @param int $columnIndex Numeric column coordinate of the cell 1653 + * @param int $row Numeric row coordinate of the cell 1654 + * @param int $break Break type [type of Worksheet::BREAK_*] 1655 1655 * 1656 1656 * @return Worksheet 1657 1657 */ 1658 - public function setBreakByColumnAndRow[$pColumn, $pRow, $pBreak] 1658 + public function setBreakByColumnAndRow[$columnIndex, $row, $break] 1659 1659 { 1660 - return $this->setBreak[Coordinate::stringFromColumnIndex[$pColumn] . $pRow, $pBreak]; 1660 + return $this->setBreak[Coordinate::stringFromColumnIndex[$columnIndex] . $row, $break]; 1661 1661 } 1662 1662 1663 1663 /** .. .. @@ -1715,18 +1715,18 @@ class Worksheet implements IComparable 1715 1715 /** 1716 1716 * Set merge on a cell range by using numeric cell coordinates. 1717 1717 * 1718 - * @param int $pColumn1 Numeric column coordinate of the first cell [A = 0] 1719 - * @param int $pRow1 Numeric row coordinate of the first cell 1720 - * @param int $pColumn2 Numeric column coordinate of the last cell [A = 0] 1721 - * @param int $pRow2 Numeric row coordinate of the last cell 1718 + * @param int $columnIndex1 Numeric column coordinate of the first cell 1719 + * @param int $row1 Numeric row coordinate of the first cell 1720 + * @param int $columnIndex2 Numeric column coordinate of the last cell 1721 + * @param int $row2 Numeric row coordinate of the last cell 1722 1722 * 1723 1723 * @throws Exception 1724 1724 * 1725 1725 * @return Worksheet 1726 1726 */ 1727 - public function mergeCellsByColumnAndRow[$pColumn1, $pRow1, $pColumn2, $pRow2] 1727 + public function mergeCellsByColumnAndRow[$columnIndex1, $row1, $columnIndex2, $row2] 1728 1728 { 1729 - $cellRange = Coordinate::stringFromColumnIndex[$pColumn1] . $pRow1 . ':' . Coordinate::stringFromColumnIndex[$pColumn2] . $pRow2; 1729 + $cellRange = Coordinate::stringFromColumnIndex[$columnIndex1] . $row1 . ':' . Coordinate::stringFromColumnIndex[$columnIndex2] . $row2; 1730 1730 1731 1731 return $this->mergeCells[$cellRange]; 1732 1732 } .. .. @@ -1761,18 +1761,18 @@ class Worksheet implements IComparable 1761 1761 /** 1762 1762 * Remove merge on a cell range by using numeric cell coordinates. 1763 1763 * 1764 - * @param int $pColumn1 Numeric column coordinate of the first cell [A = 0] 1765 - * @param int $pRow1 Numeric row coordinate of the first cell 1766 - * @param int $pColumn2 Numeric column coordinate of the last cell [A = 0] 1767 - * @param int $pRow2 Numeric row coordinate of the last cell 1764 + * @param int $columnIndex1 Numeric column coordinate of the first cell 1765 + * @param int $row1 Numeric row coordinate of the first cell 1766 + * @param int $columnIndex2 Numeric column coordinate of the last cell 1767 + * @param int $row2 Numeric row coordinate of the last cell 1768 1768 * 1769 1769 * @throws Exception 1770 1770 * 1771 1771 * @return Worksheet 1772 1772 */ 1773 - public function unmergeCellsByColumnAndRow[$pColumn1, $pRow1, $pColumn2, $pRow2] 1773 + public function unmergeCellsByColumnAndRow[$columnIndex1, $row1, $columnIndex2, $row2] 1774 1774 { 1775 - $cellRange = Coordinate::stringFromColumnIndex[$pColumn1] . $pRow1 . ':' . Coordinate::stringFromColumnIndex[$pColumn2] . $pRow2; 1775 + $cellRange = Coordinate::stringFromColumnIndex[$columnIndex1] . $row1 . ':' . Coordinate::stringFromColumnIndex[$columnIndex2] . $row2; 1776 1776 1777 1777 return $this->unmergeCells[$cellRange]; 1778 1778 } .. .. @@ -1828,22 +1828,22 @@ class Worksheet implements IComparable 1828 1828 /** 1829 1829 * Set protection on a cell range by using numeric cell coordinates. 1830 1830 * 1831 - * @param int $pColumn1 Numeric column coordinate of the first cell [A = 0] 1832 - * @param int $pRow1 Numeric row coordinate of the first cell 1833 - * @param int $pColumn2 Numeric column coordinate of the last cell [A = 0] 1834 - * @param int $pRow2 Numeric row coordinate of the last cell 1835 - * @param string $pPassword Password to unlock the protection 1836 - * @param bool $pAlreadyHashed If the password has already been hashed, set this to true 1831 + * @param int $columnIndex1 Numeric column coordinate of the first cell 1832 + * @param int $row1 Numeric row coordinate of the first cell 1833 + * @param int $columnIndex2 Numeric column coordinate of the last cell 1834 + * @param int $row2 Numeric row coordinate of the last cell 1835 + * @param string $password Password to unlock the protection 1836 + * @param bool $alreadyHashed If the password has already been hashed, set this to true 1837 1837 * 1838 1838 * @throws Exception 1839 1839 * 1840 1840 * @return Worksheet 1841 1841 */ 1842 - public function protectCellsByColumnAndRow[$pColumn1, $pRow1, $pColumn2, $pRow2, $pPassword, $pAlreadyHashed = false] 1842 + public function protectCellsByColumnAndRow[$columnIndex1, $row1, $columnIndex2, $row2, $password, $alreadyHashed = false] 1843 1843 { 1844 - $cellRange = Coordinate::stringFromColumnIndex[$pColumn1] . $pRow1 . ':' . Coordinate::stringFromColumnIndex[$pColumn2] . $pRow2; 1844 + $cellRange = Coordinate::stringFromColumnIndex[$columnIndex1] . $row1 . ':' . Coordinate::stringFromColumnIndex[$columnIndex2] . $row2; 1845 1845 1846 - return $this->protectCells[$cellRange, $pPassword, $pAlreadyHashed]; 1846 + return $this->protectCells[$cellRange, $password, $alreadyHashed]; 1847 1847 } 1848 1848 1849 1849 /** .. .. @@ -1872,18 +1872,18 @@ class Worksheet implements IComparable 1872 1872 /** 1873 1873 * Remove protection on a cell range by using numeric cell coordinates. 1874 1874 * 1875 - * @param int $pColumn1 Numeric column coordinate of the first cell [A = 0] 1876 - * @param int $pRow1 Numeric row coordinate of the first cell 1877 - * @param int $pColumn2 Numeric column coordinate of the last cell [A = 0] 1878 - * @param int $pRow2 Numeric row coordinate of the last cell 1875 + * @param int $columnIndex1 Numeric column coordinate of the first cell 1876 + * @param int $row1 Numeric row coordinate of the first cell 1877 + * @param int $columnIndex2 Numeric column coordinate of the last cell 1878 + * @param int $row2 Numeric row coordinate of the last cell 1879 1879 * 1880 1880 * @throws Exception 1881 1881 * 1882 1882 * @return Worksheet 1883 1883 */ 1884 - public function unprotectCellsByColumnAndRow[$pColumn1, $pRow1, $pColumn2, $pRow2] 1884 + public function unprotectCellsByColumnAndRow[$columnIndex1, $row1, $columnIndex2, $row2] 1885 1885 { 1886 - $cellRange = Coordinate::stringFromColumnIndex[$pColumn1] . $pRow1 . ':' . Coordinate::stringFromColumnIndex[$pColumn2] . $pRow2; 1886 + $cellRange = Coordinate::stringFromColumnIndex[$columnIndex1] . $row1 . ':' . Coordinate::stringFromColumnIndex[$columnIndex2] . $row2; 1887 1887 1888 1888 return $this->unprotectCells[$cellRange]; 1889 1889 } .. .. @@ -1932,21 +1932,21 @@ class Worksheet implements IComparable 1932 1932 /** 1933 1933 * Set Autofilter Range by using numeric cell coordinates. 1934 1934 * 1935 - * @param int $pColumn1 Numeric column coordinate of the first cell [A = 0] 1936 - * @param int $pRow1 Numeric row coordinate of the first cell 1937 - * @param int $pColumn2 Numeric column coordinate of the second cell [A = 0] 1938 - * @param int $pRow2 Numeric row coordinate of the second cell 1935 + * @param int $columnIndex1 Numeric column coordinate of the first cell 1936 + * @param int $row1 Numeric row coordinate of the first cell 1937 + * @param int $columnIndex2 Numeric column coordinate of the second cell 1938 + * @param int $row2 Numeric row coordinate of the second cell 1939 1939 * 1940 1940 * @throws Exception 1941 1941 * 1942 1942 * @return Worksheet 1943 1943 */ 1944 - public function setAutoFilterByColumnAndRow[$pColumn1, $pRow1, $pColumn2, $pRow2] 1944 + public function setAutoFilterByColumnAndRow[$columnIndex1, $row1, $columnIndex2, $row2] 1945 1945 { 1946 1946 return $this->setAutoFilter[ 1947 - Coordinate::stringFromColumnIndex[$pColumn1] . $pRow1 1947 + Coordinate::stringFromColumnIndex[$columnIndex1] . $row1 1948 1948 . ':' . 1949 - Coordinate::stringFromColumnIndex[$pColumn2] . $pRow2 1949 + Coordinate::stringFromColumnIndex[$columnIndex2] . $row2 1950 1950 ]; 1951 1951 } 1952 1952 .. .. @@ -2002,16 +2002,16 @@ class Worksheet implements IComparable 2002 2002 /** 2003 2003 * Freeze Pane by using numeric cell coordinates. 2004 2004 * 2005 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 2006 - * @param int $pRow Numeric row coordinate of the cell 2005 + * @param int $columnIndex Numeric column coordinate of the cell 2006 + * @param int $row Numeric row coordinate of the cell 2007 2007 * 2008 2008 * @throws Exception 2009 2009 * 2010 2010 * @return Worksheet 2011 2011 */ 2012 - public function freezePaneByColumnAndRow[$pColumn, $pRow] 2012 + public function freezePaneByColumnAndRow[$columnIndex, $row] 2013 2013 { 2014 - return $this->freezePane[Coordinate::stringFromColumnIndex[$pColumn] . $pRow]; 2014 + return $this->freezePane[Coordinate::stringFromColumnIndex[$columnIndex] . $row]; 2015 2015 } 2016 2016 2017 2017 /** .. .. @@ -2071,20 +2071,20 @@ class Worksheet implements IComparable 2071 2071 /** 2072 2072 * Insert a new column, updating all possible related data. 2073 2073 * 2074 - * @param int $pBefore Insert before this one [numeric column coordinate of the cell, A = 0] 2074 + * @param int $beforeColumnIndex Insert before this one [numeric column coordinate of the cell] 2075 2075 * @param int $pNumCols Number of columns to insert 2076 2076 * 2077 2077 * @throws Exception 2078 2078 * 2079 2079 * @return Worksheet 2080 2080 */ 2081 - public function insertNewColumnBeforeByIndex[$pBefore, $pNumCols = 1] 2081 + public function insertNewColumnBeforeByIndex[$beforeColumnIndex, $pNumCols = 1] 2082 2082 { 2083 - if [$pBefore >= 0] { 2084 - return $this->insertNewColumnBefore[Coordinate::stringFromColumnIndex[$pBefore], $pNumCols]; 2083 + if [$beforeColumnIndex >= 1] { 2084 + return $this->insertNewColumnBefore[Coordinate::stringFromColumnIndex[$beforeColumnIndex], $pNumCols]; 2085 2085 } 2086 2086 2087 - throw new Exception['Columns can only be inserted before at least column A [0].']; 2087 + throw new Exception['Columns can only be inserted before at least column A [1].']; 2088 2088 } 2089 2089 2090 2090 /** .. .. @@ -2128,12 +2128,12 @@ class Worksheet implements IComparable 2128 2128 { 2129 2129 if [!is_numeric[$pColumn]] { 2130 2130 $highestColumn = $this->getHighestDataColumn[]; 2131 - $pColumn = Coordinate::stringFromColumnIndex[Coordinate::columnIndexFromString[$pColumn] - 1 + $pNumCols]; 2131 + $pColumn = Coordinate::stringFromColumnIndex[Coordinate::columnIndexFromString[$pColumn] + $pNumCols]; 2132 2132 $objReferenceHelper = ReferenceHelper::getInstance[]; 2133 2133 $objReferenceHelper->insertNewBefore[$pColumn . '1', -$pNumCols, 0, $this]; 2134 2134 for [$c = 0; $c < $pNumCols; ++$c] { 2135 2135 $this->getCellCollection[]->removeColumn[$highestColumn]; 2136 - $highestColumn = Coordinate::stringFromColumnIndex[Coordinate::columnIndexFromString[$highestColumn] - 2]; 2136 + $highestColumn = Coordinate::stringFromColumnIndex[Coordinate::columnIndexFromString[$highestColumn] - 1]; 2137 2137 } 2138 2138 } else { 2139 2139 throw new Exception['Column references should not be numeric.']; .. .. @@ -2145,20 +2145,20 @@ class Worksheet implements IComparable 2145 2145 /** 2146 2146 * Remove a column, updating all possible related data. 2147 2147 * 2148 - * @param int $pColumn Remove starting with this one [numeric column coordinate of the cell A = 0] 2149 - * @param int $pNumCols Number of columns to remove 2148 + * @param int $columnIndex Remove starting with this one [numeric column coordinate of the cell] 2149 + * @param int $numColumns Number of columns to remove 2150 2150 * 2151 2151 * @throws Exception 2152 2152 * 2153 2153 * @return Worksheet 2154 2154 */ 2155 - public function removeColumnByIndex[$pColumn, $pNumCols = 1] 2155 + public function removeColumnByIndex[$columnIndex, $numColumns = 1] 2156 2156 { 2157 - if [$pColumn >= 0] { 2158 - return $this->removeColumn[Coordinate::stringFromColumnIndex[$pColumn], $pNumCols]; 2157 + if [$columnIndex >= 1] { 2158 + return $this->removeColumn[Coordinate::stringFromColumnIndex[$columnIndex], $numColumns]; 2159 2159 } 2160 2160 2161 - throw new Exception['Columns to be deleted should at least start from column 0']; 2161 + throw new Exception['Columns to be deleted should at least start from column A [1]']; 2162 2162 } 2163 2163 2164 2164 /** .. .. @@ -2343,14 +2343,14 @@ class Worksheet implements IComparable 2343 2343 /** 2344 2344 * Get comment for cell by using numeric cell coordinates. 2345 2345 * 2346 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 2347 - * @param int $pRow Numeric row coordinate of the cell 2346 + * @param int $columnIndex Numeric column coordinate of the cell 2347 + * @param int $row Numeric row coordinate of the cell 2348 2348 * 2349 2349 * @return Comment 2350 2350 */ 2351 - public function getCommentByColumnAndRow[$pColumn, $pRow] 2351 + public function getCommentByColumnAndRow[$columnIndex, $row] 2352 2352 { 2353 - return $this->getComment[Coordinate::stringFromColumnIndex[$pColumn] . $pRow]; 2353 + return $this->getComment[Coordinate::stringFromColumnIndex[$columnIndex] . $row]; 2354 2354 } 2355 2355 2356 2356 /** .. .. @@ -2425,16 +2425,16 @@ class Worksheet implements IComparable 2425 2425 /** 2426 2426 * Selected cell by using numeric cell coordinates. 2427 2427 * 2428 - * @param int $pColumn Numeric column coordinate of the cell [A = 0] 2429 - * @param int $pRow Numeric row coordinate of the cell 2428 + * @param int $columnIndex Numeric column coordinate of the cell 2429 + * @param int $row Numeric row coordinate of the cell 2430 2430 * 2431 2431 * @throws Exception 2432 2432 * 2433 2433 * @return Worksheet 2434 2434 */ 2435 - public function setSelectedCellByColumnAndRow[$pColumn, $pRow] 2435 + public function setSelectedCellByColumnAndRow[$columnIndex, $row] 2436 2436 { 2437 - return $this->setSelectedCells[Coordinate::stringFromColumnIndex[$pColumn] . $pRow]; 2437 + return $this->setSelectedCells[Coordinate::stringFromColumnIndex[$columnIndex] . $row]; 2438 2438 } 2439 2439 2440 2440 /** .. .. @@ -2524,9 +2524,9 @@ class Worksheet implements IComparable 2524 2524 $returnValue = []; 2525 2525 // Identify the range that we need to extract from the worksheet 2526 2526 list[$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries[$pRange]; 2527 - $minCol = Coordinate::stringFromColumnIndex[$rangeStart[0] - 1]; 2527 + $minCol = Coordinate::stringFromColumnIndex[$rangeStart[0]]; 2528 2528 $minRow = $rangeStart[1]; 2529 - $maxCol = Coordinate::stringFromColumnIndex[$rangeEnd[0] - 1]; 2529 + $maxCol = Coordinate::stringFromColumnIndex[$rangeEnd[0]]; 2530 2530 $maxRow = $rangeEnd[1]; 2531 2531 2532 2532 ++$maxCol; .. .. @@ -2653,7 +2653,7 @@ class Worksheet implements IComparable 2653 2653 } 2654 2654 2655 2655 /** 2656 - * Run PhpSpreadsheet garabage collector. 2656 + * Run PhpSpreadsheet garbage collector. 2657 2657 * 2658 2658 * @return Worksheet 2659 2659 */ .. .. @@ -2678,10 +2678,10 @@ class Worksheet implements IComparable 2678 2678 } 2679 2679 2680 2680 // Cache values 2681 - if [$highestColumn < 0] { 2681 + if [$highestColumn < 1] { 2682 2682 $this->cachedHighestColumn = 'A'; 2683 2683 } else { 2684 - $this->cachedHighestColumn = Coordinate::stringFromColumnIndex[--$highestColumn]; 2684 + $this->cachedHighestColumn = Coordinate::stringFromColumnIndex[$highestColumn]; 2685 2685 } 2686 2686 $this->cachedHighestRow = $highestRow; 2687 2687 .. ...

Chủ Đề