/**
  * @param Range $range
  *
  * @return string
  */
 public function getData(Range $range)
 {
     $reserved = 0x0;
     $data = pack("VV", $range->getRowFrom(), $range->getRowTo() + 1);
     $data .= pack("vvv", $range->getColFrom(), $range->getColTo() + 1, $reserved);
     return $this->getFullRecord($data);
 }
 /**
  * @param Range  $area
  * @param Margin $margin
  *
  * @return string
  */
 protected function packArea(Range $area, Margin $margin)
 {
     $data = pack("v2", $area->getColFrom(), $margin->getLeft());
     $data .= pack("v2", $area->getRowFrom(), $margin->getTop());
     $data .= pack("v2", $area->getColTo(), $margin->getRight());
     $data .= pack("v2", $area->getRowTo(), $margin->getBottom());
     return $data;
 }
 /**
  * Generate the SELECTION record
  *
  * @param Range $selection
  * @param integer $activePane pane position
  * @return string
  */
 public function getData($selection, $activePane)
 {
     $rwAct = $selection->getRowFrom();
     // Active row
     $colAct = $selection->getColFrom();
     // Active column
     $irefAct = 0;
     // Active cell ref
     $cref = 1;
     // Number of refs
     $data = pack("CvvvvvvCC", $activePane, $rwAct, $colAct, $irefAct, $cref, $selection->getRowFrom(), $selection->getRowTo(), $selection->getColFrom(), $selection->getColTo());
     return $this->getFullRecord($data);
 }