You are here

public static function PHPExcel_Calculation::_translateSeparator in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php \PHPExcel_Calculation::_translateSeparator()
2 calls to PHPExcel_Calculation::_translateSeparator()
PHPExcel_Calculation::_translateFormula in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php
PHPExcel_Reader_OOCalc::loadIntoExisting in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/OOCalc.php
* Loads PHPExcel from file into PHPExcel instance * *

File

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

Class

PHPExcel_Calculation
PHPExcel_Calculation (Multiton)

Code

public static function _translateSeparator($fromSeparator, $toSeparator, $formula, &$inBraces) {
  $strlen = mb_strlen($formula);
  for ($i = 0; $i < $strlen; ++$i) {
    $chr = mb_substr($formula, $i, 1);
    switch ($chr) {
      case '{':
        $inBraces = TRUE;
        break;
      case '}':
        $inBraces = FALSE;
        break;
      case $fromSeparator:
        if (!$inBraces) {
          $formula = mb_substr($formula, 0, $i) . $toSeparator . mb_substr($formula, $i + 1);
        }
    }
  }
  return $formula;
}