Ejemplo n.º 1
0
 /**
  * @param Worksheet $worksheet
  *
  * @return int
  */
 protected function calcGrbit(Worksheet $worksheet)
 {
     $fLeftToRight = 0x0;
     // Print over then down
     $fLandscape = $worksheet->getPrintSetup()->getOrientation();
     // Page orientation
     $fNoPls = 0x0;
     // Setup not read from printer
     $fNoColor = 0x0;
     // Print black and white
     $fDraft = 0x0;
     // Print draft quality
     $fNotes = 0x0;
     // Print notes
     $fNoOrient = 0x0;
     // Orientation not set
     $fUsePage = 0x0;
     // Use custom starting page
     $grbit = $fLeftToRight;
     $grbit |= $fLandscape << 1;
     $grbit |= $fNoPls << 2;
     $grbit |= $fNoColor << 3;
     $grbit |= $fDraft << 4;
     $grbit |= $fNotes << 5;
     $grbit |= $fNoOrient << 6;
     $grbit |= $fUsePage << 7;
     return $grbit;
 }
Ejemplo n.º 2
0
 /**
  * Generate the WSBOOL biff record
  * @param Worksheet $sheet
  *
  * @return string
  */
 public function getData(Worksheet $sheet)
 {
     $grbit = 0x0;
     // Set the option flags
     $grbit |= 0x1;
     // Auto page breaks visible
     if ($sheet->getOutlineStyle()) {
         $grbit |= 0x20;
         // Auto outline styles
     }
     if ($sheet->getOutlineBelow()) {
         $grbit |= 0x40;
         // Outline summary below
     }
     if ($sheet->getOutlineRight()) {
         $grbit |= 0x80;
         // Outline summary right
     }
     if ($sheet->getPrintSetup()->isFitPage()) {
         $grbit |= 0x100;
         // Page setup fit to page
     }
     if ($sheet->isOutlineOn()) {
         $grbit |= 0x400;
         // Outline symbols displayed
     }
     $data = pack("v", $grbit);
     return $this->getFullRecord($data);
 }
Ejemplo n.º 3
0
 /**
  * @param Worksheet $worksheet
  *
  * @return int
  */
 protected function calcGrbit(Worksheet $worksheet)
 {
     $fDspFmla = 0;
     // 0 - bit
     $fDspGrid = intval($worksheet->areGridLinesVisible());
     // 1
     $fDspRwCol = 1;
     // 2
     $fFrozen = intval($worksheet->isFrozen());
     // 3
     $fDspZeros = 1;
     // 4
     $fDefaultHdr = 1;
     // 5
     $fArabic = intval($worksheet->isRtl());
     // 6
     $fDspGuts = intval($worksheet->isOutlineOn());
     // 7
     $fFrozenNoSplit = 0;
     // 0 - bit
     $fSelected = intval($worksheet->isSelected());
     // 1
     $fPaged = 1;
     // 2
     $grbit = $fDspFmla;
     $grbit |= $fDspGrid << 1;
     $grbit |= $fDspRwCol << 2;
     $grbit |= $fFrozen << 3;
     $grbit |= $fDspZeros << 4;
     $grbit |= $fDefaultHdr << 5;
     $grbit |= $fArabic << 6;
     $grbit |= $fDspGuts << 7;
     $grbit |= $fFrozenNoSplit << 8;
     $grbit |= $fSelected << 9;
     $grbit |= $fPaged << 10;
     return $grbit;
 }
Ejemplo n.º 4
0
 /**
  * @param Worksheet $sheet
  *
  * @return string
  */
 protected function getPrintTitleData(Worksheet $sheet)
 {
     $printRepeat = $sheet->getPrintSetup()->getPrintRepeat();
     $rowmin = $printRepeat->getRowFrom();
     $rowmax = $printRepeat->getRowTo();
     $colmin = $printRepeat->getColFrom();
     $colmax = $printRepeat->getColTo();
     $rangeHeader = $this->getRangeCommonHeader($sheet);
     if ($rowmax !== Biff8::MAX_ROW_IDX && $colmax !== Biff8::MAX_COL_IDX) {
         $data = pack('Cv', 0x29, 0x17);
         // tMemFunc
         $data .= $rangeHeader;
         $data .= pack('v4', 0, Biff8::MAX_ROW_IDX, $colmin, $colmax);
         // tArea3d
         $data .= $rangeHeader;
         $data .= pack('v4', $rowmin, $rowmax, 0, Biff8::MAX_COL_IDX);
         // tArea3d
         $data .= pack('C', 0x10);
         // tList
     } else {
         $data = $rangeHeader;
         $data .= pack('v4', $rowmin, $rowmax, $colmin, $colmax);
     }
     return $data;
 }