rubyXL 3.4.37 → 3.4.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/README.rdoc +14 -3
  4. data/Rakefile +18 -13
  5. data/VERSION +1 -1
  6. data/lib/rubyXL/cell.rb +2 -2
  7. data/lib/rubyXL/convenience_methods/cell.rb +15 -8
  8. data/lib/rubyXL/convenience_methods/workbook.rb +2 -2
  9. data/lib/rubyXL/convenience_methods/worksheet.rb +41 -30
  10. data/lib/rubyXL/objects/border.rb +13 -5
  11. data/lib/rubyXL/objects/cell_style.rb +2 -0
  12. data/lib/rubyXL/objects/color.rb +3 -1
  13. data/lib/rubyXL/objects/container_nodes.rb +2 -0
  14. data/lib/rubyXL/objects/fill.rb +2 -0
  15. data/lib/rubyXL/objects/font.rb +2 -0
  16. data/lib/rubyXL/objects/ooxml_object.rb +16 -16
  17. data/lib/rubyXL/objects/reference.rb +38 -33
  18. data/lib/rubyXL/objects/root.rb +8 -1
  19. data/lib/rubyXL/objects/sheet_data.rb +7 -2
  20. data/lib/rubyXL/objects/simple_types.rb +101 -98
  21. data/lib/rubyXL/objects/workbook.rb +5 -5
  22. data/lib/rubyXL/objects/worksheet.rb +23 -4
  23. data/lib/rubyXL/worksheet.rb +5 -17
  24. data/rdoc/README_rdoc.html +28 -9
  25. data/rdoc/RubyXL/AExtension.html +5 -5
  26. data/rdoc/RubyXL/AExtensionStorageArea.html +5 -5
  27. data/rdoc/RubyXL/ActiveX.html +5 -5
  28. data/rdoc/RubyXL/ActiveXBinary.html +5 -5
  29. data/rdoc/RubyXL/AdjustHandleList.html +5 -5
  30. data/rdoc/RubyXL/Alignment.html +5 -5
  31. data/rdoc/RubyXL/AlternateContent.html +5 -5
  32. data/rdoc/RubyXL/AlternateUrls.html +5 -5
  33. data/rdoc/RubyXL/Authors.html +5 -5
  34. data/rdoc/RubyXL/AutoFilter.html +5 -5
  35. data/rdoc/RubyXL/AutoFilterColumn.html +5 -5
  36. data/rdoc/RubyXL/BinaryImageFile.html +5 -5
  37. data/rdoc/RubyXL/BodyProperties.html +5 -5
  38. data/rdoc/RubyXL/BooleanNode.html +5 -5
  39. data/rdoc/RubyXL/BooleanValue.html +5 -5
  40. data/rdoc/RubyXL/Border.html +19 -13
  41. data/rdoc/RubyXL/BorderEdge.html +10 -10
  42. data/rdoc/RubyXL/Borders.html +6 -6
  43. data/rdoc/RubyXL/Break.html +5 -5
  44. data/rdoc/RubyXL/BreakList.html +5 -5
  45. data/rdoc/RubyXL/CT_AdjPoint2D.html +5 -5
  46. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +5 -5
  47. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +5 -5
  48. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +5 -5
  49. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +5 -5
  50. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +5 -5
  51. data/rdoc/RubyXL/CT_Backdrop.html +5 -5
  52. data/rdoc/RubyXL/CT_Bevel.html +5 -5
  53. data/rdoc/RubyXL/CT_BiLevelEffect.html +5 -5
  54. data/rdoc/RubyXL/CT_BlendEffect.html +5 -5
  55. data/rdoc/RubyXL/CT_Blip.html +5 -5
  56. data/rdoc/RubyXL/CT_BlipFillProperties.html +5 -5
  57. data/rdoc/RubyXL/CT_BlurEffect.html +5 -5
  58. data/rdoc/RubyXL/CT_Camera.html +5 -5
  59. data/rdoc/RubyXL/CT_Color.html +5 -5
  60. data/rdoc/RubyXL/CT_ColorChangeEffect.html +5 -5
  61. data/rdoc/RubyXL/CT_ColorMapping.html +5 -5
  62. data/rdoc/RubyXL/CT_ColorScheme.html +5 -5
  63. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +5 -5
  64. data/rdoc/RubyXL/CT_ConnectionSite.html +5 -5
  65. data/rdoc/RubyXL/CT_ConnectionSiteList.html +5 -5
  66. data/rdoc/RubyXL/CT_DashStop.html +5 -5
  67. data/rdoc/RubyXL/CT_DashStopList.html +5 -5
  68. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +5 -5
  69. data/rdoc/RubyXL/CT_DuotoneEffect.html +5 -5
  70. data/rdoc/RubyXL/CT_EffectContainer.html +5 -5
  71. data/rdoc/RubyXL/CT_EffectList.html +5 -5
  72. data/rdoc/RubyXL/CT_EffectReference.html +5 -5
  73. data/rdoc/RubyXL/CT_EffectStyleItem.html +5 -5
  74. data/rdoc/RubyXL/CT_EffectStyleList.html +5 -5
  75. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +5 -5
  76. data/rdoc/RubyXL/CT_FillEffect.html +5 -5
  77. data/rdoc/RubyXL/CT_FillOverlayEffect.html +5 -5
  78. data/rdoc/RubyXL/CT_FillStyleList.html +5 -5
  79. data/rdoc/RubyXL/CT_FlatText.html +5 -5
  80. data/rdoc/RubyXL/CT_FontCollection.html +5 -5
  81. data/rdoc/RubyXL/CT_FontReference.html +5 -5
  82. data/rdoc/RubyXL/CT_GeomGuideList.html +5 -5
  83. data/rdoc/RubyXL/CT_GlowEffect.html +5 -5
  84. data/rdoc/RubyXL/CT_GradientFillProperties.html +5 -5
  85. data/rdoc/RubyXL/CT_GradientStop.html +5 -5
  86. data/rdoc/RubyXL/CT_GradientStopList.html +5 -5
  87. data/rdoc/RubyXL/CT_HSLEffect.html +5 -5
  88. data/rdoc/RubyXL/CT_HslColor.html +5 -5
  89. data/rdoc/RubyXL/CT_Hyperlink.html +5 -5
  90. data/rdoc/RubyXL/CT_InnerShadowEffect.html +5 -5
  91. data/rdoc/RubyXL/CT_LightRig.html +5 -5
  92. data/rdoc/RubyXL/CT_LineEndProperties.html +5 -5
  93. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +5 -5
  94. data/rdoc/RubyXL/CT_LineProperties.html +5 -5
  95. data/rdoc/RubyXL/CT_LineStyleList.html +5 -5
  96. data/rdoc/RubyXL/CT_LinearShadeProperties.html +5 -5
  97. data/rdoc/RubyXL/CT_LuminanceEffect.html +5 -5
  98. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +5 -5
  99. data/rdoc/RubyXL/CT_OuterShadowEffect.html +5 -5
  100. data/rdoc/RubyXL/CT_Path2D.html +5 -5
  101. data/rdoc/RubyXL/CT_Path2DArcTo.html +5 -5
  102. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +5 -5
  103. data/rdoc/RubyXL/CT_Path2DList.html +5 -5
  104. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +5 -5
  105. data/rdoc/RubyXL/CT_Path2DTo.html +5 -5
  106. data/rdoc/RubyXL/CT_PathShadeProperties.html +5 -5
  107. data/rdoc/RubyXL/CT_PatternFillProperties.html +5 -5
  108. data/rdoc/RubyXL/CT_Point3D.html +5 -5
  109. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +5 -5
  110. data/rdoc/RubyXL/CT_PresetColor.html +5 -5
  111. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +5 -5
  112. data/rdoc/RubyXL/CT_PresetShadowEffect.html +5 -5
  113. data/rdoc/RubyXL/CT_PresetTextShape.html +5 -5
  114. data/rdoc/RubyXL/CT_ReflectionEffect.html +5 -5
  115. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +5 -5
  116. data/rdoc/RubyXL/CT_RelativeRect.html +5 -5
  117. data/rdoc/RubyXL/CT_SRgbColor.html +5 -5
  118. data/rdoc/RubyXL/CT_ScRgbColor.html +5 -5
  119. data/rdoc/RubyXL/CT_Scene3D.html +5 -5
  120. data/rdoc/RubyXL/CT_SchemeColor.html +5 -5
  121. data/rdoc/RubyXL/CT_Shape3D.html +5 -5
  122. data/rdoc/RubyXL/CT_ShapeStyle.html +5 -5
  123. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +5 -5
  124. data/rdoc/RubyXL/CT_SphereCoords.html +5 -5
  125. data/rdoc/RubyXL/CT_StretchInfoProperties.html +5 -5
  126. data/rdoc/RubyXL/CT_StyleMatrix.html +5 -5
  127. data/rdoc/RubyXL/CT_StyleMatrixReference.html +5 -5
  128. data/rdoc/RubyXL/CT_SupplementalFont.html +5 -5
  129. data/rdoc/RubyXL/CT_SystemColor.html +5 -5
  130. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +5 -5
  131. data/rdoc/RubyXL/CT_TextBlipBullet.html +5 -5
  132. data/rdoc/RubyXL/CT_TextCharBullet.html +5 -5
  133. data/rdoc/RubyXL/CT_TextCharacterProperties.html +5 -5
  134. data/rdoc/RubyXL/CT_TextFont.html +5 -5
  135. data/rdoc/RubyXL/CT_TextListStyle.html +5 -5
  136. data/rdoc/RubyXL/CT_TextNormalAutofit.html +5 -5
  137. data/rdoc/RubyXL/CT_TextParagraphProperties.html +5 -5
  138. data/rdoc/RubyXL/CT_TextSpacing.html +5 -5
  139. data/rdoc/RubyXL/CT_TextTabStop.html +5 -5
  140. data/rdoc/RubyXL/CT_TextTabStopList.html +5 -5
  141. data/rdoc/RubyXL/CT_TileInfoProperties.html +5 -5
  142. data/rdoc/RubyXL/CT_TintEffect.html +5 -5
  143. data/rdoc/RubyXL/CT_Transform2D.html +5 -5
  144. data/rdoc/RubyXL/CT_TransformEffect.html +5 -5
  145. data/rdoc/RubyXL/CT_Vector3D.html +5 -5
  146. data/rdoc/RubyXL/CT_XYAdjustHandle.html +5 -5
  147. data/rdoc/RubyXL/CalculationChain.html +5 -5
  148. data/rdoc/RubyXL/CalculationChainCell.html +5 -5
  149. data/rdoc/RubyXL/CalculationProperties.html +5 -5
  150. data/rdoc/RubyXL/Cell.html +6 -6
  151. data/rdoc/RubyXL/CellConvenienceMethods.html +72 -51
  152. data/rdoc/RubyXL/CellExt.html +5 -5
  153. data/rdoc/RubyXL/CellSmartTag.html +5 -5
  154. data/rdoc/RubyXL/CellSmartTagProperty.html +5 -5
  155. data/rdoc/RubyXL/CellSmartTags.html +5 -5
  156. data/rdoc/RubyXL/CellStyle.html +5 -5
  157. data/rdoc/RubyXL/CellStyleXFs.html +5 -5
  158. data/rdoc/RubyXL/CellStyles.html +5 -5
  159. data/rdoc/RubyXL/CellValue.html +5 -5
  160. data/rdoc/RubyXL/CellWatch.html +5 -5
  161. data/rdoc/RubyXL/CellWatches.html +5 -5
  162. data/rdoc/RubyXL/CellXFs.html +5 -5
  163. data/rdoc/RubyXL/ChartColorsFile.html +5 -5
  164. data/rdoc/RubyXL/ChartFile.html +5 -5
  165. data/rdoc/RubyXL/ChartStyleFile.html +5 -5
  166. data/rdoc/RubyXL/ChartUserShapesFile.html +5 -5
  167. data/rdoc/RubyXL/Chartsheet.html +5 -5
  168. data/rdoc/RubyXL/ChartsheetPageSetup.html +5 -5
  169. data/rdoc/RubyXL/ChartsheetProperties.html +5 -5
  170. data/rdoc/RubyXL/ChartsheetProtection.html +5 -5
  171. data/rdoc/RubyXL/ChartsheetView.html +5 -5
  172. data/rdoc/RubyXL/ChartsheetViews.html +5 -5
  173. data/rdoc/RubyXL/Color.html +7 -7
  174. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +5 -5
  175. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +5 -5
  176. data/rdoc/RubyXL/ColorConvenienceClasses.html +5 -5
  177. data/rdoc/RubyXL/ColorConvenienceMethods.html +5 -5
  178. data/rdoc/RubyXL/ColorFilter.html +5 -5
  179. data/rdoc/RubyXL/ColorScale.html +5 -5
  180. data/rdoc/RubyXL/ColorSet.html +5 -5
  181. data/rdoc/RubyXL/Colors.html +5 -5
  182. data/rdoc/RubyXL/ColumnRange.html +5 -5
  183. data/rdoc/RubyXL/ColumnRanges.html +5 -5
  184. data/rdoc/RubyXL/Comment.html +5 -5
  185. data/rdoc/RubyXL/CommentList.html +5 -5
  186. data/rdoc/RubyXL/CommentsFile.html +5 -5
  187. data/rdoc/RubyXL/ConditionalFormatValue.html +5 -5
  188. data/rdoc/RubyXL/ConditionalFormatting.html +5 -5
  189. data/rdoc/RubyXL/ConditionalFormattingRule.html +5 -5
  190. data/rdoc/RubyXL/Connection.html +5 -5
  191. data/rdoc/RubyXL/ConnectionTable.html +5 -5
  192. data/rdoc/RubyXL/ConnectionTables.html +5 -5
  193. data/rdoc/RubyXL/ConnectionTextField.html +5 -5
  194. data/rdoc/RubyXL/ConnectionTextFields.html +5 -5
  195. data/rdoc/RubyXL/Connections.html +5 -5
  196. data/rdoc/RubyXL/ContentTypeDefault.html +5 -5
  197. data/rdoc/RubyXL/ContentTypeOverride.html +5 -5
  198. data/rdoc/RubyXL/ContentTypes.html +5 -5
  199. data/rdoc/RubyXL/ControlPropertiesFile.html +5 -5
  200. data/rdoc/RubyXL/CorePropertiesFile.html +5 -5
  201. data/rdoc/RubyXL/CustomColor.html +5 -5
  202. data/rdoc/RubyXL/CustomColorList.html +5 -5
  203. data/rdoc/RubyXL/CustomFilter.html +5 -5
  204. data/rdoc/RubyXL/CustomFilters.html +5 -5
  205. data/rdoc/RubyXL/CustomGeometry.html +5 -5
  206. data/rdoc/RubyXL/CustomProperties.html +5 -5
  207. data/rdoc/RubyXL/CustomPropertiesFile.html +5 -5
  208. data/rdoc/RubyXL/CustomProperty.html +5 -5
  209. data/rdoc/RubyXL/CustomPropertyFile.html +5 -5
  210. data/rdoc/RubyXL/CustomSheetView.html +5 -5
  211. data/rdoc/RubyXL/CustomSheetViews.html +5 -5
  212. data/rdoc/RubyXL/CustomWorkbookView.html +5 -5
  213. data/rdoc/RubyXL/CustomWorkbookViews.html +5 -5
  214. data/rdoc/RubyXL/CustomXMLFile.html +5 -5
  215. data/rdoc/RubyXL/DXF.html +5 -5
  216. data/rdoc/RubyXL/DXFs.html +5 -5
  217. data/rdoc/RubyXL/DataBar.html +5 -5
  218. data/rdoc/RubyXL/DataConsolidate.html +5 -5
  219. data/rdoc/RubyXL/DataConsolidationReference.html +5 -5
  220. data/rdoc/RubyXL/DataConsolidationReferences.html +5 -5
  221. data/rdoc/RubyXL/DataType.html +5 -5
  222. data/rdoc/RubyXL/DataValidation.html +5 -5
  223. data/rdoc/RubyXL/DataValidations.html +5 -5
  224. data/rdoc/RubyXL/DateGroupItem.html +5 -5
  225. data/rdoc/RubyXL/DefinedName.html +5 -5
  226. data/rdoc/RubyXL/DefinedNameExt.html +5 -5
  227. data/rdoc/RubyXL/DefinedNames.html +5 -5
  228. data/rdoc/RubyXL/DefinedNamesExt.html +5 -5
  229. data/rdoc/RubyXL/DocumentPropertiesFile.html +5 -5
  230. data/rdoc/RubyXL/DrawingFile.html +5 -5
  231. data/rdoc/RubyXL/DynamicFilter.html +5 -5
  232. data/rdoc/RubyXL/EmbeddedControl.html +5 -5
  233. data/rdoc/RubyXL/EmbeddedControls.html +5 -5
  234. data/rdoc/RubyXL/Extension.html +5 -5
  235. data/rdoc/RubyXL/ExtensionStorageArea.html +5 -5
  236. data/rdoc/RubyXL/Extents.html +5 -5
  237. data/rdoc/RubyXL/ExternalBook.html +5 -5
  238. data/rdoc/RubyXL/ExternalLinksFile.html +5 -5
  239. data/rdoc/RubyXL/ExternalReference.html +5 -5
  240. data/rdoc/RubyXL/ExternalReferences.html +5 -5
  241. data/rdoc/RubyXL/ExtraColorSchemeList.html +5 -5
  242. data/rdoc/RubyXL/FieldItem.html +5 -5
  243. data/rdoc/RubyXL/FileRecoveryProperties.html +5 -5
  244. data/rdoc/RubyXL/FileSharing.html +5 -5
  245. data/rdoc/RubyXL/FileVersion.html +5 -5
  246. data/rdoc/RubyXL/Fill.html +6 -6
  247. data/rdoc/RubyXL/Fills.html +6 -6
  248. data/rdoc/RubyXL/FilterContainer.html +5 -5
  249. data/rdoc/RubyXL/FloatNode.html +5 -5
  250. data/rdoc/RubyXL/FloatValue.html +5 -5
  251. data/rdoc/RubyXL/Font.html +6 -6
  252. data/rdoc/RubyXL/FontConvenienceMethods.html +5 -5
  253. data/rdoc/RubyXL/FontScheme.html +5 -5
  254. data/rdoc/RubyXL/Fonts.html +6 -6
  255. data/rdoc/RubyXL/Formula.html +5 -5
  256. data/rdoc/RubyXL/FunctionGroup.html +5 -5
  257. data/rdoc/RubyXL/FunctionGroups.html +5 -5
  258. data/rdoc/RubyXL/GenericStorageObject.html +5 -5
  259. data/rdoc/RubyXL/GradientFill.html +5 -5
  260. data/rdoc/RubyXL/HeaderFooterSettings.html +5 -5
  261. data/rdoc/RubyXL/Hyperlink.html +5 -5
  262. data/rdoc/RubyXL/HyperlinkRelFile.html +5 -5
  263. data/rdoc/RubyXL/Hyperlinks.html +5 -5
  264. data/rdoc/RubyXL/IconFilter.html +5 -5
  265. data/rdoc/RubyXL/IconSet.html +5 -5
  266. data/rdoc/RubyXL/IgnoredError.html +5 -5
  267. data/rdoc/RubyXL/IgnoredErrors.html +5 -5
  268. data/rdoc/RubyXL/IndexedColors.html +5 -5
  269. data/rdoc/RubyXL/InputCells.html +5 -5
  270. data/rdoc/RubyXL/IntegerNode.html +5 -5
  271. data/rdoc/RubyXL/IntegerValue.html +5 -5
  272. data/rdoc/RubyXL/LegacyCell.html +5 -5
  273. data/rdoc/RubyXL/LegacyWorksheet.html +6 -140
  274. data/rdoc/RubyXL/MRUColors.html +5 -5
  275. data/rdoc/RubyXL/MacrosFile.html +5 -5
  276. data/rdoc/RubyXL/MergedCell.html +5 -5
  277. data/rdoc/RubyXL/MergedCells.html +5 -5
  278. data/rdoc/RubyXL/NumFmt.html +5 -5
  279. data/rdoc/RubyXL/NumberFormat.html +5 -5
  280. data/rdoc/RubyXL/NumberFormats.html +5 -5
  281. data/rdoc/RubyXL/OLEObject.html +5 -5
  282. data/rdoc/RubyXL/OLEObjectFile.html +5 -5
  283. data/rdoc/RubyXL/OLEObjects.html +5 -5
  284. data/rdoc/RubyXL/OLESize.html +5 -5
  285. data/rdoc/RubyXL/OOXMLContainerObject.html +13 -20
  286. data/rdoc/RubyXL/OOXMLIgnored.html +5 -5
  287. data/rdoc/RubyXL/OOXMLObject.html +5 -5
  288. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +17 -13
  289. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +16 -17
  290. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +5 -5
  291. data/rdoc/RubyXL/OOXMLTopLevelObject.html +6 -6
  292. data/rdoc/RubyXL/OdbcOleDbProperties.html +5 -5
  293. data/rdoc/RubyXL/Offset.html +5 -5
  294. data/rdoc/RubyXL/OlapProperties.html +5 -5
  295. data/rdoc/RubyXL/OleItem.html +5 -5
  296. data/rdoc/RubyXL/OleItems.html +5 -5
  297. data/rdoc/RubyXL/OleLink.html +5 -5
  298. data/rdoc/RubyXL/OutlineProperties.html +5 -5
  299. data/rdoc/RubyXL/PageMargins.html +5 -5
  300. data/rdoc/RubyXL/PageSetup.html +5 -5
  301. data/rdoc/RubyXL/PageSetupProperties.html +5 -5
  302. data/rdoc/RubyXL/Pane.html +5 -5
  303. data/rdoc/RubyXL/Parser.html +5 -5
  304. data/rdoc/RubyXL/PatternFill.html +5 -5
  305. data/rdoc/RubyXL/PersonMetadata.html +5 -5
  306. data/rdoc/RubyXL/PhoneticProperties.html +5 -5
  307. data/rdoc/RubyXL/PhoneticRun.html +5 -5
  308. data/rdoc/RubyXL/PivotArea.html +5 -5
  309. data/rdoc/RubyXL/PivotCache.html +5 -5
  310. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +5 -5
  311. data/rdoc/RubyXL/PivotCacheRecordsFile.html +5 -5
  312. data/rdoc/RubyXL/PivotCaches.html +5 -5
  313. data/rdoc/RubyXL/PivotReference.html +5 -5
  314. data/rdoc/RubyXL/PivotReferences.html +5 -5
  315. data/rdoc/RubyXL/{PivotTableSelection.html → PivotSelection.html} +12 -12
  316. data/rdoc/RubyXL/PivotTableFile.html +5 -5
  317. data/rdoc/RubyXL/PresetGeometry.html +5 -5
  318. data/rdoc/RubyXL/PrintOptions.html +5 -5
  319. data/rdoc/RubyXL/PrinterSettingsFile.html +5 -5
  320. data/rdoc/RubyXL/ProtectedRange.html +5 -5
  321. data/rdoc/RubyXL/ProtectedRanges.html +5 -5
  322. data/rdoc/RubyXL/Protection.html +5 -5
  323. data/rdoc/RubyXL/QueryParameter.html +5 -5
  324. data/rdoc/RubyXL/QueryParameters.html +5 -5
  325. data/rdoc/RubyXL/QueryTable.html +5 -5
  326. data/rdoc/RubyXL/QueryTableDeletedField.html +5 -5
  327. data/rdoc/RubyXL/QueryTableDeletedFields.html +5 -5
  328. data/rdoc/RubyXL/QueryTableField.html +5 -5
  329. data/rdoc/RubyXL/QueryTableFields.html +5 -5
  330. data/rdoc/RubyXL/QueryTableRefresh.html +5 -5
  331. data/rdoc/RubyXL/RID.html +5 -5
  332. data/rdoc/RubyXL/RawOOXML.html +5 -5
  333. data/rdoc/RubyXL/Reference.html +110 -154
  334. data/rdoc/RubyXL/Relationship.html +5 -5
  335. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +5 -5
  336. data/rdoc/RubyXL/RelationshipSupport.html +5 -5
  337. data/rdoc/RubyXL/RevisionPointer.html +5 -5
  338. data/rdoc/RubyXL/RichText.html +5 -5
  339. data/rdoc/RubyXL/RichTextRun.html +5 -5
  340. data/rdoc/RubyXL/Row.html +14 -14
  341. data/rdoc/RubyXL/RowExt.html +5 -5
  342. data/rdoc/RubyXL/RunProperties.html +5 -5
  343. data/rdoc/RubyXL/Scenario.html +5 -5
  344. data/rdoc/RubyXL/Scenarios.html +5 -5
  345. data/rdoc/RubyXL/Selection.html +6 -6
  346. data/rdoc/RubyXL/ShapeGuide.html +5 -5
  347. data/rdoc/RubyXL/ShapeTextRectangle.html +5 -5
  348. data/rdoc/RubyXL/SharedStringsTable.html +5 -5
  349. data/rdoc/RubyXL/Sheet.html +5 -5
  350. data/rdoc/RubyXL/SheetCalculationProperties.html +5 -5
  351. data/rdoc/RubyXL/SheetData.html +7 -7
  352. data/rdoc/RubyXL/SheetDataExt.html +5 -5
  353. data/rdoc/RubyXL/SheetDataSet.html +5 -5
  354. data/rdoc/RubyXL/SheetMetadata.html +5 -5
  355. data/rdoc/RubyXL/SheetName.html +5 -5
  356. data/rdoc/RubyXL/SheetNames.html +5 -5
  357. data/rdoc/RubyXL/Sheets.html +5 -5
  358. data/rdoc/RubyXL/SlicerCacheFile.html +5 -5
  359. data/rdoc/RubyXL/SlicerFile.html +5 -5
  360. data/rdoc/RubyXL/SmartTagProperties.html +5 -5
  361. data/rdoc/RubyXL/SmartTagType.html +5 -5
  362. data/rdoc/RubyXL/SmartTagTypes.html +5 -5
  363. data/rdoc/RubyXL/SmartTags.html +5 -5
  364. data/rdoc/RubyXL/SortCondition.html +5 -5
  365. data/rdoc/RubyXL/SortState.html +5 -5
  366. data/rdoc/RubyXL/Sqref.html +7 -7
  367. data/rdoc/RubyXL/Stop.html +5 -5
  368. data/rdoc/RubyXL/StringNode.html +5 -5
  369. data/rdoc/RubyXL/StringNodeW3C.html +7 -7
  370. data/rdoc/RubyXL/StringValue.html +5 -5
  371. data/rdoc/RubyXL/Stylesheet.html +5 -5
  372. data/rdoc/RubyXL/TableFile.html +5 -5
  373. data/rdoc/RubyXL/TableParts.html +5 -5
  374. data/rdoc/RubyXL/TableStyle.html +5 -5
  375. data/rdoc/RubyXL/TableStyles.html +5 -5
  376. data/rdoc/RubyXL/Text.html +5 -5
  377. data/rdoc/RubyXL/TextImportSettings.html +5 -5
  378. data/rdoc/RubyXL/Theme.html +5 -5
  379. data/rdoc/RubyXL/ThemeElements.html +5 -5
  380. data/rdoc/RubyXL/ThumbnailFile.html +5 -5
  381. data/rdoc/RubyXL/Top10.html +5 -5
  382. data/rdoc/RubyXL/VMLDrawingFile.html +5 -5
  383. data/rdoc/RubyXL/Variant.html +5 -5
  384. data/rdoc/RubyXL/Vector.html +6 -6
  385. data/rdoc/RubyXL/VectorValue.html +5 -5
  386. data/rdoc/RubyXL/VisualProperties.html +5 -5
  387. data/rdoc/RubyXL/WebPublishObject.html +5 -5
  388. data/rdoc/RubyXL/WebPublishObjects.html +5 -5
  389. data/rdoc/RubyXL/WebPublishingItem.html +5 -5
  390. data/rdoc/RubyXL/WebPublishingItems.html +5 -5
  391. data/rdoc/RubyXL/WebPublishingProperties.html +5 -5
  392. data/rdoc/RubyXL/WebQueryProperties.html +5 -5
  393. data/rdoc/RubyXL/Workbook.html +8 -8
  394. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +8 -8
  395. data/rdoc/RubyXL/WorkbookProperties.html +5 -5
  396. data/rdoc/RubyXL/WorkbookProtection.html +5 -5
  397. data/rdoc/RubyXL/WorkbookRoot.html +15 -8
  398. data/rdoc/RubyXL/WorkbookView.html +5 -5
  399. data/rdoc/RubyXL/WorkbookViews.html +5 -5
  400. data/rdoc/RubyXL/Worksheet.html +147 -13
  401. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +111 -100
  402. data/rdoc/RubyXL/WorksheetDimensions.html +6 -6
  403. data/rdoc/RubyXL/WorksheetFormatProperties.html +5 -5
  404. data/rdoc/RubyXL/WorksheetProperties.html +5 -5
  405. data/rdoc/RubyXL/WorksheetProtection.html +5 -5
  406. data/rdoc/RubyXL/WorksheetView.html +5 -5
  407. data/rdoc/RubyXL/WorksheetViews.html +5 -5
  408. data/rdoc/RubyXL/XF.html +5 -5
  409. data/rdoc/RubyXL.html +13 -5
  410. data/rdoc/created.rid +21 -21
  411. data/rdoc/index.html +10 -10
  412. data/rdoc/js/search_data.js +1 -1
  413. data/rubyXL.gemspec +7 -4
  414. data/spec/lib/cell_spec.rb +45 -5
  415. data/spec/lib/color_spec.rb +2 -2
  416. data/spec/lib/reference_spec.rb +25 -0
  417. data/spec/lib/workbook_root_spec.rb +43 -0
  418. data/spec/lib/worksheet_spec.rb +65 -57
  419. metadata +32 -3
@@ -3,8 +3,9 @@ module RubyXL
3
3
  ROW_MAX = 1024 * 1024
4
4
  COL_MAX = 16393
5
5
 
6
- attr_reader :row_range, :col_range, :sheet_name
6
+ attr_reader :first_row, :last_row, :first_col, :last_col
7
7
  attr_reader :row_from_absolute, :row_to_absolute, :col_from_absolute, :col_to_absolute
8
+ attr_reader :sheet_name
8
9
 
9
10
  # RubyXL::Reference.new(row, col)
10
11
  # RubyXL::Reference.new(row_from, row_to, col_from, col_to)
@@ -33,56 +34,60 @@ module RubyXL
33
34
  row_from, col_from, @row_from_absolute, @col_from_absolute = self.class.ref2ind(from)
34
35
  row_to, col_to, @row_to_absolute, @col_to_absolute = self.class.ref2ind(to) unless to.nil?
35
36
  else
36
- raise ArgumentError.new("invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
37
+ raise(ArgumentError, "Invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
37
38
  end
38
39
  end
39
40
 
40
- @row_range = Range.new(row_from || 0, row_to || row_from || ROW_MAX)
41
- @col_range = Range.new(col_from || 0, col_to || col_from || COL_MAX)
41
+ @first_row = row_from || 0
42
+ @last_row = row_to || row_from || ROW_MAX
43
+ @first_col = col_from || 0
44
+ @last_col = col_to || col_from || COL_MAX
42
45
  end
43
46
 
44
- def single_cell?
45
- (@row_range.begin == @row_range.end) && (@col_range.begin == @col_range.end)
46
- end
47
-
48
- def valid?
49
- !(row_range.begin.negative? || col_range.begin.negative?)
50
- end
51
-
52
- def first_row
53
- @row_range.begin
47
+ def row_range
48
+ warn "[DEPRECATION] `row_range` is deprecated. Please use `first_row` and `last_row` instead."
49
+ @row_range ||= Range.new(@first_row, @last_row)
54
50
  end
55
51
 
56
- def last_row
57
- @row_range.end
52
+ def col_range
53
+ warn "[DEPRECATION] `col_range` is deprecated. Please use `first_col` and `last_col` instead."
54
+ @col_range ||= Range.new(@first_col, @last_col)
58
55
  end
59
56
 
60
- def first_col
61
- @col_range.begin
57
+ def single_cell?
58
+ (@first_row == @last_row) && (@first_col == @last_col)
62
59
  end
63
60
 
64
- def last_col
65
- @col_range.end
61
+ def valid?
62
+ !(@first_row.negative? || @first_col.negative?)
66
63
  end
67
64
 
68
65
  def ==(other)
69
- !other.nil? && (@sheet_name == other.sheet_name) &&
70
- (@row_range == other.row_range) && (@col_range == other.col_range)
66
+ return false unless other.is_a?(RubyXL::Reference)
67
+ return false unless @sheet_name == other.sheet_name
68
+
69
+ (@first_row == other.first_row) &&
70
+ (@last_row == other.last_row) &&
71
+ (@first_col == other.first_col) &&
72
+ (@last_col == other.last_col)
71
73
  end
72
74
 
73
75
  def cover?(other)
74
- !other.nil? && (@row_range.cover?(other.row_range.begin) &&
75
- @row_range.cover?(other.row_range.end) &&
76
- @col_range.cover?(other.col_range.begin) &&
77
- @col_range.cover?(other.col_range.end))
76
+ return false unless other.is_a?(RubyXL::Reference)
77
+ return false unless @sheet_name == other.sheet_name
78
+
79
+ (@first_row <= other.first_row) &&
80
+ (@last_row >= other.last_row) &&
81
+ (@first_col <= other.first_col) &&
82
+ (@last_col >= other.last_col)
78
83
  end
79
84
 
80
85
  def to_s
81
86
  result = +''
82
87
 
83
88
  if @sheet_name then
84
- if @sheet_name.index(' ') then
85
- result << "'#{@sheet_name}'"
89
+ if @sheet_name.include?(' ') then
90
+ result << "'" << @sheet_name << "'"
86
91
  else
87
92
  result << @sheet_name
88
93
  end
@@ -90,19 +95,19 @@ module RubyXL
90
95
  end
91
96
 
92
97
  if single_cell? then
93
- result << self.class.ind2ref(@row_range.begin, @col_range.begin, @row_from_absolute, @col_from_absolute)
98
+ result << self.class.ind2ref(@first_row, @first_col, @row_from_absolute, @col_from_absolute)
94
99
  else
95
- result << self.class.ind2ref(@row_range.begin, @col_range.begin, @row_from_absolute, @col_from_absolute)
100
+ result << self.class.ind2ref(@first_row, @first_col, @row_from_absolute, @col_from_absolute)
96
101
  result << ':'
97
- result << self.class.ind2ref(@row_range.end, @col_range.end, @row_to_absolute, @col_to_absolute)
102
+ result << self.class.ind2ref(@last_row, @last_col, @row_to_absolute, @col_to_absolute)
98
103
  end
99
104
  end
100
105
 
101
106
  def inspect
102
107
  if single_cell? then
103
- "#<#{self.class} @sheet_name=#{@sheet_name} @row=#{@row_range.begin} @col=#{@col_range.begin}>"
108
+ "#<#{self.class} @sheet_name=#{@sheet_name} @row=#{@first_row} @col=#{@first_col}>"
104
109
  else
105
- "#<#{self.class} @sheet_name=#{@sheet_name} @row_range=#{@row_range} @col_range=#{@col_range}>"
110
+ "#<#{self.class} @sheet_name=#{@sheet_name} rows=#{@first_row}..#{@last_row} cols=#{@first_col}..#{@last_col}>"
106
111
  end
107
112
  end
108
113
 
@@ -45,7 +45,14 @@ module RubyXL
45
45
 
46
46
  self.rels_hash.keys.sort_by{ |c| c::SAVE_ORDER }.each { |klass|
47
47
  puts "<-- DEBUG: saving related #{klass} files" if @@debug
48
- self.rels_hash[klass].select! { |obj|
48
+ # This is a hack.
49
+ # Technically, MS Excel allows one file to be shared amongst multiple sheets in the XLS document.
50
+ # That file exists in the archive structure only once, and all sheets refer to the same file by path.
51
+ # RubyXL uses a tree structure, where each sheet has its own "branches" (related objects),
52
+ # and loops in the relationship graph are not allowed (a child node can have onle one parent).
53
+ # This needs to be fixed in the future. Thankfully, files like that seem to be rare, and this
54
+ # situation can be avoided simply by not saving a node if it already exists in the zipfile.
55
+ self.rels_hash[klass].uniq{ |item| item.xlsx_path }.select! { |obj|
49
56
  puts "<-- DEBUG: > #{obj.xlsx_path}" if @@debug
50
57
  obj.add_to_zip(zipstream)
51
58
  }
@@ -24,7 +24,7 @@ module RubyXL
24
24
 
25
25
  def before_write_xml
26
26
  preserve_whitespace
27
- true
27
+ !(value.nil? || value == '')
28
28
  end
29
29
  end
30
30
 
@@ -46,7 +46,7 @@ module RubyXL
46
46
  attr_accessor :worksheet
47
47
 
48
48
  def index_in_collection
49
- r.col_range.begin
49
+ r.first_col
50
50
  end
51
51
 
52
52
  def row
@@ -143,6 +143,11 @@ module RubyXL
143
143
  # http://www.datypic.com/sc/ooxml/e-ssml_row-1.html
144
144
  class Row < OOXMLObject
145
145
  define_attribute(:r, :int)
146
+ # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.row%28v=office.14%29.aspx
147
+ # "Optimization only, and not required. Specifies the range of non-empty columns (in the format X:Y)
148
+ # for the block of rows to which the current row belongs. To achieve the optimization, span attribute
149
+ # values in a single block should be the same.
150
+ # There are 16 rows per block, beginning with the first row."
146
151
  define_attribute(:spans, :string)
147
152
  define_attribute(:s, :int, :default => 0, :accessor => :style_index)
148
153
  define_attribute(:customFormat, :bool, :default => false)
@@ -1,80 +1,82 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RubyXL
2
- ST_PageOrder = %w{ downThenOver overThenDown }
3
- ST_Orientation = %w{ default portrait landscape }
4
- ST_CellComments = %w{ none asDisplayed atEnd }
5
- ST_PrintError = %w{ displayed blank dash NA }
6
- ST_CfvoType = %w{ num percent max min formula percentile }
7
- ST_SheetViewType = %w{ normal pageBreakPreview pageLayout }
8
- ST_PivotAreaType = %w{ none normal data all origin button topRight }
9
- ST_Axis = %w{ axisRow axisCol axisPage axisValues }
4
+ ST_PageOrder = %w{ downThenOver overThenDown }.freeze
5
+ ST_Orientation = %w{ default portrait landscape }.freeze
6
+ ST_CellComments = %w{ none asDisplayed atEnd }.freeze
7
+ ST_PrintError = %w{ displayed blank dash NA }.freeze
8
+ ST_CfvoType = %w{ num percent max min formula percentile }.freeze
9
+ ST_SheetViewType = %w{ normal pageBreakPreview pageLayout }.freeze
10
+ ST_PivotAreaType = %w{ none normal data all origin button topRight }.freeze
11
+ ST_Axis = %w{ axisRow axisCol axisPage axisValues }.freeze
10
12
  ST_BorderStyle = %w{ none thin medium dashed dotted thick double hair
11
- mediumDashed dashDot mediumDashDot dashDotDot slantDashDot }
12
- ST_HorizontalAlignment = %w{ general left center right fill justify centerContinuous distributed }
13
- ST_VerticalAlignment = %w{ top center bottom justify distributed }
13
+ mediumDashed dashDot mediumDashDot dashDotDot slantDashDot }.freeze
14
+ ST_HorizontalAlignment = %w{ general left center right fill justify centerContinuous distributed }.freeze
15
+ ST_VerticalAlignment = %w{ top center bottom justify distributed }.freeze
14
16
  ST_VectorBaseType = %w{ variant i1 i2 i4 i8 ui1 ui2 ui4 ui8 r4 r8
15
- lpstr lpwstr bstr date filetime bool cy error clsid cf }
16
- ST_PhoneticType = %w{ halfwidthKatakana fullwidthKatakana Hiragana noConversion }
17
- ST_PhoneticAlignment = %w{ noControl left center distributed }
18
- ST_WebSourceType = %w{ sheet printArea autoFilter range chart pivotTable query label }
19
- ST_CellType = %w{ b n e s str inlineStr }
20
- ST_GradientType = %w{ linear path }
17
+ lpstr lpwstr bstr date filetime bool cy error clsid cf }.freeze
18
+ ST_PhoneticType = %w{ halfwidthKatakana fullwidthKatakana Hiragana noConversion }.freeze
19
+ ST_PhoneticAlignment = %w{ noControl left center distributed }.freeze
20
+ ST_WebSourceType = %w{ sheet printArea autoFilter range chart pivotTable query label }.freeze
21
+ ST_CellType = %w{ b n e s str inlineStr }.freeze
22
+ ST_GradientType = %w{ linear path }.freeze
21
23
  ST_PatternType = %w{ none solid mediumGray darkGray lightGray
22
24
  darkHorizontal darkVertical darkDown darkUp darkGrid darkTrellis
23
25
  lightHorizontal lightVertical lightDown lightUp lightGrid lightTrellis
24
- gray125 gray0625 }
25
- ST_Objects = %w{ all placeholders none }
26
- ST_UpdateLinks = %w{ userSet never always }
27
- ST_Visibility = %w{ visible hidden veryHidden }
26
+ gray125 gray0625 }.freeze
27
+ ST_Objects = %w{ all placeholders none }.freeze
28
+ ST_UpdateLinks = %w{ userSet never always }.freeze
29
+ ST_Visibility = %w{ visible hidden veryHidden }.freeze
28
30
 
29
- ST_DateTimeGrouping = %w{ year month day hour minute second }
31
+ ST_DateTimeGrouping = %w{ year month day hour minute second }.freeze
30
32
  ST_CalendarType = %w{ none gregorian gregorianUs japan taiwan korea hijri thai hebrew
31
- gregorianMeFrench gregorianArabic gregorianXlitEnglish gregorianXlitFrench }
32
- ST_FilterOperator = %w{ equal lessThan lessThanOrEqual notEqual greaterThanOrEqual greaterThan }
33
+ gregorianMeFrench gregorianArabic gregorianXlitEnglish gregorianXlitFrench }.freeze
34
+ ST_FilterOperator = %w{ equal lessThan lessThanOrEqual notEqual greaterThanOrEqual greaterThan }.freeze
33
35
  ST_DynamicFilterType = %w{ null aboveAverage belowAverage tomorrow today yesterday
34
36
  nextWeek thisWeek lastWeek nextMonth thisMonth lastMonth
35
37
  nextQuarter thisQuarter lastQuarter nextYear thisYear lastYear
36
- yearToDate Q1 Q2 Q3 Q4 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 }
38
+ yearToDate Q1 Q2 Q3 Q4 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 }.freeze
37
39
  ST_IconSetType = %w{ 3Arrows 3ArrowsGray 3Flags 3TrafficLights1 3TrafficLights2
38
40
  3Signs 3Symbols 3Symbols2 4Arrows 4ArrowsGray 4RedToBlack
39
- 4Rating 4TrafficLights 5Arrows 5ArrowsGray 5Rating 5Quarters }
40
- ST_SortMethod = %w{ stroke pinYin none }
41
- ST_SortBy = %w{ value cellColor fontColor icon }
41
+ 4Rating 4TrafficLights 5Arrows 5ArrowsGray 5Rating 5Quarters }.freeze
42
+ ST_SortMethod = %w{ stroke pinYin none }.freeze
43
+ ST_SortBy = %w{ value cellColor fontColor icon }.freeze
42
44
 
43
- ST_CellFormulaType = %w{ normal array dataTable shared }
45
+ ST_CellFormulaType = %w{ normal array dataTable shared }.freeze
44
46
  ST_TargetScreenSize = %w{ 544x376 640x480 720x512 800x600 1024x768 1152x882
45
- 1152x900 1280x1024 1600x1200 1800x1440 1920x1200 }
46
- ST_SmartTagShow = %w{ all none noIndicator }
47
+ 1152x900 1280x1024 1600x1200 1800x1440 1920x1200 }.freeze
48
+ ST_SmartTagShow = %w{ all none noIndicator }.freeze
47
49
 
48
50
  ST_CfType = %w{ expression cellIs colorScale dataBar iconSet top10 uniqueValues
49
51
  duplicateValues containsText notContainsText beginsWith
50
52
  endsWith containsBlanks notContainsBlanks containsErrors
51
- notContainsErrors timePeriod aboveAverage }
53
+ notContainsErrors timePeriod aboveAverage }.freeze
52
54
  ST_TimePeriod = %w{ today yesterday tomorrow last7Days thisMonth
53
- lastMonth nextMonth thisWeek lastWeek nextWeek }
54
- ST_CalcMode = %w{ manual auto autoNoTable }
55
- ST_RefMode = %w{ A1 R1C1 }
55
+ lastMonth nextMonth thisWeek lastWeek nextWeek }.freeze
56
+ ST_CalcMode = %w{ manual auto autoNoTable }.freeze
57
+ ST_RefMode = %w{ A1 R1C1 }.freeze
56
58
 
57
- ST_DvAspect = %w{ DVASPECT_CONTENT DVASPECT_ICON }
58
- ST_OleUpdate = %w{ OLEUPDATE_ALWAYS OLEUPDATE_ONCALL }
59
+ ST_DvAspect = %w{ DVASPECT_CONTENT DVASPECT_ICON }.freeze
60
+ ST_OleUpdate = %w{ OLEUPDATE_ALWAYS OLEUPDATE_ONCALL }.freeze
59
61
 
60
- ST_Pane = %w{ bottomRight topRight bottomLeft topLeft }
61
- ST_PaneState = %w{ split frozen frozenSplit }
62
+ ST_Pane = %w{ bottomRight topRight bottomLeft topLeft }.freeze
63
+ ST_PaneState = %w{ split frozen frozenSplit }.freeze
62
64
 
63
- ST_Comments = %w{ commNone commIndicator commIndAndComment }
65
+ ST_Comments = %w{ commNone commIndicator commIndAndComment }.freeze
64
66
 
65
- ST_DataValidationType = %w{ none whole decimal list date time textLength custom }
66
- ST_DataValidationErrorStyle = %w{ stop warning information }
67
+ ST_DataValidationType = %w{ none whole decimal list date time textLength custom }.freeze
68
+ ST_DataValidationErrorStyle = %w{ stop warning information }.freeze
67
69
  ST_DataValidationImeMode = %w{ noControl off on disabled hiragana fullKatakana halfKatakana
68
- fullAlpha halfAlpha fullHangul halfHangul }
70
+ fullAlpha halfAlpha fullHangul halfHangul }.freeze
69
71
  ST_DataValidationOperator = %w{ between notBetween equal notEqual lessThan lessThanOrEqual
70
- greaterThan greaterThanOrEqual }
72
+ greaterThan greaterThanOrEqual }.freeze
71
73
 
72
74
  ST_DataConsolidateFunction = %w{ average count countNums max min
73
- product stdDev stdDevp sum var varp }
75
+ product stdDev stdDevp sum var varp }.freeze
74
76
 
75
77
  ST_ConditionalFormattingOperator = %w{ lessThan lessThanOrEqual equal notEqual greaterThanOrEqual greaterThan
76
- between notBetween containsText notContains beginsWith endsWith }
77
- ST_BlackWhiteMode = %w{ clr auto gray ltGray invGray grayWhite blackGray blackWhite black white hidden }
78
+ between notBetween containsText notContains beginsWith endsWith }.freeze
79
+ ST_BlackWhiteMode = %w{ clr auto gray ltGray invGray grayWhite blackGray blackWhite black white hidden }.freeze
78
80
  ST_ShapeType = %w{ line lineInv triangle rtTriangle rect diamond parallelogram trapezoid
79
81
  nonIsoscelesTrapezoid pentagon hexagon heptagon octagon decagon dodecagon
80
82
  star4 star5 star6 star7 star8 star10 star12 star16 star24 star32
@@ -108,15 +110,15 @@ module RubyXL
108
110
  actionButtonBackPrevious actionButtonEnd actionButtonBeginning actionButtonReturn
109
111
  actionButtonDocument actionButtonSound actionButtonMovie gear6 gear9 funnel
110
112
  mathPlus mathMinus mathMultiply mathDivide mathEqual mathNotEqual
111
- cornerTabs squareTabs plaqueTabs chartX chartStar chartPlus }
113
+ cornerTabs squareTabs plaqueTabs chartX chartStar chartPlus }.freeze
112
114
 
113
115
  ST_SystemColorVal = %w{ scrollBar background activeCaption inactiveCaption menu window windowFrame menuText
114
116
  windowText captionText activeBorder inactiveBorder appWorkspace highlight highlightText
115
117
  btnFace btnShadow grayText btnText inactiveCaptionText btnHighlight 3dDkShadow 3dLight
116
- infoText infoBk hotLight gradientActiveCaption gradientInactiveCaption menuHighlight menuBar }
118
+ infoText infoBk hotLight gradientActiveCaption gradientInactiveCaption menuHighlight menuBar }.freeze
117
119
 
118
120
  ST_SchemeColorVal = %w{ bg1 tx1 bg2 tx2 accent1 accent2 accent3 accent4 accent5 accent6
119
- hlink folHlink phClr dk1 lt1 dk2 lt2 }
121
+ hlink folHlink phClr dk1 lt1 dk2 lt2 }.freeze
120
122
 
121
123
  ST_PresetColorVal = %w{ aliceBlue antiqueWhite aqua aquamarine azure beige bisque black blanchedAlmond blue blueViolet
122
124
  brown burlyWood cadetBlue chartreuse chocolate coral cornflowerBlue cornsilk crimson cyan
@@ -133,14 +135,14 @@ module RubyXL
133
135
  paleTurquoise paleVioletRed papayaWhip peachPuff peru pink plum powderBlue purple
134
136
  red rosyBrown royalBlue saddleBrown salmon sandyBrown seaGreen seaShell sienna
135
137
  silver skyBlue slateBlue slateGray snow springGreen steelBlue tan teal thistle
136
- tomato turquoise violet wheat white whiteSmoke yellow yellowGreen }
137
-
138
- ST_PathFillMode = %w{ none norm lighten lightenLess darken darkenLess }
139
- ST_TextVertOverflowType = %w{ overflow ellipsis clip }
140
- ST_TextHorzOverflowType = %w{ overflow clip }
141
- ST_TextVerticalType = %w{ horz vert vert270 wordArtVert eaVert mongolianVert wordArtVertRtl }
142
- ST_TextWrappingType = %w{ none square }
143
- ST_TextAnchoringType = %w{ t ctr b just dist }
138
+ tomato turquoise violet wheat white whiteSmoke yellow yellowGreen }.freeze
139
+
140
+ ST_PathFillMode = %w{ none norm lighten lightenLess darken darkenLess }.freeze
141
+ ST_TextVertOverflowType = %w{ overflow ellipsis clip }.freeze
142
+ ST_TextHorzOverflowType = %w{ overflow clip }.freeze
143
+ ST_TextVerticalType = %w{ horz vert vert270 wordArtVert eaVert mongolianVert wordArtVertRtl }.freeze
144
+ ST_TextWrappingType = %w{ none square }.freeze
145
+ ST_TextAnchoringType = %w{ t ctr b just dist }.freeze
144
146
  ST_TextShapeType = %w{ textNoShape textPlain textStop textTriangle textTriangleInverted textChevron
145
147
  textChevronInverted textRingInside textRingOutside textArchUp textArchDown
146
148
  textCircle textButton textArchUpPour textArchDownPour textCirclePour textButtonPour
@@ -148,36 +150,36 @@ module RubyXL
148
150
  textWave4 textInflate textDeflate textInflateBottom textDeflateBottom textInflateTop
149
151
  textDeflateTop textDeflateInflate textDeflateInflateDeflate textFadeRight
150
152
  textFadeLeft textFadeUp textFadeDown textSlantUp textSlantDown
151
- textCascadeUp textCascadeDown }
153
+ textCascadeUp textCascadeDown }.freeze
152
154
 
153
155
  ST_PresetMaterialType = %w{ legacyMatte legacyPlastic legacyMetal legacyWireframe matte plastic metal
154
- warmMatte translucentPowder powder dkEdge softEdge clear flat softmetal }
156
+ warmMatte translucentPowder powder dkEdge softEdge clear flat softmetal }.freeze
155
157
 
156
158
  ST_BevelPresetType = %w{ relaxedInset circle slope cross angle softRound convex
157
- coolSlant divot riblet hardEdge artDeco }
159
+ coolSlant divot riblet hardEdge artDeco }.freeze
158
160
 
159
161
 
160
- ST_LineEndType = %w{ none triangle stealth diamond oval arrow }
161
- ST_LineEndWidth = %w{ sm med lg }
162
- ST_LineEndLength = %w{ sm med lg }
162
+ ST_LineEndType = %w{ none triangle stealth diamond oval arrow }.freeze
163
+ ST_LineEndWidth = %w{ sm med lg }.freeze
164
+ ST_LineEndLength = %w{ sm med lg }.freeze
163
165
 
164
166
  ST_PresetLineDashVal = %w{ solid dot dash lgDash dashDot lgDashDot lgDashDotDot
165
- sysDash sysDot sysDashDot sysDashDotDot }
167
+ sysDash sysDot sysDashDot sysDashDotDot }.freeze
166
168
 
167
- ST_TileFlipMode = %w{ none x y xy }
168
- ST_PathShadeType = %w{ shape circle rect }
169
+ ST_TileFlipMode = %w{ none x y xy }.freeze
170
+ ST_PathShadeType = %w{ shape circle rect }.freeze
169
171
 
170
172
  ST_PresetPatternVal = %w{ pct5 pct10 pct20 pct25 pct30 pct40 pct50 pct60 pct70 pct75 pct80 pct90
171
173
  horz vert ltHorz ltVert dkHorz dkVert narHorz narVert dashHorz dashVert
172
174
  cross dnDiag upDiag ltDnDiag ltUpDiag dkDnDiag dkUpDiag
173
175
  wdDnDiag wdUpDiag dashDnDiag dashUpDiag diagCross smCheck lgCheck
174
176
  smGrid lgGrid dotGrid smConfetti lgConfetti horzBrick diagBrick
175
- solidDmnd openDmnd dotDmnd plaid sphere weave divot shingle wave trellis zigZag }
176
- ST_RectAlignment = %w{ tl t tr l ctr r bl b br }
177
- ST_BlipCompression = %w{ email screen print hqprint none }
178
- ST_ColorSchemeIndex = %w{ dk1 lt1 dk2 lt2 accent1 accent2 accent3 accent4 accent5 accent6 hlink folHlink }
179
- ST_FontCollectionIndex = %w{ major minor none }
180
- ST_BlendMode = %w{ over mult screen darken lighten }
177
+ solidDmnd openDmnd dotDmnd plaid sphere weave divot shingle wave trellis zigZag }.freeze
178
+ ST_RectAlignment = %w{ tl t tr l ctr r bl b br }.freeze
179
+ ST_BlipCompression = %w{ email screen print hqprint none }.freeze
180
+ ST_ColorSchemeIndex = %w{ dk1 lt1 dk2 lt2 accent1 accent2 accent3 accent4 accent5 accent6 hlink folHlink }.freeze
181
+ ST_FontCollectionIndex = %w{ major minor none }.freeze
182
+ ST_BlendMode = %w{ over mult screen darken lighten }.freeze
181
183
  ST_PresetCameraType = %w{ legacyObliqueTopLeft legacyObliqueTop legacyObliqueTopRight legacyObliqueLeft
182
184
  legacyObliqueFront legacyObliqueRight legacyObliqueBottomLeft legacyObliqueBottom
183
185
  legacyObliqueBottomRight legacyPerspectiveTopLeft legacyPerspectiveTop
@@ -195,16 +197,16 @@ module RubyXL
195
197
  perspectiveContrastingLeftFacing perspectiveContrastingRightFacing
196
198
  perspectiveHeroicLeftFacing perspectiveHeroicRightFacing
197
199
  perspectiveHeroicExtremeLeftFacing perspectiveHeroicExtremeRightFacing
198
- perspectiveRelaxed perspectiveRelaxedModerately }
200
+ perspectiveRelaxed perspectiveRelaxedModerately }.freeze
199
201
  ST_LightRigType = %w{ legacyFlat1 legacyFlat2 legacyFlat3 legacyFlat4 legacyNormal1 legacyNormal2
200
202
  legacyNormal3 legacyNormal4 legacyHarsh1 legacyHarsh2 legacyHarsh3 legacyHarsh4
201
203
  threePt balanced soft harsh flood contrasting morning sunrise sunset chilly
202
- freezing flat twoPt glow brightRoom }
203
- ST_LightRigDirection = %w{ tl t tr l ctr r bl b br }
204
- ST_EffectContainerType = %w{ sib tree }
204
+ freezing flat twoPt glow brightRoom }.freeze
205
+ ST_LightRigDirection = %w{ tl t tr l ctr r bl b br }.freeze
206
+ ST_EffectContainerType = %w{ sib tree }.freeze
205
207
  ST_PresetShadowVal = %w{ shdw1 shdw2 shdw3 shdw4 shdw5 shdw6 shdw7 shdw8 shdw9 shdw10
206
- shdw11 shdw12 shdw13 shdw14 shdw15 shdw16 shdw17 shdw18 shdw19 shdw20 }
207
- ST_TextTabAlignType = %w{ l ctr r dec }
208
+ shdw11 shdw12 shdw13 shdw14 shdw15 shdw16 shdw17 shdw18 shdw19 shdw20 }.freeze
209
+ ST_TextTabAlignType = %w{ l ctr r dec }.freeze
208
210
  ST_TextAutonumberScheme = %w{ alphaLcParenBoth alphaUcParenBoth alphaLcParenR alphaUcParenR
209
211
  alphaLcPeriod alphaUcPeriod arabicParenBoth arabicParenR arabicPeriod arabicPlain
210
212
  romanLcParenBoth romanUcParenBoth romanLcParenR romanUcParenR
@@ -213,37 +215,38 @@ module RubyXL
213
215
  ea1ChtPeriod ea1ChtPlain ea1JpnChsDbPeriod ea1JpnKorPlain ea1JpnKorPeriod
214
216
  arabic1Minus arabic2Minus hebrew2Minus thaiAlphaPeriod thaiAlphaParenR
215
217
  thaiAlphaParenBoth thaiNumPeriod thaiNumParenR thaiNumParenBoth hindiAlphaPeriod
216
- hindiNumPeriod hindiNumParenR hindiAlpha1Period }
218
+ hindiNumPeriod hindiNumParenR hindiAlpha1Period }.freeze
217
219
 
218
- ST_TextAlignType = %w{ l ctr r just justLow dist thaiDist }
219
- ST_TextFontAlignType = %w{ auto t ctr base b }
220
- ST_LineCap = %w{ rnd sq flat }
221
- ST_CompoundLine = %w{ sng dbl thickThin thinThick tri }
222
- ST_PenAlignment = %w{ ctr in }
220
+ ST_TextAlignType = %w{ l ctr r just justLow dist thaiDist }.freeze
221
+ ST_TextFontAlignType = %w{ auto t ctr base b }.freeze
222
+ ST_LineCap = %w{ rnd sq flat }.freeze
223
+ ST_CompoundLine = %w{ sng dbl thickThin thinThick tri }.freeze
224
+ ST_PenAlignment = %w{ ctr in }.freeze
223
225
 
224
226
  ST_TextUnderlineType = %w{ none words sng dbl heavy dotted dottedHeavy dash dashHeavy dashLong dashLongHeavy
225
- dotDash dotDashHeavy dotDotDash dotDotDashHeavy wavy wavyHeavy wavyDbl }
226
- ST_UnderlineValues = %w{ single double singleAccounting doubleAccounting none }
227
+ dotDash dotDashHeavy dotDotDash dotDotDashHeavy wavy wavyHeavy wavyDbl }.freeze
228
+ ST_UnderlineValues = %w{ single double singleAccounting doubleAccounting none }.freeze
229
+
230
+ ST_TextStrikeType = %w{ noStrike sngStrike dblStrike }.freeze
231
+ ST_TextCapsType = %w{ none small all }.freeze
227
232
 
228
- ST_TextStrikeType = %w{ noStrike sngStrike dblStrike }
229
- ST_TextCapsType = %w{ none small all }
233
+ ST_RelationshipId = :string
234
+ ST_Xstring = :string
230
235
 
231
236
  # TODO: http://www.datypic.com/sc/ooxml/t-ssml_ST_UnsignedIntHex.html
232
237
  ST_UnsignedIntHex = :string # length = 4
233
238
  # TODO: http://www.datypic.com/sc/ooxml/t-ssml_ST_UnsignedShortHex.html
234
239
  ST_UnsignedShortHex = :string # length = 2
235
240
 
236
- ST_Xstring = :string
237
-
238
241
  # Query Tables
239
- ST_GrowShrinkType = %w{ insertDelete insertClear overwriteClear }
242
+ ST_GrowShrinkType = %w{ insertDelete insertClear overwriteClear }.freeze
240
243
 
241
244
  # Connections
242
- ST_CredMethod = %w{ integrated none stored prompt }
243
- ST_ParameterType = %w{ prompt value cell }
244
- ST_FileType = %w{ mac win dos }
245
- ST_Qualifier = %w{ doubleQuote singleQuote none }
246
- ST_ExternalConnectionType = %w{ general text MDY DMY YMD MYD DYM YDM skip EMD }
245
+ ST_CredMethod = %w{ integrated none stored prompt }.freeze
246
+ ST_ParameterType = %w{ prompt value cell }.freeze
247
+ ST_FileType = %w{ mac win dos }.freeze
248
+ ST_Qualifier = %w{ doubleQuote singleQuote none }.freeze
249
+ ST_ExternalConnectionType = %w{ general text MDY DMY YMD MYD DYM YDM skip EMD }.freeze
247
250
 
248
- ST_HtmlFmt = %w{ none rtf all }
251
+ ST_HtmlFmt = %w{ none rtf all }.freeze
249
252
  end
@@ -93,8 +93,8 @@ module RubyXL
93
93
 
94
94
  # http://www.datypic.com/sc/ooxml/e-ssml_sheet-1.html
95
95
  class Sheet < OOXMLObject
96
- define_attribute(:name, :string, :required => true)
97
- define_attribute(:sheetId, :int, :required => true)
96
+ define_attribute(:name, RubyXL::ST_Xstring, :required => true)
97
+ define_attribute(:sheetId, :uint, :required => true)
98
98
  define_attribute(:state, RubyXL::ST_Visibility, :default => 'visible')
99
99
  define_relationship(:required => true)
100
100
  define_element_name 'sheet'
@@ -381,8 +381,8 @@ module RubyXL
381
381
  worksheets.each { |sheet, i|
382
382
  rel = relationship_container.find_by_target(sheet.xlsx_path)
383
383
 
384
- raise "Worksheet name '#{sheet.sheet_name}' contains forbidden characters" if sheet.sheet_name =~ SHEET_NAME_FORBIDDEN_CHARS
385
- raise "Worksheet name '#{sheet.sheet_name}' is forbidden" if SHEET_NAME_FORBIDDEN_NAMES.include?(sheet.sheet_name)
384
+ raise(RuntimeError, "Worksheet name '#{sheet.sheet_name}' contains forbidden characters") if sheet.sheet_name =~ SHEET_NAME_FORBIDDEN_CHARS
385
+ raise(RuntimeError, "Worksheet name '#{sheet.sheet_name}' is forbidden") if SHEET_NAME_FORBIDDEN_NAMES.include?(sheet.sheet_name)
386
386
 
387
387
  sheets << RubyXL::Sheet.new(:name => sheet.sheet_name[0..30], # Max sheet name length is 31 char
388
388
  :sheet_id => sheet.sheet_id || (max_sheet_id += 1),
@@ -408,7 +408,7 @@ module RubyXL
408
408
 
409
409
  extension = File.extname(dst_file_path)
410
410
  unless %w{.xlsx .xlsm .xltx .xltm}.include?(extension.downcase)
411
- raise "Unsupported extension: #{extension} (only .xlsx, .xlsm, .xltx and .xltm files are supported)."
411
+ raise ArgumentError, "Unsupported extension: #{extension} (only .xlsx, .xlsm, .xltx and .xltm files are supported)."
412
412
  end
413
413
 
414
414
  File.open(dst_file_path, 'wb') { |output_file| FileUtils.copy_stream(root.stream, output_file) }
@@ -51,6 +51,10 @@ module RubyXL
51
51
  end
52
52
 
53
53
  # http://www.datypic.com/sc/ooxml/e-ssml_dimension-3.html
54
+ # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.sheetdimension%28v=office.14%29.aspx
55
+ # "This element specifies the used range of the worksheet. It specifies the row and column bounds of used cells
56
+ # in the worksheet. +This is optional and is not required+. Used cells include cells with formulas, text content,
57
+ # and cell formatting. When an entire column is formatted, only the first cell in that column is considered used."
54
58
  class WorksheetDimensions < OOXMLObject
55
59
  define_attribute(:ref, :ref)
56
60
  define_element_name 'dimension'
@@ -547,14 +551,14 @@ module RubyXL
547
551
  define_attribute(:offset, :ref)
548
552
  define_attribute(:collapsedLevelsAreSubtotals, :bool, :default => false)
549
553
  define_attribute(:axis, RubyXL::ST_Axis)
550
- define_attribute(:fieldPosition, :int, :default => 0)
554
+ define_attribute(:fieldPosition, :uint, :default => 0)
551
555
  define_child_node(RubyXL::PivotReferences)
552
556
  define_child_node(RubyXL::ExtensionStorageArea)
553
557
  define_element_name 'pivotArea'
554
558
  end
555
559
 
556
560
  # http://www.datypic.com/sc/ooxml/e-ssml_pivotSelection-1.html
557
- class PivotTableSelection < OOXMLObject
561
+ class PivotSelection < OOXMLObject
558
562
  define_attribute(:pane, RubyXL::ST_Pane, :default => 'topLeft')
559
563
  define_attribute(:showHeader, :bool, :default => false)
560
564
  define_attribute(:label, :bool, :default => false)
@@ -599,7 +603,7 @@ module RubyXL
599
603
  define_attribute(:workbookViewId, :uint, :required => true, :default => 0)
600
604
  define_child_node(RubyXL::Pane)
601
605
  define_child_node(RubyXL::Selection, :collection => true, :accessor => :selections)
602
- define_child_node(RubyXL::PivotTableSelection, :collection => true, :accessor => :pivot_table_selections)
606
+ define_child_node(RubyXL::PivotSelection, :collection => true, :accessor => :pivot_selections)
603
607
  define_child_node(RubyXL::ExtensionStorageArea)
604
608
  define_element_name 'sheetView'
605
609
  end
@@ -753,10 +757,25 @@ module RubyXL
753
757
 
754
758
  def cell_at(ref)
755
759
  reference = RubyXL::Reference.new(ref)
756
- raise "Invalid reference: #{ref}" unless reference.valid? && reference.single_cell?
760
+ raise(ArgumentError, "Invalid reference: #{ref}") unless reference.valid? && reference.single_cell?
757
761
  sheet_data&.rows&.[](reference.first_row)&.cells&.[](reference.first_col)
758
762
  end
759
763
 
764
+ # Allows for easier access to sheet_data
765
+ def [](row = 0)
766
+ sheet_data[row]
767
+ end
768
+
769
+ def each
770
+ sheet_data.rows.each { |row| yield(row) }
771
+ end
772
+
773
+ def add_row(row_index = 0, params = {})
774
+ new_row = RubyXL::Row.new(params)
775
+ new_row.worksheet = self
776
+ sheet_data.rows[row_index] = new_row
777
+ end
778
+
760
779
  include LegacyWorksheet
761
780
  end
762
781
  end
@@ -16,21 +16,6 @@ module RubyXL
16
16
  @generic_storage = []
17
17
  end
18
18
 
19
- # allows for easier access to sheet_data
20
- def [](row = 0)
21
- sheet_data[row]
22
- end
23
-
24
- def each
25
- sheet_data.rows.each { |row| yield(row) }
26
- end
27
-
28
- def add_row(row_index = 0, params = {})
29
- new_row = RubyXL::Row.new(params)
30
- new_row.worksheet = self
31
- sheet_data.rows[row_index] = new_row
32
- end
33
-
34
19
  def add_cell(row_index = 0, column_index = 0, data = '', formula = nil, overwrite = true)
35
20
  validate_workbook
36
21
  validate_nonnegative(row_index)
@@ -65,6 +50,9 @@ module RubyXL
65
50
  c.datatype = RubyXL::DataType::INLINE_STRING
66
51
  when Time, Date, DateTime then
67
52
  c.raw_value = workbook.date_to_num(data)
53
+ when TrueClass, FalseClass then
54
+ c.raw_value = data ? 1 : 0
55
+ c.datatype = RubyXL::DataType::BOOLEAN
68
56
  when NilClass then nil
69
57
  end
70
58
  end
@@ -85,7 +73,7 @@ module RubyXL
85
73
  return if @workbook.worksheets.any? { |sheet| sheet.equal?(self) }
86
74
  end
87
75
 
88
- raise "This worksheet #{self} is not in workbook #{@workbook}"
76
+ raise RuntimeError, "Worksheet #{self} is not in workbook #{@workbook}"
89
77
  end
90
78
 
91
79
  # Ensures that storage space for a cell with +row_index+ and +column_index+
@@ -98,7 +86,7 @@ module RubyXL
98
86
  end
99
87
 
100
88
  def validate_nonnegative(row_or_col)
101
- raise 'Row and Column arguments must be nonnegative' if row_or_col < 0
89
+ raise(ArgumentError, 'Row and Column arguments must be nonnegative') if row_or_col < 0
102
90
  end
103
91
  private :validate_nonnegative
104
92
  end