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