You are here

private static function PHPExcel_Reader_Excel2007::toCSSArray in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel2007.php \PHPExcel_Reader_Excel2007::toCSSArray()
1 call to PHPExcel_Reader_Excel2007::toCSSArray()
PHPExcel_Reader_Excel2007::load in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel2007.php
* Loads PHPExcel from file * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel2007.php, line 2043

Class

PHPExcel_Reader_Excel2007
PHPExcel_Reader_Excel2007

Code

private static function toCSSArray($style) {
  $style = str_replace(array(
    "\r",
    "\n",
  ), "", $style);
  $temp = explode(';', $style);
  $style = array();
  foreach ($temp as $item) {
    $item = explode(':', $item);
    if (strpos($item[1], 'px') !== false) {
      $item[1] = str_replace('px', '', $item[1]);
    }
    if (strpos($item[1], 'pt') !== false) {
      $item[1] = str_replace('pt', '', $item[1]);
      $item[1] = PHPExcel_Shared_Font::fontSizeToPixels($item[1]);
    }
    if (strpos($item[1], 'in') !== false) {
      $item[1] = str_replace('in', '', $item[1]);
      $item[1] = PHPExcel_Shared_Font::inchSizeToPixels($item[1]);
    }
    if (strpos($item[1], 'cm') !== false) {
      $item[1] = str_replace('cm', '', $item[1]);
      $item[1] = PHPExcel_Shared_Font::centimeterSizeToPixels($item[1]);
    }
    $style[$item[0]] = $item[1];
  }
  return $style;
}