rubyXL 3.4.38 → 3.4.43

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 (465) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -4
  3. data/Rakefile +65 -29
  4. data/bin/console +10 -0
  5. data/bin/setup +3 -0
  6. data/lib/rubyXL/convenience_methods/cell.rb +17 -7
  7. data/lib/rubyXL/convenience_methods/worksheet.rb +51 -32
  8. data/lib/rubyXL/convenience_methods.rb +5 -5
  9. data/lib/rubyXL/{cell.rb → legacy_cell.rb} +2 -2
  10. data/lib/rubyXL/{worksheet.rb → legacy_worksheet.rb} +5 -17
  11. data/lib/rubyXL/objects/border.rb +11 -8
  12. data/lib/rubyXL/objects/calculation_chain.rb +4 -2
  13. data/lib/rubyXL/objects/cell_style.rb +4 -2
  14. data/lib/rubyXL/objects/chartsheet.rb +7 -5
  15. data/lib/rubyXL/objects/color.rb +5 -3
  16. data/lib/rubyXL/objects/column_range.rb +3 -1
  17. data/lib/rubyXL/objects/comments.rb +4 -2
  18. data/lib/rubyXL/objects/connection.rb +5 -3
  19. data/lib/rubyXL/objects/container_nodes.rb +4 -2
  20. data/lib/rubyXL/objects/content_types.rb +3 -1
  21. data/lib/rubyXL/objects/data_validation.rb +5 -3
  22. data/lib/rubyXL/objects/document_properties.rb +4 -2
  23. data/lib/rubyXL/objects/extensions.rb +3 -1
  24. data/lib/rubyXL/objects/external_links.rb +4 -0
  25. data/lib/rubyXL/objects/fill.rb +4 -2
  26. data/lib/rubyXL/objects/filters.rb +5 -3
  27. data/lib/rubyXL/objects/font.rb +5 -3
  28. data/lib/rubyXL/objects/formula.rb +4 -2
  29. data/lib/rubyXL/objects/ooxml_object.rb +17 -17
  30. data/lib/rubyXL/objects/query_table.rb +7 -5
  31. data/lib/rubyXL/objects/reference.rb +49 -32
  32. data/lib/rubyXL/objects/relationships.rb +1 -1
  33. data/lib/rubyXL/objects/root.rb +14 -5
  34. data/lib/rubyXL/objects/shared_strings.rb +5 -3
  35. data/lib/rubyXL/objects/sheet_common.rb +4 -2
  36. data/lib/rubyXL/objects/sheet_data.rb +18 -7
  37. data/lib/rubyXL/objects/simple_types.rb +101 -98
  38. data/lib/rubyXL/objects/storage.rb +4 -0
  39. data/lib/rubyXL/objects/stylesheet.rb +8 -6
  40. data/lib/rubyXL/objects/text.rb +13 -6
  41. data/lib/rubyXL/objects/theme.rb +2 -2
  42. data/lib/rubyXL/objects/workbook.rb +22 -19
  43. data/lib/rubyXL/objects/worksheet.rb +40 -19
  44. data/lib/rubyXL/parser.rb +2 -0
  45. data/lib/rubyXL/version.rb +3 -0
  46. data/lib/rubyXL.rb +3 -2
  47. data/rubyXL.gemspec +11 -480
  48. metadata +52 -427
  49. data/.circleci/config.yml +0 -71
  50. data/.codeclimate.yml +0 -3
  51. data/.rubocop.yml +0 -124
  52. data/CHANGELOG.md +0 -12
  53. data/Gemfile +0 -20
  54. data/VERSION +0 -1
  55. data/rdoc/README_rdoc.html +0 -871
  56. data/rdoc/RubyXL/AExtension.html +0 -703
  57. data/rdoc/RubyXL/AExtensionStorageArea.html +0 -543
  58. data/rdoc/RubyXL/ActiveX.html +0 -654
  59. data/rdoc/RubyXL/ActiveXBinary.html +0 -560
  60. data/rdoc/RubyXL/AdjustHandleList.html +0 -539
  61. data/rdoc/RubyXL/Alignment.html +0 -539
  62. data/rdoc/RubyXL/AlternateContent.html +0 -543
  63. data/rdoc/RubyXL/AlternateUrls.html +0 -539
  64. data/rdoc/RubyXL/Authors.html +0 -539
  65. data/rdoc/RubyXL/AutoFilter.html +0 -539
  66. data/rdoc/RubyXL/AutoFilterColumn.html +0 -539
  67. data/rdoc/RubyXL/BinaryImageFile.html +0 -568
  68. data/rdoc/RubyXL/BodyProperties.html +0 -539
  69. data/rdoc/RubyXL/BooleanNode.html +0 -543
  70. data/rdoc/RubyXL/BooleanValue.html +0 -543
  71. data/rdoc/RubyXL/Border.html +0 -758
  72. data/rdoc/RubyXL/BorderEdge.html +0 -656
  73. data/rdoc/RubyXL/Borders.html +0 -608
  74. data/rdoc/RubyXL/Break.html +0 -539
  75. data/rdoc/RubyXL/BreakList.html +0 -539
  76. data/rdoc/RubyXL/CT_AdjPoint2D.html +0 -539
  77. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +0 -539
  78. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +0 -539
  79. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +0 -539
  80. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +0 -539
  81. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +0 -539
  82. data/rdoc/RubyXL/CT_Backdrop.html +0 -539
  83. data/rdoc/RubyXL/CT_Bevel.html +0 -539
  84. data/rdoc/RubyXL/CT_BiLevelEffect.html +0 -539
  85. data/rdoc/RubyXL/CT_BlendEffect.html +0 -539
  86. data/rdoc/RubyXL/CT_Blip.html +0 -539
  87. data/rdoc/RubyXL/CT_BlipFillProperties.html +0 -539
  88. data/rdoc/RubyXL/CT_BlurEffect.html +0 -539
  89. data/rdoc/RubyXL/CT_Camera.html +0 -539
  90. data/rdoc/RubyXL/CT_Color.html +0 -539
  91. data/rdoc/RubyXL/CT_ColorChangeEffect.html +0 -539
  92. data/rdoc/RubyXL/CT_ColorMapping.html +0 -539
  93. data/rdoc/RubyXL/CT_ColorScheme.html +0 -539
  94. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +0 -539
  95. data/rdoc/RubyXL/CT_ConnectionSite.html +0 -539
  96. data/rdoc/RubyXL/CT_ConnectionSiteList.html +0 -539
  97. data/rdoc/RubyXL/CT_DashStop.html +0 -539
  98. data/rdoc/RubyXL/CT_DashStopList.html +0 -539
  99. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +0 -539
  100. data/rdoc/RubyXL/CT_DuotoneEffect.html +0 -539
  101. data/rdoc/RubyXL/CT_EffectContainer.html +0 -539
  102. data/rdoc/RubyXL/CT_EffectList.html +0 -539
  103. data/rdoc/RubyXL/CT_EffectReference.html +0 -539
  104. data/rdoc/RubyXL/CT_EffectStyleItem.html +0 -539
  105. data/rdoc/RubyXL/CT_EffectStyleList.html +0 -539
  106. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +0 -539
  107. data/rdoc/RubyXL/CT_FillEffect.html +0 -539
  108. data/rdoc/RubyXL/CT_FillOverlayEffect.html +0 -539
  109. data/rdoc/RubyXL/CT_FillStyleList.html +0 -539
  110. data/rdoc/RubyXL/CT_FlatText.html +0 -539
  111. data/rdoc/RubyXL/CT_FontCollection.html +0 -539
  112. data/rdoc/RubyXL/CT_FontReference.html +0 -539
  113. data/rdoc/RubyXL/CT_GeomGuideList.html +0 -539
  114. data/rdoc/RubyXL/CT_GlowEffect.html +0 -539
  115. data/rdoc/RubyXL/CT_GradientFillProperties.html +0 -539
  116. data/rdoc/RubyXL/CT_GradientStop.html +0 -539
  117. data/rdoc/RubyXL/CT_GradientStopList.html +0 -539
  118. data/rdoc/RubyXL/CT_HSLEffect.html +0 -539
  119. data/rdoc/RubyXL/CT_HslColor.html +0 -539
  120. data/rdoc/RubyXL/CT_Hyperlink.html +0 -539
  121. data/rdoc/RubyXL/CT_InnerShadowEffect.html +0 -539
  122. data/rdoc/RubyXL/CT_LightRig.html +0 -539
  123. data/rdoc/RubyXL/CT_LineEndProperties.html +0 -539
  124. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +0 -539
  125. data/rdoc/RubyXL/CT_LineProperties.html +0 -539
  126. data/rdoc/RubyXL/CT_LineStyleList.html +0 -539
  127. data/rdoc/RubyXL/CT_LinearShadeProperties.html +0 -539
  128. data/rdoc/RubyXL/CT_LuminanceEffect.html +0 -539
  129. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +0 -539
  130. data/rdoc/RubyXL/CT_OuterShadowEffect.html +0 -539
  131. data/rdoc/RubyXL/CT_Path2D.html +0 -539
  132. data/rdoc/RubyXL/CT_Path2DArcTo.html +0 -539
  133. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +0 -539
  134. data/rdoc/RubyXL/CT_Path2DList.html +0 -539
  135. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +0 -539
  136. data/rdoc/RubyXL/CT_Path2DTo.html +0 -539
  137. data/rdoc/RubyXL/CT_PathShadeProperties.html +0 -539
  138. data/rdoc/RubyXL/CT_PatternFillProperties.html +0 -539
  139. data/rdoc/RubyXL/CT_Point3D.html +0 -539
  140. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +0 -539
  141. data/rdoc/RubyXL/CT_PresetColor.html +0 -539
  142. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +0 -539
  143. data/rdoc/RubyXL/CT_PresetShadowEffect.html +0 -539
  144. data/rdoc/RubyXL/CT_PresetTextShape.html +0 -539
  145. data/rdoc/RubyXL/CT_ReflectionEffect.html +0 -539
  146. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +0 -539
  147. data/rdoc/RubyXL/CT_RelativeRect.html +0 -539
  148. data/rdoc/RubyXL/CT_SRgbColor.html +0 -539
  149. data/rdoc/RubyXL/CT_ScRgbColor.html +0 -539
  150. data/rdoc/RubyXL/CT_Scene3D.html +0 -539
  151. data/rdoc/RubyXL/CT_SchemeColor.html +0 -539
  152. data/rdoc/RubyXL/CT_Shape3D.html +0 -539
  153. data/rdoc/RubyXL/CT_ShapeStyle.html +0 -539
  154. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +0 -539
  155. data/rdoc/RubyXL/CT_SphereCoords.html +0 -539
  156. data/rdoc/RubyXL/CT_StretchInfoProperties.html +0 -539
  157. data/rdoc/RubyXL/CT_StyleMatrix.html +0 -539
  158. data/rdoc/RubyXL/CT_StyleMatrixReference.html +0 -539
  159. data/rdoc/RubyXL/CT_SupplementalFont.html +0 -539
  160. data/rdoc/RubyXL/CT_SystemColor.html +0 -539
  161. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +0 -539
  162. data/rdoc/RubyXL/CT_TextBlipBullet.html +0 -539
  163. data/rdoc/RubyXL/CT_TextCharBullet.html +0 -539
  164. data/rdoc/RubyXL/CT_TextCharacterProperties.html +0 -539
  165. data/rdoc/RubyXL/CT_TextFont.html +0 -539
  166. data/rdoc/RubyXL/CT_TextListStyle.html +0 -539
  167. data/rdoc/RubyXL/CT_TextNormalAutofit.html +0 -539
  168. data/rdoc/RubyXL/CT_TextParagraphProperties.html +0 -539
  169. data/rdoc/RubyXL/CT_TextSpacing.html +0 -539
  170. data/rdoc/RubyXL/CT_TextTabStop.html +0 -539
  171. data/rdoc/RubyXL/CT_TextTabStopList.html +0 -539
  172. data/rdoc/RubyXL/CT_TileInfoProperties.html +0 -539
  173. data/rdoc/RubyXL/CT_TintEffect.html +0 -539
  174. data/rdoc/RubyXL/CT_Transform2D.html +0 -539
  175. data/rdoc/RubyXL/CT_TransformEffect.html +0 -539
  176. data/rdoc/RubyXL/CT_Vector3D.html +0 -539
  177. data/rdoc/RubyXL/CT_XYAdjustHandle.html +0 -539
  178. data/rdoc/RubyXL/CalculationChain.html +0 -633
  179. data/rdoc/RubyXL/CalculationChainCell.html +0 -539
  180. data/rdoc/RubyXL/CalculationProperties.html +0 -539
  181. data/rdoc/RubyXL/Cell.html +0 -1315
  182. data/rdoc/RubyXL/CellConvenienceMethods.html +0 -2290
  183. data/rdoc/RubyXL/CellExt.html +0 -539
  184. data/rdoc/RubyXL/CellSmartTag.html +0 -539
  185. data/rdoc/RubyXL/CellSmartTagProperty.html +0 -539
  186. data/rdoc/RubyXL/CellSmartTags.html +0 -539
  187. data/rdoc/RubyXL/CellStyle.html +0 -539
  188. data/rdoc/RubyXL/CellStyleXFs.html +0 -608
  189. data/rdoc/RubyXL/CellStyles.html +0 -608
  190. data/rdoc/RubyXL/CellValue.html +0 -609
  191. data/rdoc/RubyXL/CellWatch.html +0 -539
  192. data/rdoc/RubyXL/CellWatches.html +0 -539
  193. data/rdoc/RubyXL/CellXFs.html +0 -609
  194. data/rdoc/RubyXL/ChartColorsFile.html +0 -568
  195. data/rdoc/RubyXL/ChartFile.html +0 -664
  196. data/rdoc/RubyXL/ChartStyleFile.html +0 -568
  197. data/rdoc/RubyXL/ChartUserShapesFile.html +0 -568
  198. data/rdoc/RubyXL/Chartsheet.html +0 -743
  199. data/rdoc/RubyXL/ChartsheetPageSetup.html +0 -539
  200. data/rdoc/RubyXL/ChartsheetProperties.html +0 -539
  201. data/rdoc/RubyXL/ChartsheetProtection.html +0 -539
  202. data/rdoc/RubyXL/ChartsheetView.html +0 -539
  203. data/rdoc/RubyXL/ChartsheetViews.html +0 -539
  204. data/rdoc/RubyXL/Color.html +0 -629
  205. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +0 -774
  206. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +0 -845
  207. data/rdoc/RubyXL/ColorConvenienceClasses.html +0 -528
  208. data/rdoc/RubyXL/ColorConvenienceMethods.html +0 -606
  209. data/rdoc/RubyXL/ColorFilter.html +0 -539
  210. data/rdoc/RubyXL/ColorScale.html +0 -539
  211. data/rdoc/RubyXL/ColorSet.html +0 -539
  212. data/rdoc/RubyXL/Colors.html +0 -539
  213. data/rdoc/RubyXL/ColumnRange.html +0 -786
  214. data/rdoc/RubyXL/ColumnRanges.html +0 -773
  215. data/rdoc/RubyXL/Comment.html +0 -539
  216. data/rdoc/RubyXL/CommentList.html +0 -539
  217. data/rdoc/RubyXL/CommentsFile.html +0 -657
  218. data/rdoc/RubyXL/ConditionalFormatValue.html +0 -539
  219. data/rdoc/RubyXL/ConditionalFormatting.html +0 -539
  220. data/rdoc/RubyXL/ConditionalFormattingRule.html +0 -539
  221. data/rdoc/RubyXL/Connection.html +0 -539
  222. data/rdoc/RubyXL/ConnectionTable.html +0 -539
  223. data/rdoc/RubyXL/ConnectionTables.html +0 -539
  224. data/rdoc/RubyXL/ConnectionTextField.html +0 -539
  225. data/rdoc/RubyXL/ConnectionTextFields.html +0 -539
  226. data/rdoc/RubyXL/Connections.html +0 -633
  227. data/rdoc/RubyXL/ContentTypeDefault.html +0 -543
  228. data/rdoc/RubyXL/ContentTypeOverride.html +0 -543
  229. data/rdoc/RubyXL/ContentTypes.html +0 -721
  230. data/rdoc/RubyXL/ControlPropertiesFile.html +0 -568
  231. data/rdoc/RubyXL/CorePropertiesFile.html +0 -1013
  232. data/rdoc/RubyXL/CustomColor.html +0 -539
  233. data/rdoc/RubyXL/CustomColorList.html +0 -539
  234. data/rdoc/RubyXL/CustomFilter.html +0 -539
  235. data/rdoc/RubyXL/CustomFilters.html +0 -539
  236. data/rdoc/RubyXL/CustomGeometry.html +0 -539
  237. data/rdoc/RubyXL/CustomProperties.html +0 -539
  238. data/rdoc/RubyXL/CustomPropertiesFile.html +0 -568
  239. data/rdoc/RubyXL/CustomProperty.html +0 -539
  240. data/rdoc/RubyXL/CustomPropertyFile.html +0 -568
  241. data/rdoc/RubyXL/CustomSheetView.html +0 -539
  242. data/rdoc/RubyXL/CustomSheetViews.html +0 -539
  243. data/rdoc/RubyXL/CustomWorkbookView.html +0 -539
  244. data/rdoc/RubyXL/CustomWorkbookViews.html +0 -539
  245. data/rdoc/RubyXL/CustomXMLFile.html +0 -560
  246. data/rdoc/RubyXL/DXF.html +0 -539
  247. data/rdoc/RubyXL/DXFs.html +0 -539
  248. data/rdoc/RubyXL/DataBar.html +0 -539
  249. data/rdoc/RubyXL/DataConsolidate.html +0 -539
  250. data/rdoc/RubyXL/DataConsolidationReference.html +0 -539
  251. data/rdoc/RubyXL/DataConsolidationReferences.html +0 -539
  252. data/rdoc/RubyXL/DataType.html +0 -589
  253. data/rdoc/RubyXL/DataValidation.html +0 -539
  254. data/rdoc/RubyXL/DataValidations.html +0 -539
  255. data/rdoc/RubyXL/DateGroupItem.html +0 -539
  256. data/rdoc/RubyXL/DefinedName.html +0 -539
  257. data/rdoc/RubyXL/DefinedNameExt.html +0 -539
  258. data/rdoc/RubyXL/DefinedNames.html +0 -616
  259. data/rdoc/RubyXL/DefinedNamesExt.html +0 -539
  260. data/rdoc/RubyXL/DocumentPropertiesFile.html +0 -725
  261. data/rdoc/RubyXL/DrawingFile.html +0 -663
  262. data/rdoc/RubyXL/DynamicFilter.html +0 -539
  263. data/rdoc/RubyXL/EmbeddedControl.html +0 -539
  264. data/rdoc/RubyXL/EmbeddedControls.html +0 -539
  265. data/rdoc/RubyXL/Extension.html +0 -539
  266. data/rdoc/RubyXL/ExtensionStorageArea.html +0 -539
  267. data/rdoc/RubyXL/Extents.html +0 -539
  268. data/rdoc/RubyXL/ExternalBook.html +0 -539
  269. data/rdoc/RubyXL/ExternalLinksFile.html +0 -659
  270. data/rdoc/RubyXL/ExternalReference.html +0 -539
  271. data/rdoc/RubyXL/ExternalReferences.html +0 -539
  272. data/rdoc/RubyXL/ExtraColorSchemeList.html +0 -539
  273. data/rdoc/RubyXL/FieldItem.html +0 -539
  274. data/rdoc/RubyXL/FileRecoveryProperties.html +0 -539
  275. data/rdoc/RubyXL/FileSharing.html +0 -539
  276. data/rdoc/RubyXL/FileVersion.html +0 -539
  277. data/rdoc/RubyXL/Fill.html +0 -608
  278. data/rdoc/RubyXL/Fills.html +0 -608
  279. data/rdoc/RubyXL/FilterContainer.html +0 -539
  280. data/rdoc/RubyXL/FloatNode.html +0 -543
  281. data/rdoc/RubyXL/FloatValue.html +0 -543
  282. data/rdoc/RubyXL/Font.html +0 -626
  283. data/rdoc/RubyXL/FontConvenienceMethods.html +0 -1169
  284. data/rdoc/RubyXL/FontScheme.html +0 -539
  285. data/rdoc/RubyXL/Fonts.html +0 -608
  286. data/rdoc/RubyXL/Formula.html +0 -539
  287. data/rdoc/RubyXL/FunctionGroup.html +0 -539
  288. data/rdoc/RubyXL/FunctionGroups.html +0 -539
  289. data/rdoc/RubyXL/GenericStorageObject.html +0 -803
  290. data/rdoc/RubyXL/GradientFill.html +0 -539
  291. data/rdoc/RubyXL/HeaderFooterSettings.html +0 -539
  292. data/rdoc/RubyXL/Hyperlink.html +0 -539
  293. data/rdoc/RubyXL/HyperlinkRelFile.html +0 -560
  294. data/rdoc/RubyXL/Hyperlinks.html +0 -539
  295. data/rdoc/RubyXL/IconFilter.html +0 -539
  296. data/rdoc/RubyXL/IconSet.html +0 -539
  297. data/rdoc/RubyXL/IgnoredError.html +0 -539
  298. data/rdoc/RubyXL/IgnoredErrors.html +0 -539
  299. data/rdoc/RubyXL/IndexedColors.html +0 -539
  300. data/rdoc/RubyXL/InputCells.html +0 -539
  301. data/rdoc/RubyXL/IntegerNode.html +0 -543
  302. data/rdoc/RubyXL/IntegerValue.html +0 -543
  303. data/rdoc/RubyXL/LegacyCell.html +0 -597
  304. data/rdoc/RubyXL/LegacyWorksheet.html +0 -894
  305. data/rdoc/RubyXL/MRUColors.html +0 -539
  306. data/rdoc/RubyXL/MacrosFile.html +0 -568
  307. data/rdoc/RubyXL/MergedCell.html +0 -539
  308. data/rdoc/RubyXL/MergedCells.html +0 -539
  309. data/rdoc/RubyXL/NumFmt.html +0 -539
  310. data/rdoc/RubyXL/NumberFormat.html +0 -609
  311. data/rdoc/RubyXL/NumberFormats.html +0 -625
  312. data/rdoc/RubyXL/OLEObject.html +0 -539
  313. data/rdoc/RubyXL/OLEObjectFile.html +0 -568
  314. data/rdoc/RubyXL/OLEObjects.html +0 -539
  315. data/rdoc/RubyXL/OLESize.html +0 -539
  316. data/rdoc/RubyXL/OOXMLContainerObject.html +0 -916
  317. data/rdoc/RubyXL/OOXMLIgnored.html +0 -681
  318. data/rdoc/RubyXL/OOXMLObject.html +0 -561
  319. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +0 -1030
  320. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +0 -1092
  321. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +0 -1174
  322. data/rdoc/RubyXL/OOXMLTopLevelObject.html +0 -891
  323. data/rdoc/RubyXL/OdbcOleDbProperties.html +0 -539
  324. data/rdoc/RubyXL/Offset.html +0 -539
  325. data/rdoc/RubyXL/OlapProperties.html +0 -539
  326. data/rdoc/RubyXL/OleItem.html +0 -539
  327. data/rdoc/RubyXL/OleItems.html +0 -539
  328. data/rdoc/RubyXL/OleLink.html +0 -539
  329. data/rdoc/RubyXL/OutlineProperties.html +0 -539
  330. data/rdoc/RubyXL/PageMargins.html +0 -539
  331. data/rdoc/RubyXL/PageSetup.html +0 -539
  332. data/rdoc/RubyXL/PageSetupProperties.html +0 -539
  333. data/rdoc/RubyXL/Pane.html +0 -539
  334. data/rdoc/RubyXL/Parser.html +0 -670
  335. data/rdoc/RubyXL/PatternFill.html +0 -539
  336. data/rdoc/RubyXL/PersonMetadata.html +0 -568
  337. data/rdoc/RubyXL/PhoneticProperties.html +0 -539
  338. data/rdoc/RubyXL/PhoneticRun.html +0 -539
  339. data/rdoc/RubyXL/PivotArea.html +0 -539
  340. data/rdoc/RubyXL/PivotCache.html +0 -539
  341. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +0 -590
  342. data/rdoc/RubyXL/PivotCacheRecordsFile.html +0 -568
  343. data/rdoc/RubyXL/PivotCaches.html +0 -539
  344. data/rdoc/RubyXL/PivotReference.html +0 -539
  345. data/rdoc/RubyXL/PivotReferences.html +0 -539
  346. data/rdoc/RubyXL/PivotTableFile.html +0 -590
  347. data/rdoc/RubyXL/PivotTableSelection.html +0 -539
  348. data/rdoc/RubyXL/PresetGeometry.html +0 -539
  349. data/rdoc/RubyXL/PrintOptions.html +0 -539
  350. data/rdoc/RubyXL/PrinterSettingsFile.html +0 -568
  351. data/rdoc/RubyXL/ProtectedRange.html +0 -539
  352. data/rdoc/RubyXL/ProtectedRanges.html +0 -539
  353. data/rdoc/RubyXL/Protection.html +0 -539
  354. data/rdoc/RubyXL/QueryParameter.html +0 -539
  355. data/rdoc/RubyXL/QueryParameters.html +0 -539
  356. data/rdoc/RubyXL/QueryTable.html +0 -655
  357. data/rdoc/RubyXL/QueryTableDeletedField.html +0 -539
  358. data/rdoc/RubyXL/QueryTableDeletedFields.html +0 -539
  359. data/rdoc/RubyXL/QueryTableField.html +0 -539
  360. data/rdoc/RubyXL/QueryTableFields.html +0 -539
  361. data/rdoc/RubyXL/QueryTableRefresh.html +0 -539
  362. data/rdoc/RubyXL/RID.html +0 -543
  363. data/rdoc/RubyXL/RawOOXML.html +0 -703
  364. data/rdoc/RubyXL/Reference.html +0 -1376
  365. data/rdoc/RubyXL/Relationship.html +0 -543
  366. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +0 -604
  367. data/rdoc/RubyXL/RelationshipSupport.html +0 -943
  368. data/rdoc/RubyXL/RevisionPointer.html +0 -539
  369. data/rdoc/RubyXL/RichText.html +0 -611
  370. data/rdoc/RubyXL/RichTextRun.html +0 -608
  371. data/rdoc/RubyXL/Row.html +0 -1003
  372. data/rdoc/RubyXL/RowExt.html +0 -539
  373. data/rdoc/RubyXL/RunProperties.html +0 -539
  374. data/rdoc/RubyXL/Scenario.html +0 -539
  375. data/rdoc/RubyXL/Scenarios.html +0 -539
  376. data/rdoc/RubyXL/Selection.html +0 -616
  377. data/rdoc/RubyXL/ShapeGuide.html +0 -539
  378. data/rdoc/RubyXL/ShapeTextRectangle.html +0 -539
  379. data/rdoc/RubyXL/SharedStringsTable.html +0 -952
  380. data/rdoc/RubyXL/Sheet.html +0 -539
  381. data/rdoc/RubyXL/SheetCalculationProperties.html +0 -539
  382. data/rdoc/RubyXL/SheetData.html +0 -652
  383. data/rdoc/RubyXL/SheetDataExt.html +0 -539
  384. data/rdoc/RubyXL/SheetDataSet.html +0 -539
  385. data/rdoc/RubyXL/SheetMetadata.html +0 -568
  386. data/rdoc/RubyXL/SheetName.html +0 -539
  387. data/rdoc/RubyXL/SheetNames.html +0 -539
  388. data/rdoc/RubyXL/Sheets.html +0 -539
  389. data/rdoc/RubyXL/SlicerCacheFile.html +0 -568
  390. data/rdoc/RubyXL/SlicerFile.html +0 -568
  391. data/rdoc/RubyXL/SmartTagProperties.html +0 -539
  392. data/rdoc/RubyXL/SmartTagType.html +0 -539
  393. data/rdoc/RubyXL/SmartTagTypes.html +0 -539
  394. data/rdoc/RubyXL/SmartTags.html +0 -539
  395. data/rdoc/RubyXL/SortCondition.html +0 -539
  396. data/rdoc/RubyXL/SortState.html +0 -539
  397. data/rdoc/RubyXL/Sqref.html +0 -681
  398. data/rdoc/RubyXL/Stop.html +0 -539
  399. data/rdoc/RubyXL/StringNode.html +0 -543
  400. data/rdoc/RubyXL/StringNodeW3C.html +0 -681
  401. data/rdoc/RubyXL/StringValue.html +0 -543
  402. data/rdoc/RubyXL/Stylesheet.html +0 -864
  403. data/rdoc/RubyXL/TableFile.html +0 -568
  404. data/rdoc/RubyXL/TableParts.html +0 -543
  405. data/rdoc/RubyXL/TableStyle.html +0 -539
  406. data/rdoc/RubyXL/TableStyles.html +0 -539
  407. data/rdoc/RubyXL/Text.html +0 -679
  408. data/rdoc/RubyXL/TextImportSettings.html +0 -539
  409. data/rdoc/RubyXL/Theme.html +0 -1077
  410. data/rdoc/RubyXL/ThemeElements.html +0 -539
  411. data/rdoc/RubyXL/ThumbnailFile.html +0 -568
  412. data/rdoc/RubyXL/Top10.html +0 -539
  413. data/rdoc/RubyXL/VMLDrawingFile.html +0 -590
  414. data/rdoc/RubyXL/Variant.html +0 -539
  415. data/rdoc/RubyXL/Vector.html +0 -612
  416. data/rdoc/RubyXL/VectorValue.html +0 -543
  417. data/rdoc/RubyXL/VisualProperties.html +0 -539
  418. data/rdoc/RubyXL/WebPublishObject.html +0 -539
  419. data/rdoc/RubyXL/WebPublishObjects.html +0 -539
  420. data/rdoc/RubyXL/WebPublishingItem.html +0 -539
  421. data/rdoc/RubyXL/WebPublishingItems.html +0 -539
  422. data/rdoc/RubyXL/WebPublishingProperties.html +0 -539
  423. data/rdoc/RubyXL/WebQueryProperties.html +0 -539
  424. data/rdoc/RubyXL/Workbook.html +0 -2085
  425. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +0 -1407
  426. data/rdoc/RubyXL/WorkbookProperties.html +0 -539
  427. data/rdoc/RubyXL/WorkbookProtection.html +0 -539
  428. data/rdoc/RubyXL/WorkbookRoot.html +0 -933
  429. data/rdoc/RubyXL/WorkbookView.html +0 -539
  430. data/rdoc/RubyXL/WorkbookViews.html +0 -539
  431. data/rdoc/RubyXL/Worksheet.html +0 -1090
  432. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +0 -4076
  433. data/rdoc/RubyXL/WorksheetDimensions.html +0 -539
  434. data/rdoc/RubyXL/WorksheetFormatProperties.html +0 -543
  435. data/rdoc/RubyXL/WorksheetProperties.html +0 -539
  436. data/rdoc/RubyXL/WorksheetProtection.html +0 -539
  437. data/rdoc/RubyXL/WorksheetView.html +0 -539
  438. data/rdoc/RubyXL/WorksheetViews.html +0 -539
  439. data/rdoc/RubyXL/XF.html +0 -539
  440. data/rdoc/RubyXL.html +0 -1373
  441. data/rdoc/created.rid +0 -45
  442. data/rdoc/css/rdoc.css +0 -1955
  443. data/rdoc/index.html +0 -455
  444. data/rdoc/js/aliki.js +0 -511
  445. data/rdoc/js/bash_highlighter.js +0 -167
  446. data/rdoc/js/c_highlighter.js +0 -299
  447. data/rdoc/js/search_controller.js +0 -129
  448. data/rdoc/js/search_data.js +0 -1
  449. data/rdoc/js/search_navigation.js +0 -105
  450. data/rdoc/js/search_ranker.js +0 -239
  451. data/rdoc/js/theme-toggle.js +0 -112
  452. data/spec/lib/cell_spec.rb +0 -654
  453. data/spec/lib/color_spec.rb +0 -21
  454. data/spec/lib/parser_spec.rb +0 -118
  455. data/spec/lib/reference_spec.rb +0 -97
  456. data/spec/lib/rgb_color_spec.rb +0 -29
  457. data/spec/lib/stylesheet_spec.rb +0 -27
  458. data/spec/lib/text_spec.rb +0 -27
  459. data/spec/lib/workbook_spec.rb +0 -197
  460. data/spec/lib/worksheet_spec.rb +0 -1769
  461. data/spec/spec_helper.rb +0 -13
  462. data/test/input/.gitkeep +0 -0
  463. data/test/output/.gitkeep +0 -0
  464. data/test/test_parse_write.rb +0 -15
  465. data/tmp/.gitignore +0 -1
@@ -1,4 +1,6 @@
1
- require 'rubyXL/objects/ooxml_object'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
2
4
 
3
5
  module RubyXL
4
6
  # http://www.datypic.com/sc/ooxml/e-ssml_ext-1.html
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+
1
5
  module RubyXL
2
6
  # http://www.datypic.com/sc/ooxml/e-ssml_sheetName-1.html
3
7
  class SheetName < OOXMLObject
@@ -1,5 +1,7 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/simple_types'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'simple_types'
3
5
 
4
6
  module RubyXL
5
7
  # http://www.datypic.com/sc/ooxml/e-ssml_stop-1.html
@@ -1,6 +1,8 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/simple_types'
3
- require 'rubyXL/objects/extensions'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'simple_types'
5
+ require_relative 'extensions'
4
6
 
5
7
  module RubyXL
6
8
  # http://www.datypic.com/sc/ooxml/e-ssml_dateGroupItem-1.html
@@ -1,6 +1,8 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/container_nodes'
3
- require 'rubyXL/objects/color'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'container_nodes'
5
+ require_relative 'color'
4
6
 
5
7
  module RubyXL
6
8
  # http://www.datypic.com/sc/ooxml/e-ssml_font-1.html
@@ -1,5 +1,7 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/simple_types'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'simple_types'
3
5
 
4
6
  module RubyXL
5
7
  # http://www.datypic.com/sc/ooxml/e-ssml_f-1.html
@@ -1,6 +1,6 @@
1
1
  require 'nokogiri'
2
2
  require 'pathname'
3
- require 'rubyXL/objects/reference'
3
+ require_relative 'reference'
4
4
 
5
5
  module RubyXL
6
6
  module OOXMLObjectClassMethods
@@ -34,7 +34,7 @@ module RubyXL
34
34
  # * +:bool+ - <tt>Boolean</tt> ("1" and "true" convert to +true+, others to +false+)
35
35
  # * one of +simple_types+ - <tt>String</tt>, plus the list of acceptable values is saved for future validation (not used yet).
36
36
  # * +extra_parameters+ - Hash of optional parameters as follows:
37
- # * +:accessor+ - Name of the accessor for this attribute to be defined on the object. If not provided, defaults to classidied +attribute_name+.
37
+ # * +:accessor+ - Name of the accessor for this attribute to be defined on the object. If not provided, defaults to snakecased +attribute_name+.
38
38
  # * +:default+ - Value this attribute defaults to if not explicitly provided.
39
39
  # * +:required+ - Whether this attribute is required when writing XML. If the value of the attrinute is not explicitly provided, +:default+ is written instead.
40
40
  # * +:computed+ - Do not store this attribute on +parse+, but do call the object-provided read accessor on +write_xml+.
@@ -52,6 +52,8 @@ module RubyXL
52
52
  attr_hash = { :attr_type => attr_type }
53
53
  attr_hash.merge!(extra_params) if extra_params
54
54
  attr_hash[:accessor] ||= accessorize(attr_name)
55
+ attr_hash[:instance_var] ||= "@#{attr_hash[:accessor]}".to_sym
56
+ attr_hash[:setter] ||= "#{attr_hash[:accessor]}=".to_sym
55
57
  attrs[attr_name.to_s] = attr_hash
56
58
  self.send(:attr_accessor, attr_hash[:accessor]) unless attr_hash[:computed]
57
59
  end
@@ -89,7 +91,9 @@ module RubyXL
89
91
  child_nodes[child_node_name] = {
90
92
  :class => klass,
91
93
  :is_array => extra_params[:collection],
92
- :accessor => accessor
94
+ :accessor => accessor,
95
+ :setter => "#{accessor}=".to_sym,
96
+ :instance_var => "@#{accessor}".to_sym
93
97
  }
94
98
 
95
99
  define_count_attribute if extra_params[:collection] == :with_count
@@ -164,7 +168,7 @@ module RubyXL
164
168
  end
165
169
 
166
170
  child_node_params = known_child_nodes[child_node_name]
167
- raise "Unknown child node [#{child_node_name}] for element [#{node.name}]" if child_node_params.nil?
171
+ raise(RuntimeError, "Unknown child node [#{child_node_name}] for element [#{node.name}]") if child_node_params.nil?
168
172
  parsed_object = child_node_params[:class].parse(child_node, known_namespaces)
169
173
  if child_node_params[:is_array] then
170
174
  index = parsed_object.index_in_collection
@@ -179,7 +183,7 @@ module RubyXL
179
183
  collection[index] = parsed_object
180
184
  end
181
185
  else
182
- obj.send("#{child_node_params[:accessor]}=", parsed_object)
186
+ obj.send(child_node_params[:setter], parsed_object)
183
187
  end
184
188
  }
185
189
  end
@@ -208,10 +212,10 @@ module RubyXL
208
212
  when :int then Integer(raw_value)
209
213
  when :uint then
210
214
  v = Integer(raw_value)
211
- raise ArgumentError.new("invalid value for unsigned Integer(): \"#{raw_value}\"") if v < 0
215
+ raise(ArgumentError, "Invalid value for unsigned Integer(): \"#{raw_value}\"") if v < 0
212
216
  v
213
217
  end
214
- obj.send("#{params[:accessor]}=", val)
218
+ obj.send(params[:setter], val)
215
219
  end
216
220
  end
217
221
 
@@ -230,10 +234,9 @@ module RubyXL
230
234
 
231
235
  def initialize(params = nil)
232
236
  @local_namespaces = nil
233
- params ||= {}
234
237
 
235
238
  obtain_class_variable(:@@ooxml_attributes).each_value { |v|
236
- instance_variable_set("@#{v[:accessor]}", params[v[:accessor]]) unless v[:computed]
239
+ instance_variable_set(v[:instance_var], params&.[](v[:accessor])) unless v[:computed]
237
240
  }
238
241
 
239
242
  init_child_nodes(params)
@@ -242,15 +245,14 @@ module RubyXL
242
245
  def init_child_nodes(params)
243
246
  obtain_class_variable(:@@ooxml_child_nodes).each_value { |v|
244
247
  initial_value =
245
- if params.has_key?(v[:accessor]) then params[v[:accessor]]
248
+ if params&.has_key?(v[:accessor]) then params[v[:accessor]]
246
249
  elsif v[:is_array] then []
247
250
  else nil
248
251
  end
249
252
 
250
- instance_variable_set("@#{v[:accessor]}", initial_value)
253
+ instance_variable_set(v[:instance_var], initial_value)
251
254
  }
252
255
  end
253
- private :init_child_nodes
254
256
 
255
257
  def preserve_whitespace
256
258
  self.xml_space = (value.is_a?(String) && ((value =~ /\A\s/) || (value =~ /\s\Z/) || value.include?("\n"))) ? 'preserve' : nil
@@ -395,7 +397,7 @@ module RubyXL
395
397
  def init_child_nodes(params)
396
398
  obtain_class_variable(:@@ooxml_child_nodes).each_value { |v|
397
399
  next if v[:is_array] # Only one collection node allowed per OOXMLContainerObject, and it is contained in itself.
398
- instance_variable_set("@#{v[:accessor]}", params[v[:accessor]])
400
+ instance_variable_set(v[:instance_var], params[v[:accessor]])
399
401
  }
400
402
  end
401
403
  protected :init_child_nodes
@@ -405,9 +407,7 @@ module RubyXL
405
407
  end
406
408
 
407
409
  def inspect
408
- vars = [ super ]
409
- vars = self.instance_variables.each { |v| vars << "#{v}=#{instance_variable_get(v).inspect}" }
410
- "<#{self.class}: #{super} #{vars.join(", ")}>"
410
+ "<#{self.class}: #{super} #{self.instance_variables.collect{ |v| "#{v}=#{instance_variable_get(v).inspect}" }.join(', ')}>"
411
411
  end
412
412
 
413
413
  class << self
@@ -430,7 +430,7 @@ module RubyXL
430
430
  # Prototype method. For top-level OOXML object, returns the path at which the current object's XML file
431
431
  # is located within the <tt>.xlsx</tt> zip container.
432
432
  def xlsx_path
433
- raise 'Subclass responsebility'
433
+ raise RuntimeError, 'Subclass responsebility'
434
434
  end
435
435
 
436
436
  # Sets the list of namespaces on this object to be added when writing out XML. Valid only on top-level objects.
@@ -1,8 +1,10 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/simple_types'
3
- require 'rubyXL/objects/extensions'
4
- require 'rubyXL/objects/relationships'
5
- require 'rubyXL/objects/sheet_common'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'simple_types'
5
+ require_relative 'extensions'
6
+ require_relative 'relationships'
7
+ require_relative 'sheet_common'
6
8
 
7
9
  # Query Tables
8
10
  # https://msdn.microsoft.com/en-us/library/hh643563(v=office.12).aspx
@@ -1,10 +1,13 @@
1
+ require_relative 'ooxml_object'
2
+
1
3
  module RubyXL
2
4
  class Reference
3
5
  ROW_MAX = 1024 * 1024
4
6
  COL_MAX = 16393
5
7
 
6
- attr_reader :row_range, :col_range, :sheet_name
8
+ attr_reader :first_row, :last_row, :first_col, :last_col
7
9
  attr_reader :row_from_absolute, :row_to_absolute, :col_from_absolute, :col_to_absolute
10
+ attr_reader :sheet_name
8
11
 
9
12
  # RubyXL::Reference.new(row, col)
10
13
  # RubyXL::Reference.new(row_from, row_to, col_from, col_to)
@@ -33,56 +36,70 @@ module RubyXL
33
36
  row_from, col_from, @row_from_absolute, @col_from_absolute = self.class.ref2ind(from)
34
37
  row_to, col_to, @row_to_absolute, @col_to_absolute = self.class.ref2ind(to) unless to.nil?
35
38
  else
36
- raise ArgumentError.new("invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
39
+ raise(ArgumentError, "Invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
37
40
  end
38
41
  end
39
42
 
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)
43
+ @first_row = row_from || 0
44
+ @last_row = row_to || row_from || ROW_MAX
45
+ @first_col = col_from || 0
46
+ @last_col = col_to || col_from || COL_MAX
42
47
  end
43
48
 
44
- def single_cell?
45
- (@row_range.begin == @row_range.end) && (@col_range.begin == @col_range.end)
49
+ def row_range
50
+ warn "[DEPRECATION] `row_range` is deprecated. Please use `first_row` and `last_row` instead."
51
+ @row_range ||= Range.new(@first_row, @last_row)
46
52
  end
47
53
 
48
- def valid?
49
- !(row_range.begin.negative? || col_range.begin.negative?)
54
+ def col_range
55
+ warn "[DEPRECATION] `col_range` is deprecated. Please use `first_col` and `last_col` instead."
56
+ @col_range ||= Range.new(@first_col, @last_col)
50
57
  end
51
58
 
52
- def first_row
53
- @row_range.begin
59
+ def single_cell?
60
+ (@first_row == @last_row) && (@first_col == @last_col)
54
61
  end
55
62
 
56
- def last_row
57
- @row_range.end
63
+ def valid?
64
+ !(@first_row.negative? || @first_col.negative?)
58
65
  end
59
66
 
60
- def first_col
61
- @col_range.begin
62
- end
67
+ def ==(other)
68
+ return false unless other.is_a?(RubyXL::Reference)
69
+ return false unless @sheet_name == other.sheet_name
63
70
 
64
- def last_col
65
- @col_range.end
71
+ (@first_row == other.first_row) &&
72
+ (@last_row == other.last_row) &&
73
+ (@first_col == other.first_col) &&
74
+ (@last_col == other.last_col)
66
75
  end
67
76
 
68
- def ==(other)
69
- !other.nil? && (@sheet_name == other.sheet_name) &&
70
- (@row_range == other.row_range) && (@col_range == other.col_range)
77
+ def cover?(other)
78
+ return false unless other.is_a?(RubyXL::Reference)
79
+ return false if @sheet_name != other.sheet_name
80
+
81
+ (@first_row <= other.first_row) &&
82
+ (@last_row >= other.last_row) &&
83
+ (@first_col <= other.first_col) &&
84
+ (@last_col >= other.last_col)
71
85
  end
72
86
 
73
- 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))
87
+ def intersect?(other)
88
+ return false unless other.is_a?(RubyXL::Reference)
89
+ return false if @sheet_name != other.sheet_name
90
+
91
+ (((@first_row <= other.first_row) && (@last_row >= other.first_row)) ||
92
+ ((@first_row <= other.last_row) && (@last_row >= other.last_row))) &&
93
+ (((@first_col <= other.first_col) && (@last_col >= other.first_col)) ||
94
+ ((@first_col <= other.last_col) && (@last_col >= other.last_col)))
78
95
  end
79
96
 
80
97
  def to_s
81
98
  result = +''
82
99
 
83
100
  if @sheet_name then
84
- if @sheet_name.index(' ') then
85
- result << "'#{@sheet_name}'"
101
+ if @sheet_name.include?(' ') then
102
+ result << "'" << @sheet_name << "'"
86
103
  else
87
104
  result << @sheet_name
88
105
  end
@@ -90,19 +107,19 @@ module RubyXL
90
107
  end
91
108
 
92
109
  if single_cell? then
93
- result << self.class.ind2ref(@row_range.begin, @col_range.begin, @row_from_absolute, @col_from_absolute)
110
+ result << self.class.ind2ref(@first_row, @first_col, @row_from_absolute, @col_from_absolute)
94
111
  else
95
- result << self.class.ind2ref(@row_range.begin, @col_range.begin, @row_from_absolute, @col_from_absolute)
112
+ result << self.class.ind2ref(@first_row, @first_col, @row_from_absolute, @col_from_absolute)
96
113
  result << ':'
97
- result << self.class.ind2ref(@row_range.end, @col_range.end, @row_to_absolute, @col_to_absolute)
114
+ result << self.class.ind2ref(@last_row, @last_col, @row_to_absolute, @col_to_absolute)
98
115
  end
99
116
  end
100
117
 
101
118
  def inspect
102
119
  if single_cell? then
103
- "#<#{self.class} @sheet_name=#{@sheet_name} @row=#{@row_range.begin} @col=#{@col_range.begin}>"
120
+ "#<#{self.class} @sheet_name=#{@sheet_name} @row=#{@first_row} @col=#{@first_col}>"
104
121
  else
105
- "#<#{self.class} @sheet_name=#{@sheet_name} @row_range=#{@row_range} @col_range=#{@col_range}>"
122
+ "#<#{self.class} @sheet_name=#{@sheet_name} rows=#{@first_row}..#{@last_row} cols=#{@first_col}..#{@last_col}>"
106
123
  end
107
124
  end
108
125
 
@@ -1,5 +1,5 @@
1
1
  require 'pathname'
2
- require 'rubyXL/objects/ooxml_object'
2
+ require_relative 'ooxml_object'
3
3
 
4
4
  module RubyXL
5
5
  class RID < OOXMLObject
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'zip'
2
- require 'rubyXL/objects/relationships'
3
- require 'rubyXL/objects/document_properties'
4
- require 'rubyXL/objects/content_types'
5
- require 'rubyXL/objects/workbook'
4
+ require_relative 'relationships'
5
+ require_relative 'document_properties'
6
+ require_relative 'content_types'
7
+ require_relative 'workbook'
6
8
 
7
9
  module RubyXL
8
10
  class WorkbookRoot
@@ -45,7 +47,14 @@ module RubyXL
45
47
 
46
48
  self.rels_hash.keys.sort_by{ |c| c::SAVE_ORDER }.each { |klass|
47
49
  puts "<-- DEBUG: saving related #{klass} files" if @@debug
48
- self.rels_hash[klass].select! { |obj|
50
+ # This is a hack.
51
+ # Technically, MS Excel allows one file to be shared amongst multiple sheets in the XLS document.
52
+ # That file exists in the archive structure only once, and all sheets refer to the same file by path.
53
+ # RubyXL uses a tree structure, where each sheet has its own "branches" (related objects),
54
+ # and loops in the relationship graph are not allowed (a child node can have onle one parent).
55
+ # This needs to be fixed in the future. Thankfully, files like that seem to be rare, and this
56
+ # situation can be avoided simply by not saving a node if it already exists in the zipfile.
57
+ self.rels_hash[klass].uniq{ |item| item.xlsx_path }.select! { |obj|
49
58
  puts "<-- DEBUG: > #{obj.xlsx_path}" if @@debug
50
59
  obj.add_to_zip(zipstream)
51
60
  }
@@ -1,6 +1,8 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/text'
3
- require 'rubyXL/objects/extensions'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'text'
5
+ require_relative 'extensions'
4
6
 
5
7
  module RubyXL
6
8
  # http://www.datypic.com/sc/ooxml/e-ssml_sst.html
@@ -1,5 +1,7 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/storage'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'storage'
3
5
 
4
6
  module RubyXL
5
7
  # http://www.datypic.com/sc/ooxml/e-ssml_webPublishItem-1.html
@@ -1,8 +1,11 @@
1
- require 'rubyXL/objects/ooxml_object'
2
- require 'rubyXL/objects/simple_types'
3
- require 'rubyXL/objects/text'
4
- require 'rubyXL/objects/formula'
5
- require 'rubyXL/cell'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ooxml_object'
4
+ require_relative 'simple_types'
5
+ require_relative 'text'
6
+ require_relative 'formula'
7
+
8
+ require_relative '../legacy_cell'
6
9
 
7
10
  module RubyXL
8
11
  # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.cellvalues(v=office.14).aspx
@@ -23,6 +26,8 @@ module RubyXL
23
26
  define_element_name 'v'
24
27
 
25
28
  def before_write_xml
29
+ return false if (value.nil? || value == '')
30
+ self.value = RubyXL::Text.escape_bad_xml_chars(value)
26
31
  preserve_whitespace
27
32
  true
28
33
  end
@@ -46,7 +51,7 @@ module RubyXL
46
51
  attr_accessor :worksheet
47
52
 
48
53
  def index_in_collection
49
- r.col_range.begin
54
+ r.first_col
50
55
  end
51
56
 
52
57
  def row
@@ -109,7 +114,8 @@ module RubyXL
109
114
  case datatype
110
115
  when RubyXL::DataType::SHARED_STRING then workbook.shared_strings_container[r.to_i].to_s
111
116
  when RubyXL::DataType::INLINE_STRING then is.to_s
112
- when RubyXL::DataType::RAW_STRING then raw_value
117
+ when RubyXL::DataType::RAW_STRING then
118
+ raw_value&.gsub(RubyXL::Text::ESCAPED_UNICODE) { Regexp.last_match(1).hex.chr(::Encoding::UTF_8) }
113
119
  when RubyXL::DataType::DATE then raw_value && DateTime.parse(raw_value)
114
120
  when RubyXL::DataType::ERROR then nil
115
121
  else
@@ -143,6 +149,11 @@ module RubyXL
143
149
  # http://www.datypic.com/sc/ooxml/e-ssml_row-1.html
144
150
  class Row < OOXMLObject
145
151
  define_attribute(:r, :int)
152
+ # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.row%28v=office.14%29.aspx
153
+ # "Optimization only, and not required. Specifies the range of non-empty columns (in the format X:Y)
154
+ # for the block of rows to which the current row belongs. To achieve the optimization, span attribute
155
+ # values in a single block should be the same.
156
+ # There are 16 rows per block, beginning with the first row."
146
157
  define_attribute(:spans, :string)
147
158
  define_attribute(:s, :int, :default => 0, :accessor => :style_index)
148
159
  define_attribute(:customFormat, :bool, :default => false)