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