@@ 2437-2460 (lines=24) @@ | ||
2434 | private static $functionReplaceFromExcel = null; |
|
2435 | private static $functionReplaceToLocale = null; |
|
2436 | ||
2437 | public function _translateFormulaToLocale($formula) |
|
2438 | { |
|
2439 | if (self::$functionReplaceFromExcel === null) { |
|
2440 | self::$functionReplaceFromExcel = array(); |
|
2441 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
|
2442 | self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName).'([\s]*\()/Ui'; |
|
2443 | } |
|
2444 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
|
2445 | self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui'; |
|
2446 | } |
|
2447 | } |
|
2448 | ||
2449 | if (self::$functionReplaceToLocale === null) { |
|
2450 | self::$functionReplaceToLocale = array(); |
|
2451 | foreach (array_values(self::$localeFunctions) as $localeFunctionName) { |
|
2452 | self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2'; |
|
2453 | } |
|
2454 | foreach (array_values(self::$localeBoolean) as $localeBoolean) { |
|
2455 | self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2'; |
|
2456 | } |
|
2457 | } |
|
2458 | ||
2459 | return self::translateFormula(self::$functionReplaceFromExcel, self::$functionReplaceToLocale, $formula, ',', self::$localeArgumentSeparator); |
|
2460 | } |
|
2461 | ||
2462 | ||
2463 | private static $functionReplaceFromLocale = null; |
|
@@ 2466-2489 (lines=24) @@ | ||
2463 | private static $functionReplaceFromLocale = null; |
|
2464 | private static $functionReplaceToExcel = null; |
|
2465 | ||
2466 | public function _translateFormulaToEnglish($formula) |
|
2467 | { |
|
2468 | if (self::$functionReplaceFromLocale === null) { |
|
2469 | self::$functionReplaceFromLocale = array(); |
|
2470 | foreach (array_values(self::$localeFunctions) as $localeFunctionName) { |
|
2471 | self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName).'([\s]*\()/Ui'; |
|
2472 | } |
|
2473 | foreach (array_values(self::$localeBoolean) as $excelBoolean) { |
|
2474 | self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui'; |
|
2475 | } |
|
2476 | } |
|
2477 | ||
2478 | if (self::$functionReplaceToExcel === null) { |
|
2479 | self::$functionReplaceToExcel = array(); |
|
2480 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
|
2481 | self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2'; |
|
2482 | } |
|
2483 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
|
2484 | self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2'; |
|
2485 | } |
|
2486 | } |
|
2487 | ||
2488 | return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ','); |
|
2489 | } |
|
2490 | ||
2491 | ||
2492 | public static function localeFunc($function) |