Get automatic number formatting working for Excel 2003 xml files

This commit is contained in:
Nathan Gray 2011-03-21 14:53:41 +00:00
parent b2ef231049
commit e13ef7c892

View File

@ -568,6 +568,11 @@ abstract class bo_merge
case 'application/vnd.oasis.opendocument.spreadsheet': // open office calc case 'application/vnd.oasis.opendocument.spreadsheet': // open office calc
$format = '/<table:table-cell([^>]+?)office:value-type="([^"]+)"([^>]*?)>.?<([a-z].*?)[^>]*>('.implode('|',$names).')<\/\4>.?<\/table:table-cell>/s'; $format = '/<table:table-cell([^>]+?)office:value-type="([^"]+)"([^>]*?)>.?<([a-z].*?)[^>]*>('.implode('|',$names).')<\/\4>.?<\/table:table-cell>/s';
$replacement = '<table:table-cell$1office:value-type="float" office:value="$5"$3>$5</table:table-cell>'; $replacement = '<table:table-cell$1office:value-type="float" office:value="$5"$3>$5</table:table-cell>';
break;
case 'application/xmlExcel.Sheet': // Excel 2003
$format = '/'.preg_quote('<Data ss:Type="String">','/').'('.implode('|',$names).')'.preg_quote('</Data>','/').'/';
$replacement = '<Data ss:Type="Number">$1</Data>';
break; break;
} }
if($format && $names) if($format && $names)