rubyXL 3.4.38 → 3.4.41

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 (444) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -4
  3. data/Rakefile +124 -26
  4. data/VERSION +1 -1
  5. data/bin/console +10 -0
  6. data/bin/setup +3 -0
  7. data/lib/rubyXL/cell.rb +2 -2
  8. data/lib/rubyXL/convenience_methods/cell.rb +17 -7
  9. data/lib/rubyXL/convenience_methods/worksheet.rb +41 -30
  10. data/lib/rubyXL/objects/border.rb +9 -6
  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 +10 -2
  20. data/lib/rubyXL/objects/simple_types.rb +101 -98
  21. data/lib/rubyXL/objects/text.rb +6 -1
  22. data/lib/rubyXL/objects/workbook.rb +5 -5
  23. data/lib/rubyXL/objects/worksheet.rb +23 -4
  24. data/lib/rubyXL/version.rb +3 -0
  25. data/lib/rubyXL/worksheet.rb +5 -17
  26. data/lib/rubyXL.rb +1 -0
  27. data/rubyXL.gemspec +11 -480
  28. metadata +50 -424
  29. data/.circleci/config.yml +0 -71
  30. data/.codeclimate.yml +0 -3
  31. data/.rubocop.yml +0 -124
  32. data/CHANGELOG.md +0 -12
  33. data/Gemfile +0 -20
  34. data/rdoc/README_rdoc.html +0 -871
  35. data/rdoc/RubyXL/AExtension.html +0 -703
  36. data/rdoc/RubyXL/AExtensionStorageArea.html +0 -543
  37. data/rdoc/RubyXL/ActiveX.html +0 -654
  38. data/rdoc/RubyXL/ActiveXBinary.html +0 -560
  39. data/rdoc/RubyXL/AdjustHandleList.html +0 -539
  40. data/rdoc/RubyXL/Alignment.html +0 -539
  41. data/rdoc/RubyXL/AlternateContent.html +0 -543
  42. data/rdoc/RubyXL/AlternateUrls.html +0 -539
  43. data/rdoc/RubyXL/Authors.html +0 -539
  44. data/rdoc/RubyXL/AutoFilter.html +0 -539
  45. data/rdoc/RubyXL/AutoFilterColumn.html +0 -539
  46. data/rdoc/RubyXL/BinaryImageFile.html +0 -568
  47. data/rdoc/RubyXL/BodyProperties.html +0 -539
  48. data/rdoc/RubyXL/BooleanNode.html +0 -543
  49. data/rdoc/RubyXL/BooleanValue.html +0 -543
  50. data/rdoc/RubyXL/Border.html +0 -758
  51. data/rdoc/RubyXL/BorderEdge.html +0 -656
  52. data/rdoc/RubyXL/Borders.html +0 -608
  53. data/rdoc/RubyXL/Break.html +0 -539
  54. data/rdoc/RubyXL/BreakList.html +0 -539
  55. data/rdoc/RubyXL/CT_AdjPoint2D.html +0 -539
  56. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +0 -539
  57. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +0 -539
  58. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +0 -539
  59. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +0 -539
  60. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +0 -539
  61. data/rdoc/RubyXL/CT_Backdrop.html +0 -539
  62. data/rdoc/RubyXL/CT_Bevel.html +0 -539
  63. data/rdoc/RubyXL/CT_BiLevelEffect.html +0 -539
  64. data/rdoc/RubyXL/CT_BlendEffect.html +0 -539
  65. data/rdoc/RubyXL/CT_Blip.html +0 -539
  66. data/rdoc/RubyXL/CT_BlipFillProperties.html +0 -539
  67. data/rdoc/RubyXL/CT_BlurEffect.html +0 -539
  68. data/rdoc/RubyXL/CT_Camera.html +0 -539
  69. data/rdoc/RubyXL/CT_Color.html +0 -539
  70. data/rdoc/RubyXL/CT_ColorChangeEffect.html +0 -539
  71. data/rdoc/RubyXL/CT_ColorMapping.html +0 -539
  72. data/rdoc/RubyXL/CT_ColorScheme.html +0 -539
  73. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +0 -539
  74. data/rdoc/RubyXL/CT_ConnectionSite.html +0 -539
  75. data/rdoc/RubyXL/CT_ConnectionSiteList.html +0 -539
  76. data/rdoc/RubyXL/CT_DashStop.html +0 -539
  77. data/rdoc/RubyXL/CT_DashStopList.html +0 -539
  78. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +0 -539
  79. data/rdoc/RubyXL/CT_DuotoneEffect.html +0 -539
  80. data/rdoc/RubyXL/CT_EffectContainer.html +0 -539
  81. data/rdoc/RubyXL/CT_EffectList.html +0 -539
  82. data/rdoc/RubyXL/CT_EffectReference.html +0 -539
  83. data/rdoc/RubyXL/CT_EffectStyleItem.html +0 -539
  84. data/rdoc/RubyXL/CT_EffectStyleList.html +0 -539
  85. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +0 -539
  86. data/rdoc/RubyXL/CT_FillEffect.html +0 -539
  87. data/rdoc/RubyXL/CT_FillOverlayEffect.html +0 -539
  88. data/rdoc/RubyXL/CT_FillStyleList.html +0 -539
  89. data/rdoc/RubyXL/CT_FlatText.html +0 -539
  90. data/rdoc/RubyXL/CT_FontCollection.html +0 -539
  91. data/rdoc/RubyXL/CT_FontReference.html +0 -539
  92. data/rdoc/RubyXL/CT_GeomGuideList.html +0 -539
  93. data/rdoc/RubyXL/CT_GlowEffect.html +0 -539
  94. data/rdoc/RubyXL/CT_GradientFillProperties.html +0 -539
  95. data/rdoc/RubyXL/CT_GradientStop.html +0 -539
  96. data/rdoc/RubyXL/CT_GradientStopList.html +0 -539
  97. data/rdoc/RubyXL/CT_HSLEffect.html +0 -539
  98. data/rdoc/RubyXL/CT_HslColor.html +0 -539
  99. data/rdoc/RubyXL/CT_Hyperlink.html +0 -539
  100. data/rdoc/RubyXL/CT_InnerShadowEffect.html +0 -539
  101. data/rdoc/RubyXL/CT_LightRig.html +0 -539
  102. data/rdoc/RubyXL/CT_LineEndProperties.html +0 -539
  103. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +0 -539
  104. data/rdoc/RubyXL/CT_LineProperties.html +0 -539
  105. data/rdoc/RubyXL/CT_LineStyleList.html +0 -539
  106. data/rdoc/RubyXL/CT_LinearShadeProperties.html +0 -539
  107. data/rdoc/RubyXL/CT_LuminanceEffect.html +0 -539
  108. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +0 -539
  109. data/rdoc/RubyXL/CT_OuterShadowEffect.html +0 -539
  110. data/rdoc/RubyXL/CT_Path2D.html +0 -539
  111. data/rdoc/RubyXL/CT_Path2DArcTo.html +0 -539
  112. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +0 -539
  113. data/rdoc/RubyXL/CT_Path2DList.html +0 -539
  114. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +0 -539
  115. data/rdoc/RubyXL/CT_Path2DTo.html +0 -539
  116. data/rdoc/RubyXL/CT_PathShadeProperties.html +0 -539
  117. data/rdoc/RubyXL/CT_PatternFillProperties.html +0 -539
  118. data/rdoc/RubyXL/CT_Point3D.html +0 -539
  119. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +0 -539
  120. data/rdoc/RubyXL/CT_PresetColor.html +0 -539
  121. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +0 -539
  122. data/rdoc/RubyXL/CT_PresetShadowEffect.html +0 -539
  123. data/rdoc/RubyXL/CT_PresetTextShape.html +0 -539
  124. data/rdoc/RubyXL/CT_ReflectionEffect.html +0 -539
  125. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +0 -539
  126. data/rdoc/RubyXL/CT_RelativeRect.html +0 -539
  127. data/rdoc/RubyXL/CT_SRgbColor.html +0 -539
  128. data/rdoc/RubyXL/CT_ScRgbColor.html +0 -539
  129. data/rdoc/RubyXL/CT_Scene3D.html +0 -539
  130. data/rdoc/RubyXL/CT_SchemeColor.html +0 -539
  131. data/rdoc/RubyXL/CT_Shape3D.html +0 -539
  132. data/rdoc/RubyXL/CT_ShapeStyle.html +0 -539
  133. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +0 -539
  134. data/rdoc/RubyXL/CT_SphereCoords.html +0 -539
  135. data/rdoc/RubyXL/CT_StretchInfoProperties.html +0 -539
  136. data/rdoc/RubyXL/CT_StyleMatrix.html +0 -539
  137. data/rdoc/RubyXL/CT_StyleMatrixReference.html +0 -539
  138. data/rdoc/RubyXL/CT_SupplementalFont.html +0 -539
  139. data/rdoc/RubyXL/CT_SystemColor.html +0 -539
  140. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +0 -539
  141. data/rdoc/RubyXL/CT_TextBlipBullet.html +0 -539
  142. data/rdoc/RubyXL/CT_TextCharBullet.html +0 -539
  143. data/rdoc/RubyXL/CT_TextCharacterProperties.html +0 -539
  144. data/rdoc/RubyXL/CT_TextFont.html +0 -539
  145. data/rdoc/RubyXL/CT_TextListStyle.html +0 -539
  146. data/rdoc/RubyXL/CT_TextNormalAutofit.html +0 -539
  147. data/rdoc/RubyXL/CT_TextParagraphProperties.html +0 -539
  148. data/rdoc/RubyXL/CT_TextSpacing.html +0 -539
  149. data/rdoc/RubyXL/CT_TextTabStop.html +0 -539
  150. data/rdoc/RubyXL/CT_TextTabStopList.html +0 -539
  151. data/rdoc/RubyXL/CT_TileInfoProperties.html +0 -539
  152. data/rdoc/RubyXL/CT_TintEffect.html +0 -539
  153. data/rdoc/RubyXL/CT_Transform2D.html +0 -539
  154. data/rdoc/RubyXL/CT_TransformEffect.html +0 -539
  155. data/rdoc/RubyXL/CT_Vector3D.html +0 -539
  156. data/rdoc/RubyXL/CT_XYAdjustHandle.html +0 -539
  157. data/rdoc/RubyXL/CalculationChain.html +0 -633
  158. data/rdoc/RubyXL/CalculationChainCell.html +0 -539
  159. data/rdoc/RubyXL/CalculationProperties.html +0 -539
  160. data/rdoc/RubyXL/Cell.html +0 -1315
  161. data/rdoc/RubyXL/CellConvenienceMethods.html +0 -2290
  162. data/rdoc/RubyXL/CellExt.html +0 -539
  163. data/rdoc/RubyXL/CellSmartTag.html +0 -539
  164. data/rdoc/RubyXL/CellSmartTagProperty.html +0 -539
  165. data/rdoc/RubyXL/CellSmartTags.html +0 -539
  166. data/rdoc/RubyXL/CellStyle.html +0 -539
  167. data/rdoc/RubyXL/CellStyleXFs.html +0 -608
  168. data/rdoc/RubyXL/CellStyles.html +0 -608
  169. data/rdoc/RubyXL/CellValue.html +0 -609
  170. data/rdoc/RubyXL/CellWatch.html +0 -539
  171. data/rdoc/RubyXL/CellWatches.html +0 -539
  172. data/rdoc/RubyXL/CellXFs.html +0 -609
  173. data/rdoc/RubyXL/ChartColorsFile.html +0 -568
  174. data/rdoc/RubyXL/ChartFile.html +0 -664
  175. data/rdoc/RubyXL/ChartStyleFile.html +0 -568
  176. data/rdoc/RubyXL/ChartUserShapesFile.html +0 -568
  177. data/rdoc/RubyXL/Chartsheet.html +0 -743
  178. data/rdoc/RubyXL/ChartsheetPageSetup.html +0 -539
  179. data/rdoc/RubyXL/ChartsheetProperties.html +0 -539
  180. data/rdoc/RubyXL/ChartsheetProtection.html +0 -539
  181. data/rdoc/RubyXL/ChartsheetView.html +0 -539
  182. data/rdoc/RubyXL/ChartsheetViews.html +0 -539
  183. data/rdoc/RubyXL/Color.html +0 -629
  184. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +0 -774
  185. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +0 -845
  186. data/rdoc/RubyXL/ColorConvenienceClasses.html +0 -528
  187. data/rdoc/RubyXL/ColorConvenienceMethods.html +0 -606
  188. data/rdoc/RubyXL/ColorFilter.html +0 -539
  189. data/rdoc/RubyXL/ColorScale.html +0 -539
  190. data/rdoc/RubyXL/ColorSet.html +0 -539
  191. data/rdoc/RubyXL/Colors.html +0 -539
  192. data/rdoc/RubyXL/ColumnRange.html +0 -786
  193. data/rdoc/RubyXL/ColumnRanges.html +0 -773
  194. data/rdoc/RubyXL/Comment.html +0 -539
  195. data/rdoc/RubyXL/CommentList.html +0 -539
  196. data/rdoc/RubyXL/CommentsFile.html +0 -657
  197. data/rdoc/RubyXL/ConditionalFormatValue.html +0 -539
  198. data/rdoc/RubyXL/ConditionalFormatting.html +0 -539
  199. data/rdoc/RubyXL/ConditionalFormattingRule.html +0 -539
  200. data/rdoc/RubyXL/Connection.html +0 -539
  201. data/rdoc/RubyXL/ConnectionTable.html +0 -539
  202. data/rdoc/RubyXL/ConnectionTables.html +0 -539
  203. data/rdoc/RubyXL/ConnectionTextField.html +0 -539
  204. data/rdoc/RubyXL/ConnectionTextFields.html +0 -539
  205. data/rdoc/RubyXL/Connections.html +0 -633
  206. data/rdoc/RubyXL/ContentTypeDefault.html +0 -543
  207. data/rdoc/RubyXL/ContentTypeOverride.html +0 -543
  208. data/rdoc/RubyXL/ContentTypes.html +0 -721
  209. data/rdoc/RubyXL/ControlPropertiesFile.html +0 -568
  210. data/rdoc/RubyXL/CorePropertiesFile.html +0 -1013
  211. data/rdoc/RubyXL/CustomColor.html +0 -539
  212. data/rdoc/RubyXL/CustomColorList.html +0 -539
  213. data/rdoc/RubyXL/CustomFilter.html +0 -539
  214. data/rdoc/RubyXL/CustomFilters.html +0 -539
  215. data/rdoc/RubyXL/CustomGeometry.html +0 -539
  216. data/rdoc/RubyXL/CustomProperties.html +0 -539
  217. data/rdoc/RubyXL/CustomPropertiesFile.html +0 -568
  218. data/rdoc/RubyXL/CustomProperty.html +0 -539
  219. data/rdoc/RubyXL/CustomPropertyFile.html +0 -568
  220. data/rdoc/RubyXL/CustomSheetView.html +0 -539
  221. data/rdoc/RubyXL/CustomSheetViews.html +0 -539
  222. data/rdoc/RubyXL/CustomWorkbookView.html +0 -539
  223. data/rdoc/RubyXL/CustomWorkbookViews.html +0 -539
  224. data/rdoc/RubyXL/CustomXMLFile.html +0 -560
  225. data/rdoc/RubyXL/DXF.html +0 -539
  226. data/rdoc/RubyXL/DXFs.html +0 -539
  227. data/rdoc/RubyXL/DataBar.html +0 -539
  228. data/rdoc/RubyXL/DataConsolidate.html +0 -539
  229. data/rdoc/RubyXL/DataConsolidationReference.html +0 -539
  230. data/rdoc/RubyXL/DataConsolidationReferences.html +0 -539
  231. data/rdoc/RubyXL/DataType.html +0 -589
  232. data/rdoc/RubyXL/DataValidation.html +0 -539
  233. data/rdoc/RubyXL/DataValidations.html +0 -539
  234. data/rdoc/RubyXL/DateGroupItem.html +0 -539
  235. data/rdoc/RubyXL/DefinedName.html +0 -539
  236. data/rdoc/RubyXL/DefinedNameExt.html +0 -539
  237. data/rdoc/RubyXL/DefinedNames.html +0 -616
  238. data/rdoc/RubyXL/DefinedNamesExt.html +0 -539
  239. data/rdoc/RubyXL/DocumentPropertiesFile.html +0 -725
  240. data/rdoc/RubyXL/DrawingFile.html +0 -663
  241. data/rdoc/RubyXL/DynamicFilter.html +0 -539
  242. data/rdoc/RubyXL/EmbeddedControl.html +0 -539
  243. data/rdoc/RubyXL/EmbeddedControls.html +0 -539
  244. data/rdoc/RubyXL/Extension.html +0 -539
  245. data/rdoc/RubyXL/ExtensionStorageArea.html +0 -539
  246. data/rdoc/RubyXL/Extents.html +0 -539
  247. data/rdoc/RubyXL/ExternalBook.html +0 -539
  248. data/rdoc/RubyXL/ExternalLinksFile.html +0 -659
  249. data/rdoc/RubyXL/ExternalReference.html +0 -539
  250. data/rdoc/RubyXL/ExternalReferences.html +0 -539
  251. data/rdoc/RubyXL/ExtraColorSchemeList.html +0 -539
  252. data/rdoc/RubyXL/FieldItem.html +0 -539
  253. data/rdoc/RubyXL/FileRecoveryProperties.html +0 -539
  254. data/rdoc/RubyXL/FileSharing.html +0 -539
  255. data/rdoc/RubyXL/FileVersion.html +0 -539
  256. data/rdoc/RubyXL/Fill.html +0 -608
  257. data/rdoc/RubyXL/Fills.html +0 -608
  258. data/rdoc/RubyXL/FilterContainer.html +0 -539
  259. data/rdoc/RubyXL/FloatNode.html +0 -543
  260. data/rdoc/RubyXL/FloatValue.html +0 -543
  261. data/rdoc/RubyXL/Font.html +0 -626
  262. data/rdoc/RubyXL/FontConvenienceMethods.html +0 -1169
  263. data/rdoc/RubyXL/FontScheme.html +0 -539
  264. data/rdoc/RubyXL/Fonts.html +0 -608
  265. data/rdoc/RubyXL/Formula.html +0 -539
  266. data/rdoc/RubyXL/FunctionGroup.html +0 -539
  267. data/rdoc/RubyXL/FunctionGroups.html +0 -539
  268. data/rdoc/RubyXL/GenericStorageObject.html +0 -803
  269. data/rdoc/RubyXL/GradientFill.html +0 -539
  270. data/rdoc/RubyXL/HeaderFooterSettings.html +0 -539
  271. data/rdoc/RubyXL/Hyperlink.html +0 -539
  272. data/rdoc/RubyXL/HyperlinkRelFile.html +0 -560
  273. data/rdoc/RubyXL/Hyperlinks.html +0 -539
  274. data/rdoc/RubyXL/IconFilter.html +0 -539
  275. data/rdoc/RubyXL/IconSet.html +0 -539
  276. data/rdoc/RubyXL/IgnoredError.html +0 -539
  277. data/rdoc/RubyXL/IgnoredErrors.html +0 -539
  278. data/rdoc/RubyXL/IndexedColors.html +0 -539
  279. data/rdoc/RubyXL/InputCells.html +0 -539
  280. data/rdoc/RubyXL/IntegerNode.html +0 -543
  281. data/rdoc/RubyXL/IntegerValue.html +0 -543
  282. data/rdoc/RubyXL/LegacyCell.html +0 -597
  283. data/rdoc/RubyXL/LegacyWorksheet.html +0 -894
  284. data/rdoc/RubyXL/MRUColors.html +0 -539
  285. data/rdoc/RubyXL/MacrosFile.html +0 -568
  286. data/rdoc/RubyXL/MergedCell.html +0 -539
  287. data/rdoc/RubyXL/MergedCells.html +0 -539
  288. data/rdoc/RubyXL/NumFmt.html +0 -539
  289. data/rdoc/RubyXL/NumberFormat.html +0 -609
  290. data/rdoc/RubyXL/NumberFormats.html +0 -625
  291. data/rdoc/RubyXL/OLEObject.html +0 -539
  292. data/rdoc/RubyXL/OLEObjectFile.html +0 -568
  293. data/rdoc/RubyXL/OLEObjects.html +0 -539
  294. data/rdoc/RubyXL/OLESize.html +0 -539
  295. data/rdoc/RubyXL/OOXMLContainerObject.html +0 -916
  296. data/rdoc/RubyXL/OOXMLIgnored.html +0 -681
  297. data/rdoc/RubyXL/OOXMLObject.html +0 -561
  298. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +0 -1030
  299. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +0 -1092
  300. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +0 -1174
  301. data/rdoc/RubyXL/OOXMLTopLevelObject.html +0 -891
  302. data/rdoc/RubyXL/OdbcOleDbProperties.html +0 -539
  303. data/rdoc/RubyXL/Offset.html +0 -539
  304. data/rdoc/RubyXL/OlapProperties.html +0 -539
  305. data/rdoc/RubyXL/OleItem.html +0 -539
  306. data/rdoc/RubyXL/OleItems.html +0 -539
  307. data/rdoc/RubyXL/OleLink.html +0 -539
  308. data/rdoc/RubyXL/OutlineProperties.html +0 -539
  309. data/rdoc/RubyXL/PageMargins.html +0 -539
  310. data/rdoc/RubyXL/PageSetup.html +0 -539
  311. data/rdoc/RubyXL/PageSetupProperties.html +0 -539
  312. data/rdoc/RubyXL/Pane.html +0 -539
  313. data/rdoc/RubyXL/Parser.html +0 -670
  314. data/rdoc/RubyXL/PatternFill.html +0 -539
  315. data/rdoc/RubyXL/PersonMetadata.html +0 -568
  316. data/rdoc/RubyXL/PhoneticProperties.html +0 -539
  317. data/rdoc/RubyXL/PhoneticRun.html +0 -539
  318. data/rdoc/RubyXL/PivotArea.html +0 -539
  319. data/rdoc/RubyXL/PivotCache.html +0 -539
  320. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +0 -590
  321. data/rdoc/RubyXL/PivotCacheRecordsFile.html +0 -568
  322. data/rdoc/RubyXL/PivotCaches.html +0 -539
  323. data/rdoc/RubyXL/PivotReference.html +0 -539
  324. data/rdoc/RubyXL/PivotReferences.html +0 -539
  325. data/rdoc/RubyXL/PivotTableFile.html +0 -590
  326. data/rdoc/RubyXL/PivotTableSelection.html +0 -539
  327. data/rdoc/RubyXL/PresetGeometry.html +0 -539
  328. data/rdoc/RubyXL/PrintOptions.html +0 -539
  329. data/rdoc/RubyXL/PrinterSettingsFile.html +0 -568
  330. data/rdoc/RubyXL/ProtectedRange.html +0 -539
  331. data/rdoc/RubyXL/ProtectedRanges.html +0 -539
  332. data/rdoc/RubyXL/Protection.html +0 -539
  333. data/rdoc/RubyXL/QueryParameter.html +0 -539
  334. data/rdoc/RubyXL/QueryParameters.html +0 -539
  335. data/rdoc/RubyXL/QueryTable.html +0 -655
  336. data/rdoc/RubyXL/QueryTableDeletedField.html +0 -539
  337. data/rdoc/RubyXL/QueryTableDeletedFields.html +0 -539
  338. data/rdoc/RubyXL/QueryTableField.html +0 -539
  339. data/rdoc/RubyXL/QueryTableFields.html +0 -539
  340. data/rdoc/RubyXL/QueryTableRefresh.html +0 -539
  341. data/rdoc/RubyXL/RID.html +0 -543
  342. data/rdoc/RubyXL/RawOOXML.html +0 -703
  343. data/rdoc/RubyXL/Reference.html +0 -1376
  344. data/rdoc/RubyXL/Relationship.html +0 -543
  345. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +0 -604
  346. data/rdoc/RubyXL/RelationshipSupport.html +0 -943
  347. data/rdoc/RubyXL/RevisionPointer.html +0 -539
  348. data/rdoc/RubyXL/RichText.html +0 -611
  349. data/rdoc/RubyXL/RichTextRun.html +0 -608
  350. data/rdoc/RubyXL/Row.html +0 -1003
  351. data/rdoc/RubyXL/RowExt.html +0 -539
  352. data/rdoc/RubyXL/RunProperties.html +0 -539
  353. data/rdoc/RubyXL/Scenario.html +0 -539
  354. data/rdoc/RubyXL/Scenarios.html +0 -539
  355. data/rdoc/RubyXL/Selection.html +0 -616
  356. data/rdoc/RubyXL/ShapeGuide.html +0 -539
  357. data/rdoc/RubyXL/ShapeTextRectangle.html +0 -539
  358. data/rdoc/RubyXL/SharedStringsTable.html +0 -952
  359. data/rdoc/RubyXL/Sheet.html +0 -539
  360. data/rdoc/RubyXL/SheetCalculationProperties.html +0 -539
  361. data/rdoc/RubyXL/SheetData.html +0 -652
  362. data/rdoc/RubyXL/SheetDataExt.html +0 -539
  363. data/rdoc/RubyXL/SheetDataSet.html +0 -539
  364. data/rdoc/RubyXL/SheetMetadata.html +0 -568
  365. data/rdoc/RubyXL/SheetName.html +0 -539
  366. data/rdoc/RubyXL/SheetNames.html +0 -539
  367. data/rdoc/RubyXL/Sheets.html +0 -539
  368. data/rdoc/RubyXL/SlicerCacheFile.html +0 -568
  369. data/rdoc/RubyXL/SlicerFile.html +0 -568
  370. data/rdoc/RubyXL/SmartTagProperties.html +0 -539
  371. data/rdoc/RubyXL/SmartTagType.html +0 -539
  372. data/rdoc/RubyXL/SmartTagTypes.html +0 -539
  373. data/rdoc/RubyXL/SmartTags.html +0 -539
  374. data/rdoc/RubyXL/SortCondition.html +0 -539
  375. data/rdoc/RubyXL/SortState.html +0 -539
  376. data/rdoc/RubyXL/Sqref.html +0 -681
  377. data/rdoc/RubyXL/Stop.html +0 -539
  378. data/rdoc/RubyXL/StringNode.html +0 -543
  379. data/rdoc/RubyXL/StringNodeW3C.html +0 -681
  380. data/rdoc/RubyXL/StringValue.html +0 -543
  381. data/rdoc/RubyXL/Stylesheet.html +0 -864
  382. data/rdoc/RubyXL/TableFile.html +0 -568
  383. data/rdoc/RubyXL/TableParts.html +0 -543
  384. data/rdoc/RubyXL/TableStyle.html +0 -539
  385. data/rdoc/RubyXL/TableStyles.html +0 -539
  386. data/rdoc/RubyXL/Text.html +0 -679
  387. data/rdoc/RubyXL/TextImportSettings.html +0 -539
  388. data/rdoc/RubyXL/Theme.html +0 -1077
  389. data/rdoc/RubyXL/ThemeElements.html +0 -539
  390. data/rdoc/RubyXL/ThumbnailFile.html +0 -568
  391. data/rdoc/RubyXL/Top10.html +0 -539
  392. data/rdoc/RubyXL/VMLDrawingFile.html +0 -590
  393. data/rdoc/RubyXL/Variant.html +0 -539
  394. data/rdoc/RubyXL/Vector.html +0 -612
  395. data/rdoc/RubyXL/VectorValue.html +0 -543
  396. data/rdoc/RubyXL/VisualProperties.html +0 -539
  397. data/rdoc/RubyXL/WebPublishObject.html +0 -539
  398. data/rdoc/RubyXL/WebPublishObjects.html +0 -539
  399. data/rdoc/RubyXL/WebPublishingItem.html +0 -539
  400. data/rdoc/RubyXL/WebPublishingItems.html +0 -539
  401. data/rdoc/RubyXL/WebPublishingProperties.html +0 -539
  402. data/rdoc/RubyXL/WebQueryProperties.html +0 -539
  403. data/rdoc/RubyXL/Workbook.html +0 -2085
  404. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +0 -1407
  405. data/rdoc/RubyXL/WorkbookProperties.html +0 -539
  406. data/rdoc/RubyXL/WorkbookProtection.html +0 -539
  407. data/rdoc/RubyXL/WorkbookRoot.html +0 -933
  408. data/rdoc/RubyXL/WorkbookView.html +0 -539
  409. data/rdoc/RubyXL/WorkbookViews.html +0 -539
  410. data/rdoc/RubyXL/Worksheet.html +0 -1090
  411. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +0 -4076
  412. data/rdoc/RubyXL/WorksheetDimensions.html +0 -539
  413. data/rdoc/RubyXL/WorksheetFormatProperties.html +0 -543
  414. data/rdoc/RubyXL/WorksheetProperties.html +0 -539
  415. data/rdoc/RubyXL/WorksheetProtection.html +0 -539
  416. data/rdoc/RubyXL/WorksheetView.html +0 -539
  417. data/rdoc/RubyXL/WorksheetViews.html +0 -539
  418. data/rdoc/RubyXL/XF.html +0 -539
  419. data/rdoc/RubyXL.html +0 -1373
  420. data/rdoc/created.rid +0 -45
  421. data/rdoc/css/rdoc.css +0 -1955
  422. data/rdoc/index.html +0 -455
  423. data/rdoc/js/aliki.js +0 -511
  424. data/rdoc/js/bash_highlighter.js +0 -167
  425. data/rdoc/js/c_highlighter.js +0 -299
  426. data/rdoc/js/search_controller.js +0 -129
  427. data/rdoc/js/search_data.js +0 -1
  428. data/rdoc/js/search_navigation.js +0 -105
  429. data/rdoc/js/search_ranker.js +0 -239
  430. data/rdoc/js/theme-toggle.js +0 -112
  431. data/spec/lib/cell_spec.rb +0 -654
  432. data/spec/lib/color_spec.rb +0 -21
  433. data/spec/lib/parser_spec.rb +0 -118
  434. data/spec/lib/reference_spec.rb +0 -97
  435. data/spec/lib/rgb_color_spec.rb +0 -29
  436. data/spec/lib/stylesheet_spec.rb +0 -27
  437. data/spec/lib/text_spec.rb +0 -27
  438. data/spec/lib/workbook_spec.rb +0 -197
  439. data/spec/lib/worksheet_spec.rb +0 -1769
  440. data/spec/spec_helper.rb +0 -13
  441. data/test/input/.gitkeep +0 -0
  442. data/test/output/.gitkeep +0 -0
  443. data/test/test_parse_write.rb +0 -15
  444. data/tmp/.gitignore +0 -1
@@ -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
  }
@@ -23,6 +23,8 @@ module RubyXL
23
23
  define_element_name 'v'
24
24
 
25
25
  def before_write_xml
26
+ return false if (value.nil? || value == '')
27
+ self.value = RubyXL::Text.escape_bad_xml_chars(value)
26
28
  preserve_whitespace
27
29
  true
28
30
  end
@@ -46,7 +48,7 @@ module RubyXL
46
48
  attr_accessor :worksheet
47
49
 
48
50
  def index_in_collection
49
- r.col_range.begin
51
+ r.first_col
50
52
  end
51
53
 
52
54
  def row
@@ -109,7 +111,8 @@ module RubyXL
109
111
  case datatype
110
112
  when RubyXL::DataType::SHARED_STRING then workbook.shared_strings_container[r.to_i].to_s
111
113
  when RubyXL::DataType::INLINE_STRING then is.to_s
112
- when RubyXL::DataType::RAW_STRING then raw_value
114
+ when RubyXL::DataType::RAW_STRING then
115
+ raw_value.gsub(RubyXL::Text::ESCAPED_UNICODE) { Regexp.last_match(1).hex.chr(::Encoding::UTF_8) }
113
116
  when RubyXL::DataType::DATE then raw_value && DateTime.parse(raw_value)
114
117
  when RubyXL::DataType::ERROR then nil
115
118
  else
@@ -143,6 +146,11 @@ module RubyXL
143
146
  # http://www.datypic.com/sc/ooxml/e-ssml_row-1.html
144
147
  class Row < OOXMLObject
145
148
  define_attribute(:r, :int)
149
+ # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.row%28v=office.14%29.aspx
150
+ # "Optimization only, and not required. Specifies the range of non-empty columns (in the format X:Y)
151
+ # for the block of rows to which the current row belongs. To achieve the optimization, span attribute
152
+ # values in a single block should be the same.
153
+ # There are 16 rows per block, beginning with the first row."
146
154
  define_attribute(:spans, :string)
147
155
  define_attribute(:s, :int, :default => 0, :accessor => :style_index)
148
156
  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
@@ -18,13 +18,18 @@ module RubyXL
18
18
 
19
19
  def before_write_xml
20
20
  preserve_whitespace
21
- self.value.gsub(INVALID_XML10_CHARS) { |bad_char| format('_x%04x_', bad_char.ord) }
21
+ self.value = RubyXL::Text::escape_bad_xml_chars(value)
22
22
  true
23
23
  end
24
24
 
25
25
  def to_s
26
26
  value.to_s.gsub(ESCAPED_UNICODE) { Regexp.last_match(1).hex.chr(::Encoding::UTF_8) }
27
27
  end
28
+
29
+ def self.escape_bad_xml_chars(str)
30
+ return str unless str.is_a?(String)
31
+ str.gsub(INVALID_XML10_CHARS) { |bad_char| format('_x%04X_', bad_char.ord) }
32
+ end
28
33
  end
29
34
 
30
35
  # http://www.datypic.com/sc/ooxml/e-ssml_rPr-1.html
@@ -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
@@ -0,0 +1,3 @@
1
+ module RubyXL
2
+ VERSION = "3.4.41"
3
+ end