Improve ODS Writer

Remove num-columns-repeated and num-rows-repeated as it does not seem to be required (LibreOffice does not add them).
This greatly simplifies the writer and the XML output.
Added some optional attributes to help LibreOffice with cell values caching ("calcext")
This commit is contained in:
Adrien Loison committed 2015-08-31 09:55:17 -07:00
1 parent ef171910b9
commit 156fd29a44
5 files changed
+23 -43

No files matched your search

@@ -114,7 +114,7 @@ class WriterWithStyleTest extends \PHPUnit_Framework_TestCase
$style2 = (new StyleBuilder())
->setFontSize(15)
->setFontColor(Color::RED)
->setFontName('Font')
->setFontName('Cambria')
->build();
$this->writeToODSFileWithMultipleStyles($dataRows, $fileName, [$style, $style2]);
@@ -133,7 +133,7 @@ class WriterWithStyleTest extends \PHPUnit_Framework_TestCase
$customFont2Element = $cellStyleElements[2];
$this->assertFirstChildHasAttributeEquals('15pt', $customFont2Element, 'text-properties', 'fo:font-size');
$this->assertFirstChildHasAttributeEquals('#' . Color::RED, $customFont2Element, 'text-properties', 'fo:color');
$this->assertFirstChildHasAttributeEquals('Font', $customFont2Element, 'text-properties', 'style:font-name');
$this->assertFirstChildHasAttributeEquals('Cambria', $customFont2Element, 'text-properties', 'style:font-name');
}
/**
@@ -114,7 +114,7 @@ class WriterWithStyleTest extends \PHPUnit_Framework_TestCase
$style2 = (new StyleBuilder())
->setFontSize(15)
->setFontColor(Color::RED)
->setFontName('Font')
->setFontName('Cambria')
->build();
$this->writeToXLSXFileWithMultipleStyles($dataRows, $fileName, [$style, $style2]);
@@ -148,7 +148,7 @@ class WriterWithStyleTest extends \PHPUnit_Framework_TestCase
$this->assertChildrenNumEquals(3, $thirdFontElement, 'The font should only have 3 properties.');
$this->assertFirstChildHasAttributeEquals('15', $thirdFontElement, 'sz', 'val');
$this->assertFirstChildHasAttributeEquals(Color::toARGB(Color::RED), $thirdFontElement, 'color', 'rgb');
$this->assertFirstChildHasAttributeEquals('Font', $thirdFontElement, 'name', 'val');
$this->assertFirstChildHasAttributeEquals('Cambria', $thirdFontElement, 'name', 'val');
}
/**