From cd904875956c6a3ab4f76b8ac4d278e6a337d41e Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 17 Mar 2014 17:51:11 +0000 Subject: [PATCH] Better handling for new LibreOffice cell attributes to handle numbers as float --- etemplate/inc/class.bo_merge.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index d336da05b4..ec7e534be0 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -1083,8 +1083,8 @@ abstract class bo_merge switch($mimetype) { case 'application/vnd.oasis.opendocument.spreadsheet': // open office calc - $format = '/]+?)office:value-type="[^"]+"([^>]*?)>.?<([a-z].*?)[^>]*>('.implode('|',$names).')<\/\3>.?<\/table:table-cell>/s'; - $replacement = '$4'; + $format = '/]+?)office:value-type="[^"]+"([^>]*?)(?:calcext:value-type="[^"]+")?>.?<([a-z].*?)[^>]*>('.implode('|',$names).')<\/\3>.?<\/table:table-cell>/s'; + $replacement = '<$3>$4'; break; case 'application/vnd.oasis.opendocument.text': // tables in open office writer $format = '/]+?)office:value-type="[^"]+"([^>]*?)>.?<([a-z].*?)[^>]*>('.implode('|',$names).')<\/\3>.?<\/table:table-cell>/s'; @@ -1192,8 +1192,8 @@ abstract class bo_merge switch($mimetype) { case 'application/vnd.oasis.opendocument.spreadsheet': // open office calc - $format = '/]+?)office:value-type="[^"]+"([^>]*?)>.?<([a-z].*?)[^>]*>\$\$('.implode('|',$names).')\$\$<\/\3>.?<\/table:table-cell>/s'; - $replacement = '<$3>\$\$$4\$\$'; + $format = '/]+?)office:value-type="[^"]+"([^>]*?)(?:calcext:value-type="[^"]+")?>.?<([a-z].*?)[^>]*>\$\$('.implode('|',$names).')\$\$<\/\3>.?<\/table:table-cell>/s'; + $replacement = '<$3>\$\$$4\$\$'; break; case 'application/xmlExcel.Sheet': // Excel 2003 $format = '/'.preg_quote('','/').'..('.implode('|',$names).')..'.preg_quote('','/').'/';