private function writeSelection()
    {
        // look up the selected cell range
        $selectedCells = Coordinate::splitRange($this->phpSheet->getSelectedCells());
        $selectedCells = $selectedCells[0];
        if (count($selectedCells) == 2) {
            list($first, $last) = $selectedCells;
        } else {
            $first = $selectedCells[0];
            $last = $selectedCells[0];
        }

        list($colFirst, $rwFirst) = Coordinate::coordinateFromString($first);
        $colFirst = Coordinate::columnIndexFromString($colFirst) - 1; // base 0 column index
        --$rwFirst; // base 0 row index

        list($colLast, $rwLast) = Coordinate::coordinateFromString($last);
        $colLast = Coordinate::columnIndexFromString($colLast) - 1; // base 0 column index
        --$rwLast; // base 0 row index

        // make sure we are not out of bounds
        $colFirst = min($colFirst, 255);
        $colLast = min($colLast, 255);

        $rwFirst = min($rwFirst, 65535);
        $rwLast = min($rwLast, 65535);

        $record = 0x001D; // Record identifier
        $length = 0x000F; // Number of bytes to follow

        $pnn = $this->activePane; // Pane position
        $rwAct = $rwFirst; // Active row
        $colAct = $colFirst; // Active column
        $irefAct = 0; // Active cell ref
        $cref = 1; // Number of refs

        if (!isset($rwLast)) {
            $rwLast = $rwFirst; // Last  row in reference
        }
        if (!isset($colLast)) {
            $colLast = $colFirst; // Last  col in reference
        }

        // Swap last row/col for first row/col as necessary
        if ($rwFirst > $rwLast) {
            list($rwFirst, $rwLast) = [$rwLast, $rwFirst];
        }

        if ($colFirst > $colLast) {
            list($colFirst, $colLast) = [$colLast, $colFirst];
        }

        $header = pack('vv', $record, $length);
        $data = pack('CvvvvvvCC', $pnn, $rwAct, $colAct, $irefAct, $cref, $rwFirst, $rwLast, $colFirst, $colLast);
        $this->append($header . $data);
    }
private function writeSelection()
    {
        // look up the selected cell range
        $selectedCells = Coordinate::splitRange($this->phpSheet->getSelectedCells());
        $selectedCells = $selectedCells[0];
        if (count($selectedCells) == 2) {
            list($first, $last) = $selectedCells;
        } else {
            $first = $selectedCells[0];
            $last = $selectedCells[0];
        }

        list($colFirst, $rwFirst) = Coordinate::coordinateFromString($first);
        $colFirst = Coordinate::columnIndexFromString($colFirst) - 1; // base 0 column index
        --$rwFirst; // base 0 row index

        list($colLast, $rwLast) = Coordinate::coordinateFromString($last);
        $colLast = Coordinate::columnIndexFromString($colLast) - 1; // base 0 column index
        --$rwLast; // base 0 row index

        // make sure we are not out of bounds
        $colFirst = min($colFirst, 255);
        $colLast = min($colLast, 255);

        $rwFirst = min($rwFirst, 65535);
        $rwLast = min($rwLast, 65535);

        $record = 0x001D; // Record identifier
        $length = 0x000F; // Number of bytes to follow

        $pnn = $this->activePane; // Pane position
        $rwAct = $rwFirst; // Active row
        $colAct = $colFirst; // Active column
        $irefAct = 0; // Active cell ref
        $cref = 1; // Number of refs

        if (!isset($rwLast)) {
            $rwLast = $rwFirst; // Last  row in reference
        }
        if (!isset($colLast)) {
            $colLast = $colFirst; // Last  col in reference
        }

        // Swap last row/col for first row/col as necessary
        if ($rwFirst > $rwLast) {
            list($rwFirst, $rwLast) = [$rwLast, $rwFirst];
        }

        if ($colFirst > $colLast) {
            list($colFirst, $colLast) = [$colLast, $colFirst];
        }

        $header = pack('vv', $record, $length);
        $data = pack('CvvvvvvCC', $pnn, $rwAct, $colAct, $irefAct, $cref, $rwFirst, $rwLast, $colFirst, $colLast);
        $this->append($header . $data);
    }
private function writeSelection ( ) { // look up the selected cell range $ selectedCells = Coordinate :: splitRange ( $ this -> phpSheet -> getSelectedCells ( ) ) ; $ selectedCells = $ selectedCells [ 0 ] ; if ( count ( $ selectedCells ) == 2 ) { list ( $ first , $ last ) = $ selectedCells ; } else { $ first = $ selectedCells [ 0 ] ; $ last = $ selectedCells [ 0 ] ; } list ( $ colFirst , $ rwFirst ) = Coordinate :: coordinateFromString ( $ first ) ; $ colFirst = Coordinate :: columnIndexFromString ( $ colFirst ) - 1 ; // base 0 column index -- $ rwFirst ; // base 0 row index list ( $ colLast , $ rwLast ) = Coordinate :: coordinateFromString ( $ last ) ; $ colLast = Coordinate :: columnIndexFromString ( $ colLast ) - 1 ; // base 0 column index -- $ rwLast ; // base 0 row index // make sure we are not out of bounds $ colFirst = min ( $ colFirst , 255 ) ; $ colLast = min ( $ colLast , 255 ) ; $ rwFirst = min ( $ rwFirst , 65535 ) ; $ rwLast = min ( $ rwLast , 65535 ) ; $ record = 0x001D ; // Record identifier $ length = 0x000F ; // Number of bytes to follow $ pnn = $ this -> activePane ; // Pane position $ rwAct = $ rwFirst ; // Active row $ colAct = $ colFirst ; // Active column $ irefAct = 0 ; // Active cell ref $ cref = 1 ; // Number of refs if ( ! isset ( $ rwLast ) ) { $ rwLast = $ rwFirst ; // Last  row in reference } if ( ! isset ( $ colLast ) ) { $ colLast = $ colFirst ; // Last  col in reference } // Swap last row/col for first row/col as necessary if ( $ rwFirst > $ rwLast ) { list ( $ rwFirst , $ rwLast ) = [ $ rwLast , $ rwFirst ] ; } if ( $ colFirst > $ colLast ) { list ( $ colFirst , $ colLast ) = [ $ colLast , $ colFirst ] ; } $ header = pack ( 'vv' , $ record , $ length ) ; $ data = pack ( 'CvvvvvvCC' , $ pnn , $ rwAct , $ colAct , $ irefAct , $ cref , $ rwFirst , $ rwLast , $ colFirst , $ colLast ) ; $ this -> append ( $ header . $ data ) ; }
Write BIFF record SELECTION.
Write BIFF record SELECTION .