mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-31 12:40:00 +00:00
Rename xlfn functions for Ods
This commit is contained in:
@@ -210,6 +210,11 @@ class Content extends WriterPart
|
||||
// don't do anything
|
||||
}
|
||||
}
|
||||
if ($cell->isArrayFormula()) {
|
||||
[$columnSpan, $rowSpan] = Coordinate::rangeDimension((string) $cell->arrayFormulaRange());
|
||||
$objWriter->writeAttribute('table:number-matrix-rows-spanned', $rowSpan);
|
||||
$objWriter->writeAttribute('table:number-matrix-columns-spanned', $columnSpan);
|
||||
}
|
||||
$objWriter->writeAttribute('table:formula', $this->formulaConvertor->convertFormula($cell->getValue()));
|
||||
if (is_numeric($formulaValue)) {
|
||||
$objWriter->writeAttribute('office:value-type', 'float');
|
||||
|
||||
@@ -23,6 +23,7 @@ class Formula
|
||||
{
|
||||
$formula = $this->convertCellReferences($formula, $worksheetName);
|
||||
$formula = $this->convertDefinedNames($formula);
|
||||
$formula = $this->convertFunctionNames($formula);
|
||||
|
||||
if (substr($formula, 0, 1) !== '=') {
|
||||
$formula = '=' . $formula;
|
||||
@@ -31,6 +32,11 @@ class Formula
|
||||
return 'of:' . $formula;
|
||||
}
|
||||
|
||||
private function convertFunctionNames(string $formula): string
|
||||
{
|
||||
return (string) preg_replace('/_xlfn\./ui', 'COM.MICROSOFT.', $formula);
|
||||
}
|
||||
|
||||
private function convertDefinedNames(string $formula): string
|
||||
{
|
||||
$splitCount = preg_match_all(
|
||||
|
||||
Reference in New Issue
Block a user