lib_test.go 61 KB

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