You are here

function socialcalc_parse_cell_value in Sheetnode 6

Same name and namespace in other branches
  1. 5 socialcalc.inc \socialcalc_parse_cell_value()
  2. 7.2 socialcalc.inc \socialcalc_parse_cell_value()
  3. 7 socialcalc.inc \socialcalc_parse_cell_value()
1 call to socialcalc_parse_cell_value()
socialcalc_parse_values in ./socialcalc.inc

File

./socialcalc.inc, line 412
SocialCalc manipulation functions Translated from socialcalc-3.js and companion files

Code

function socialcalc_parse_cell_value($parts, $j) {
  $cell = array();
  while ($t = @$parts[$j++]) {
    switch ($t) {
      case "v":
        $cell['datavalue'] = doubleval(socialcalc_decode_value($parts[$j++]));
        break 2;

      // first time for me :-)
      case "t":
        $cell['datavalue'] = strval(socialcalc_decode_value($parts[$j++]));
        break 2;
      case "vt":
        $j++;
        $cell['datavalue'] = socialcalc_decode_value($parts[$j++]);
        break 2;
      case "vtf":
        $j++;
        $cell['datavalue'] = socialcalc_decode_value($parts[$j++]);
        break 2;
      case "vtc":
        $j++;
        $cell['datavalue'] = socialcalc_decode_value($parts[$j++]);
        break 2;
    }
  }
  return $cell;
}