xmlCalcChain.go 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of
  2. // this source code is governed by a BSD-style license that can be found in
  3. // the LICENSE file.
  4. //
  5. // Package excelize providing a set of functions that allow you to write to
  6. // and read from XLSX / XLSM / XLTM files. Supports reading and writing
  7. // spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
  8. // complex components by high compatibility, and provided streaming API for
  9. // generating or reading data from a worksheet with huge amounts of data. This
  10. // library needs Go version 1.15 or later.
  11. package excelize
  12. import "encoding/xml"
  13. // xlsxCalcChain directly maps the calcChain element. This element represents the root of the calculation chain.
  14. type xlsxCalcChain struct {
  15. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main calcChain"`
  16. C []xlsxCalcChainC `xml:"c"`
  17. }
  18. // xlsxCalcChainC directly maps the c element.
  19. //
  20. // Attributes | Attributes
  21. // --------------------------+----------------------------------------------------------
  22. // a (Array) | A Boolean flag indicating whether the cell's formula
  23. // | is an array formula. True if this cell's formula is
  24. // | an array formula, false otherwise. If there is a
  25. // | conflict between this attribute and the t attribute
  26. // | of the f element (§18.3.1.40), the t attribute takes
  27. // | precedence. The possible values for this attribute
  28. // | are defined by the W3C XML Schema boolean datatype.
  29. // |
  30. // i (Sheet Id) | A sheet Id of a sheet the cell belongs to. If this is
  31. // | omitted, it is assumed to be the same as the i value
  32. // | of the previous cell.The possible values for this
  33. // | attribute are defined by the W3C XML Schema int datatype.
  34. // |
  35. // l (New Dependency Level) | A Boolean flag indicating that the cell's formula
  36. // | starts a new dependency level. True if the formula
  37. // | starts a new dependency level, false otherwise.
  38. // | Starting a new dependency level means that all
  39. // | concurrent calculations, and child calculations, shall
  40. // | be completed - and the cells have new values - before
  41. // | the calc chain can continue. In other words, this
  42. // | dependency level might depend on levels that came before
  43. // | it, and any later dependency levels might depend on
  44. // | this level; but not later dependency levels can have
  45. // | any calculations started until this dependency level
  46. // | completes.The possible values for this attribute are
  47. // | defined by the W3C XML Schema boolean datatype.
  48. // |
  49. // r (Cell Reference) | An A-1 style reference to a cell.The possible values
  50. // | for this attribute are defined by the ST_CellRef
  51. // | simple type (§18.18.7).
  52. // |
  53. // s (Child Chain) | A Boolean flag indicating whether the cell's formula
  54. // | is on a child chain. True if this cell is part of a
  55. // | child chain, false otherwise. If this is omitted, it
  56. // | is assumed to be the same as the s value of the
  57. // | previous cell .A child chain is a list of calculations
  58. // | that occur which depend on the parent to the chain.
  59. // | There shall not be cross dependencies between child
  60. // | chains. Child chains are not the same as dependency
  61. // | levels - a child chain and its parent are all on the
  62. // | same dependency level. Child chains are series of
  63. // | calculations that can be independently farmed out to
  64. // | other threads or processors.The possible values for
  65. // | this attribute are defined by the W3C XML Schema
  66. // | boolean datatype.
  67. // |
  68. // t (New Thread) | A Boolean flag indicating whether the cell's formula
  69. // | starts a new thread. True if the cell's formula starts
  70. // | a new thread, false otherwise.The possible values for
  71. // | this attribute are defined by the W3C XML Schema
  72. // | boolean datatype.
  73. //
  74. type xlsxCalcChainC struct {
  75. R string `xml:"r,attr"`
  76. I int `xml:"i,attr"`
  77. L bool `xml:"l,attr,omitempty"`
  78. S bool `xml:"s,attr,omitempty"`
  79. T bool `xml:"t,attr,omitempty"`
  80. A bool `xml:"a,attr,omitempty"`
  81. }