You are here

public function PHPExcel_Style::getSharedComponent in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Style.php \PHPExcel_Style::getSharedComponent()

Get the shared style component for the currently active cell in currently active sheet. Only used for style supervisor

Return value

PHPExcel_Style

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Style.php, line 142

Class

PHPExcel_Style
PHPExcel_Style

Code

public function getSharedComponent() {
  $activeSheet = $this
    ->getActiveSheet();
  $selectedCell = $this
    ->getActiveCell();

  // e.g. 'A1'
  if ($activeSheet
    ->cellExists($selectedCell)) {
    $xfIndex = $activeSheet
      ->getCell($selectedCell)
      ->getXfIndex();
  }
  else {
    $xfIndex = 0;
  }
  return $this->_parent
    ->getCellXfByIndex($xfIndex);
}