18 $this->worksheet = $workSheet;
21 public function load(): void
30 if (isset($this->sheetViewXml->pane)) {
33 if (isset($this->sheetViewXml->selection, $this->sheetViewXml->selection[
'sqref'])) {
40 if (isset($this->sheetViewXml[
'zoomScale'])) {
41 $zoomScale = (int) ($this->sheetViewXml[
'zoomScale']);
42 if ($zoomScale <= 0) {
48 $this->worksheet->getSheetView()->setZoomScale($zoomScale);
51 if (isset($this->sheetViewXml[
'zoomScaleNormal'])) {
52 $zoomScaleNormal = (int) ($this->sheetViewXml[
'zoomScaleNormal']);
53 if ($zoomScaleNormal <= 0) {
56 $zoomScaleNormal = 100;
59 $this->worksheet->getSheetView()->setZoomScaleNormal($zoomScaleNormal);
63 private function view(): void
65 if (isset($this->sheetViewXml[
'view'])) {
66 $this->worksheet->getSheetView()->setView((
string) $this->sheetViewXml[
'view']);
72 if (isset($this->sheetViewXml[
'showGridLines'])) {
73 $this->worksheet->setShowGridLines(
74 self::boolean((
string) $this->sheetViewXml[
'showGridLines'])
81 if (isset($this->sheetViewXml[
'showRowColHeaders'])) {
82 $this->worksheet->setShowRowColHeaders(
83 self::boolean((
string) $this->sheetViewXml[
'showRowColHeaders'])
90 if (isset($this->sheetViewXml[
'rightToLeft'])) {
91 $this->worksheet->setRightToLeft(
92 self::boolean((
string) $this->sheetViewXml[
'rightToLeft'])
99 if (isset($this->sheetViewXml[
'showZeros'])) {
100 $this->worksheet->getSheetView()->setShowZeros(
101 self::boolean((
string) $this->sheetViewXml[
'showZeros'])
112 if (isset($this->sheetViewXml->pane[
'xSplit'])) {
113 $xSplit = (int) ($this->sheetViewXml->pane[
'xSplit']);
116 if (isset($this->sheetViewXml->pane[
'ySplit'])) {
117 $ySplit = (int) ($this->sheetViewXml->pane[
'ySplit']);
120 if (isset($this->sheetViewXml->pane[
'topLeftCell'])) {
121 $topLeftCell = (string) $this->sheetViewXml->pane[
'topLeftCell'];
124 $this->worksheet->freezePane(
132 $sqref = (string) $this->sheetViewXml->selection[
'sqref'];
133 $sqref = explode(
' ', $sqref);
136 $this->worksheet->setSelectedCells($sqref);
__construct(SimpleXMLElement $sheetViewXml, Worksheet $workSheet)
static stringFromColumnIndex($columnIndex)
String from column index.