|
|
@@ -240,26 +240,29 @@ func (l *FileSuite) TestMarshalWorkbook(c *C) {
|
|
|
workbook.Sheets.Sheet[0] = xlsxSheet{
|
|
|
Name: "MyFirstSheet",
|
|
|
SheetId: "1",
|
|
|
- Id: "rId1"}
|
|
|
+ Id: "rId1",
|
|
|
+ State: "visible"}
|
|
|
|
|
|
workbook.Sheets.Sheet[1] = xlsxSheet{
|
|
|
Name: "MySecondSheet",
|
|
|
SheetId: "2",
|
|
|
- Id: "rId2"}
|
|
|
+ Id: "rId2",
|
|
|
+ State: "visible"}
|
|
|
|
|
|
expectedWorkbook := `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
|
<fileVersion appName="Go XLSX"></fileVersion>
|
|
|
- <workbookPr date1904="false"></workbookPr>
|
|
|
+ <workbookPr showObjects="all" date1904="false"></workbookPr>
|
|
|
+ <workbookProtection></workbookProtection>
|
|
|
<bookViews>
|
|
|
- <workbookView></workbookView>
|
|
|
+ <workbookView showHorizontalScroll="true" showVerticalScroll="true" showSheetTabs="true" tabRatio="204" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"></workbookView>
|
|
|
</bookViews>
|
|
|
<sheets>
|
|
|
- <sheet name="MyFirstSheet" sheetId="1" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId1"></sheet>
|
|
|
- <sheet name="MySecondSheet" sheetId="2" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId2"></sheet>
|
|
|
+ <sheet name="MyFirstSheet" sheetId="1" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId1" state="visible"></sheet>
|
|
|
+ <sheet name="MySecondSheet" sheetId="2" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId2" state="visible"></sheet>
|
|
|
</sheets>
|
|
|
<definedNames></definedNames>
|
|
|
- <calcPr></calcPr>
|
|
|
+ <calcPr iterateCount="100" refMode="A1" iterateDelta="0.001"></calcPr>
|
|
|
</workbook>`
|
|
|
output, err := xml.MarshalIndent(workbook, " ", " ")
|
|
|
c.Assert(err, IsNil)
|
|
|
@@ -715,16 +718,17 @@ func (l *FileSuite) TestMarshalFile(c *C) {
|
|
|
expectedWorkbook := `<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
|
<fileVersion appName="Go XLSX"></fileVersion>
|
|
|
- <workbookPr date1904="false"></workbookPr>
|
|
|
+ <workbookPr showObjects="all" date1904="false"></workbookPr>
|
|
|
+ <workbookProtection></workbookProtection>
|
|
|
<bookViews>
|
|
|
- <workbookView></workbookView>
|
|
|
+ <workbookView showHorizontalScroll="true" showVerticalScroll="true" showSheetTabs="true" tabRatio="204" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"></workbookView>
|
|
|
</bookViews>
|
|
|
<sheets>
|
|
|
- <sheet name="MySheet" sheetId="1" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId1"></sheet>
|
|
|
- <sheet name="AnotherSheet" sheetId="2" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId2"></sheet>
|
|
|
+ <sheet name="MySheet" sheetId="1" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId1" state="visible"></sheet>
|
|
|
+ <sheet name="AnotherSheet" sheetId="2" xmlns:relationships="http://schemas.openxmlformats.org/officeDocument/2006/relationships" relationships:id="rId2" state="visible"></sheet>
|
|
|
</sheets>
|
|
|
<definedNames></definedNames>
|
|
|
- <calcPr></calcPr>
|
|
|
+ <calcPr iterateCount="100" refMode="A1" iterateDelta="0.001"></calcPr>
|
|
|
</workbook>`
|
|
|
c.Assert(parts["xl/workbook.xml"], Equals, expectedWorkbook)
|
|
|
|