Create invoice : New version of libreoffice use the numeric in another way

This commit is contained in:
Dany De Bontridder 2018-04-21 02:35:14 +02:00
parent e12848f577
commit d4579aca32

View file

@ -272,9 +272,14 @@ class Document
*/
if ( is_numeric($value) && $p_type=='OOo')
{
$searched='/office:value-type="string"><text:p>'.$pattern.'/';
// For libreOffice <=4
$searched='/office:value-type="string"><text:p>'.$pattern.'/i';
$replaced='office:value-type="float" office:value="'.$value.'"><text:p>'.$pattern;
$buffer=preg_replace($searched, $replaced, $buffer,1);
// For libreOffice >=4
$searched='/office:value-type="string" calcext:value-type="string"><text:p>'.$pattern.'/i';
$replaced='office:value-type="float" office:value="'.$value.'" calcext:value-type="float"><text:p>'.$pattern;
$buffer=preg_replace($searched, $replaced, $buffer,1);
}
// replace into the $buffer
// take the position in the buffer