18 $this->worksheet = $workSheet;
31 if (isset($columnAttributes[
'xfIndex'])) {
32 $this->worksheet->getColumnDimension($columnAddress)->setXfIndex($columnAttributes[
'xfIndex']);
34 if (isset($columnAttributes[
'visible'])) {
35 $this->worksheet->getColumnDimension($columnAddress)->setVisible($columnAttributes[
'visible']);
37 if (isset($columnAttributes[
'collapsed'])) {
38 $this->worksheet->getColumnDimension($columnAddress)->setCollapsed($columnAttributes[
'collapsed']);
40 if (isset($columnAttributes[
'outlineLevel'])) {
41 $this->worksheet->getColumnDimension($columnAddress)->setOutlineLevel($columnAttributes[
'outlineLevel']);
43 if (isset($columnAttributes[
'width'])) {
44 $this->worksheet->getColumnDimension($columnAddress)->setWidth($columnAttributes[
'width']);
57 if (isset($rowAttributes[
'xfIndex'])) {
58 $this->worksheet->getRowDimension($rowNumber)->setXfIndex($rowAttributes[
'xfIndex']);
60 if (isset($rowAttributes[
'visible'])) {
61 $this->worksheet->getRowDimension($rowNumber)->setVisible($rowAttributes[
'visible']);
63 if (isset($rowAttributes[
'collapsed'])) {
64 $this->worksheet->getRowDimension($rowNumber)->setCollapsed($rowAttributes[
'collapsed']);
66 if (isset($rowAttributes[
'outlineLevel'])) {
67 $this->worksheet->getRowDimension($rowNumber)->setOutlineLevel($rowAttributes[
'outlineLevel']);
69 if (isset($rowAttributes[
'rowHeight'])) {
70 $this->worksheet->getRowDimension($rowNumber)->setRowHeight($rowAttributes[
'rowHeight']);
80 if ($this->worksheetXml === null) {
84 $columnsAttributes = [];
86 if (isset($this->worksheetXml->cols)) {
90 if ($this->worksheetXml->sheetData && $this->worksheetXml->sheetData->row) {
95 $columnsAttributesAreSet = [];
96 foreach ($columnsAttributes as $columnCoordinate => $columnAttributes) {
101 if (!isset($columnsAttributesAreSet[$columnCoordinate])) {
103 $columnsAttributesAreSet[$columnCoordinate] =
true;
108 $rowsAttributesAreSet = [];
109 foreach ($rowsAttributes as $rowCoordinate => $rowAttributes) {
114 if (!isset($rowsAttributesAreSet[$rowCoordinate])) {
116 $rowsAttributesAreSet[$rowCoordinate] =
true;
124 foreach ($rowsAttributes as $rowCoordinate => $rowAttributes) {
125 if (!$readFilter->
readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) {
135 $columnAttributes = [];
137 foreach ($worksheetCols->col as $column) {
141 for ($columnAddress = $startColumn; $columnAddress !== $endColumn; ++$columnAddress) {
144 if ((
int) ($column[
'max']) == 16384) {
150 return $columnAttributes;
155 $columnAttributes = [];
158 $columnAttributes[
'xfIndex'] = (int) $column[
'style'];
160 if (self::boolean($column[
'hidden'])) {
161 $columnAttributes[
'visible'] =
false;
163 if (self::boolean($column[
'collapsed'])) {
164 $columnAttributes[
'collapsed'] =
true;
166 if (((
int) $column[
'outlineLevel']) > 0) {
167 $columnAttributes[
'outlineLevel'] = (int) $column[
'outlineLevel'];
169 $columnAttributes[
'width'] = (float) $column[
'width'];
171 return $columnAttributes;
176 foreach ($columnsAttributes as $columnCoordinate => $columnAttributes) {
177 if (!$readFilter->
readCell($columnCoordinate, $rowCoordinate, $this->worksheet->getTitle())) {
189 foreach ($worksheetRow as
$row) {
191 $rowAttributes[(int) $row[
'r']][
'rowHeight'] = (
float) $row[
'ht'];
193 if (self::boolean($row[
'hidden'])) {
194 $rowAttributes[(int) $row[
'r']][
'visible'] =
false;
196 if (self::boolean($row[
'collapsed'])) {
197 $rowAttributes[(int) $row[
'r']][
'collapsed'] =
true;
199 if ((
int) $row[
'outlineLevel'] > 0) {
200 $rowAttributes[(int) $row[
'r']][
'outlineLevel'] = (
int) $row[
'outlineLevel'];
203 $rowAttributes[(int) $row[
'r']][
'xfIndex'] = (
int) $row[
's'];
207 return $rowAttributes;
isFilteredColumn(IReadFilter $readFilter, $columnCoordinate, array $rowsAttributes)
isFilteredRow(IReadFilter $readFilter, $rowCoordinate, array $columnsAttributes)
readColumnAttributes(SimpleXMLElement $worksheetCols, $readDataOnly)
load(?IReadFilter $readFilter=null, $readDataOnly=false)
__construct(Worksheet $workSheet, ?SimpleXMLElement $worksheetXml=null)
setColumnAttributes($columnAddress, array $columnAttributes)
Set Worksheet column attributes by attributes array passed.
readCell($column, $row, $worksheetName='')
Should this cell be read?
readColumnRangeAttributes(SimpleXMLElement $column, $readDataOnly)
readRowAttributes(SimpleXMLElement $worksheetRow, $readDataOnly)
static stringFromColumnIndex($columnIndex)
String from column index.
setRowAttributes($rowNumber, array $rowAttributes)
Set Worksheet row attributes by attributes array passed.