private function readSelection()
    {
        $length = self::getUInt2d($this->data, $this->pos + 2);
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);

        // move stream pointer to next record
        $this->pos += 4 + $length;

        if (!$this->readDataOnly) {
            // offset: 0; size: 1; pane identifier
            $paneId = ord($recordData[0]);

            // offset: 1; size: 2; index to row of the active cell
            $r = self::getUInt2d($recordData, 1);

            // offset: 3; size: 2; index to column of the active cell
            $c = self::getUInt2d($recordData, 3);

            // offset: 5; size: 2; index into the following cell range list to the
            //  entry that contains the active cell
            $index = self::getUInt2d($recordData, 5);

            // offset: 7; size: var; cell range address list containing all selected cell ranges
            $data = substr($recordData, 7);
            $cellRangeAddressList = $this->readBIFF5CellRangeAddressList($data); // note: also BIFF8 uses BIFF5 syntax

            $selectedCells = $cellRangeAddressList['cellRangeAddresses'][0];

            // first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!)
            if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) {
                $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells);
            }

            // first row '1' + last row '65536' indicates that full column is selected
            if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) {
                $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells);
            }

            // first column 'A' + last column 'IV' indicates that full row is selected
            if (preg_match('/^(A\d+\:)IV(\d+)$/', $selectedCells)) {
                $selectedCells = preg_replace('/^(A\d+\:)IV(\d+)$/', '${1}XFD${2}', $selectedCells);
            }

            $this->phpSheet->setSelectedCells($selectedCells);
        }
    }
private function readSelection()
    {
        $length = self::getUInt2d($this->data, $this->pos + 2);
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);

        // move stream pointer to next record
        $this->pos += 4 + $length;

        if (!$this->readDataOnly) {
            // offset: 0; size: 1; pane identifier
            $paneId = ord($recordData[0]);

            // offset: 1; size: 2; index to row of the active cell
            $r = self::getUInt2d($recordData, 1);

            // offset: 3; size: 2; index to column of the active cell
            $c = self::getUInt2d($recordData, 3);

            // offset: 5; size: 2; index into the following cell range list to the
            //  entry that contains the active cell
            $index = self::getUInt2d($recordData, 5);

            // offset: 7; size: var; cell range address list containing all selected cell ranges
            $data = substr($recordData, 7);
            $cellRangeAddressList = $this->readBIFF5CellRangeAddressList($data); // note: also BIFF8 uses BIFF5 syntax

            $selectedCells = $cellRangeAddressList['cellRangeAddresses'][0];

            // first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!)
            if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) {
                $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells);
            }

            // first row '1' + last row '65536' indicates that full column is selected
            if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) {
                $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells);
            }

            // first column 'A' + last column 'IV' indicates that full row is selected
            if (preg_match('/^(A\d+\:)IV(\d+)$/', $selectedCells)) {
                $selectedCells = preg_replace('/^(A\d+\:)IV(\d+)$/', '${1}XFD${2}', $selectedCells);
            }

            $this->phpSheet->setSelectedCells($selectedCells);
        }
    }
private function readSelection ( ) { $ length = self :: getUInt2d ( $ this -> data , $ this -> pos + 2 ) ; $ recordData = $ this -> readRecordData ( $ this -> data , $ this -> pos + 4 , $ length ) ; // move stream pointer to next record $ this -> pos += 4 + $ length ; if ( ! $ this -> readDataOnly ) { // offset: 0; size: 1; pane identifier $ paneId = ord ( $ recordData [ 0 ] ) ; // offset: 1; size: 2; index to row of the active cell $ r = self :: getUInt2d ( $ recordData , 1 ) ; // offset: 3; size: 2; index to column of the active cell $ c = self :: getUInt2d ( $ recordData , 3 ) ; // offset: 5; size: 2; index into the following cell range list to the //  entry that contains the active cell $ index = self :: getUInt2d ( $ recordData , 5 ) ; // offset: 7; size: var; cell range address list containing all selected cell ranges $ data = substr ( $ recordData , 7 ) ; $ cellRangeAddressList = $ this -> readBIFF5CellRangeAddressList ( $ data ) ; // note: also BIFF8 uses BIFF5 syntax $ selectedCells = $ cellRangeAddressList [ 'cellRangeAddresses' ] [ 0 ] ; // first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!) if ( preg_match ( '/^([A-Z]+1\:[A-Z]+)16384$/' , $ selectedCells ) ) { $ selectedCells = preg_replace ( '/^([A-Z]+1\:[A-Z]+)16384$/' , '${1}1048576' , $ selectedCells ) ; } // first row '1' + last row '65536' indicates that full column is selected if ( preg_match ( '/^([A-Z]+1\:[A-Z]+)65536$/' , $ selectedCells ) ) { $ selectedCells = preg_replace ( '/^([A-Z]+1\:[A-Z]+)65536$/' , '${1}1048576' , $ selectedCells ) ; } // first column 'A' + last column 'IV' indicates that full row is selected if ( preg_match ( '/^(A\d+\:)IV(\d+)$/' , $ selectedCells ) ) { $ selectedCells = preg_replace ( '/^(A\d+\:)IV(\d+)$/' , '${1}XFD${2}' , $ selectedCells ) ; } $ this -> phpSheet -> setSelectedCells ( $ selectedCells ) ; } }
Read SELECTION record. There is one such record for each pane in the sheet.
Read SELECTION record . There is one such record for each pane in the sheet .