@@ 2402-2425 (lines=24) @@ | ||
2399 | private static $functionReplaceFromExcel = null; |
|
2400 | private static $functionReplaceToLocale = null; |
|
2401 | ||
2402 | public function _translateFormulaToLocale($formula) |
|
2403 | { |
|
2404 | if (self::$functionReplaceFromExcel === null) { |
|
2405 | self::$functionReplaceFromExcel = []; |
|
2406 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
|
2407 | self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName) . '([\s]*\()/Ui'; |
|
2408 | } |
|
2409 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
|
2410 | self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean) . '([^\w\.])/Ui'; |
|
2411 | } |
|
2412 | } |
|
2413 | ||
2414 | if (self::$functionReplaceToLocale === null) { |
|
2415 | self::$functionReplaceToLocale = []; |
|
2416 | foreach (array_values(self::$localeFunctions) as $localeFunctionName) { |
|
2417 | self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2'; |
|
2418 | } |
|
2419 | foreach (array_values(self::$localeBoolean) as $localeBoolean) { |
|
2420 | self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2'; |
|
2421 | } |
|
2422 | } |
|
2423 | ||
2424 | return self::translateFormula(self::$functionReplaceFromExcel, self::$functionReplaceToLocale, $formula, ',', self::$localeArgumentSeparator); |
|
2425 | } |
|
2426 | ||
2427 | private static $functionReplaceFromLocale = null; |
|
2428 | private static $functionReplaceToExcel = null; |
|
@@ 2430-2453 (lines=24) @@ | ||
2427 | private static $functionReplaceFromLocale = null; |
|
2428 | private static $functionReplaceToExcel = null; |
|
2429 | ||
2430 | public function _translateFormulaToEnglish($formula) |
|
2431 | { |
|
2432 | if (self::$functionReplaceFromLocale === null) { |
|
2433 | self::$functionReplaceFromLocale = []; |
|
2434 | foreach (array_values(self::$localeFunctions) as $localeFunctionName) { |
|
2435 | self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName) . '([\s]*\()/Ui'; |
|
2436 | } |
|
2437 | foreach (array_values(self::$localeBoolean) as $excelBoolean) { |
|
2438 | self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean) . '([^\w\.])/Ui'; |
|
2439 | } |
|
2440 | } |
|
2441 | ||
2442 | if (self::$functionReplaceToExcel === null) { |
|
2443 | self::$functionReplaceToExcel = []; |
|
2444 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
|
2445 | self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2'; |
|
2446 | } |
|
2447 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
|
2448 | self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2'; |
|
2449 | } |
|
2450 | } |
|
2451 | ||
2452 | return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ','); |
|
2453 | } |
|
2454 | ||
2455 | public static function localeFunc($function) |
|
2456 | { |