diff --git a/CHANGELOG.md b/CHANGELOG.md index 9883c3dd7..1241d00ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,12 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Problem rendering line chart with missing plot label. [PR #4074](https://github.com/PHPOffice/PhpSpreadsheet/pull/4074) - More RTL in Xlsx/Html Comments [Issue #4004](https://github.com/PHPOffice/PhpSpreadsheet/issues/4004) [PR #4065](https://github.com/PHPOffice/PhpSpreadsheet/pull/4065) - Empty String in sharedStrings. [Issue #4063](https://github.com/PHPOffice/PhpSpreadsheet/issues/4063) [PR #4064](https://github.com/PHPOffice/PhpSpreadsheet/pull/4064) +- Xlsx Writer RichText and TYPE_STRING. [Issue #476](https://github.com/PHPOffice/PhpSpreadsheet/issues/476) [PR #4094](https://github.com/PHPOffice/PhpSpreadsheet/pull/4094) +- Ods boolean data. [Issue #460](https://github.com/PHPOffice/PhpSpreadsheet/issues/460) [PR #4093](https://github.com/PHPOffice/PhpSpreadsheet/pull/4093) +- Html Writer Minor Fixes. [PR #4089](https://github.com/PHPOffice/PhpSpreadsheet/pull/4089) +- Changes to INDEX function. [Issue #64](https://github.com/PHPOffice/PhpSpreadsheet/issues/64) [PR #4088](https://github.com/PHPOffice/PhpSpreadsheet/pull/4088) +- Ods Reader and Whitespace Text Nodes. [Issue #804](https://github.com/PHPOffice/PhpSpreadsheet/issues/804) [PR #4087](https://github.com/PHPOffice/PhpSpreadsheet/pull/4087) +- Ods Xml Reader and Whitespace Text Nodes. [Issue #804](https://github.com/PHPOffice/PhpSpreadsheet/issues/804) [PR #4087](https://github.com/PHPOffice/PhpSpreadsheet/pull/4087) - Treat invalid formulas as strings. [Issue #1310](https://github.com/PHPOffice/PhpSpreadsheet/issues/1310) [PR #4073](https://github.com/PHPOffice/PhpSpreadsheet/pull/4073) ## 2024-05-11 - 2.1.0 diff --git a/docs/index.md b/docs/index.md index 9505181b7..d577d8982 100644 --- a/docs/index.md +++ b/docs/index.md @@ -20,6 +20,9 @@ allow you to read and write various spreadsheet file formats such as Excel and L |CSV | ✓ | ✓ | |PDF (using either the TCPDF, Dompdf or mPDF libraries, which need to be installed separately)| | ✓ | +Note - reading or writing certain aspects of a spreadsheet may not be supported in all formats. For more details, please consult +[Features Cross-reference](./references/features-cross-reference.md). + # Getting started ## Software requirements diff --git a/docs/references/features-cross-reference.md b/docs/references/features-cross-reference.md index 7ebe2de51..06d279035 100644 --- a/docs/references/features-cross-reference.md +++ b/docs/references/features-cross-reference.md @@ -28,7 +28,7 @@ ✔ ✔ ● - ● + ● 6 ✔ N/A N/A @@ -389,7 +389,7 @@ Conditional Formatting - ● + ✔ ✔ ✖ ✖ @@ -414,7 +414,7 @@ ✔ ✔ ✔ - ✖ + ✔ ✔ N/A N/A @@ -495,14 +495,14 @@ ✔ N/A ● - ● + ● 7 Number Format Mask ✔ ✔ ✔ - ✔ + ● ✔ N/A ✔ @@ -517,7 +517,7 @@ ✔ N/A ✖ - ● + ● 7 Horizontal @@ -583,7 +583,7 @@ ✔ N/A ✔ - ✔ + ● 7 Patterned @@ -605,7 +605,7 @@ ✔ N/A ✔ - ✔ + ● 7 Font Face @@ -704,7 +704,7 @@ ✔ N/A ● - ✔ + ● 7 Line Style @@ -797,13 +797,13 @@ Alignment ✖ 3 - ✖ + ✔ ✖ ✖ ✖ N/A ✖ - ✖ + ✔ Background Image @@ -929,7 +929,7 @@ Macros ✖ - ✔ + ● 5 ✖ ✖ ✖ @@ -940,7 +940,7 @@ Form Controls ✖ - ✖ + ● 4 ✖ ✖ ✖ @@ -1001,6 +1001,10 @@ 1. Only text contents 2. Only BIFF8 files support Rich Text. Prior to that, comments could only be plain text 3. Only BIFF8 files support alignment and rotation. Prior to that, comments could only be unformatted text +4. Xlsx forms and controls can be read and written but not otherwise manipulated +5. Xlsx macros can be read and written; their values can be retrieved and changed, but only in a binary form which is unlikely to be useful +6. There is very limited support for reading styles from an Ods spreadsheet. Writing styles has better support, although Number Format is incomplete. +7. In most cases, Html reader processes only inline styles; styles provided by Css classes may be ignored. ## Writers @@ -1184,7 +1188,7 @@ Row Height/Column Width ✔ ✔ - ✖ + ✔ N/A ✔ ✔ @@ -1256,7 +1260,7 @@ Number Format Mask ✔ ✔ - ✔ + ● N/A ✔ ✔ @@ -1472,10 +1476,10 @@ Merged Cells ✔ ✔ - ✖ + ✔ N/A ✔ - ✖ + ✔ Cell Comments @@ -1498,10 +1502,10 @@ Alignment ✖ - ✖ + ✔ ✖ N/A - ✖ + ✔ N/A @@ -1606,7 +1610,7 @@ Macros ✖ - ✔ + ● 5 ✖ N/A ✖ @@ -1615,7 +1619,7 @@ Form Controls ✖ - ✖ + ● 4 ✖ N/A ✖ @@ -1803,8 +1807,8 @@ Macros - $spreadsheet->getMacrosCode(); - $spreadsheet->setMacrosCode(); + $spreadsheet->getMacrosCode();5 + $spreadsheet->setMacrosCode();5 Security diff --git a/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php b/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php index d578854de..228b46448 100644 --- a/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php +++ b/src/PhpSpreadsheet/Calculation/LookupRef/Matrix.php @@ -81,7 +81,6 @@ class Matrix } $rowNum = $rowNum ?? 0; - $originalColumnNum = $columnNum; $columnNum = $columnNum ?? 0; try { @@ -91,6 +90,17 @@ class Matrix return $e->getMessage(); } + if (is_array($matrix) && count($matrix) === 1 && $rowNum > 1) { + $matrixKey = array_keys($matrix)[0]; + if (is_array($matrix[$matrixKey])) { + $tempMatrix = []; + foreach ($matrix[$matrixKey] as $key => $value) { + $tempMatrix[$key] = [$value]; + } + $matrix = $tempMatrix; + } + } + if (!is_array($matrix) || ($rowNum > count($matrix))) { return ExcelError::REF(); } @@ -101,9 +111,6 @@ class Matrix if ($columnNum > count($columnKeys)) { return ExcelError::REF(); } - if ($originalColumnNum === null && 1 < count($columnKeys)) { - return ExcelError::REF(); - } if ($columnNum === 0) { return self::extractRowValue($matrix, $rowKeys, $rowNum); diff --git a/src/PhpSpreadsheet/Reader/Ods.php b/src/PhpSpreadsheet/Reader/Ods.php index 0eefc8452..da7b85cee 100644 --- a/src/PhpSpreadsheet/Reader/Ods.php +++ b/src/PhpSpreadsheet/Reader/Ods.php @@ -6,6 +6,7 @@ use DOMAttr; use DOMDocument; use DOMElement; use DOMNode; +use DOMText; use PhpOffice\PhpSpreadsheet\Cell\Coordinate; use PhpOffice\PhpSpreadsheet\Cell\DataType; use PhpOffice\PhpSpreadsheet\Helper\Dimension as HelperDimension; @@ -403,8 +404,11 @@ class Ods extends BaseReader } $columnID = 'A'; - /** @var DOMElement $cellData */ + /** @var DOMElement|DOMText $cellData */ foreach ($childNode->childNodes as $cellData) { + if ($cellData instanceof DOMText) { + continue; // should just be whitespace + } if ($this->getReadFilter() !== null) { if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { if ($cellData->hasAttributeNS($tableNs, 'number-columns-repeated')) { @@ -519,7 +523,7 @@ class Ods extends BaseReader break; case 'boolean': $type = DataType::TYPE_BOOL; - $dataValue = ($allCellDataText == 'TRUE') ? true : false; + $dataValue = ($cellData->getAttributeNS($officeNs, 'boolean-value') === 'true') ? true : false; break; case 'percentage': diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php index 1dfd8c0bf..3def4a4dc 100644 --- a/src/PhpSpreadsheet/Writer/Html.php +++ b/src/PhpSpreadsheet/Writer/Html.php @@ -356,7 +356,11 @@ class Html extends BaseWriter $html .= ' ' . PHP_EOL; $html .= ' ' . PHP_EOL; $html .= ' ' . PHP_EOL; - $html .= ' ' . htmlspecialchars($properties->getTitle(), Settings::htmlEntityFlags()) . '' . PHP_EOL; + $title = $properties->getTitle(); + if ($title === '') { + $title = $this->spreadsheet->getActiveSheet()->getTitle(); + } + $html .= ' ' . htmlspecialchars($title, Settings::htmlEntityFlags()) . '' . PHP_EOL; $html .= self::generateMeta($properties->getCreator(), 'author'); $html .= self::generateMeta($properties->getTitle(), 'title'); $html .= self::generateMeta($properties->getDescription(), 'description'); @@ -1463,11 +1467,21 @@ class Html extends BaseWriter $xcssClass['height'] = $height; } //** end of redundant code ** + if ($this->useInlineCss) { + foreach (['border-top', 'border-bottom', 'border-right', 'border-left'] as $borderType) { + if (($xcssClass[$borderType] ?? '') === 'none #000000') { + unset($xcssClass[$borderType]); + } + } + } if ($htmlx) { $xcssClass['position'] = 'relative'; } $html .= ' style="' . $this->assembleCSS($xcssClass) . '"'; + if ($this->useInlineCss) { + $html .= ' class="gridlines gridlinesp"'; + } } $html = $this->generateRowSpans($html, $rowSpan, $colSpan); diff --git a/src/PhpSpreadsheet/Writer/Ods/Content.php b/src/PhpSpreadsheet/Writer/Ods/Content.php index a03d3f039..b40054f07 100644 --- a/src/PhpSpreadsheet/Writer/Ods/Content.php +++ b/src/PhpSpreadsheet/Writer/Ods/Content.php @@ -2,6 +2,7 @@ namespace PhpOffice\PhpSpreadsheet\Writer\Ods; +use PhpOffice\PhpSpreadsheet\Calculation\Calculation; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Cell\Cell; use PhpOffice\PhpSpreadsheet\Cell\Coordinate; @@ -211,8 +212,8 @@ class Content extends WriterPart switch ($cell->getDataType()) { case DataType::TYPE_BOOL: $objWriter->writeAttribute('office:value-type', 'boolean'); - $objWriter->writeAttribute('office:value', $cell->getValueString()); - $objWriter->writeElement('text:p', $cell->getValueString()); + $objWriter->writeAttribute('office:boolean-value', $cell->getValue() ? 'true' : 'false'); + $objWriter->writeElement('text:p', Calculation::getInstance()->getLocaleBoolean($cell->getValue() ? 'TRUE' : 'FALSE')); break; case DataType::TYPE_ERROR: diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php index 59e4ad36f..28a7c0ee8 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php @@ -1602,7 +1602,7 @@ class Worksheet extends WriterPart break; case 's': // String - $this->writeCellString($objWriter, $mappedType, $cellValueString, $flippedStringTable); + $this->writeCellString($objWriter, $mappedType, ($cellValue instanceof RichText) ? $cellValue : $cellValueString, $flippedStringTable); break; case 'f': // Formula diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php index f961c7ac7..978162667 100644 --- a/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php @@ -13,21 +13,15 @@ class CalculationFunctionListTest extends TestCase { private string $compatibilityMode; - private string $locale; - protected function setUp(): void { $this->compatibilityMode = Functions::getCompatibilityMode(); - $calculation = Calculation::getInstance(); - $this->locale = $calculation->getLocale(); Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } protected function tearDown(): void { Functions::setCompatibilityMode($this->compatibilityMode); - $calculation = Calculation::getInstance(); - $calculation->setLocale($this->locale); } /** diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php index 24f9d93cc..4910eb0ba 100644 --- a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php @@ -16,21 +16,15 @@ class CalculationTest extends TestCase { private string $compatibilityMode; - private string $locale; - protected function setUp(): void { $this->compatibilityMode = Functions::getCompatibilityMode(); - $calculation = Calculation::getInstance(); - $this->locale = $calculation->getLocale(); Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } protected function tearDown(): void { Functions::setCompatibilityMode($this->compatibilityMode); - $calculation = Calculation::getInstance(); - $calculation->setLocale($this->locale); } /** diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php index e893fc7f3..3f508405a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php @@ -34,4 +34,37 @@ class IndexOnSpreadsheetTest extends AllSetupTeardown { return require 'tests/data/Calculation/LookupRef/INDEXonSpreadsheet.php'; } + + /** + * @dataProvider providerIndexLiteralArrays + */ + public function testLiteralArrays(mixed $expectedResult, string $indexArgs): void + { + $sheet = $this->getSheet(); + $sheet->getCell('A10')->setValue(10); + $sheet->getCell('B10')->setValue(11); + $sheet->getCell('C10')->setValue(12); + $sheet->getCell('D10')->setValue(13); + $sheet->getCell('X10')->setValue(10); + $sheet->getCell('X11')->setValue(11); + $sheet->getCell('X12')->setValue(12); + $sheet->getCell('X13')->setValue(13); + $sheet->getCell('A1')->setValue("=INDEX($indexArgs)"); + $result = $sheet->getCell('A1')->getCalculatedValue(); + self::assertEquals($expectedResult, $result); + } + + public static function providerIndexLiteralArrays(): array + { + return [ + 'issue 64' => ['Fourth', '{"First","Second","Third","Fourth","Fifth","Sixth","Seventh"}, 4'], + 'issue 64 selecting first "row"' => ['First', '{"First","Second","Third","Fourth","Fifth","Sixth","Seventh"}, 1'], + 'array result condensed to single value' => [40, '{10,11;20,21;30,31;40,41;50,51;60,61},4'], + 'both row and column' => [41, '{10,11;20,21;30,31;40,41;50,51;60,61},4,2'], + '1*1 array' => ['first', '{"first"},1'], + 'array expressed in rows' => [20, '{10;20;30;40},2'], + 'spreadsheet single row' => [11, 'A10:D10,2'], + 'spreadsheet single column' => [13, 'X10:X13,4'], + ]; + } } diff --git a/tests/PhpSpreadsheetTests/Reader/Ods/BooleanDataTest.php b/tests/PhpSpreadsheetTests/Reader/Ods/BooleanDataTest.php new file mode 100644 index 000000000..28efec197 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Reader/Ods/BooleanDataTest.php @@ -0,0 +1,83 @@ +locale = $calculation->getLocale(); + } + + protected function tearDown(): void + { + $calculation = Calculation::getInstance(); + $calculation->setLocale($this->locale); + if ($this->tempfile !== '') { + unlink($this->tempfile); + $this->tempfile = ''; + } + } + + public function testBooleanData(): void + { + $spreadsheetOld = new Spreadsheet(); + $sheetOld = $spreadsheetOld->getActiveSheet(); + $sheetOld->getCell('A1')->setValue(true); + $sheetOld->getCell('A2')->setValue(false); + $writer = new OdsWriter($spreadsheetOld); + $this->tempfile = File::temporaryFileName(); + $writer->save($this->tempfile); + $spreadsheetOld->disconnectWorksheets(); + $reader = new OdsReader(); + $spreadsheet = $reader->load($this->tempfile); + $sheet = $spreadsheet->getActiveSheet(); + self::assertTrue($sheet->getCell('A1')->getValue()); + self::assertFalse($sheet->getCell('A2')->getValue()); + $spreadsheet->disconnectWorksheets(); + $zipFile = 'zip://' . $this->tempfile . '#content.xml'; + $contents = (string) file_get_contents($zipFile); + self::assertStringContainsString('TRUE', $contents); + self::assertStringContainsString('FALSE', $contents); + } + + public function testBooleanDataGerman(): void + { + $calculation = Calculation::getInstance(); + $calculation->setLocale('de'); + $spreadsheetOld = new Spreadsheet(); + $sheetOld = $spreadsheetOld->getActiveSheet(); + $sheetOld->getCell('A1')->setValue(true); + $sheetOld->getCell('A2')->setValue(false); + $writer = new OdsWriter($spreadsheetOld); + $this->tempfile = File::temporaryFileName(); + $writer->save($this->tempfile); + $spreadsheetOld->disconnectWorksheets(); + $reader = new OdsReader(); + $spreadsheet = $reader->load($this->tempfile); + $sheet = $spreadsheet->getActiveSheet(); + self::assertTrue($sheet->getCell('A1')->getValue()); + self::assertFalse($sheet->getCell('A2')->getValue()); + $spreadsheet->disconnectWorksheets(); + $zipFile = 'zip://' . $this->tempfile . '#content.xml'; + $contents = (string) file_get_contents($zipFile); + self::assertStringContainsString('WAHR', $contents); + self::assertStringContainsString('FALSCH', $contents); + self::assertStringNotContainsString('TRUE', $contents); + self::assertStringNotContainsString('FALSE', $contents); + } +} diff --git a/tests/PhpSpreadsheetTests/Reader/Ods/Issue804Test.php b/tests/PhpSpreadsheetTests/Reader/Ods/Issue804Test.php new file mode 100644 index 000000000..afb33dabe --- /dev/null +++ b/tests/PhpSpreadsheetTests/Reader/Ods/Issue804Test.php @@ -0,0 +1,38 @@ + + + Name', $data); + } + } + + public function testIssue2810(): void + { + // Whitespace between Xml nodes + $filename = 'tests/data/Reader/Ods/issue.804.ods'; + $reader = new Ods(); + $spreadsheet = $reader->load($filename); + $sheet = $spreadsheet->getActiveSheet(); + self::assertSame('Straße', $sheet->getCell('G1')->getValue()); + $spreadsheet->disconnectWorksheets(); + } +} diff --git a/tests/PhpSpreadsheetTests/Writer/Html/Issue3678Test.php b/tests/PhpSpreadsheetTests/Writer/Html/Issue3678Test.php index cabcaca8f..e4f292c2d 100644 --- a/tests/PhpSpreadsheetTests/Writer/Html/Issue3678Test.php +++ b/tests/PhpSpreadsheetTests/Writer/Html/Issue3678Test.php @@ -24,7 +24,8 @@ class Issue3678Test extends TestCase ]; $sheet->getStyle('A1')->applyFromArray($styleArray); $style1 = "vertical-align:bottom; border-bottom:none #000000; border-top:none #000000; border-left:none #000000; border-right:none #000000; color:#000000; font-family:'Calibri'; font-size:11pt; background-color:#FFFF00"; - $style2 = $style1 . '; text-align:right; width:42pt'; + $style2 = "vertical-align:bottom; color:#000000; font-family:'Calibri'; font-size:11pt; background-color:#FFFF00"; + $style2 .= '; text-align:right; width:42pt'; $writer = new Html($spreadsheet); $html = $writer->generateHtmlAll(); self::assertStringContainsString('td.style1, th.style1 { ' . $style1 . ' }', $html); @@ -33,7 +34,7 @@ class Issue3678Test extends TestCase self::assertStringContainsString('.n { text-align:right }', $html); $writer->setUseInlineCss(true); $html = $writer->generateHtmlAll(); - self::assertStringContainsString('1', $html); + self::assertStringContainsString('1', $html); $spreadsheet->disconnectWorksheets(); } } diff --git a/tests/PhpSpreadsheetTests/Writer/Html/NoTitleTest.php b/tests/PhpSpreadsheetTests/Writer/Html/NoTitleTest.php new file mode 100644 index 000000000..7faf8a6ad --- /dev/null +++ b/tests/PhpSpreadsheetTests/Writer/Html/NoTitleTest.php @@ -0,0 +1,62 @@ +load($file); + self::assertSame('', $spreadsheet->getProperties()->getTitle()); + + $writer = new Html($spreadsheet); + $writer->setUseInlineCss(true); + $html = $writer->generateHTMLAll(); + self::assertStringContainsString('Sheet1', $html); + self::assertStringContainsString('C1', $html); + $writer->setUseInlineCss(false); + $html = $writer->generateHTMLAll(); + self::assertStringContainsString('C1', $html); + $spreadsheet->disconnectWorksheets(); + } + + public function testHideSomeGridlines(): void + { + $spreadsheet = new Spreadsheet(); + $sheet = $spreadsheet->getActiveSheet(); + $sheet->fromArray( + [ + [1, 2, 3, 4, 5, 6], + [7, 8, 9, 10, 11, 12], + [17, 18, 19, 20, 21, 22], + [27, 28, 29, 30, 31, 32], + [37, 38, 39, 40, 41, 42], + ] + ); + $sheet->getStyle('B2:D4')->getBorders()->applyFromArray( + [ + 'allBorders' => [ + 'borderStyle' => Border::BORDER_NONE, + 'color' => ['rgb' => '808080'], + ], + ], + ); + + $writer = new Html($spreadsheet); + $writer->setUseInlineCss(true); + $html = $writer->generateHTMLAll(); + self::assertStringContainsString('7', $html); + self::assertStringContainsString('19', $html); + $spreadsheet->disconnectWorksheets(); + } +} diff --git a/tests/PhpSpreadsheetTests/Writer/Xlsx/Issue476Test.php b/tests/PhpSpreadsheetTests/Writer/Xlsx/Issue476Test.php new file mode 100644 index 000000000..513fe7940 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Writer/Xlsx/Issue476Test.php @@ -0,0 +1,30 @@ +load('tests/data/Writer/XLSX/issue.476.xlsx'); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, 'Xlsx'); + $spreadsheet->disconnectWorksheets(); + + $sheet = $reloadedSpreadsheet->getActiveSheet(); + $richText = $sheet->getCell('A1')->getValue(); + self::assertInstanceOf(RichText::class, $richText); + $plainText = $richText->getPlainText(); + self::assertSame("Art. 1A of the Geneva Refugee Convention and Protocol or other international or national instruments.\n", $plainText); + + $reloadedSpreadsheet->disconnectWorksheets(); + } +} diff --git a/tests/data/Calculation/LookupRef/INDEXonSpreadsheet.php b/tests/data/Calculation/LookupRef/INDEXonSpreadsheet.php index 76f6ddd46..b2202704d 100644 --- a/tests/data/Calculation/LookupRef/INDEXonSpreadsheet.php +++ b/tests/data/Calculation/LookupRef/INDEXonSpreadsheet.php @@ -82,7 +82,7 @@ return [ 2, ], 'Column number omitted from 2-column matrix' => [ - '#REF!', // Expected + 'abc', // Expected [ ['abc', 'def'], ['xyz', 'tuv'], diff --git a/tests/data/Reader/Ods/issue.804.ods b/tests/data/Reader/Ods/issue.804.ods new file mode 100644 index 000000000..b42de4cf6 Binary files /dev/null and b/tests/data/Reader/Ods/issue.804.ods differ diff --git a/tests/data/Writer/Ods/content-with-data.xml b/tests/data/Writer/Ods/content-with-data.xml index 82c67e746..db7d75a74 100644 --- a/tests/data/Writer/Ods/content-with-data.xml +++ b/tests/data/Writer/Ods/content-with-data.xml @@ -95,11 +95,11 @@ - - 1 + + TRUE - - + + FALSE 1 1 diff --git a/tests/data/Writer/XLSX/issue.476.xlsx b/tests/data/Writer/XLSX/issue.476.xlsx new file mode 100644 index 000000000..f76f2d227 Binary files /dev/null and b/tests/data/Writer/XLSX/issue.476.xlsx differ