lib_test.go 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702
  1. package xlsx
  2. import (
  3. "bytes"
  4. "encoding/xml"
  5. "os"
  6. "strings"
  7. "testing"
  8. . "gopkg.in/check.v1"
  9. )
  10. type LibSuite struct{}
  11. var _ = Suite(&LibSuite{})
  12. // Attempting to open a file without workbook.xml.rels returns an error.
  13. func (l *LibSuite) TestReadZipReaderWithFileWithNoWorkbookRels(c *C) {
  14. _, err := OpenFile("./testdocs/badfile_noWorkbookRels.xlsx")
  15. c.Assert(err, NotNil)
  16. c.Assert(err.Error(), Equals, "xl/_rels/workbook.xml.rels not found in input xlsx.")
  17. }
  18. // Attempting to open a file with no worksheets returns an error.
  19. func (l *LibSuite) TestReadZipReaderWithFileWithNoWorksheets(c *C) {
  20. _, err := OpenFile("./testdocs/badfile_noWorksheets.xlsx")
  21. c.Assert(err, NotNil)
  22. c.Assert(err.Error(), Equals, "Input xlsx contains no worksheets.")
  23. }
  24. // Attempt to read data from a file with inlined string sheet data.
  25. func (l *LibSuite) TestReadWithInlineStrings(c *C) {
  26. var xlsxFile *File
  27. var err error
  28. xlsxFile, err = OpenFile("./testdocs/inlineStrings.xlsx")
  29. c.Assert(err, IsNil)
  30. sheet := xlsxFile.Sheets[0]
  31. r1 := sheet.Rows[0]
  32. c1 := r1.Cells[1]
  33. val, err := c1.FormattedValue()
  34. if err != nil {
  35. c.Error(err)
  36. return
  37. }
  38. if val == "" {
  39. c.Error("Expected a string value")
  40. return
  41. }
  42. c.Assert(val, Equals, "HL Retail - North America - Activity by Day - MTD")
  43. }
  44. // which they are contained from the XLSX file, even when the
  45. // worksheet files have arbitrary, non-numeric names.
  46. func (l *LibSuite) TestReadWorkbookRelationsFromZipFileWithFunnyNames(c *C) {
  47. var xlsxFile *File
  48. var err error
  49. xlsxFile, err = OpenFile("./testdocs/testrels.xlsx")
  50. c.Assert(err, IsNil)
  51. bob := xlsxFile.Sheet["Bob"]
  52. row1 := bob.Rows[0]
  53. cell1 := row1.Cells[0]
  54. if val, err := cell1.FormattedValue(); err != nil {
  55. c.Error(err)
  56. } else {
  57. c.Assert(val, Equals, "I am Bob")
  58. }
  59. }
  60. // We can marshal WorkBookRels to an xml file
  61. func (l *LibSuite) TestWorkBookRelsMarshal(c *C) {
  62. var rels WorkBookRels = make(WorkBookRels)
  63. rels["rId1"] = "worksheets/sheet.xml"
  64. expectedXML := `<?xml version="1.0" encoding="UTF-8"?>
  65. <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Target="worksheets/sheet.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"></Relationship><Relationship Id="rId2" Target="sharedStrings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"></Relationship><Relationship Id="rId3" Target="theme/theme1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"></Relationship><Relationship Id="rId4" Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"></Relationship></Relationships>`
  66. xRels := rels.MakeXLSXWorkbookRels()
  67. output := bytes.NewBufferString(xml.Header)
  68. body, err := xml.Marshal(xRels)
  69. c.Assert(err, IsNil)
  70. c.Assert(body, NotNil)
  71. _, err = output.Write(body)
  72. c.Assert(err, IsNil)
  73. c.Assert(output.String(), Equals, expectedXML)
  74. }
  75. // Excel column codes are a special form of base26 that doesn't allow
  76. // zeros, except in the least significant part of the code. Test we
  77. // can smoosh the numbers in a normal base26 representation (presented
  78. // as a slice of integers) down to this form.
  79. func (l *LibSuite) TestSmooshBase26Slice(c *C) {
  80. input := []int{20, 0, 1}
  81. expected := []int{19, 26, 1}
  82. c.Assert(smooshBase26Slice(input), DeepEquals, expected)
  83. }
  84. // formatColumnName converts slices of base26 integers to alphabetical
  85. // column names. Note that the least signifcant character has a
  86. // different numeric offset (Yuck!)
  87. func (l *LibSuite) TestFormatColumnName(c *C) {
  88. c.Assert(formatColumnName([]int{0}), Equals, "A")
  89. c.Assert(formatColumnName([]int{25}), Equals, "Z")
  90. c.Assert(formatColumnName([]int{1, 25}), Equals, "AZ")
  91. c.Assert(formatColumnName([]int{26, 25}), Equals, "ZZ")
  92. c.Assert(formatColumnName([]int{26, 26, 25}), Equals, "ZZZ")
  93. }
  94. // getLargestDenominator returns the largest power of a provided value
  95. // that can fit within a given value.
  96. func (l *LibSuite) TestGetLargestDenominator(c *C) {
  97. d, p := getLargestDenominator(0, 1, 2, 0)
  98. c.Assert(d, Equals, 1)
  99. c.Assert(p, Equals, 0)
  100. d, p = getLargestDenominator(1, 1, 2, 0)
  101. c.Assert(d, Equals, 1)
  102. c.Assert(p, Equals, 0)
  103. d, p = getLargestDenominator(2, 1, 2, 0)
  104. c.Assert(d, Equals, 2)
  105. c.Assert(p, Equals, 1)
  106. d, p = getLargestDenominator(4, 1, 2, 0)
  107. c.Assert(d, Equals, 4)
  108. c.Assert(p, Equals, 2)
  109. d, p = getLargestDenominator(8, 1, 2, 0)
  110. c.Assert(d, Equals, 8)
  111. c.Assert(p, Equals, 3)
  112. d, p = getLargestDenominator(9, 1, 2, 0)
  113. c.Assert(d, Equals, 8)
  114. c.Assert(p, Equals, 3)
  115. d, p = getLargestDenominator(15, 1, 2, 0)
  116. c.Assert(d, Equals, 8)
  117. c.Assert(p, Equals, 3)
  118. d, p = getLargestDenominator(16, 1, 2, 0)
  119. c.Assert(d, Equals, 16)
  120. c.Assert(p, Equals, 4)
  121. }
  122. func (l *LibSuite) TestLettersToNumeric(c *C) {
  123. cases := map[string]int{"A": 0, "G": 6, "z": 25, "AA": 26, "Az": 51,
  124. "BA": 52, "BZ": 77, "ZA": 26*26 + 0, "ZZ": 26*26 + 25,
  125. "AAA": 26*26 + 26 + 0, "AMI": 1022}
  126. for input, ans := range cases {
  127. output := ColLettersToIndex(input)
  128. c.Assert(output, Equals, ans)
  129. }
  130. }
  131. func (l *LibSuite) TestNumericToLetters(c *C) {
  132. cases := map[string]int{
  133. "A": 0,
  134. "G": 6,
  135. "Z": 25,
  136. "AA": 26,
  137. "AZ": 51,
  138. "BA": 52,
  139. "BZ": 77, "ZA": 26 * 26, "ZB": 26*26 + 1,
  140. "ZZ": 26*26 + 25,
  141. "AAA": 26*26 + 26 + 0, "AMI": 1022}
  142. for ans, input := range cases {
  143. output := ColIndexToLetters(input)
  144. c.Assert(output, Equals, ans)
  145. }
  146. }
  147. func (l *LibSuite) TestLetterOnlyMapFunction(c *C) {
  148. var input string = "ABC123"
  149. var output string = strings.Map(letterOnlyMapF, input)
  150. c.Assert(output, Equals, "ABC")
  151. input = "abc123"
  152. output = strings.Map(letterOnlyMapF, input)
  153. c.Assert(output, Equals, "ABC")
  154. }
  155. func (l *LibSuite) TestIntOnlyMapFunction(c *C) {
  156. var input string = "ABC123"
  157. var output string = strings.Map(intOnlyMapF, input)
  158. c.Assert(output, Equals, "123")
  159. }
  160. func (l *LibSuite) TestGetCoordsFromCellIDString(c *C) {
  161. var cellIDString string = "A3"
  162. var x, y int
  163. var err error
  164. x, y, err = GetCoordsFromCellIDString(cellIDString)
  165. c.Assert(err, IsNil)
  166. c.Assert(x, Equals, 0)
  167. c.Assert(y, Equals, 2)
  168. }
  169. func (l *LibSuite) TestGetCellIDStringFromCoords(c *C) {
  170. c.Assert(GetCellIDStringFromCoords(0, 0), Equals, "A1")
  171. c.Assert(GetCellIDStringFromCoords(2, 2), Equals, "C3")
  172. }
  173. func (l *LibSuite) TestGetMaxMinFromDimensionRef(c *C) {
  174. var dimensionRef string = "A1:B2"
  175. var minx, miny, maxx, maxy int
  176. var err error
  177. minx, miny, maxx, maxy, err = getMaxMinFromDimensionRef(dimensionRef)
  178. c.Assert(err, IsNil)
  179. c.Assert(minx, Equals, 0)
  180. c.Assert(miny, Equals, 0)
  181. c.Assert(maxx, Equals, 1)
  182. c.Assert(maxy, Equals, 1)
  183. }
  184. func (l *LibSuite) TestCalculateMaxMinFromWorksheet(c *C) {
  185. var sheetxml = bytes.NewBufferString(`
  186. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  187. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  188. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
  189. xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main"
  190. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  191. xmlns:mv="urn:schemas-microsoft-com:mac:vml"
  192. xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
  193. xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
  194. xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
  195. <sheetViews>
  196. <sheetView workbookViewId="0"/>
  197. </sheetViews>
  198. <sheetFormatPr customHeight="1" defaultColWidth="14.43" defaultRowHeight="15.75"/>
  199. <sheetData>
  200. <row r="1">
  201. <c t="s" s="1" r="A1">
  202. <v>0</v>
  203. </c>
  204. <c t="s" s="1" r="B1">
  205. <v>1</v>
  206. </c>
  207. </row>
  208. <row r="2">
  209. <c t="s" s="1" r="A2">
  210. <v>2</v>
  211. </c>
  212. <c t="s" s="1" r="B2">
  213. <v>3</v>
  214. </c>
  215. </row>
  216. </sheetData>
  217. <drawing r:id="rId1"/>
  218. </worksheet>`)
  219. worksheet := new(xlsxWorksheet)
  220. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  221. c.Assert(err, IsNil)
  222. minx, miny, maxx, maxy, err := calculateMaxMinFromWorksheet(worksheet)
  223. c.Assert(err, IsNil)
  224. c.Assert(minx, Equals, 0)
  225. c.Assert(miny, Equals, 0)
  226. c.Assert(maxx, Equals, 1)
  227. c.Assert(maxy, Equals, 1)
  228. }
  229. func (l *LibSuite) TestGetRangeFromString(c *C) {
  230. var rangeString string
  231. var lower, upper int
  232. var err error
  233. rangeString = "1:3"
  234. lower, upper, err = getRangeFromString(rangeString)
  235. c.Assert(err, IsNil)
  236. c.Assert(lower, Equals, 1)
  237. c.Assert(upper, Equals, 3)
  238. }
  239. func (l *LibSuite) TestMakeRowFromSpan(c *C) {
  240. var rangeString string
  241. var row *Row
  242. var length int
  243. var sheet *Sheet
  244. sheet = new(Sheet)
  245. rangeString = "1:3"
  246. row = makeRowFromSpan(rangeString, sheet)
  247. length = len(row.Cells)
  248. c.Assert(length, Equals, 3)
  249. c.Assert(row.Sheet, Equals, sheet)
  250. rangeString = "5:7" // Note - we ignore lower bound!
  251. row = makeRowFromSpan(rangeString, sheet)
  252. length = len(row.Cells)
  253. c.Assert(length, Equals, 7)
  254. c.Assert(row.Sheet, Equals, sheet)
  255. rangeString = "1:1"
  256. row = makeRowFromSpan(rangeString, sheet)
  257. length = len(row.Cells)
  258. c.Assert(length, Equals, 1)
  259. c.Assert(row.Sheet, Equals, sheet)
  260. }
  261. func (l *LibSuite) TestReadRowsFromSheet(c *C) {
  262. var sharedstringsXML = bytes.NewBufferString(`
  263. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  264. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="4" uniqueCount="4">
  265. <si>
  266. <t>Foo</t>
  267. </si>
  268. <si>
  269. <t>Bar</t>
  270. </si>
  271. <si>
  272. <t xml:space="preserve">Baz </t>
  273. </si>
  274. <si>
  275. <t>Quuk</t>
  276. </si>
  277. </sst>`)
  278. var sheetxml = bytes.NewBufferString(`
  279. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  280. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  281. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  282. <dimension ref="A1:B2"/>
  283. <sheetViews>
  284. <sheetView tabSelected="1" workbookViewId="0">
  285. <selection activeCell="C2" sqref="C2"/>
  286. <pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/>
  287. </sheetView>
  288. </sheetViews>
  289. <sheetFormatPr baseColWidth="10" defaultRowHeight="15"/>
  290. <sheetData>
  291. <row r="1" spans="1:2" ht="123.45" customHeight="1">
  292. <c r="A1" t="s">
  293. <v>0</v>
  294. </c>
  295. <c r="B1" t="s">
  296. <v>1</v>
  297. </c>
  298. </row>
  299. <row r="2" spans="1:2">
  300. <c r="A2" t="s">
  301. <v>2</v>
  302. </c>
  303. <c r="B2" t="s">
  304. <v>3</v>
  305. </c>
  306. </row>
  307. </sheetData>
  308. <pageMargins left="0.7" right="0.7"
  309. top="0.78740157499999996"
  310. bottom="0.78740157499999996"
  311. header="0.3"
  312. footer="0.3"/>
  313. </worksheet>`)
  314. worksheet := new(xlsxWorksheet)
  315. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  316. c.Assert(err, IsNil)
  317. sst := new(xlsxSST)
  318. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  319. c.Assert(err, IsNil)
  320. file := new(File)
  321. file.referenceTable = MakeSharedStringRefTable(sst)
  322. sheet := new(Sheet)
  323. rows, cols, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  324. c.Assert(maxRows, Equals, 2)
  325. c.Assert(maxCols, Equals, 2)
  326. row := rows[0]
  327. c.Assert(row.Sheet, Equals, sheet)
  328. c.Assert(len(row.Cells), Equals, 2)
  329. c.Assert(row.Height, Equals, 123.45)
  330. c.Assert(row.isCustom, Equals, true)
  331. cell1 := row.Cells[0]
  332. c.Assert(cell1.Value, Equals, "Foo")
  333. cell2 := row.Cells[1]
  334. c.Assert(cell2.Value, Equals, "Bar")
  335. col := cols[0]
  336. c.Assert(col.Min, Equals, 0)
  337. c.Assert(col.Max, Equals, 0)
  338. c.Assert(col.Hidden, Equals, false)
  339. c.Assert(len(worksheet.SheetViews.SheetView), Equals, 1)
  340. sheetView := worksheet.SheetViews.SheetView[0]
  341. c.Assert(sheetView.Pane, NotNil)
  342. pane := sheetView.Pane
  343. c.Assert(pane.XSplit, Equals, 0.0)
  344. c.Assert(pane.YSplit, Equals, 1.0)
  345. }
  346. func (l *LibSuite) TestReadRowsFromSheetWithMergeCells(c *C) {
  347. var sharedstringsXML = bytes.NewBufferString(`
  348. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  349. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="3" uniqueCount="3">
  350. <si>
  351. <t>Value A</t>
  352. </si>
  353. <si>
  354. <t>Value B</t>
  355. </si>
  356. <si>
  357. <t>Value C</t>
  358. </si>
  359. </sst>
  360. `)
  361. var sheetxml = bytes.NewBufferString(`
  362. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  363. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
  364. <sheetViews>
  365. <sheetView workbookViewId="0"/>
  366. </sheetViews>
  367. <sheetFormatPr customHeight="1" defaultColWidth="17.29" defaultRowHeight="15.0"/>
  368. <cols>
  369. <col customWidth="1" min="1" max="6" width="14.43"/>
  370. </cols>
  371. <sheetData>
  372. <row r="1" ht="15.75" customHeight="1">
  373. <c r="A1" s="1" t="s">
  374. <v>0</v>
  375. </c>
  376. </row>
  377. <row r="2" ht="15.75" customHeight="1">
  378. <c r="A2" s="1" t="s">
  379. <v>1</v>
  380. </c>
  381. <c r="B2" s="1" t="s">
  382. <v>2</v>
  383. </c>
  384. </row>
  385. </sheetData>
  386. <mergeCells count="1">
  387. <mergeCell ref="A1:B1"/>
  388. </mergeCells>
  389. <drawing r:id="rId1"/>
  390. </worksheet>`)
  391. worksheet := new(xlsxWorksheet)
  392. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  393. c.Assert(err, IsNil)
  394. sst := new(xlsxSST)
  395. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  396. c.Assert(err, IsNil)
  397. file := new(File)
  398. file.referenceTable = MakeSharedStringRefTable(sst)
  399. sheet := new(Sheet)
  400. rows, _, _, _ := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  401. row := rows[0] //
  402. cell1 := row.Cells[0]
  403. c.Assert(cell1.HMerge, Equals, 1)
  404. c.Assert(cell1.VMerge, Equals, 0)
  405. }
  406. // An invalid value in the "r" attribute in a <row> was causing a panic
  407. // in readRowsFromSheet. This test is a copy of TestReadRowsFromSheet,
  408. // with the important difference of the value 1048576 below in <row r="1048576", which is
  409. // higher than the number of rows in the sheet. That number itself isn't significant;
  410. // it just happens to be the value found to trigger the error in a user's file.
  411. func (l *LibSuite) TestReadRowsFromSheetBadR(c *C) {
  412. var sharedstringsXML = bytes.NewBufferString(`
  413. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  414. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="4" uniqueCount="4">
  415. <si>
  416. <t>Foo</t>
  417. </si>
  418. <si>
  419. <t>Bar</t>
  420. </si>
  421. <si>
  422. <t xml:space="preserve">Baz </t>
  423. </si>
  424. <si>
  425. <t>Quuk</t>
  426. </si>
  427. </sst>`)
  428. var sheetxml = bytes.NewBufferString(`
  429. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  430. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  431. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  432. <dimension ref="A1:B2"/>
  433. <sheetViews>
  434. <sheetView tabSelected="1" workbookViewId="0">
  435. <selection activeCell="C2" sqref="C2"/>
  436. <pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/>
  437. </sheetView>
  438. </sheetViews>
  439. <sheetFormatPr baseColWidth="10" defaultRowHeight="15"/>
  440. <sheetData>
  441. <row r="1" spans="1:2">
  442. <c r="A1" t="s">
  443. <v>0</v>
  444. </c>
  445. <c r="B1" t="s">
  446. <v>1</v>
  447. </c>
  448. </row>
  449. <row r="1048576" spans="1:2">
  450. <c r="A2" t="s">
  451. <v>2</v>
  452. </c>
  453. <c r="B2" t="s">
  454. <v>3</v>
  455. </c>
  456. </row>
  457. </sheetData>
  458. <pageMargins left="0.7" right="0.7"
  459. top="0.78740157499999996"
  460. bottom="0.78740157499999996"
  461. header="0.3"
  462. footer="0.3"/>
  463. </worksheet>`)
  464. worksheet := new(xlsxWorksheet)
  465. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  466. c.Assert(err, IsNil)
  467. sst := new(xlsxSST)
  468. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  469. c.Assert(err, IsNil)
  470. file := new(File)
  471. file.referenceTable = MakeSharedStringRefTable(sst)
  472. sheet := new(Sheet)
  473. // Discarding all return values; this test is a regression for
  474. // a panic due to an "index out of range."
  475. readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  476. }
  477. func (l *LibSuite) TestReadRowsFromSheetWithLeadingEmptyRows(c *C) {
  478. var sharedstringsXML = bytes.NewBufferString(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  479. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="2" uniqueCount="2"><si><t>ABC</t></si><si><t>DEF</t></si></sst>`)
  480. var sheetxml = bytes.NewBufferString(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  481. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
  482. <dimension ref="A4:A5"/>
  483. <sheetViews>
  484. <sheetView tabSelected="1" workbookViewId="0">
  485. <selection activeCell="A2" sqref="A2"/>
  486. </sheetView>
  487. </sheetViews>
  488. <sheetFormatPr baseColWidth="10" defaultRowHeight="15" x14ac:dyDescent="0"/>
  489. <sheetData>
  490. <row r="4" spans="1:1">
  491. <c r="A4" t="s">
  492. <v>0</v>
  493. </c>
  494. </row>
  495. <row r="5" spans="1:1">
  496. <c r="A5" t="s">
  497. <v>1</v>
  498. </c>
  499. </row>
  500. </sheetData>
  501. <pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5"/>
  502. <pageSetup paperSize="9" orientation="portrait" horizontalDpi="4294967292" verticalDpi="4294967292"/>
  503. <extLst>
  504. <ext uri="{64002731-A6B0-56B0-2670-7721B7C09600}" xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main">
  505. <mx:PLV Mode="0" OnePage="0" WScale="0"/>
  506. </ext>
  507. </extLst>
  508. </worksheet>
  509. `)
  510. worksheet := new(xlsxWorksheet)
  511. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  512. c.Assert(err, IsNil)
  513. sst := new(xlsxSST)
  514. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  515. c.Assert(err, IsNil)
  516. file := new(File)
  517. file.referenceTable = MakeSharedStringRefTable(sst)
  518. sheet := new(Sheet)
  519. rows, _, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  520. c.Assert(maxRows, Equals, 5)
  521. c.Assert(maxCols, Equals, 1)
  522. c.Assert(len(rows[0].Cells), Equals, 0)
  523. c.Assert(len(rows[1].Cells), Equals, 0)
  524. c.Assert(len(rows[2].Cells), Equals, 0)
  525. c.Assert(len(rows[3].Cells), Equals, 1)
  526. if val, err := rows[3].Cells[0].FormattedValue(); err != nil {
  527. c.Error(err)
  528. } else {
  529. c.Assert(val, Equals, "ABC")
  530. }
  531. c.Assert(len(rows[4].Cells), Equals, 1)
  532. if val, err := rows[4].Cells[0].FormattedValue(); err != nil {
  533. c.Error(err)
  534. } else {
  535. c.Assert(val, Equals, "DEF")
  536. }
  537. }
  538. func (l *LibSuite) TestReadRowsFromSheetWithLeadingEmptyCols(c *C) {
  539. var sharedstringsXML = bytes.NewBufferString(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  540. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="2" uniqueCount="2"><si><t>ABC</t></si><si><t>DEF</t></si></sst>`)
  541. var sheetxml = bytes.NewBufferString(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  542. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
  543. <dimension ref="C1:D2"/>
  544. <sheetViews>
  545. <sheetView tabSelected="1" workbookViewId="0">
  546. <selection activeCell="A2" sqref="A2"/>
  547. </sheetView>
  548. </sheetViews>
  549. <sheetFormatPr baseColWidth="10" defaultRowHeight="15" x14ac:dyDescent="0"/>
  550. <cols>
  551. <col min="3" max="3" width="17" customWidth="1"/>
  552. <col min="4" max="4" width="18" customWidth="1"/>
  553. </cols>
  554. <sheetData>
  555. <row r="1" spans="3:4">
  556. <c r="C1" t="s"><v>0</v></c>
  557. <c r="D1" t="s"><v>1</v></c>
  558. </row>
  559. <row r="2" spans="3:4">
  560. <c r="C2" t="s"><v>0</v></c>
  561. <c r="D2" t="s"><v>1</v></c>
  562. </row>
  563. </sheetData>
  564. <pageMargins left="0.75" right="0.75" top="1" bottom="1" header="0.5" footer="0.5"/>
  565. <pageSetup paperSize="9" orientation="portrait" horizontalDpi="4294967292" verticalDpi="4294967292"/>
  566. <extLst>
  567. <ext uri="{64002731-A6B0-56B0-2670-7721B7C09600}" xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main">
  568. <mx:PLV Mode="0" OnePage="0" WScale="0"/>
  569. </ext>
  570. </extLst>
  571. </worksheet>
  572. `)
  573. worksheet := new(xlsxWorksheet)
  574. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  575. c.Assert(err, IsNil)
  576. sst := new(xlsxSST)
  577. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  578. c.Assert(err, IsNil)
  579. file := new(File)
  580. file.referenceTable = MakeSharedStringRefTable(sst)
  581. sheet := new(Sheet)
  582. rows, cols, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  583. c.Assert(maxRows, Equals, 2)
  584. c.Assert(maxCols, Equals, 4)
  585. c.Assert(len(rows[0].Cells), Equals, 4)
  586. if val, err := rows[0].Cells[0].FormattedValue(); err != nil {
  587. c.Error(err)
  588. } else {
  589. c.Assert(val, Equals, "")
  590. }
  591. if val, err := rows[0].Cells[1].FormattedValue(); err != nil {
  592. c.Error(err)
  593. } else {
  594. c.Assert(val, Equals, "")
  595. }
  596. if val, err := rows[0].Cells[2].FormattedValue(); err != nil {
  597. c.Error(err)
  598. } else {
  599. c.Assert(val, Equals, "ABC")
  600. }
  601. if val, err := rows[0].Cells[3].FormattedValue(); err != nil {
  602. c.Error(err)
  603. } else {
  604. c.Assert(val, Equals, "DEF")
  605. }
  606. c.Assert(len(rows[1].Cells), Equals, 4)
  607. if val, err := rows[1].Cells[0].FormattedValue(); err != nil {
  608. c.Error(err)
  609. } else {
  610. c.Assert(val, Equals, "")
  611. }
  612. if val, err := rows[1].Cells[1].FormattedValue(); err != nil {
  613. c.Error(err)
  614. } else {
  615. c.Assert(val, Equals, "")
  616. }
  617. if val, err := rows[1].Cells[2].FormattedValue(); err != nil {
  618. c.Error(err)
  619. } else {
  620. c.Assert(val, Equals, "ABC")
  621. }
  622. if val, err := rows[1].Cells[3].FormattedValue(); err != nil {
  623. c.Error(err)
  624. } else {
  625. c.Assert(val, Equals, "DEF")
  626. }
  627. c.Assert(len(cols), Equals, 4)
  628. c.Assert(cols[0].Width, Equals, 0.0)
  629. c.Assert(cols[1].Width, Equals, 0.0)
  630. c.Assert(cols[2].Width, Equals, 17.0)
  631. c.Assert(cols[3].Width, Equals, 18.0)
  632. }
  633. func (l *LibSuite) TestReadRowsFromSheetWithEmptyCells(c *C) {
  634. var sharedstringsXML = bytes.NewBufferString(`
  635. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  636. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="8" uniqueCount="5">
  637. <si>
  638. <t>Bob</t>
  639. </si>
  640. <si>
  641. <t>Alice</t>
  642. </si>
  643. <si>
  644. <t>Sue</t>
  645. </si>
  646. <si>
  647. <t>Yes</t>
  648. </si>
  649. <si>
  650. <t>No</t>
  651. </si>
  652. </sst>
  653. `)
  654. var sheetxml = bytes.NewBufferString(`
  655. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  656. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><dimension ref="A1:C3"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"><selection activeCell="D3" sqref="D3"/></sheetView></sheetViews><sheetFormatPr baseColWidth="10" defaultRowHeight="15"/>
  657. <sheetData>
  658. <row r="1" spans="1:3">
  659. <c r="A1" t="s">
  660. <v>
  661. 0
  662. </v>
  663. </c>
  664. <c r="B1" t="s">
  665. <v>
  666. 1
  667. </v>
  668. </c>
  669. <c r="C1" t="s">
  670. <v>
  671. 2
  672. </v>
  673. </c>
  674. </row>
  675. <row r="2" spans="1:3">
  676. <c r="A2" t="s">
  677. <v>
  678. 3
  679. </v>
  680. </c>
  681. <c r="B2" t="s">
  682. <v>
  683. 4
  684. </v>
  685. </c>
  686. <c r="C2" t="s">
  687. <v>
  688. 3
  689. </v>
  690. </c>
  691. </row>
  692. <row r="3" spans="1:3">
  693. <c r="A3" t="s">
  694. <v>
  695. 4
  696. </v>
  697. </c>
  698. <c r="C3" t="s">
  699. <v>
  700. 3
  701. </v>
  702. </c>
  703. </row>
  704. </sheetData>
  705. <pageMargins left="0.7" right="0.7" top="0.78740157499999996" bottom="0.78740157499999996" header="0.3" footer="0.3"/>
  706. </worksheet>
  707. `)
  708. worksheet := new(xlsxWorksheet)
  709. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  710. c.Assert(err, IsNil)
  711. sst := new(xlsxSST)
  712. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  713. c.Assert(err, IsNil)
  714. file := new(File)
  715. file.referenceTable = MakeSharedStringRefTable(sst)
  716. sheet := new(Sheet)
  717. rows, cols, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  718. c.Assert(maxRows, Equals, 3)
  719. c.Assert(maxCols, Equals, 3)
  720. row := rows[2]
  721. c.Assert(row.Sheet, Equals, sheet)
  722. c.Assert(len(row.Cells), Equals, 3)
  723. cell1 := row.Cells[0]
  724. c.Assert(cell1.Value, Equals, "No")
  725. cell2 := row.Cells[1]
  726. c.Assert(cell2.Value, Equals, "")
  727. cell3 := row.Cells[2]
  728. c.Assert(cell3.Value, Equals, "Yes")
  729. col := cols[0]
  730. c.Assert(col.Min, Equals, 0)
  731. c.Assert(col.Max, Equals, 0)
  732. c.Assert(col.Hidden, Equals, false)
  733. }
  734. func (l *LibSuite) TestReadRowsFromSheetWithTrailingEmptyCells(c *C) {
  735. var row *Row
  736. var cell1, cell2, cell3, cell4 *Cell
  737. var sharedstringsXML = bytes.NewBufferString(`
  738. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  739. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="4" uniqueCount="4"><si><t>A</t></si><si><t>B</t></si><si><t>C</t></si><si><t>D</t></si></sst>`)
  740. var sheetxml = bytes.NewBufferString(`
  741. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  742. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><dimension ref="A1:D8"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"><selection activeCell="A7" sqref="A7"/></sheetView></sheetViews><sheetFormatPr baseColWidth="10" defaultRowHeight="15"/><sheetData><row r="1" spans="1:4"><c r="A1" t="s"><v>0</v></c><c r="B1" t="s"><v>1</v></c><c r="C1" t="s"><v>2</v></c><c r="D1" t="s"><v>3</v></c></row><row r="2" spans="1:4"><c r="A2"><v>1</v></c></row><row r="3" spans="1:4"><c r="B3"><v>1</v></c></row><row r="4" spans="1:4"><c r="C4"><v>1</v></c></row><row r="5" spans="1:4"><c r="D5"><v>1</v></c></row><row r="6" spans="1:4"><c r="C6"><v>1</v></c></row><row r="7" spans="1:4"><c r="B7"><v>1</v></c></row><row r="8" spans="1:4"><c r="A8"><v>1</v></c></row></sheetData><pageMargins left="0.7" right="0.7" top="0.78740157499999996" bottom="0.78740157499999996" header="0.3" footer="0.3"/></worksheet>
  743. `)
  744. worksheet := new(xlsxWorksheet)
  745. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  746. c.Assert(err, IsNil)
  747. sst := new(xlsxSST)
  748. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  749. c.Assert(err, IsNil)
  750. file := new(File)
  751. file.referenceTable = MakeSharedStringRefTable(sst)
  752. sheet := new(Sheet)
  753. rows, _, maxCol, maxRow := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  754. c.Assert(maxCol, Equals, 4)
  755. c.Assert(maxRow, Equals, 8)
  756. row = rows[0]
  757. c.Assert(row.Sheet, Equals, sheet)
  758. c.Assert(len(row.Cells), Equals, 4)
  759. cell1 = row.Cells[0]
  760. c.Assert(cell1.Value, Equals, "A")
  761. cell2 = row.Cells[1]
  762. c.Assert(cell2.Value, Equals, "B")
  763. cell3 = row.Cells[2]
  764. c.Assert(cell3.Value, Equals, "C")
  765. cell4 = row.Cells[3]
  766. c.Assert(cell4.Value, Equals, "D")
  767. row = rows[1]
  768. c.Assert(row.Sheet, Equals, sheet)
  769. c.Assert(len(row.Cells), Equals, 4)
  770. cell1 = row.Cells[0]
  771. c.Assert(cell1.Value, Equals, "1")
  772. cell2 = row.Cells[1]
  773. c.Assert(cell2.Value, Equals, "")
  774. cell3 = row.Cells[2]
  775. c.Assert(cell3.Value, Equals, "")
  776. cell4 = row.Cells[3]
  777. c.Assert(cell4.Value, Equals, "")
  778. }
  779. func (l *LibSuite) TestReadRowsFromSheetWithMultipleSpans(c *C) {
  780. var sharedstringsXML = bytes.NewBufferString(`
  781. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  782. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="4" uniqueCount="4">
  783. <si>
  784. <t>Foo</t>
  785. </si>
  786. <si>
  787. <t>Bar</t>
  788. </si>
  789. <si>
  790. <t xml:space="preserve">Baz </t>
  791. </si>
  792. <si>
  793. <t>Quuk</t>
  794. </si>
  795. </sst>`)
  796. var sheetxml = bytes.NewBufferString(`
  797. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  798. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  799. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  800. <dimension ref="A1:D2"/>
  801. <sheetViews>
  802. <sheetView tabSelected="1" workbookViewId="0">
  803. <selection activeCell="C2" sqref="C2"/>
  804. </sheetView>
  805. </sheetViews>
  806. <sheetFormatPr baseColWidth="10" defaultRowHeight="15"/>
  807. <sheetData>
  808. <row r="1" spans="1:2 3:4">
  809. <c r="A1" t="s">
  810. <v>0</v>
  811. </c>
  812. <c r="B1" t="s">
  813. <v>1</v>
  814. </c>
  815. <c r="C1" t="s">
  816. <v>0</v>
  817. </c>
  818. <c r="D1" t="s">
  819. <v>1</v>
  820. </c>
  821. </row>
  822. <row r="2" spans="1:2 3:4">
  823. <c r="A2" t="s">
  824. <v>2</v>
  825. </c>
  826. <c r="B2" t="s">
  827. <v>3</v>
  828. </c>
  829. <c r="C2" t="s">
  830. <v>2</v>
  831. </c>
  832. <c r="D2" t="s">
  833. <v>3</v>
  834. </c>
  835. </row>
  836. </sheetData>
  837. <pageMargins left="0.7" right="0.7"
  838. top="0.78740157499999996"
  839. bottom="0.78740157499999996"
  840. header="0.3"
  841. footer="0.3"/>
  842. </worksheet>`)
  843. worksheet := new(xlsxWorksheet)
  844. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  845. c.Assert(err, IsNil)
  846. sst := new(xlsxSST)
  847. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  848. c.Assert(err, IsNil)
  849. file := new(File)
  850. file.referenceTable = MakeSharedStringRefTable(sst)
  851. sheet := new(Sheet)
  852. rows, _, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  853. c.Assert(maxRows, Equals, 2)
  854. c.Assert(maxCols, Equals, 4)
  855. row := rows[0]
  856. c.Assert(row.Sheet, Equals, sheet)
  857. c.Assert(len(row.Cells), Equals, 4)
  858. cell1 := row.Cells[0]
  859. c.Assert(cell1.Value, Equals, "Foo")
  860. cell2 := row.Cells[1]
  861. c.Assert(cell2.Value, Equals, "Bar")
  862. cell3 := row.Cells[2]
  863. c.Assert(cell3.Value, Equals, "Foo")
  864. cell4 := row.Cells[3]
  865. c.Assert(cell4.Value, Equals, "Bar")
  866. }
  867. func (l *LibSuite) TestReadRowsFromSheetWithMultipleTypes(c *C) {
  868. var sharedstringsXML = bytes.NewBufferString(`
  869. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  870. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="4" uniqueCount="4">
  871. <si>
  872. <t>Hello World</t>
  873. </si>
  874. </sst>`)
  875. var sheetxml = bytes.NewBufferString(`
  876. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  877. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  878. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  879. <dimension ref="A1:F1"/>
  880. <sheetViews>
  881. <sheetView tabSelected="1" workbookViewId="0">
  882. <selection activeCell="C1" sqref="C1"/>
  883. </sheetView>
  884. </sheetViews>
  885. <sheetFormatPr baseColWidth="10" defaultRowHeight="15"/>
  886. <sheetData>
  887. <row r="1" spans="1:6">
  888. <c r="A1" t="s">
  889. <v>0</v>
  890. </c>
  891. <c r="B1">
  892. <v>12345</v>
  893. </c>
  894. <c r="C1">
  895. <v>1.024</v>
  896. </c>
  897. <c r="D1" t="b">
  898. <v>1</v>
  899. </c>
  900. <c r="E1">
  901. <f>10+20</f>
  902. <v>30</v>
  903. </c>
  904. <c r="F1" t="e">
  905. <f>10/0</f>
  906. <v>#DIV/0!</v>
  907. </c>
  908. </row>
  909. </sheetData>
  910. <pageMargins left="0.7" right="0.7"
  911. top="0.78740157499999996"
  912. bottom="0.78740157499999996"
  913. header="0.3"
  914. footer="0.3"/>
  915. </worksheet>`)
  916. worksheet := new(xlsxWorksheet)
  917. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  918. c.Assert(err, IsNil)
  919. sst := new(xlsxSST)
  920. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  921. c.Assert(err, IsNil)
  922. file := new(File)
  923. file.referenceTable = MakeSharedStringRefTable(sst)
  924. sheet := new(Sheet)
  925. rows, _, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  926. c.Assert(maxRows, Equals, 1)
  927. c.Assert(maxCols, Equals, 6)
  928. row := rows[0]
  929. c.Assert(row.Sheet, Equals, sheet)
  930. c.Assert(len(row.Cells), Equals, 6)
  931. cell1 := row.Cells[0]
  932. c.Assert(cell1.Type(), Equals, CellTypeString)
  933. if val, err := cell1.FormattedValue(); err != nil {
  934. c.Error(err)
  935. } else {
  936. c.Assert(val, Equals, "Hello World")
  937. }
  938. cell2 := row.Cells[1]
  939. c.Assert(cell2.Type(), Equals, CellTypeNumeric)
  940. intValue, _ := cell2.Int()
  941. c.Assert(intValue, Equals, 12345)
  942. cell3 := row.Cells[2]
  943. c.Assert(cell3.Type(), Equals, CellTypeNumeric)
  944. float, _ := cell3.Float()
  945. c.Assert(float, Equals, 1.024)
  946. cell4 := row.Cells[3]
  947. c.Assert(cell4.Type(), Equals, CellTypeBool)
  948. c.Assert(cell4.Bool(), Equals, true)
  949. cell5 := row.Cells[4]
  950. c.Assert(cell5.Type(), Equals, CellTypeNumeric)
  951. c.Assert(cell5.Formula(), Equals, "10+20")
  952. c.Assert(cell5.Value, Equals, "30")
  953. cell6 := row.Cells[5]
  954. c.Assert(cell6.Type(), Equals, CellTypeError)
  955. c.Assert(cell6.Formula(), Equals, "10/0")
  956. c.Assert(cell6.Value, Equals, "#DIV/0!")
  957. }
  958. func (l *LibSuite) TestReadRowsFromSheetWithHiddenColumn(c *C) {
  959. var sharedstringsXML = bytes.NewBufferString(`
  960. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  961. <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  962. <si><t>This is a test.</t></si>
  963. <si><t>This should be invisible.</t></si>
  964. </sst>`)
  965. var sheetxml = bytes.NewBufferString(`
  966. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  967. <worksheet xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main"
  968. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main"
  969. xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  970. <sheetViews><sheetView workbookViewId="0"/>
  971. </sheetViews>
  972. <sheetFormatPr customHeight="1" defaultColWidth="14.43" defaultRowHeight="15.75"/>
  973. <cols>
  974. <col hidden="1" max="2" min="2"/>
  975. </cols>
  976. <sheetData>
  977. <row r="1">
  978. <c r="A1" s="1" t="s"><v>0</v></c>
  979. <c r="B1" s="1" t="s"><v>1</v></c>
  980. </row>
  981. </sheetData><drawing r:id="rId1"/></worksheet>`)
  982. worksheet := new(xlsxWorksheet)
  983. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  984. c.Assert(err, IsNil)
  985. sst := new(xlsxSST)
  986. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  987. c.Assert(err, IsNil)
  988. file := new(File)
  989. file.referenceTable = MakeSharedStringRefTable(sst)
  990. sheet := new(Sheet)
  991. rows, _, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  992. c.Assert(maxRows, Equals, 1)
  993. c.Assert(maxCols, Equals, 2)
  994. row := rows[0]
  995. c.Assert(row.Sheet, Equals, sheet)
  996. c.Assert(len(row.Cells), Equals, 2)
  997. cell1 := row.Cells[0]
  998. c.Assert(cell1.Type(), Equals, CellTypeString)
  999. if val, err := cell1.FormattedValue(); err != nil {
  1000. c.Error(err)
  1001. } else {
  1002. c.Assert(val, Equals, "This is a test.")
  1003. }
  1004. c.Assert(cell1.Hidden, Equals, false)
  1005. cell2 := row.Cells[1]
  1006. c.Assert(cell2.Type(), Equals, CellTypeString)
  1007. if val, err := cell2.FormattedValue(); err != nil {
  1008. c.Error(err)
  1009. } else {
  1010. c.Assert(val, Equals, "This should be invisible.")
  1011. }
  1012. c.Assert(cell2.Hidden, Equals, true)
  1013. }
  1014. // When converting the xlsxRow to a Row we create a as many cells as we find.
  1015. func (l *LibSuite) TestReadRowFromRaw(c *C) {
  1016. var rawRow xlsxRow
  1017. var cell xlsxC
  1018. var row *Row
  1019. rawRow = xlsxRow{}
  1020. cell = xlsxC{R: "A1"}
  1021. cell = xlsxC{R: "A2"}
  1022. rawRow.C = append(rawRow.C, cell)
  1023. sheet := new(Sheet)
  1024. row = makeRowFromRaw(rawRow, sheet)
  1025. c.Assert(row, NotNil)
  1026. c.Assert(row.Cells, HasLen, 1)
  1027. c.Assert(row.Sheet, Equals, sheet)
  1028. }
  1029. // When a cell claims it is at a position greater than its ordinal
  1030. // position in the file we make up the missing cells.
  1031. func (l *LibSuite) TestReadRowFromRawWithMissingCells(c *C) {
  1032. var rawRow xlsxRow
  1033. var cell xlsxC
  1034. var row *Row
  1035. rawRow = xlsxRow{}
  1036. cell = xlsxC{R: "A1"}
  1037. rawRow.C = append(rawRow.C, cell)
  1038. cell = xlsxC{R: "E1"}
  1039. rawRow.C = append(rawRow.C, cell)
  1040. sheet := new(Sheet)
  1041. row = makeRowFromRaw(rawRow, sheet)
  1042. c.Assert(row, NotNil)
  1043. c.Assert(row.Cells, HasLen, 5)
  1044. c.Assert(row.Sheet, Equals, sheet)
  1045. }
  1046. // We can cope with missing coordinate references
  1047. func (l *LibSuite) TestReadRowFromRawWithPartialCoordinates(c *C) {
  1048. var rawRow xlsxRow
  1049. var cell xlsxC
  1050. var row *Row
  1051. rawRow = xlsxRow{}
  1052. cell = xlsxC{R: "A1"}
  1053. rawRow.C = append(rawRow.C, cell)
  1054. cell = xlsxC{}
  1055. rawRow.C = append(rawRow.C, cell)
  1056. cell = xlsxC{R: "Z:1"}
  1057. rawRow.C = append(rawRow.C, cell)
  1058. cell = xlsxC{}
  1059. rawRow.C = append(rawRow.C, cell)
  1060. sheet := new(Sheet)
  1061. row = makeRowFromRaw(rawRow, sheet)
  1062. c.Assert(row, NotNil)
  1063. c.Assert(row.Cells, HasLen, 27)
  1064. c.Assert(row.Sheet, Equals, sheet)
  1065. }
  1066. func (l *LibSuite) TestSharedFormulas(c *C) {
  1067. var sheetxml = bytes.NewBufferString(`
  1068. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  1069. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
  1070. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  1071. <dimension ref="A1:C2"/>
  1072. <sheetViews>
  1073. <sheetView tabSelected="1" workbookViewId="0">
  1074. <selection activeCell="C1" sqref="C1"/>
  1075. </sheetView>
  1076. </sheetViews>
  1077. <sheetFormatPr baseColWidth="10" defaultRowHeight="15"/>
  1078. <sheetData>
  1079. <row r="1" spans="1:3">
  1080. <c r="A1">
  1081. <v>1</v>
  1082. </c>
  1083. <c r="B1">
  1084. <v>2</v>
  1085. </c>
  1086. <c r="C1">
  1087. <v>3</v>
  1088. </c>
  1089. </row>
  1090. <row r="2" spans="1:3">
  1091. <c r="A2">
  1092. <v>2</v>
  1093. <f t="shared" ref="A2:C2" si="0">2*A1</f>
  1094. </c>
  1095. <c r="B2">
  1096. <v>4</v>
  1097. <f t="shared" si="0"/>
  1098. </c>
  1099. <c r="C2">
  1100. <v>6</v>
  1101. <f t="shared" si="0"/>
  1102. </c>
  1103. </row>
  1104. </sheetData>
  1105. <pageMargins left="0.7" right="0.7"
  1106. top="0.78740157499999996"
  1107. bottom="0.78740157499999996"
  1108. header="0.3"
  1109. footer="0.3"/>
  1110. </worksheet>`)
  1111. worksheet := new(xlsxWorksheet)
  1112. err := xml.NewDecoder(sheetxml).Decode(worksheet)
  1113. c.Assert(err, IsNil)
  1114. file := new(File)
  1115. sheet := new(Sheet)
  1116. rows, _, maxCols, maxRows := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  1117. c.Assert(maxCols, Equals, 3)
  1118. c.Assert(maxRows, Equals, 2)
  1119. row := rows[1]
  1120. c.Assert(row.Cells[1].Formula(), Equals, "2*B1")
  1121. c.Assert(row.Cells[2].Formula(), Equals, "2*C1")
  1122. }
  1123. // Test shared formulas that have absolute references ($) in them
  1124. func (l *LibSuite) TestSharedFormulasWithAbsoluteReferences(c *C) {
  1125. formulas := []string{
  1126. "A1",
  1127. "$A1",
  1128. "A$1",
  1129. "$A$1",
  1130. "A1+B1",
  1131. "$A1+B1",
  1132. "$A$1+B1",
  1133. "A1+$B1",
  1134. "A1+B$1",
  1135. "A1+$B$1",
  1136. "$A$1+$B$1",
  1137. `IF(C23>=E$12,"Q4",IF(C23>=$D$12,"Q3",IF(C23>=C$12,"Q2","Q1")))`,
  1138. `SUM(D44:H44)*IM_A_DEFINED_NAME`,
  1139. `IM_A_DEFINED_NAME+SUM(D44:H44)*IM_A_DEFINED_NAME_ALSO`,
  1140. `SUM(D44:H44)*IM_A_DEFINED_NAME+A1`,
  1141. "AA1",
  1142. "$AA1",
  1143. "AA$1",
  1144. "$AA$1",
  1145. }
  1146. expected := []string{
  1147. "B2",
  1148. "$A2",
  1149. "B$1",
  1150. "$A$1",
  1151. "B2+C2",
  1152. "$A2+C2",
  1153. "$A$1+C2",
  1154. "B2+$B2",
  1155. "B2+C$1",
  1156. "B2+$B$1",
  1157. "$A$1+$B$1",
  1158. `IF(D24>=F$12,"Q4",IF(D24>=$D$12,"Q3",IF(D24>=D$12,"Q2","Q1")))`,
  1159. `SUM(E45:I45)*IM_A_DEFINED_NAME`,
  1160. `IM_A_DEFINED_NAME+SUM(E45:I45)*IM_A_DEFINED_NAME_ALSO`,
  1161. `SUM(E45:I45)*IM_A_DEFINED_NAME+B2`,
  1162. "AB2",
  1163. "$AA2",
  1164. "AB$1",
  1165. "$AA$1",
  1166. }
  1167. anchorCell := "C4"
  1168. sharedFormulas := map[int]sharedFormula{}
  1169. x, y, _ := GetCoordsFromCellIDString(anchorCell)
  1170. for i, formula := range formulas {
  1171. res := formula
  1172. sharedFormulas[i] = sharedFormula{x, y, res}
  1173. }
  1174. for i, formula := range formulas {
  1175. testCell := xlsxC{
  1176. R: "D5",
  1177. F: &xlsxF{
  1178. Content: formula,
  1179. T: "shared",
  1180. Si: i,
  1181. },
  1182. }
  1183. c.Assert(formulaForCell(testCell, sharedFormulas), Equals, expected[i])
  1184. }
  1185. }
  1186. // Avoid panic when cell.F.T is "e" (for error)
  1187. func (l *LibSuite) TestFormulaForCellPanic(c *C) {
  1188. cell := xlsxC{R: "A1"}
  1189. // This line would panic before the fix.
  1190. sharedFormulas := make(map[int]sharedFormula)
  1191. // Not really an important test; getting here without a
  1192. // panic is the real win.
  1193. c.Assert(formulaForCell(cell, sharedFormulas), Equals, "")
  1194. }
  1195. func (l *LibSuite) TestRowNotOverwrittenWhenFollowedByEmptyRow(c *C) {
  1196. sheetXML := bytes.NewBufferString(`
  1197. <?xml version="1.0" encoding="UTF-8"?>
  1198. <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
  1199. <sheetViews>
  1200. <sheetView workbookViewId="0" />
  1201. </sheetViews>
  1202. <sheetFormatPr customHeight="1" defaultColWidth="14.43" defaultRowHeight="15.75" />
  1203. <sheetData>
  1204. <row r="2">
  1205. <c r="A2" t="str">
  1206. <f t="shared" ref="A2" si="1">RANDBETWEEN(1,100)</f>
  1207. <v>66</v>
  1208. </c>
  1209. </row>
  1210. <row r="3">
  1211. <c r="A3" t="str">
  1212. <f t="shared" ref="A3" si="2">RANDBETWEEN(1,100)</f>
  1213. <v>30</v>
  1214. </c>
  1215. </row>
  1216. <row r="4">
  1217. <c r="A4" t="str">
  1218. <f t="shared" ref="A4" si="3">RANDBETWEEN(1,100)</f>
  1219. <v>75</v>
  1220. </c>
  1221. </row>
  1222. <row r="7">
  1223. <c r="A7" s="1" t="str">
  1224. <f t="shared" ref="A7" si="4">A4/A2</f>
  1225. <v>1.14</v>
  1226. </c>
  1227. </row>
  1228. </sheetData>
  1229. <drawing r:id="rId1" />
  1230. </worksheet>
  1231. `)
  1232. sharedstringsXML := bytes.NewBufferString(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"/>`)
  1233. worksheet := new(xlsxWorksheet)
  1234. err := xml.NewDecoder(sheetXML).Decode(worksheet)
  1235. c.Assert(err, IsNil)
  1236. sst := new(xlsxSST)
  1237. err = xml.NewDecoder(sharedstringsXML).Decode(sst)
  1238. c.Assert(err, IsNil)
  1239. file := new(File)
  1240. file.referenceTable = MakeSharedStringRefTable(sst)
  1241. sheet := new(Sheet)
  1242. rows, _, _, _ := readRowsFromSheet(worksheet, file, sheet, NoRowLimit)
  1243. cells := rows[3].Cells
  1244. c.Assert(cells, HasLen, 1)
  1245. c.Assert(cells[0].Value, Equals, "75")
  1246. }
  1247. // This was a specific issue raised by a user.
  1248. func (l *LibSuite) TestRoundTripFileWithNoSheetCols(c *C) {
  1249. originalXlFile, err := OpenFile("testdocs/original.xlsx")
  1250. c.Assert(err, IsNil)
  1251. err = originalXlFile.Save("testdocs/after_write.xlsx")
  1252. c.Assert(err, IsNil)
  1253. _, err = OpenFile("testdocs/after_write.xlsx")
  1254. c.Assert(err, IsNil)
  1255. err = os.Remove("testdocs/after_write.xlsx")
  1256. c.Assert(err, IsNil)
  1257. }
  1258. func (l *LibSuite) TestReadRestEmptyRowsFromSheet(c *C) {
  1259. originalXlFile, err := OpenFile("testdocs/empty_rows_in_the_rest.xlsx")
  1260. c.Assert(err, IsNil)
  1261. for _, sheet := range originalXlFile.Sheets {
  1262. for _, row := range sheet.Rows {
  1263. if row == nil {
  1264. c.Errorf("Row should not be nil")
  1265. }
  1266. }
  1267. }
  1268. }
  1269. // See issue #362
  1270. // An XSLX file with an invalid sheet name (xl/worksheets.xml) caused an exception
  1271. func TestFuzzCrashers(t *testing.T) {
  1272. var crashers = []string{
  1273. "PK\x03\x04\x14\x00\x00\b\b\x00D\xae\fC\xf4\xeb\xcaY=\x01" +
  1274. "\x00\x00g\x05\x00\x00\x13\x00\x00\x00[Content_T" +
  1275. "ypes].xml͔\xd1K\xc30\x10\xc6\xdf\xf7W" +
  1276. "\x94\xbcJ\x9bm\x82\x88\xb4ۃ\xe0\xa3\x0e\x9c\xcf\x12\x93\xdb\x1a\xda" +
  1277. "&\xe1.\xce\xed\xbf\xf7R7A\x11\\q\xa8/\r%\xf7}\xbf" +
  1278. "\xef\x8ek\xcb\xf9\xb6k\xb3\r Y\xef*1)\xc6\"\x03\xa7\xbd" +
  1279. "\xb1n]\x89\x87\xe5M~)\xe6\xb3Q\xb9\xdc\x05\xa0\x8ck\x1dU" +
  1280. "\xa2\x8e1\\II\xba\x86NQ\xe1\x038\xbeYy\xecT\xe4W" +
  1281. "\\ˠt\xa3\xd6 \xa7\xe3\xf1\x85\xd4\xdeEp1\x8f\xc9C\xcc" +
  1282. "\xca;ơ5\x90-\x14\xc6[\xd5A%\xe4#BK\xb2HO" +
  1283. "\x91]\xbf\t\x12\xb3\x12*\x84\xd6j\x159\x9f\xdc8\xf3\x89\x96\xef" +
  1284. "II\xd9\xd7Pm\x03\x9dq\x81\x90_\x93\x8c\xd7\v\xf4\x81$\x1b" +
  1285. "\x17\xa9n\x10ίVV\x03{<w,)`\xcbJ\x03&\x0f" +
  1286. "l\t\x18-\x1c\xc7\xd6\x1ea8\xfc\xd0kR\x1fIܶ\xfb\xd1" +
  1287. "\xbexl\x9e\xbco\x12\xf57\xc6\xcc`\xaa\x15\x82\xb9\x8fȻD" +
  1288. "?\x1e5\x05\x04e\xa8\x06\x88\xdc\xc1\a\xefor\xa4\xd6{\x1d\xc9" +
  1289. "\xfe8?q\x96w\xff\x819\xa6\xff$\xc7\xe4\x8frPܵp" +
  1290. "\xf2\xc5\xe8M\x8f\x98\xc0\xe1c8\xe9R\xf2Ytʺ=\u007fT" +
  1291. "\xca\xfe\xc79{\x05PK\x03\x04\x14\x00\x00\b\b\x00D\xae\fC" +
  1292. "f\xaa\x82\xb7\xe0\x00\x00\x00;\x02\x00\x00\v\x00\x00\x00_rel" +
  1293. "s/.rels\xad\x92\xcfJ\x031\x10\x87\xef}\x8a\x90{" +
  1294. "w\xb6\x15Dd\xb3\xbd\x88ЛH}\x80\x98\xcc\xfea7\x990" +
  1295. "\x19u}{\x83\bZ\xa9\xa5\a\x8fI~\xf3\xcd7C\x9a\xdd\x12" +
  1296. "f\xf5\x8a\x9cG\x8aFo\xaaZ+\x8c\x8e\xfc\x18{\xa3\x9f\x0e\xf7" +
  1297. "\xeb\x1b\xbdkW\xcd#\xceVJ$\x0fcʪ\xd4\xc4l\xf4 " +
  1298. "\x92n\x01\xb2\x1b0\xd8\\Q\xc2X^:\xe2`\xa5\x1c\xb9\x87d" +
  1299. "\xddd{\x84m]_\x03\xffd\xe8\xf6\x88\xa9\xf6\xdeh\xde\xfb\x8d" +
  1300. "V\x87\xf7\x84\x97\xb0\xa9\xebF\x87w\xe4^\x02F9\xd1\xe2W\xa2" +
  1301. "\x90-\xf7(F/3\xbc\x11O\xcfDSU\xa0\x1aN\xbbl/" +
  1302. "w\xf9{N\b(\xd6[\xb1\xe0\x88q\x9d\xb8T\xb3\x8c\x98\xbfu" +
  1303. "<\xb9\x87r\x9d?\x13焮\xfes9\xb8\bF\x8f\xfe\xbc\x92" +
  1304. "M\xe9\xcbh\xd5\xc0\xd1'h?\x00PK\x03\x04\x14\x00\x00\b\b" +
  1305. "\x00D\xae\fC\x17ϯ\xa7\xbc\x00\x00\x005\x01\x00\x00\x10\x00\x00" +
  1306. "\x00docProps/app.xml\x9d\x8f\xb1" +
  1307. "j\x031\x10\x05{\u007f\x85Po\xeb\xe2\xc2\x04\xa3\x93\t$\xee\x02" +
  1308. "..酴g\v\xa4]\xa1ݘ\xf3\xdfG!\x10\xa7v9" +
  1309. "\f\f\xef\xd9\xc3R\xb2\xbaB\xe3D8\xea\xa7͠\x15`\xa0\x98" +
  1310. "\xf0<\xea\x8f\xe9\xb8~֊\xc5c\xf4\x99\x10F}\x03\xd6\a\xb7" +
  1311. "\xb2\xa7F\x15\x9a$`\xd5\vȣ\xbe\x88Խ1\x1c.P<" +
  1312. "o\xba\xc6nfj\xc5K\xc7v64\xcf)\xc0+\x85\xaf\x02(" +
  1313. "f;\f;\x03\x8b\x00F\x88\xeb\xfa\x17Կ\xc5\xfdU\x1e\x8dF" +
  1314. "\n?\xfb\xf8s\xba\xd5\xdesv\"\xf1yJ\x05\xdc`\xcd\x1d\xec" +
  1315. "K\xad9\x05/\xfd\xbc{O\xa1\x11\xd3,\xeam\t\x90\xad\xf9/" +
  1316. "\xad\xb9\x1fv\xdfPK\x03\x04\x14\x00\x00\b\b\x00D\xae\fC\x17" +
  1317. "qy\xdb:\x01\x00\x00x\x02\x00\x00\x11\x00\x00\x00docPr" +
  1318. "ops/core.xml\x8d\x92_O\xc3 \x14\xc5" +
  1319. "\xdf\xfd\x14\r\xef-\xa5]\x96\x85\xb4]\xa2f\xbe\xb8\xc4\xc4\x1a\x8d" +
  1320. "o\x04\xee:b\xa1\x04pݾ\xbdm\xb7\xe1\xd4=\xf8ƽ\xe7" +
  1321. "\xdc\x1f\x87?\xc5r\xaf\xdah\a\xd6\xc9N\x97\x88$)\x8a@\xf3" +
  1322. "NHݔ\xe8\xa5^\xc5\v\x149ϴ`m\xa7\xa1D\ap" +
  1323. "hY\xdd\x14\xdcP\xdeYx\xb2\x9d\x01\xeb%\xb8h\x00iG\xb9" +
  1324. ")\xd1\xd6{C1v|\v\x8a\xb9dp\xe8A\xdctV1?" +
  1325. "\x94\xb6\xc1\x86\xf1\x0f\xd6\x00\xce\xd2t\x8e\x15x&\x98gx\x04\xc6" +
  1326. "&\x10\xd1\t)x@\x9aO\xdbN\x00\xc11\xb4\xa0@{\x87I" +
  1327. "B\xf0\xb7WI\u007f0pu\xe2,^\xb8=X定'%" +
  1328. "8\xf7N\x06W\xdf\xf7I\x9fO\xbe!?\xc1o\xeb\xc7\xe7\xe9\xa8" +
  1329. "\xb1\xd4\xe3Uq@UqBSn\x81y\x10\xd1\x00\xa0\xc7`g" +
  1330. "\xe55\xbf\xbb\xafW\xa8\xcaRB\xe2t\x1eg\x8b\x9a\xcc(\xc9i" +
  1331. "\x9a\xbf\x17\xf8\xd7\xfc\b<\xae;[\xd5\xc0Zx\x18=\xa15\xbe" +
  1332. "G˜_\x0f/\xb7\x91 n\x0f\xc1\xf5W\t\xe1ԩ\xf7\xff" +
  1333. "t3\x9ag\x17\xe9\u0380i\u007f\v;9~\xa3*\x9d6\r\xe5" +
  1334. "T\xfd\xfc,\xd5\x17PK\x03\x04\x14\x00\x00\b\b\x00D\xae\fC" +
  1335. "(\xba\xe5Ҧ\x00\x00\x00\xec\x00\x00\x00\x14\x00\x00\x00xl/s" +
  1336. "haredStrings.xmle\xce\xc1\x8a" +
  1337. "\xc20\x10\xc6\xf1\xbbO\x11\xe6\xbeMw\x11\x11IRX\xa1\xf7\x85" +
  1338. "\xf5\x01B;\xda`3\xa9\x99\xc9\xe2\xfa\xf4V\x04\x05=\xfe\u007f\x03" +
  1339. "\x1fc\x9as\x1c\xd5\x1ff\x0e\x89,|V5(\xa4.\xf5\x81\x0e" +
  1340. "\x16v\xbf\xed\xc7\x1a\x14\x8b\xa7ޏ\x89\xd0\xc2?24na\x98" +
  1341. "Eu\xa9\x90XX\x82*\x14N\x05\xb7\x8f\x9eG\x89-\f\"\xd3" +
  1342. "Fk\xee\x06\x8c\x9e\xab4!͗}\xca\xd1˜\xf9\xa0y\xca" +
  1343. "\xe8{\x1e\x10%\x8e\xfa\xab\xaeW:\xfa@\xe0\f\agĵ)" +
  1344. "\x19-\xce\xe8[\xde\xe9\xdb\xe7w\xba\xbc\xd2O)ǧ\xe9\xf9]" +
  1345. "w\x05PK\x03\x04\x14\x00\x00\b\b\x00\xcf,\rC\x0ep\x99\x04" +
  1346. "\f\x04\x00\x00\x96\x1f\x00\x00\r\x00\x1c\x00xl/style" +
  1347. "s.xmlUT\t\x00\x035\xaa\tR5\xaa\tRux" +
  1348. "\v\x00\x01\x04\xe8\x03\x00\x00\x04\xe8\x03\x00\x00\xedYQo\xdb*\x14" +
  1349. "~\xef\xaf@~\xbf\xb3\x13\xa7^|\x95tjs\x97\xabI\xd3T" +
  1350. "m\x9dt\xa5\xab\xfb@ll\xa3a\xb00ْ\xfd\xfa\x81\xb1\xb1" +
  1351. "\x9d6\x90\xaa/ծ\x1dU\x82\xc3\xc7\xc7\xc7\xe1p\\\xf0\xea\xdd" +
  1352. "\xa1$\xe0;\xe25ft\xed\xcd\xde\x04\x1e@4a)\xa6\xf9\xda" +
  1353. "\xfb\xfa\xb0\xfdc\xe9\x81Z@\x9aB\xc2(Z{GT{\xefn" +
  1354. "\xaeV\xb58\x12\xf4\xa5@H\x00\xc9@\xeb\xb5W\bQ\xfd\xe9\xfb" +
  1355. "uR\xa0\x12\xd6oX\x85\xa8l\xc9\x18/\xa1\x90U\x9e\xfbu\xc5" +
  1356. "\x11Lkթ$\xfe<\b\"\xbf\x84\x98z7W\x00\xac\xe8\xbe" +
  1357. "ܖ\xa2\x06\t\xdbS!\x954Vc\a\x9ag\xc3R\xa9\xe1\xef" +
  1358. "\xf7\x9f\xde\u007f\xbe\xfd\xe8\x01\xdd\xf6!\x95\xf0h\xe1\xf9\r\x8f\xdf\x12" +
  1359. "5\x95\x8cўr\xd1Q*\xab.\xcaJ\xfd\x13|\x87D2\xcc" +
  1360. "4AcL\x18a\x1c\xf0|\xb7\xf6\xb6۠y\x06\xad\x14\x96H" +
  1361. "w\xda@\x82w\x1c\x0f\xda2Xbrԭ\xf3!c\x01y-" +
  1362. "\x9d\xa5\xc7\xea\x1aV~\xaf匬\xa7\a\xbe\xe5\x18\x923\xc3\x06" +
  1363. "\xbf\x17\xbb.\xb5\xeb\x89\t1\xeb\x19\x9a\xf5\x94V\xc3VA!\x10" +
  1364. "\xa7[i\x03m\xf9\xe1Xɨ\xa12~\a\xec\xa6υ\xdds" +
  1365. "\x0e\x8f\xb3\xf9\xf5\v\x18jFp\xeau8\xd5-ߌ\xe3\xecn" +
  1366. "\xb9\xdd\xf6\x8e\x91\x88\xdd\x18\x11\x86\x1b\xf9\f\\\xe7\x0f\x06;ե" +
  1367. "K\xdao;\xc6S\xb9\xc7;\xcf\xcd;\xcfi;H1\xcc\x19\x85" +
  1368. "\xe4/\xf6C&\x81\f\x92\x1ay\xc6\xf8\xb5\xeaLfX\x822\xd1" +
  1369. "\x8b\xe08/\x06U\xc1\xaa\xbe\xb2cB\xb0\xb2\xafw\xa4ƋZ" +
  1370. "\xc1\xcb\xe5\x80&!\xad=QȄr\xa2\xedL\x9b\x14z\xa6E" +
  1371. "\xab>\xd3h\x99BW\xd6NO\x10!_\x14\xc5?Y\xef\xf9\xa0" +
  1372. "s\xfd!\x03\xb0\xaa\xc8\xf1\x96\xe0\x9c\x96H5\n\xbe\x97\x13m\xac" +
  1373. "w\r\xcfȴe'\x98{\xce\x04JD\x93\xb8\xb5Y\x8f\xae\xf2" +
  1374. "\xa1L\xe3j\xf5\xbb\xa2\xec\xda\x16\xc7)\xd3L\nv*@\xc18" +
  1375. "\xfe)\xf1j7\xe6\x88\".\xf7*\xc04m\x14J\x82\xba\xe0\x98" +
  1376. "~{`[,\xcc\xda\bt\x10\x9f\x99\x80Z\x8b\x04\xc9\x17\x8a\xc0" +
  1377. "\x89\xa2Ю\xf4\xc0\x0f\x0e\xab\a\t\xeb\xfa\xf4\xfe\xac\xcc4@\x81" +
  1378. "S9\x8e\xa1%,\xf9\x86\xd2vr\xc6݇\xec\xbc\aێ#" +
  1379. "\x17\x0emV\x1f\xb6@\x97\x13gC'\x9a\xe5\x9cd=-k>" +
  1380. "\xc9z\x86\xac`\x925ɚdM\xb2&Y\xbf\xb1\xacѫz" +
  1381. "\x11\xbeR]\xb3W\xaak\xf1Ju\xcd_\xa7\xae\xf8D\xd6\xca\x1f" +
  1382. "\x9eK\xccAepF\t-G\x94\xcb\xe4\x0f-/ݶ\xea\x98" +
  1383. "\x02\x0e\xd9p\aO\xe7\x15\xa77\xe7\x937\x9fw\x80~\xe4\xcc\xd9" +
  1384. "\xff&4uF\x18&\x83&;\x98|\x10u\xf9\xc04\x81\xdd\x1e" +
  1385. "\x13\x81i\xeb\x91d_Kaw\xdaf\x86T\x17~k\uf4fa" +
  1386. "\xb7%\xbd\x9b|\x1bWh\xe7ڰ\xb2\x84\x1d\xd5\xec\xda\xce\x15]" +
  1387. "\xc0\x05\xfe\r\xfe3|\x91\x9do\xe1\xe0\xdbs\x8ehr4to" +
  1388. "\xedto/\xa3\x1b)\\\xda)\xaf\xed\x94\xf7\x88'2\xf2\f[" +
  1389. "\xdc]\x98\xf7+\xae\x03@\xdd8\xd6\xed@*Z\x0f(\xdd\fl" +
  1390. "\xeaV-\xdfm\xac7\xe4\xa7\x00\xfdX\x01\x0e\x86 P\u007fV\x80" +
  1391. "\x82848D:\x18T\xb3\x15\xb0t\xf9!\b\x96.\x80\x82X" +
  1392. "\x87p0,]\f\xaa\xd9\n\xd8\x04\xea\xe7\xd0`e\x88\xe5cu" +
  1393. "T\x1c\x87a\x149\x16kt\xd3\xfdH\xe4Ʊ\x16Q\x14\x04\x8e" +
  1394. "!\x1c\xb3P\xfd\x1d\x1a\x94\x8a\x97\xac\xa63\xe4\x9cA{QL:" +
  1395. "\"ꂠu8ʹq\xc6_6\x9e\xbf\x9a\n`]\v\xf5" +
  1396. "ı5\xe4\x1c\x8b\xa5!V\r\x8e\xa8\xd6\x10\v@\x05\xbd\x95\xe1" +
  1397. "\xd1\a\x9e\xa7f\xe1HbN@\x1c;\x00j\xebXwV\x14\xd9" +
  1398. "]\x1d\xa9\x9f5\x1e\x1c\xdb?\f\xe3\xd8\nP\fV\x91a\xe8\x00" +
  1399. "\xa8\x14\xe4\x048D*\x99\x0e@\x18\xf6\xffn=z\x99\xcawo" +
  1400. "[^\xf9\xfd\a\xf5\x9b\xab_PK\x03\x04\x14\x00\x00\b\b\x00\xe0" +
  1401. "\x15\xf7D\b\xc40\xf9\xbe\x01\x00\x00}\x03\x00\x00\x0f\x00\x1c\x00x" +
  1402. "l/workbook.xmlUT\t\x00\x03\x03" +
  1403. "\x06\xcfS\x03\x06\xcfSux\v\x00\x01\x04\xe8\x03\x00\x00\x04\xe8\x03" +
  1404. "\x00\x00\x8dRMO\xdb@\x10\xbd\xe7W\xac\xf6N\xfc\x91\x88\x86\xc8" +
  1405. "\x0e\xaa@\b\x0e\x94\xaaP8\x8f\xd7\xe3x\x9b\xf5\xae\xb5;I\xa0" +
  1406. "\xbf\xbec;.)\xaa\"n;_o\xdf{3\xd9\xe5kc\xc4" +
  1407. "\x0e}\xd0\xce\xe62\x99\xc6R\xa0U\xae\xd4v\x9d˟O7g" +
  1408. "\v)\x02\x81-\xc18\x8b\xb9|\xc3 /W\x93l\xef\xfc\xa6p" +
  1409. "n#xކ\\\xd6D\xed2\x8a\x82\xaa\xb1\x810u-Z\xae" +
  1410. "T\xce7@\x1c\xfau\x14Z\x8fP\x86\x1a\x91\x1a\x13\xa5q|\x1e" +
  1411. "5\xa0\xad\x1c\x10\x96\xfe3\x18\xae\xaa\xb4\xc2k\xa7\xb6\rZ\x1a@" +
  1412. "<\x1a f\x1fj\xdd\x06\xb9\x9a\b\x91U\xda\xe0\xf3\xa0I@\xdb" +
  1413. "~\x83\x86\x99_\x81Q2\xea\xeb#\xf9\xef^\x14\xa06\xdb\xf6\x86" +
  1414. "\arY\x81\t\xc8rk\xb7\u007f(~\xa1\"\xd6\x05\xc6HQ\x02" +
  1415. "ar\x11\xcfǖ\x8f(\x8e\xb8\x99?\x1b\xf2]\xeeY\xe3>t" +
  1416. "\xd1Q_\x97\x13\xc0\x8d;|\x82\"\x97lu\xa5}\xa0\xc7Β" +
  1417. ">\xec~\xbeu^\xffv\x96\xc0<*\xef\x8c\xc9%\xf9\xed\x81U" +
  1418. "\xdfɳ\xe18\xc9BI\xab\x8f\xed\x04ŏΖ\\ο\xf0" +
  1419. "\n\xf7ږ\x8c\x8dz]\xf3W\x8b\xe4\"\x1ds/\xba\xa4\x9a7" +
  1420. "\u007f>[\xccy\x17/}\xb2g\xf3\xf6\xfe\x1e\x84E\xff(\xcb\xfa" +
  1421. "U\x8e\"\xfb@\xd8\xdeif\x88\xc6`\xd2\xf1\xe3\xec]\xc9\xf0\xfd" +
  1422. "\x15\x11\x17w:\xe8\xc20C\xbf\xd4\\\xf0we:\xc0\xff\x1f$" +
  1423. "=\x02IO\x80\xccN\x81̎@f'@\xe6\xa3\xd0wi\x19" +
  1424. ";\xab\xf8N4\xa1\xe7\xa9+\xb7\xb5l`\x12\xb3?\x1e\xab{W" +
  1425. "2\xd0WVw\xa8\xff=\xa2C|\x8d\x86\x80\x1d\x9c\xc6q\x9ct" +
  1426. "\xe8Y4\x9e\xc3j\xf2\aPK\x03\x04\x14\x00\x00\b\b\x00\xb2\x04" +
  1427. "4C\xa0J\x80\x9e\x84\x03\x00\x00\x8f\b\x00\x00\x18\x00\x1c\x00xl" +
  1428. "/worksheets/sheet1.x" +
  1429. "mlUT\t\x00\x03\xb0|;R\xb0|;Rux\v\x00\x01" +
  1430. "\x04\xe8\x03\x00\x00\x04\xe8\x03\x00\x00\xc5V\xc1r\xdb6\x10\xbd\xfb+" +
  1431. "0\xb8W\x94\x14+V<\x923\x89]5\x9dq\"O\xe543" +
  1432. "\xbdA\xc4R\xc4\x18\x04X\x00\x94b\u007f}w\x01\x92\xa2\x155\xd3" +
  1433. "[u\x11\xb1\x8bžݷx\xe4\xe2\xfd\xf7J\xb3=8\xaf\xac" +
  1434. "Y\xf2\xc9h\xcc\x19\x98\xdcJevK\xfe\xf5q\xf5˜3\x1f" +
  1435. "\x84\x91B[\x03K\xfe\f\x9e\xbf\xbf\xb9X\x1c\xac{\xf2%@`" +
  1436. "x\x80\xf1K^\x86P_g\x99\xcfK\xa8\x84\x1f\xd9\x1a\fz\n" +
  1437. "\xeb*\x11p\xe9v\x99\xaf\x1d\b\x19\x83*\x9dM\xc7\xe3\xb7Y%" +
  1438. "\x94\xe1\xe9\x84k\xf7_ΰE\xa1r\xb8\xb3yS\x81\t\xe9\x10" +
  1439. "\aZ\x04\x84\xefKU{~s\xc1\xd8\"&yp\xacP:\x80" +
  1440. "\xfbl%\"/\x84\xf6\x10ݸ\xa1\x16;\xd8@\xf8Z\xc7M\xe1" +
  1441. "\xd1>\xa0\xa1ۓ\xc53\xb2\xf6\x90\xb8\x90\n\xf3Q\x8f\x98\x83b" +
  1442. "\xc9?L\xae?N\xdb}q۟\n\x0e\xbe=\xbb7\xb0\xdcj" +
  1443. "\xeb~\x97K\xfe\xf6\x923\t\x85ht\xf8\xcd)yK\xf6%\x0f" +
  1444. "\xae\x01Μڕ\b\xe0\x1e\x8a\xd0\x01`\xbe\xb4\x87\x15\x96\xddh" +
  1445. "\xe1_\x19)\xfa^\x19\xf0]4\x19\xd7M\xd0h\xdb<W[\xab" +
  1446. "_y\xfe\xb0\a\xcc\xf5\tێ\f\x0f\x1d\u007f\x81\xb3\xbd!\x88\xed" +
  1447. "\x064\xe4\x01do\xb25\x01\xba\x05\xad\xa9Z\xce\xf6Xϒ\x1b" +
  1448. "\xa2BsvPF\xdaÃ\xb3\x01\xa3\xe2\xe4\xb4\x18i,\xb6\xd6" +
  1449. ">Q\xf9T8\x8eӋ\xb5\xd5&\x17\x1a\xdb;\x19\x0f\xd7_\xe2" +
  1450. "a\xa7V\"\xe2^<\xdb&\xb60ySc\xa9\xb5\x11&\xd1 " +
  1451. "\xf0o\x0f\t\x1fR1X\xb7ikA\xe3\xdaցE\xff\x1d\x89" +
  1452. "\xebX\xeb\xf9\xa5$\x03\xba{\x1e\x13\x8b\xab8z8#-y\xd8" +
  1453. "\xcfO@|!\xae\x19\x1f\xc4u\x1b\xa3\ti\xeff\x01\x1fi\n" +
  1454. "\xb4\xa8=5\xb7\xedR\xa9\xa4\x84c\xd3*\xf1\x9d\xea\x9c\xce\xf0Q" +
  1455. "\xd1-\xa4+\xf7L\r\x1bS\xabe(\xc9=\x9a]]\xce\xdf\xcd" +
  1456. "\xaf\xe6\xb3\xcb\xe9l\xd2\ri\x97+\xe1\xbd\x13A\xb4\x99\x9d=\x9c" +
  1457. "ɜ7>\xd8*\xa1=1v\x85\x9d\xc7\x18K\xbe\x1c\xbd\xe3\xcc" +
  1458. "\xa6i\xbb\x87=\xe8\x88\xd0\x11➢\x9c\xd641>\x16\x82a" +
  1459. "\xbew\xa2{\u007f3^d\xfb~w\x96\xbf\x0e\xfc\x98\x02\xc7\xe7\x02" +
  1460. "'\xe7\x02\x17\x19\x16\xfa\u007f\x94<=-y\xfa\xefȧ?-9" +
  1461. "\x05N\xcf\x05\xbe\xf9i\xc9\xed\xecu\xa4/j\xa7LX\xd7Q\v" +
  1462. "Y\x89\x97\x1eE\xfc(\x1f\xbb\xa3t\x9cZP\t\xbb\x8b_Z\xa7" +
  1463. "^\xac\tBߢ\xc0\x82\x1b4\x12\xdf\x12A\xe5?:\xd2$\x92" +
  1464. "\xa2~\x16n\xa70\xb7\x8eZ6\x1e]\xb5\xea\xd6>\xe3e\x8cO" +
  1465. "\xf3+\x9c\xf4\xad\r\xc8\xc0q]F\x91\xa2\xf5l2\x99\x8fg\xfd" +
  1466. "\x8f\xb3¢Μu\x1dSc\tMͶZ\xe4O\x1f\x8c\xfc" +
  1467. "V\xaa\x00G\xb2Q\x15nmEo\fO\x1af\xc8fk\x05i" +
  1468. "D\xa5\x13\x03\xe9-\x94\xf3\x81D\xe8KSmcV\x9e\xde\x10\xfd" +
  1469. "\xc5o\xd7\xdfڋ9\xec\xd9]\xad\x96\xfc\r\xe9\x19\x9a0\x9dH" +
  1470. "\xe2X[\x17\x9cP\x81Ti\ak\x17\vE\x015\x8f%\x985" +
  1471. "\xf6\x95\x1c5\xb8\x8dzA\xd48p~\xa0\x97\x8d\x87\xd5)\xa6\x16" +
  1472. "+\xba\x1e\x88spwI\x9f\xfc\x0fd\xf5\x88R\xabR\x97W\xb1" +
  1473. "\xa1L\xaa\xa2@\"M\x88\xe7\xf7\xa1\xbdy-\xe5\xaf\xfb\xe3\x85h" +
  1474. "\xa7\xcfJ\x99^(\xdd4\x9e\x1ap\x9d\x12\f6\x1c\r\x8bl\x88" +
  1475. "\x01\xbf$\xb2\xfeS\xe2\xe6\xe2\x1fPK\x03\x04\x14\x00\x00\b\b\x00" +
  1476. "\xb3\x044C\xccJ\xae2\x0e\x03\x00\x00\x99\x06\x00\x00\x18\x00\x1c\x00" +
  1477. "xl/worksheets/sheet2" +
  1478. ".xmlUT\t\x00\x03\xb1|;R\xb1|;Rux\v" +
  1479. "\x00\x01\x04\xe8\x03\x00\x00\x04\xe8\x03\x00\x00\x8dUMO\x1b1\x10\xbd" +
  1480. "\xf3+,\xdf\xcb&\x94@@,\bAS*\x01A\r\x14\xa97" +
  1481. "g=\x9b\xb5\xf0z\xb6\xb6\x97\x00\xbf\xbec\xef'\xd0Cs\x89=" +
  1482. "c\xcf\xc7{o\xbc'g/\xa5f\xcf`\x9dB\x93\xf2\xe9\xee\x84" +
  1483. "30\x19Je6)\u007f\xb8_|\x99s\xe6\xbc0Rh4\x90" +
  1484. "\xf2Wp\xfc\xect\xe7d\x8b\xf6\xc9\x15\x00\x9eQ\x00\xe3R^x" +
  1485. "_\x1d'\x89\xcb\n(\x85\xdb\xc5\n\fyr\xb4\xa5\U00034d5b" +
  1486. "\xc4U\x16\x84\x8c\x97J\x9d\xecM&\aI)\x94\xe1M\x84c\xfb" +
  1487. "?10\xcfU\x06\x97\x98\xd5%\x18\xdf\x04\xb1\xa0\x85\xa7\xf2]\xa1" +
  1488. "*\xc7Ow\x18;\x89I\xee,˕\xf6`oPR\xe5\xb9\xd0" +
  1489. "\x0e\xa2\x9b\x0eTb\x03+\xf0\x0fU<\xe4\xef\xf1\x8e\fݙ$" +
  1490. "\xc6H\xda q#\x15\xe5\v\x181\vy\xcaϧ\xed\xa1x\xe6" +
  1491. "\x97\x82\xadk\x03\xf7\x06\x96\xa1F\xfbC\xa6\xfc`\x9f3\t\xb9\xa8" +
  1492. "\xb5\xffn\x95\xbc\b\xf6\x94{[\x03gVm\n\xca~\r\xb9\xef" +
  1493. "\xb23W\xe0vA=\xd7Z\xb8w\xc6p\xfbZ\x19p\xdd\xed`" +
  1494. "\\\xd6^\x93m\xf5Z\xaeQ\xbf\xf3\xfc\xc4-\xe5\xba\"̉\xde" +
  1495. "\xb1\xe37X\xec\r^\xacW\xa0!\xf3 \xfbd\x1e\xabP\xd1\x05" +
  1496. "h\x1d{e\xcf\xd4P\xcaM Bs\xb6UF\xe2\xf6\u03a2\xa7" +
  1497. "kQ7\xed\xbd \x8a5\xe2S\xe8?tNbzC,W\x99" +
  1498. "\xd0\x04\xeet2\xde\xdf\xc6`\x1f\xad\x81\x86k\xf1\x8auİ\xf1" +
  1499. "6\xc8\x06lc\x9d\x81\x04A\u007f\xcf0\xd47\xec۴\x95\bb" +
  1500. "m\xfb\xa0\xae\xff\xbc\xa3\xadg7$\x19\x91\xdd\x13\xd9и\x88\xc2" +
  1501. "#\x85\xb4\xec\x11\xa0W\x10\b\xa3\xbaf|t\xaf;\x18M\xc4{" +
  1502. "'\x06Z\x06\x19hQ\xb9\x11\xba\x85\x92\x12\x06\xd0J\xf1\x12\xfa\xdc" +
  1503. "\x9b\xd1R\x85\x19\f\x03\xf7\x1a\x00\x9b\x04\xa8\xa5/\x82{wv\xb8" +
  1504. "??\x9a\x1f\xceg\xfb{\xb3N}I\x97\xab\xa9\xf7Rx\xd18" +
  1505. "*\xab\x8c_Vq*XA\n\xa0q\x1e\xb4\xb4\x19t\xf4\xd1B" +
  1506. "3\xd1\t\xa3@\xab\xde\xd0x\xa1/h\xd4\xc0\x8e:\xa0\xf7«" +
  1507. "쳣MN\x1c\xde\b\xbbQ\x94[GaOv\x0f[\xa9\xb7" +
  1508. "k\"&\xae\xe6\x87\xd4\xf5\x1a\xbd\xc7r\xd8\x17Q\xb1a?\x9bN" +
  1509. "\xe7\x93Y\xff\xe3,G\xd2\xdc?]Cjj\xa1\xae\xd8Z\x8b\xec" +
  1510. "\xe9\xdc\xc8\xc7B\xf9~\xb0YF\n\xb9\xc02\xbc\x1d.\xe8\xd9\x04" +
  1511. "\x1bV*@A\xb8K+Fs\x98+\xeb|\x10\xe4m]\xaec" +
  1512. "V\u07bc\x15\xbd\b\xda\xfdcK\xd2\x18\xb3\xcbJ\xa5\xfck\xd06" +
  1513. "\x99(\x9dh\x06\xa5B\xeb\xadP>(t\x03K\x1b\x1b\xa5a2" +
  1514. "\xf7\x05\x98%\xe1\x1a\x1c\x15ؕz\xa3\xaa\x8fH\n\xa3٩\x1d" +
  1515. ",>\xd6\xd4\xd6J\xae\xbb\xc09\xd8\xcbF\xab\xee\x13Y}E\r" +
  1516. "T\rʋ\b(\x93*ωH\xe3c\xfc\xfejo^J\xf9" +
  1517. "\xedy\xd0l+o\x94\xb2y]\xba\x99\xfah\xa0}\x93`t`" +
  1518. "0\x9c$\xe3\x1a蛒\xf4\x1f\x95ӝ\xbfPK\x03\x04\x14\x00" +
  1519. "\x00\b\b\x00D\xae\fC\xb6w\xb3\xfa\xf6\x02\x00\x00;\x06\x00\x00" +
  1520. "\x18\x00\x00\x00xl/worksheets/sh" +
  1521. "eet3.xml\x8dTMS\xdb0\x10\xbd\xf7Wht" +
  1522. "o\x9cP\x02\x81\x89\xc30\xa4)\x9d\xa1\x84i\xa0\xcc\xf4\xa6X\xeb" +
  1523. "X\x83\xacu%\x99\x10~}W\xb2\xe3\x18\xe8\xa19\x90\xd5.\xfb" +
  1524. "\xf5\xde\xdbL/^J͞\xc1:\x85&\xe5\xa3\xc1\x9030\x19" +
  1525. "Je6)\u007f\xb8_|\x9ep\xe6\xbc0Rh4\x90\xf2\x1d8" +
  1526. "~1\xfb4ݢ}r\x05\x80gT\xc0\xb8\x94\x17\xdeW\xe7I" +
  1527. "\xe2\xb2\x02J\xe1\x06X\x81\xa1H\x8e\xb6\x14\x9e\x9ev\x93\xb8ʂ" +
  1528. "\x901\xa9\xd4\xc9\xd1px\x92\x94B\x19\xdeT8\xb7\xffS\x03\xf3" +
  1529. "\\e0Ǭ.\xc1\xf8\xa6\x88\x05-<\x8d\xef\nU9>\x9b" +
  1530. "\xc6\x0ew\x96\xe5J{\xb0?P\xd2ع\xd0\x0e(V\x89\r\xac" +
  1531. "\xc0?T1\xee\xef\xf1\x8e\x1c\xfbp2\x9b&m\xf2l*\x15u" +
  1532. "\b\xa80\vy\xca/G!\x1c\xa3\xbf\x14l]\xcff\x19j\xb4" +
  1533. "\xdfe\xcaO\x8e9\x93\x90\x8bZ\xfboVɫ\xe0O\xb9\xb75" +
  1534. "pfզ\xa0~7\x90\xfb}?\xe6\n\xdc.h\xbbZ\v\xf7" +
  1535. "\xc6\x19\xb2o\x94\x01\xb7\xcf\x0e\xcee\xed5\xf9V\xbbr\x8d\xfaM" +
  1536. "\xe4'n\xa9\xd75\xa1KD\xf6\x03\xbf\xc1b\xe7\xf0b\xbd\x02\r" +
  1537. "\x99\a\xd95\xf3X\x85\x89\xae@\xeb\xb8#{\xa6\x85Rn\x02\xe4" +
  1538. "\x9a\xb3\xad2\x12\xb7w\x16=\xa5E\x85\xb4y\x81\xfe5\xe2S\xd8" +
  1539. "?lN\xb2yE,W\x99\xd0\x04\xe7h\xd8\u007f\xdf\xc6b\xef\xbd" +
  1540. "\x01\xf8\x1b\xb1\xc3:b\xd8D\t\xd48`@]\xd0\xd73\x1c\x06" +
  1541. ";\xbc\xdb~\x95\bzl\x17\xa0u\xff\xf4xJ:r\xfa\xf6\x9e" +
  1542. "\xb4E\x14\x14)\xa0\xe5\x8aໆ@\x0fM1\xe6\xfb\x8c\xfd\u007f" +
  1543. "ͦį\x8b\u007f\x03\xd3ZT\xae\a`\xa1\xa4\x84\x03.\xa5x" +
  1544. "\t\xab\x1c\x8d\xc9T\xe1\xa0\xc2\xf5\xec\x02&À\xa6\xf4E\b\x0f" +
  1545. "ƧǓ\xb3\xc9\xe9d||4n\x06nz\xc4\xc6s\xe1\x05" +
  1546. "\xb9*\xab\x8c_VQ٬ n\xe9$\x0f*\xd9\x1c\x14\xf2\xde" +
  1547. "C\xfa\xdeS^\xa0U\xafh\xbc\xd0Wt.`{\x83\xd3\xcd{" +
  1548. "\x95}\f$͑\xfc\x10v\xa3\xa8\xb1\x8ez\x1d\x0eN[\x05\xb7" +
  1549. "6\xc1\x1e\xad\xc9)m\xbaF\xef\xb1<\xbc\x8b(\xc4\xf0\x1e\x8fF" +
  1550. "\x93\xe1\xb8\xfbp\x96#I韡\xa4;κbk-\xb2\xa7" +
  1551. "K#\x1f\v\xe5\xbb\xf3d\x19\x91\u007f\x85e\xb8|\x174j\x82\x0f" +
  1552. "+\x15@ \xa0\xa5\x15\xbd\xdbʕu>\x88\xec\xb6.ױ%" +
  1553. "o.\xbe\xa3\xba}?\xb6\xac\xf4њW*\xe5_\x82^\xc9E" +
  1554. "\xedD#\xfe\n\xad\xb7B\xf9 \xbe\r,mܒ\x0e\xc4\xdc\x17" +
  1555. "`\x96\x84h\bT`Wꕦ>#\xee{\xf7P;X\xbc" +
  1556. "\x9f\xa9\x9d\x95Bw\x81m\xb0\xf3F\x91\xee\x03M\xddD\x84S\x83" +
  1557. "\xef\"Bɤ\xcas\xe2\xcf\xf8X\xbc\xcb\xeb\xdcK)\xbf>\x1f" +
  1558. "\x14:\x9b\xa2\x94\xcd/\x05\xa9\xaeg\x93\xd9Tlܝ\xddoF" +
  1559. "\xcf\xeew\u007f\xf6\x17PK\x01\x02\x14\x00\x14\x00\x00\b\b\x00D\xae" +
  1560. "\fC\xf4\xeb\xcaY=\x01\x00\x00g\x05\x00\x00\x13\x00\x00\x00\x00\x00" +
  1561. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00[Content" +
  1562. "_Types].xmlPK\x01\x02\x14\x00\x14\x00\x00" +
  1563. "\b\b\x00D\xae\fCf\xaa\x82\xb7\xe0\x00\x00\x00;\x02\x00\x00\v" +
  1564. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00n\x01\x00\x00_re" +
  1565. "ls/.relsPK\x01\x02\x14\x00\x14\x00\x00\b\b\x00" +
  1566. "D\xae\fC\x17ϯ\xa7\xbc\x00\x00\x005\x01\x00\x00\x10\x00\x00\x00" +
  1567. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00w\x02\x00\x00docPro" +
  1568. "ps/app.xmlPK\x01\x02\x14\x00\x14\x00\x00\b" +
  1569. "\b\x00D\xae\fC\x17qy\xdb:\x01\x00\x00x\x02\x00\x00\x11\x00" +
  1570. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00a\x03\x00\x00xl/w" +
  1571. "orksheets.xmlPK\x01\x02\x14\x00\x14" +
  1572. "\x00\x00\b\b\x00D\xae\fC(\xba\xe5Ҧ\x00\x00\x00\xec\x00\x00" +
  1573. "\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xca\x04\x00\x00x" +
  1574. "l/sharedStrings.xmlP" +
  1575. "K\x01\x02\x1e\x03\x14\x00\x00\b\b\x00\xcf,\rC\x0ep\x99\x04\f" +
  1576. "\x04\x00\x00\x96\x1f\x00\x00\r\x00\x18\x00\x00\x00\x00\x00\x01\x00\x00\x00\xb6" +
  1577. "\x81\xa2\x05\x00\x00xl/styles.xmlUT" +
  1578. "\x05\x00\x035\xaa\tRux\v\x00\x01\x04\xe8\x03\x00\x00\x04\xe8\x03" +
  1579. "\x00\x00PK\x01\x02\x1e\x03\x14\x00\x00\b\b\x00\xe0\x15\xf7D\b\xc4" +
  1580. "0\xf9\xbe\x01\x00\x00}\x03\x00\x00\x0f\x00\x18\x00\x00\x00\x00\x00\x01\x00" +
  1581. "\x00\x00\xb6\x81\xf5\t\x00\x00xl/workbook." +
  1582. "xmlUT\x05\x00\x03\x03\x06\xcfSux\v\x00\x01\x04\xe8\x03" +
  1583. "\x00\x00\x04\xe8\x03\x00\x00PK\x01\x02\x1e\x03\x14\x00\x00\b\b\x00\xb2" +
  1584. "\x044C\xa0J\x80\x9e\x84\x03\x00\x00\x8f\b\x00\x00\x18\x00\x18\x00\x00" +
  1585. "\x00\x00\x00\x01\x00\x00\x00\xb6\x81\xfc\v\x00\x00xl/work" +
  1586. "sheets/sheet1.xmlUT\x05" +
  1587. "\x00\x03\xb0|;Rux\v\x00\x01\x04\xe8\x03\x00\x00\x04\xe8\x03\x00" +
  1588. "\x00PK\x01\x02\x1e\x03\x14\x00\x00\b\b\x00\xb3\x044C\xccJ\xae" +
  1589. "2\x0e\x03\x00\x00\x99\x06\x00\x00\x18\x00\x18\x00\x00\x00\x00\x00\x01\x00\x00" +
  1590. "\x00\xb6\x81\xd2\x0f\x00\x00xl/worksheets" +
  1591. "/sheet2.xmlUT\x05\x00\x03\xb1|;R" +
  1592. "ux\v\x00\x01\x04\xe8\x03\x00\x00\x04\xe8\x03\x00\x00PK\x01\x02D" +
  1593. "\xae\fC\xb6w\xb3\xfa\xf6\x02\x00\x00;\x06\x00\x00\x18\x00\x00\x00\x00" +
  1594. "\x00\x00\x00\x00\x00\x00\x00\x00\x00PK\x05\x06\x00\x00\x00\x00\n\x00\n" +
  1595. "\x00\xe3\x02\x00\x00^\x16\x00\x00\x00\x00",
  1596. }
  1597. for _, f := range crashers {
  1598. _, err := OpenBinary([]byte(f))
  1599. if err == nil {
  1600. t.Fatal("Expected a well formed error from opening this file")
  1601. }
  1602. }
  1603. }