You are here

public function PHPExcel_Calculation::_translateFormulaToEnglish in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php \PHPExcel_Calculation::_translateFormulaToEnglish()

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php, line 2117

Class

PHPExcel_Calculation
PHPExcel_Calculation (Multiton)

Code

public function _translateFormulaToEnglish($formula) {
  if (self::$functionReplaceFromLocale === NULL) {
    self::$functionReplaceFromLocale = array();
    foreach (array_values(self::$_localeFunctions) as $localeFunctionName) {
      self::$functionReplaceFromLocale[] = '/(@?[^\\w\\.])' . preg_quote($localeFunctionName) . '([\\s]*\\()/Ui';
    }
    foreach (array_values(self::$_localeBoolean) as $excelBoolean) {
      self::$functionReplaceFromLocale[] = '/(@?[^\\w\\.])' . preg_quote($excelBoolean) . '([^\\w\\.])/Ui';
    }
  }
  if (self::$functionReplaceToExcel === NULL) {
    self::$functionReplaceToExcel = array();
    foreach (array_keys(self::$_localeFunctions) as $excelFunctionName) {
      self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2';
    }
    foreach (array_keys(self::$_localeBoolean) as $excelBoolean) {
      self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2';
    }
  }
  return self::_translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$_localeArgumentSeparator, ',');
}