You are here

public function PHPExcel_Style_Alignment::setShrinkToFit in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Style/Alignment.php \PHPExcel_Style_Alignment::setShrinkToFit()

* Set Shrink to fit * *

Parameters

boolean $pValue: * @return PHPExcel_Style_Alignment

1 call to PHPExcel_Style_Alignment::setShrinkToFit()
PHPExcel_Style_Alignment::applyFromArray in vendor/phpoffice/phpexcel/Classes/PHPExcel/Style/Alignment.php
* Apply styles from array * * <code> * $objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( * array( * 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, …

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Style/Alignment.php, line 359

Class

PHPExcel_Style_Alignment
PHPExcel_Style_Alignment

Code

public function setShrinkToFit($pValue = FALSE) {
  if ($pValue == '') {
    $pValue = FALSE;
  }
  if ($this->_isSupervisor) {
    $styleArray = $this
      ->getStyleArray(array(
      'shrinkToFit' => $pValue,
    ));
    $this
      ->getActiveSheet()
      ->getStyle($this
      ->getSelectedCells())
      ->applyFromArray($styleArray);
  }
  else {
    $this->_shrinkToFit = $pValue;
  }
  return $this;
}