rubyXL 3.4.15 → 3.4.20

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 (416) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -1
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +75 -43
  5. data/README.rdoc +6 -3
  6. data/Rakefile +3 -3
  7. data/VERSION +1 -1
  8. data/lib/rubyXL/convenience_methods/cell.rb +1 -1
  9. data/lib/rubyXL/convenience_methods/worksheet.rb +65 -0
  10. data/lib/rubyXL/objects/chartsheet.rb +1 -1
  11. data/lib/rubyXL/objects/external_links.rb +25 -1
  12. data/lib/rubyXL/objects/ooxml_object.rb +5 -0
  13. data/lib/rubyXL/objects/reference.rb +2 -5
  14. data/lib/rubyXL/objects/relationships.rb +1 -1
  15. data/lib/rubyXL/objects/sheet_data.rb +2 -1
  16. data/lib/rubyXL/objects/text.rb +2 -1
  17. data/lib/rubyXL/objects/theme.rb +1 -1
  18. data/lib/rubyXL/objects/workbook.rb +8 -5
  19. data/lib/rubyXL/objects/worksheet.rb +7 -7
  20. data/rdoc/README_rdoc.html +18 -11
  21. data/rdoc/RubyXL/AExtension.html +9 -51
  22. data/rdoc/RubyXL/AExtensionStorageArea.html +5 -14
  23. data/rdoc/RubyXL/ActiveX.html +10 -41
  24. data/rdoc/RubyXL/ActiveXBinary.html +5 -19
  25. data/rdoc/RubyXL/AdjustHandleList.html +5 -14
  26. data/rdoc/RubyXL/Alignment.html +5 -14
  27. data/rdoc/RubyXL/AlternateContent.html +5 -14
  28. data/rdoc/RubyXL/Authors.html +5 -14
  29. data/rdoc/RubyXL/AutoFilter.html +5 -14
  30. data/rdoc/RubyXL/AutoFilterColumn.html +5 -14
  31. data/rdoc/RubyXL/BinaryImageFile.html +5 -22
  32. data/rdoc/RubyXL/BodyProperties.html +5 -14
  33. data/rdoc/RubyXL/BooleanNode.html +5 -14
  34. data/rdoc/RubyXL/BooleanValue.html +5 -14
  35. data/rdoc/RubyXL/Border.html +8 -70
  36. data/rdoc/RubyXL/BorderEdge.html +8 -44
  37. data/rdoc/RubyXL/Borders.html +8 -31
  38. data/rdoc/RubyXL/Break.html +5 -14
  39. data/rdoc/RubyXL/BreakList.html +5 -14
  40. data/rdoc/RubyXL/CT_AdjPoint2D.html +5 -14
  41. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +5 -14
  42. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +5 -14
  43. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +5 -14
  44. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +5 -14
  45. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +5 -14
  46. data/rdoc/RubyXL/CT_Backdrop.html +5 -14
  47. data/rdoc/RubyXL/CT_Bevel.html +5 -14
  48. data/rdoc/RubyXL/CT_BiLevelEffect.html +5 -14
  49. data/rdoc/RubyXL/CT_BlendEffect.html +5 -14
  50. data/rdoc/RubyXL/CT_Blip.html +5 -14
  51. data/rdoc/RubyXL/CT_BlipFillProperties.html +5 -14
  52. data/rdoc/RubyXL/CT_BlurEffect.html +5 -14
  53. data/rdoc/RubyXL/CT_Camera.html +5 -14
  54. data/rdoc/RubyXL/CT_Color.html +5 -14
  55. data/rdoc/RubyXL/CT_ColorChangeEffect.html +5 -14
  56. data/rdoc/RubyXL/CT_ColorMapping.html +5 -14
  57. data/rdoc/RubyXL/CT_ColorScheme.html +5 -14
  58. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +5 -14
  59. data/rdoc/RubyXL/CT_ConnectionSite.html +5 -14
  60. data/rdoc/RubyXL/CT_ConnectionSiteList.html +5 -14
  61. data/rdoc/RubyXL/CT_DashStop.html +5 -14
  62. data/rdoc/RubyXL/CT_DashStopList.html +5 -14
  63. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +5 -14
  64. data/rdoc/RubyXL/CT_DuotoneEffect.html +5 -14
  65. data/rdoc/RubyXL/CT_EffectContainer.html +5 -14
  66. data/rdoc/RubyXL/CT_EffectList.html +5 -14
  67. data/rdoc/RubyXL/CT_EffectReference.html +5 -14
  68. data/rdoc/RubyXL/CT_EffectStyleItem.html +5 -14
  69. data/rdoc/RubyXL/CT_EffectStyleList.html +5 -14
  70. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +5 -14
  71. data/rdoc/RubyXL/CT_FillEffect.html +5 -14
  72. data/rdoc/RubyXL/CT_FillOverlayEffect.html +5 -14
  73. data/rdoc/RubyXL/CT_FillStyleList.html +5 -14
  74. data/rdoc/RubyXL/CT_FlatText.html +5 -14
  75. data/rdoc/RubyXL/CT_FontCollection.html +5 -14
  76. data/rdoc/RubyXL/CT_FontReference.html +5 -14
  77. data/rdoc/RubyXL/CT_GeomGuideList.html +5 -14
  78. data/rdoc/RubyXL/CT_GlowEffect.html +5 -14
  79. data/rdoc/RubyXL/CT_GradientFillProperties.html +5 -14
  80. data/rdoc/RubyXL/CT_GradientStop.html +5 -14
  81. data/rdoc/RubyXL/CT_GradientStopList.html +5 -14
  82. data/rdoc/RubyXL/CT_HSLEffect.html +5 -14
  83. data/rdoc/RubyXL/CT_HslColor.html +5 -14
  84. data/rdoc/RubyXL/CT_Hyperlink.html +5 -14
  85. data/rdoc/RubyXL/CT_InnerShadowEffect.html +5 -14
  86. data/rdoc/RubyXL/CT_LightRig.html +5 -14
  87. data/rdoc/RubyXL/CT_LineEndProperties.html +5 -14
  88. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +5 -14
  89. data/rdoc/RubyXL/CT_LineProperties.html +5 -14
  90. data/rdoc/RubyXL/CT_LineStyleList.html +5 -14
  91. data/rdoc/RubyXL/CT_LinearShadeProperties.html +5 -14
  92. data/rdoc/RubyXL/CT_LuminanceEffect.html +5 -14
  93. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +5 -14
  94. data/rdoc/RubyXL/CT_OuterShadowEffect.html +5 -14
  95. data/rdoc/RubyXL/CT_Path2D.html +5 -14
  96. data/rdoc/RubyXL/CT_Path2DArcTo.html +5 -14
  97. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +5 -14
  98. data/rdoc/RubyXL/CT_Path2DList.html +5 -14
  99. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +5 -14
  100. data/rdoc/RubyXL/CT_Path2DTo.html +5 -14
  101. data/rdoc/RubyXL/CT_PathShadeProperties.html +5 -14
  102. data/rdoc/RubyXL/CT_PatternFillProperties.html +5 -14
  103. data/rdoc/RubyXL/CT_Point3D.html +5 -14
  104. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +5 -14
  105. data/rdoc/RubyXL/CT_PresetColor.html +5 -14
  106. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +5 -14
  107. data/rdoc/RubyXL/CT_PresetShadowEffect.html +5 -14
  108. data/rdoc/RubyXL/CT_PresetTextShape.html +5 -14
  109. data/rdoc/RubyXL/CT_ReflectionEffect.html +5 -14
  110. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +5 -14
  111. data/rdoc/RubyXL/CT_RelativeRect.html +5 -14
  112. data/rdoc/RubyXL/CT_SRgbColor.html +5 -14
  113. data/rdoc/RubyXL/CT_ScRgbColor.html +5 -14
  114. data/rdoc/RubyXL/CT_Scene3D.html +5 -14
  115. data/rdoc/RubyXL/CT_SchemeColor.html +5 -14
  116. data/rdoc/RubyXL/CT_Shape3D.html +5 -14
  117. data/rdoc/RubyXL/CT_ShapeStyle.html +5 -14
  118. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +5 -14
  119. data/rdoc/RubyXL/CT_SphereCoords.html +5 -14
  120. data/rdoc/RubyXL/CT_StretchInfoProperties.html +5 -14
  121. data/rdoc/RubyXL/CT_StyleMatrix.html +5 -14
  122. data/rdoc/RubyXL/CT_StyleMatrixReference.html +5 -14
  123. data/rdoc/RubyXL/CT_SupplementalFont.html +5 -14
  124. data/rdoc/RubyXL/CT_SystemColor.html +5 -14
  125. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +5 -14
  126. data/rdoc/RubyXL/CT_TextBlipBullet.html +5 -14
  127. data/rdoc/RubyXL/CT_TextCharBullet.html +5 -14
  128. data/rdoc/RubyXL/CT_TextCharacterProperties.html +5 -14
  129. data/rdoc/RubyXL/CT_TextFont.html +5 -14
  130. data/rdoc/RubyXL/CT_TextListStyle.html +5 -14
  131. data/rdoc/RubyXL/CT_TextNormalAutofit.html +5 -14
  132. data/rdoc/RubyXL/CT_TextParagraphProperties.html +5 -14
  133. data/rdoc/RubyXL/CT_TextSpacing.html +5 -14
  134. data/rdoc/RubyXL/CT_TextTabStop.html +5 -14
  135. data/rdoc/RubyXL/CT_TextTabStopList.html +5 -14
  136. data/rdoc/RubyXL/CT_TileInfoProperties.html +5 -14
  137. data/rdoc/RubyXL/CT_TintEffect.html +5 -14
  138. data/rdoc/RubyXL/CT_Transform2D.html +5 -14
  139. data/rdoc/RubyXL/CT_TransformEffect.html +5 -14
  140. data/rdoc/RubyXL/CT_Vector3D.html +5 -14
  141. data/rdoc/RubyXL/CT_XYAdjustHandle.html +5 -14
  142. data/rdoc/RubyXL/CalculationChain.html +8 -39
  143. data/rdoc/RubyXL/CalculationChainCell.html +5 -14
  144. data/rdoc/RubyXL/CalculationProperties.html +5 -14
  145. data/rdoc/RubyXL/Cell.html +13 -217
  146. data/rdoc/RubyXL/CellConvenienceMethods.html +6 -457
  147. data/rdoc/RubyXL/CellExt.html +5 -14
  148. data/rdoc/RubyXL/CellSmartTag.html +5 -14
  149. data/rdoc/RubyXL/CellSmartTagProperty.html +5 -14
  150. data/rdoc/RubyXL/CellSmartTags.html +5 -14
  151. data/rdoc/RubyXL/CellStyle.html +5 -14
  152. data/rdoc/RubyXL/CellStyleXFs.html +8 -31
  153. data/rdoc/RubyXL/CellStyles.html +8 -31
  154. data/rdoc/RubyXL/CellValue.html +8 -31
  155. data/rdoc/RubyXL/CellWatch.html +5 -14
  156. data/rdoc/RubyXL/CellWatches.html +5 -14
  157. data/rdoc/RubyXL/CellXFs.html +8 -31
  158. data/rdoc/RubyXL/ChartColorsFile.html +5 -22
  159. data/rdoc/RubyXL/ChartFile.html +10 -44
  160. data/rdoc/RubyXL/ChartStyleFile.html +5 -22
  161. data/rdoc/RubyXL/ChartUserShapesFile.html +5 -22
  162. data/rdoc/RubyXL/Chartsheet.html +10 -61
  163. data/rdoc/RubyXL/ChartsheetPageSetup.html +5 -14
  164. data/rdoc/RubyXL/ChartsheetProperties.html +5 -14
  165. data/rdoc/RubyXL/ChartsheetProtection.html +5 -14
  166. data/rdoc/RubyXL/ChartsheetView.html +5 -14
  167. data/rdoc/RubyXL/ChartsheetViews.html +5 -14
  168. data/rdoc/RubyXL/Color.html +9 -37
  169. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +8 -58
  170. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +9 -73
  171. data/rdoc/RubyXL/ColorConvenienceClasses.html +3 -11
  172. data/rdoc/RubyXL/ColorConvenienceMethods.html +6 -28
  173. data/rdoc/RubyXL/ColorFilter.html +5 -14
  174. data/rdoc/RubyXL/ColorScale.html +5 -14
  175. data/rdoc/RubyXL/ColorSet.html +5 -14
  176. data/rdoc/RubyXL/Colors.html +5 -14
  177. data/rdoc/RubyXL/ColumnRange.html +8 -62
  178. data/rdoc/RubyXL/ColumnRanges.html +8 -70
  179. data/rdoc/RubyXL/Comment.html +5 -14
  180. data/rdoc/RubyXL/CommentList.html +5 -14
  181. data/rdoc/RubyXL/CommentsFile.html +8 -44
  182. data/rdoc/RubyXL/ConditionalFormatValue.html +5 -14
  183. data/rdoc/RubyXL/ConditionalFormatting.html +5 -14
  184. data/rdoc/RubyXL/ConditionalFormattingRule.html +5 -14
  185. data/rdoc/RubyXL/Connection.html +5 -14
  186. data/rdoc/RubyXL/ConnectionTable.html +5 -14
  187. data/rdoc/RubyXL/ConnectionTables.html +5 -14
  188. data/rdoc/RubyXL/ConnectionTextField.html +5 -14
  189. data/rdoc/RubyXL/ConnectionTextFields.html +5 -14
  190. data/rdoc/RubyXL/Connections.html +8 -39
  191. data/rdoc/RubyXL/ContentTypeDefault.html +5 -14
  192. data/rdoc/RubyXL/ContentTypeOverride.html +5 -14
  193. data/rdoc/RubyXL/ContentTypes.html +8 -52
  194. data/rdoc/RubyXL/ControlPropertiesFile.html +5 -22
  195. data/rdoc/RubyXL/CorePropertiesFile.html +8 -148
  196. data/rdoc/RubyXL/CustomColor.html +5 -14
  197. data/rdoc/RubyXL/CustomColorList.html +5 -14
  198. data/rdoc/RubyXL/CustomFilter.html +5 -14
  199. data/rdoc/RubyXL/CustomFilters.html +5 -14
  200. data/rdoc/RubyXL/CustomGeometry.html +5 -14
  201. data/rdoc/RubyXL/CustomProperties.html +5 -14
  202. data/rdoc/RubyXL/CustomPropertiesFile.html +5 -22
  203. data/rdoc/RubyXL/CustomProperty.html +5 -14
  204. data/rdoc/RubyXL/CustomPropertyFile.html +5 -22
  205. data/rdoc/RubyXL/CustomSheetView.html +5 -14
  206. data/rdoc/RubyXL/CustomSheetViews.html +5 -14
  207. data/rdoc/RubyXL/CustomWorkbookView.html +5 -14
  208. data/rdoc/RubyXL/CustomWorkbookViews.html +5 -14
  209. data/rdoc/RubyXL/CustomXMLFile.html +5 -19
  210. data/rdoc/RubyXL/DXF.html +5 -14
  211. data/rdoc/RubyXL/DXFs.html +5 -14
  212. data/rdoc/RubyXL/DataBar.html +5 -14
  213. data/rdoc/RubyXL/DataConsolidate.html +5 -14
  214. data/rdoc/RubyXL/DataConsolidationReference.html +5 -14
  215. data/rdoc/RubyXL/DataConsolidationReferences.html +5 -14
  216. data/rdoc/RubyXL/DataType.html +3 -34
  217. data/rdoc/RubyXL/DataValidation.html +5 -14
  218. data/rdoc/RubyXL/DataValidations.html +5 -14
  219. data/rdoc/RubyXL/DateGroupItem.html +5 -14
  220. data/rdoc/RubyXL/DefinedName.html +5 -14
  221. data/rdoc/RubyXL/DefinedNameExt.html +5 -14
  222. data/rdoc/RubyXL/DefinedNames.html +5 -14
  223. data/rdoc/RubyXL/DefinedNamesExt.html +5 -14
  224. data/rdoc/RubyXL/DocumentPropertiesFile.html +8 -57
  225. data/rdoc/RubyXL/DrawingFile.html +10 -44
  226. data/rdoc/RubyXL/DynamicFilter.html +5 -14
  227. data/rdoc/RubyXL/EmbeddedControl.html +5 -14
  228. data/rdoc/RubyXL/EmbeddedControls.html +5 -14
  229. data/rdoc/RubyXL/Extension.html +5 -14
  230. data/rdoc/RubyXL/ExtensionStorageArea.html +5 -14
  231. data/rdoc/RubyXL/Extents.html +5 -14
  232. data/rdoc/RubyXL/ExternalBook.html +5 -14
  233. data/rdoc/RubyXL/ExternalLinksFile.html +11 -45
  234. data/rdoc/RubyXL/ExternalReference.html +5 -14
  235. data/rdoc/RubyXL/ExternalReferences.html +5 -14
  236. data/rdoc/RubyXL/ExtraColorSchemeList.html +5 -14
  237. data/rdoc/RubyXL/FieldItem.html +5 -14
  238. data/rdoc/RubyXL/FileRecoveryProperties.html +5 -14
  239. data/rdoc/RubyXL/FileSharing.html +5 -14
  240. data/rdoc/RubyXL/FileVersion.html +5 -14
  241. data/rdoc/RubyXL/Fill.html +8 -31
  242. data/rdoc/RubyXL/Fills.html +8 -31
  243. data/rdoc/RubyXL/FilterContainer.html +5 -14
  244. data/rdoc/RubyXL/FloatNode.html +5 -14
  245. data/rdoc/RubyXL/FloatValue.html +5 -14
  246. data/rdoc/RubyXL/Font.html +9 -37
  247. data/rdoc/RubyXL/FontConvenienceMethods.html +7 -198
  248. data/rdoc/RubyXL/FontScheme.html +5 -14
  249. data/rdoc/RubyXL/Fonts.html +8 -31
  250. data/rdoc/RubyXL/Formula.html +5 -14
  251. data/rdoc/RubyXL/FunctionGroup.html +5 -14
  252. data/rdoc/RubyXL/FunctionGroups.html +5 -14
  253. data/rdoc/RubyXL/GenericStorageObject.html +9 -75
  254. data/rdoc/RubyXL/GradientFill.html +5 -14
  255. data/rdoc/RubyXL/HeaderFooterSettings.html +5 -14
  256. data/rdoc/RubyXL/Hyperlink.html +5 -14
  257. data/rdoc/RubyXL/HyperlinkRelFile.html +5 -19
  258. data/rdoc/RubyXL/Hyperlinks.html +5 -14
  259. data/rdoc/RubyXL/IconFilter.html +5 -14
  260. data/rdoc/RubyXL/IconSet.html +5 -14
  261. data/rdoc/RubyXL/IgnoredError.html +5 -14
  262. data/rdoc/RubyXL/IgnoredErrors.html +5 -14
  263. data/rdoc/RubyXL/IndexedColors.html +5 -14
  264. data/rdoc/RubyXL/InputCells.html +5 -14
  265. data/rdoc/RubyXL/IntegerNode.html +5 -14
  266. data/rdoc/RubyXL/IntegerValue.html +5 -14
  267. data/rdoc/RubyXL/LegacyCell.html +6 -28
  268. data/rdoc/RubyXL/LegacyWorksheet.html +9 -88
  269. data/rdoc/RubyXL/MRUColors.html +5 -14
  270. data/rdoc/RubyXL/MacrosFile.html +5 -22
  271. data/rdoc/RubyXL/MergedCell.html +5 -14
  272. data/rdoc/RubyXL/MergedCells.html +5 -14
  273. data/rdoc/RubyXL/NumFmt.html +5 -14
  274. data/rdoc/RubyXL/NumberFormat.html +8 -31
  275. data/rdoc/RubyXL/NumberFormats.html +8 -36
  276. data/rdoc/RubyXL/OLEObject.html +5 -14
  277. data/rdoc/RubyXL/OLEObjectFile.html +5 -22
  278. data/rdoc/RubyXL/OLEObjects.html +5 -14
  279. data/rdoc/RubyXL/OLESize.html +5 -14
  280. data/rdoc/RubyXL/OOXMLContainerObject.html +19 -116
  281. data/rdoc/RubyXL/OOXMLIgnored.html +9 -46
  282. data/rdoc/RubyXL/OOXMLObject.html +8 -20
  283. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +34 -86
  284. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +20 -143
  285. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +10 -169
  286. data/rdoc/RubyXL/OOXMLTopLevelObject.html +15 -104
  287. data/rdoc/RubyXL/OdbcOleDbProperties.html +5 -14
  288. data/rdoc/RubyXL/Offset.html +5 -14
  289. data/rdoc/RubyXL/OlapProperties.html +5 -14
  290. data/rdoc/RubyXL/OleItem.html +99 -0
  291. data/rdoc/RubyXL/OleItems.html +99 -0
  292. data/rdoc/RubyXL/OleLink.html +99 -0
  293. data/rdoc/RubyXL/OutlineProperties.html +5 -14
  294. data/rdoc/RubyXL/PageMargins.html +5 -14
  295. data/rdoc/RubyXL/PageSetup.html +5 -14
  296. data/rdoc/RubyXL/PageSetupProperties.html +5 -14
  297. data/rdoc/RubyXL/Pane.html +5 -14
  298. data/rdoc/RubyXL/Parser.html +8 -44
  299. data/rdoc/RubyXL/PatternFill.html +5 -14
  300. data/rdoc/RubyXL/PhoneticProperties.html +5 -14
  301. data/rdoc/RubyXL/PhoneticRun.html +5 -14
  302. data/rdoc/RubyXL/PivotArea.html +5 -14
  303. data/rdoc/RubyXL/PivotCache.html +5 -14
  304. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +7 -27
  305. data/rdoc/RubyXL/PivotCacheRecordsFile.html +5 -22
  306. data/rdoc/RubyXL/PivotCaches.html +5 -14
  307. data/rdoc/RubyXL/PivotReference.html +5 -14
  308. data/rdoc/RubyXL/PivotReferences.html +5 -14
  309. data/rdoc/RubyXL/PivotTableFile.html +7 -27
  310. data/rdoc/RubyXL/PivotTableSelection.html +5 -14
  311. data/rdoc/RubyXL/PresetGeometry.html +5 -14
  312. data/rdoc/RubyXL/PrintOptions.html +5 -14
  313. data/rdoc/RubyXL/PrinterSettingsFile.html +5 -22
  314. data/rdoc/RubyXL/ProtectedRange.html +5 -14
  315. data/rdoc/RubyXL/ProtectedRanges.html +5 -14
  316. data/rdoc/RubyXL/Protection.html +5 -14
  317. data/rdoc/RubyXL/QueryParameter.html +5 -14
  318. data/rdoc/RubyXL/QueryParameters.html +5 -14
  319. data/rdoc/RubyXL/QueryTable.html +10 -44
  320. data/rdoc/RubyXL/QueryTableDeletedField.html +5 -14
  321. data/rdoc/RubyXL/QueryTableDeletedFields.html +5 -14
  322. data/rdoc/RubyXL/QueryTableField.html +5 -14
  323. data/rdoc/RubyXL/QueryTableFields.html +5 -14
  324. data/rdoc/RubyXL/QueryTableRefresh.html +5 -14
  325. data/rdoc/RubyXL/RID.html +5 -14
  326. data/rdoc/RubyXL/RawOOXML.html +9 -51
  327. data/rdoc/RubyXL/Reference.html +11 -197
  328. data/rdoc/RubyXL/Relationship.html +5 -14
  329. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +6 -28
  330. data/rdoc/RubyXL/RelationshipSupport.html +9 -108
  331. data/rdoc/RubyXL/RevisionPointer.html +5 -14
  332. data/rdoc/RubyXL/RichText.html +10 -32
  333. data/rdoc/RubyXL/RichTextRun.html +8 -31
  334. data/rdoc/RubyXL/Row.html +17 -154
  335. data/rdoc/RubyXL/RowExt.html +5 -14
  336. data/rdoc/RubyXL/RunProperties.html +5 -14
  337. data/rdoc/RubyXL/Scenario.html +5 -14
  338. data/rdoc/RubyXL/Scenarios.html +5 -14
  339. data/rdoc/RubyXL/Selection.html +8 -31
  340. data/rdoc/RubyXL/ShapeGuide.html +5 -14
  341. data/rdoc/RubyXL/ShapeTextRectangle.html +5 -14
  342. data/rdoc/RubyXL/SharedStringsTable.html +9 -121
  343. data/rdoc/RubyXL/Sheet.html +5 -14
  344. data/rdoc/RubyXL/SheetCalculationProperties.html +5 -14
  345. data/rdoc/RubyXL/SheetData.html +10 -46
  346. data/rdoc/RubyXL/SheetDataExt.html +5 -14
  347. data/rdoc/RubyXL/SheetDataSet.html +5 -14
  348. data/rdoc/RubyXL/SheetName.html +5 -14
  349. data/rdoc/RubyXL/SheetNames.html +5 -14
  350. data/rdoc/RubyXL/Sheets.html +5 -14
  351. data/rdoc/RubyXL/SlicerCacheFile.html +5 -22
  352. data/rdoc/RubyXL/SlicerFile.html +5 -22
  353. data/rdoc/RubyXL/SmartTagProperties.html +5 -14
  354. data/rdoc/RubyXL/SmartTagType.html +5 -14
  355. data/rdoc/RubyXL/SmartTagTypes.html +5 -14
  356. data/rdoc/RubyXL/SmartTags.html +5 -14
  357. data/rdoc/RubyXL/SortCondition.html +5 -14
  358. data/rdoc/RubyXL/SortState.html +5 -14
  359. data/rdoc/RubyXL/Sqref.html +11 -48
  360. data/rdoc/RubyXL/Stop.html +5 -14
  361. data/rdoc/RubyXL/StringNode.html +5 -14
  362. data/rdoc/RubyXL/StringNodeW3C.html +9 -46
  363. data/rdoc/RubyXL/StringValue.html +5 -14
  364. data/rdoc/RubyXL/Stylesheet.html +9 -94
  365. data/rdoc/RubyXL/TableFile.html +5 -22
  366. data/rdoc/RubyXL/TableParts.html +5 -14
  367. data/rdoc/RubyXL/TableStyle.html +5 -14
  368. data/rdoc/RubyXL/TableStyles.html +5 -14
  369. data/rdoc/RubyXL/Text.html +8 -52
  370. data/rdoc/RubyXL/TextImportSettings.html +5 -14
  371. data/rdoc/RubyXL/Theme.html +9 -67
  372. data/rdoc/RubyXL/ThemeElements.html +5 -14
  373. data/rdoc/RubyXL/ThumbnailFile.html +5 -22
  374. data/rdoc/RubyXL/Top10.html +5 -14
  375. data/rdoc/RubyXL/VMLDrawingFile.html +8 -28
  376. data/rdoc/RubyXL/Variant.html +5 -14
  377. data/rdoc/RubyXL/Vector.html +8 -31
  378. data/rdoc/RubyXL/VectorValue.html +5 -14
  379. data/rdoc/RubyXL/VisualProperties.html +5 -14
  380. data/rdoc/RubyXL/WebPublishObject.html +5 -14
  381. data/rdoc/RubyXL/WebPublishObjects.html +5 -14
  382. data/rdoc/RubyXL/WebPublishingItem.html +5 -14
  383. data/rdoc/RubyXL/WebPublishingItems.html +5 -14
  384. data/rdoc/RubyXL/WebPublishingProperties.html +5 -14
  385. data/rdoc/RubyXL/WebQueryProperties.html +5 -14
  386. data/rdoc/RubyXL/Workbook.html +35 -460
  387. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +7 -224
  388. data/rdoc/RubyXL/WorkbookProperties.html +5 -14
  389. data/rdoc/RubyXL/WorkbookProtection.html +5 -14
  390. data/rdoc/RubyXL/WorkbookRoot.html +11 -101
  391. data/rdoc/RubyXL/WorkbookView.html +5 -14
  392. data/rdoc/RubyXL/WorkbookViews.html +5 -14
  393. data/rdoc/RubyXL/Worksheet.html +11 -132
  394. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +138 -1002
  395. data/rdoc/RubyXL/WorksheetDimensions.html +5 -14
  396. data/rdoc/RubyXL/WorksheetFormatProperties.html +5 -14
  397. data/rdoc/RubyXL/WorksheetProperties.html +5 -14
  398. data/rdoc/RubyXL/WorksheetProtection.html +5 -14
  399. data/rdoc/RubyXL/WorksheetView.html +5 -14
  400. data/rdoc/RubyXL/WorksheetViews.html +5 -14
  401. data/rdoc/RubyXL/XF.html +5 -14
  402. data/rdoc/RubyXL.html +6 -321
  403. data/rdoc/created.rid +16 -16
  404. data/rdoc/css/rdoc.css +21 -1
  405. data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
  406. data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
  407. data/rdoc/index.html +8 -391
  408. data/rdoc/js/navigation.js.gz +0 -0
  409. data/rdoc/js/search_index.js +1 -1
  410. data/rdoc/js/search_index.js.gz +0 -0
  411. data/rdoc/js/searcher.js.gz +0 -0
  412. data/rdoc/table_of_contents.html +18 -813
  413. data/rubyXL.gemspec +11 -8
  414. data/spec/lib/cell_spec.rb +18 -0
  415. data/spec/lib/worksheet_spec.rb +301 -0
  416. metadata +7 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 113f3b9a4f79ca55897dc0b41c3ea90b79fe22de8cfe477977a0fde79587ee9c
4
- data.tar.gz: 31887b622133cb5aa7f1fa9b807edc4a24fe678b3ada67212d20ce8d67e2cf3b
3
+ metadata.gz: 116ee9428a4b233645c4b8fc1d33c0589158230b8a070a274e2dfcbf5c4599cb
4
+ data.tar.gz: c297883a5589040468eed44560482569452c953266f46877828d85d3a2b45828
5
5
  SHA512:
6
- metadata.gz: 30aedef1cdd170c64c08b03ed501d165d31e457c2676e1939598d35952cd3c22c2f0033b1310ff4bcc83402cfd4e1ff9332a0e130dc55703c5695c63d936e4af
7
- data.tar.gz: 113ba583b359143c2c1366ac8ff8f5fa235b081ae896f0374c5b27e85ed31722226c331a869d9007025989c1961d6c2d4a9755e374ec2840fe41dc576dd2e2de
6
+ metadata.gz: f508111555352f1868242db8491675d4aee3d1da93212049ae08db937f89857e29f15ca76fd985aca300d8400deda9b7a8032cbc5c0f0ec903121fb1cabbbbed
7
+ data.tar.gz: ddd0250526862e617effdb282ee3361a0c81c662841a16c207dabc8d4a0d41405693b92c1187685ef66d71b8b9cf5899ffa635f63531daa482597c38ec4fe20f
data/.circleci/config.yml CHANGED
@@ -7,7 +7,7 @@ jobs:
7
7
  build:
8
8
  docker:
9
9
  # specify the version you desire here
10
- - image: circleci/ruby:2.4.1-node-browsers
10
+ - image: circleci/ruby:2.6.6-buster
11
11
 
12
12
  # Specify service dependencies here if necessary
13
13
  # CircleCI maintains a library of pre-built images
@@ -29,6 +29,7 @@ jobs:
29
29
  - run:
30
30
  name: install dependencies
31
31
  command: |
32
+ gem install bundler
32
33
  bundle install --jobs=4 --retry=3 --path vendor/bundle
33
34
 
34
35
  - save_cache:
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ gem "rubyzip", ">= 1.3.0" , :require => 'zip'
8
8
  group :development, :test do
9
9
  gem "bundler"
10
10
  gem "rake"
11
- gem "jeweler"
11
+ gem "juwelier"
12
12
  gem "rspec"
13
13
  gem "simplecov"
14
14
 
data/Gemfile.lock CHANGED
@@ -1,77 +1,109 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.4.0)
4
+ addressable (2.8.0)
5
+ public_suffix (>= 2.0.2, < 5.0)
5
6
  builder (3.2.4)
6
7
  descendants_tracker (0.0.4)
7
8
  thread_safe (~> 0.3, >= 0.3.1)
8
- diff-lcs (1.4.4)
9
- docile (1.3.2)
10
- faraday (0.9.2)
9
+ diff-lcs (1.5.0)
10
+ docile (1.4.0)
11
+ faraday (1.9.3)
12
+ faraday-em_http (~> 1.0)
13
+ faraday-em_synchrony (~> 1.0)
14
+ faraday-excon (~> 1.1)
15
+ faraday-httpclient (~> 1.0)
16
+ faraday-multipart (~> 1.0)
17
+ faraday-net_http (~> 1.0)
18
+ faraday-net_http_persistent (~> 1.0)
19
+ faraday-patron (~> 1.0)
20
+ faraday-rack (~> 1.0)
21
+ faraday-retry (~> 1.0)
22
+ ruby2_keywords (>= 0.0.4)
23
+ faraday-em_http (1.0.0)
24
+ faraday-em_synchrony (1.0.0)
25
+ faraday-excon (1.1.0)
26
+ faraday-httpclient (1.0.1)
27
+ faraday-multipart (1.0.3)
11
28
  multipart-post (>= 1.2, < 3)
12
- git (1.7.0)
29
+ faraday-net_http (1.0.1)
30
+ faraday-net_http_persistent (1.2.0)
31
+ faraday-patron (1.0.0)
32
+ faraday-rack (1.0.0)
33
+ faraday-retry (1.0.3)
34
+ git (1.10.2)
13
35
  rchardet (~> 1.8)
14
- github_api (0.16.0)
15
- addressable (~> 2.4.0)
36
+ github_api (0.19.0)
37
+ addressable (~> 2.4)
16
38
  descendants_tracker (~> 0.0.4)
17
- faraday (~> 0.8, < 0.10)
18
- hashie (>= 3.4)
19
- mime-types (>= 1.16, < 3.0)
39
+ faraday (>= 0.8, < 2)
40
+ hashie (~> 3.5, >= 3.5.2)
20
41
  oauth2 (~> 1.0)
21
- hashie (4.1.0)
42
+ hashie (3.6.0)
22
43
  highline (2.0.3)
23
- jeweler (2.3.9)
44
+ juwelier (2.4.9)
24
45
  builder
25
46
  bundler
26
- git (>= 1.2.5)
27
- github_api (~> 0.16.0)
28
- highline (>= 1.6.15)
29
- nokogiri (>= 1.5.10)
47
+ git
48
+ github_api
49
+ highline
50
+ kamelcase (~> 0)
51
+ nokogiri
30
52
  psych
31
53
  rake
32
54
  rdoc
33
55
  semver2
34
- jwt (2.2.1)
35
- mime-types (2.99.3)
36
- mini_portile2 (2.4.0)
56
+ jwt (2.3.0)
57
+ kamelcase (0.0.2)
58
+ semver2 (~> 3)
59
+ mini_portile2 (2.7.1)
37
60
  multi_json (1.15.0)
38
61
  multi_xml (0.6.0)
39
62
  multipart-post (2.1.1)
40
- nokogiri (1.10.10)
41
- mini_portile2 (~> 2.4.0)
42
- oauth2 (1.4.4)
63
+ nokogiri (1.13.1)
64
+ mini_portile2 (~> 2.7.0)
65
+ racc (~> 1.4)
66
+ oauth2 (1.4.7)
43
67
  faraday (>= 0.8, < 2.0)
44
68
  jwt (>= 1.0, < 3.0)
45
69
  multi_json (~> 1.3)
46
70
  multi_xml (~> 0.5)
47
71
  rack (>= 1.2, < 3)
48
- psych (3.2.0)
72
+ psych (4.0.3)
73
+ stringio
74
+ public_suffix (4.0.6)
75
+ racc (1.6.0)
49
76
  rack (2.2.3)
50
- rake (13.0.1)
77
+ rake (13.0.6)
51
78
  rchardet (1.8.0)
52
- rdoc (6.2.1)
53
- rspec (3.9.0)
54
- rspec-core (~> 3.9.0)
55
- rspec-expectations (~> 3.9.0)
56
- rspec-mocks (~> 3.9.0)
57
- rspec-core (3.9.2)
58
- rspec-support (~> 3.9.3)
59
- rspec-expectations (3.9.2)
79
+ rdoc (6.4.0)
80
+ psych (>= 4.0.0)
81
+ rspec (3.10.0)
82
+ rspec-core (~> 3.10.0)
83
+ rspec-expectations (~> 3.10.0)
84
+ rspec-mocks (~> 3.10.0)
85
+ rspec-core (3.10.1)
86
+ rspec-support (~> 3.10.0)
87
+ rspec-expectations (3.10.1)
60
88
  diff-lcs (>= 1.2.0, < 2.0)
61
- rspec-support (~> 3.9.0)
62
- rspec-mocks (3.9.1)
89
+ rspec-support (~> 3.10.0)
90
+ rspec-mocks (3.10.2)
63
91
  diff-lcs (>= 1.2.0, < 2.0)
64
- rspec-support (~> 3.9.0)
65
- rspec-support (3.9.3)
66
- rspec_junit_formatter (0.4.1)
92
+ rspec-support (~> 3.10.0)
93
+ rspec-support (3.10.3)
94
+ rspec_junit_formatter (0.5.1)
67
95
  rspec-core (>= 2, < 4, != 2.12.0)
68
- ruby-prof (1.4.1)
69
- rubyzip (2.3.0)
96
+ ruby-prof (1.4.3)
97
+ ruby2_keywords (0.0.5)
98
+ rubyzip (2.3.2)
70
99
  semver2 (3.4.2)
71
- simplecov (0.18.5)
100
+ simplecov (0.21.2)
72
101
  docile (~> 1.1)
73
102
  simplecov-html (~> 0.11)
74
- simplecov-html (0.12.2)
103
+ simplecov_json_formatter (~> 0.1)
104
+ simplecov-html (0.12.3)
105
+ simplecov_json_formatter (0.1.3)
106
+ stringio (3.0.1)
75
107
  thread_safe (0.3.6)
76
108
 
77
109
  PLATFORMS
@@ -79,7 +111,7 @@ PLATFORMS
79
111
 
80
112
  DEPENDENCIES
81
113
  bundler
82
- jeweler
114
+ juwelier
83
115
  nokogiri (>= 1.10.8)
84
116
  rake
85
117
  rspec
@@ -89,4 +121,4 @@ DEPENDENCIES
89
121
  simplecov
90
122
 
91
123
  BUNDLED WITH
92
- 2.1.4
124
+ 2.2.29
data/README.rdoc CHANGED
@@ -55,6 +55,10 @@ Please note that row is a _sparse_ array of cells. Your code *must* expect that
55
55
  worksheet.sheet_data[0][0] # Returns cell A1 in the worksheet
56
56
  worksheet[0][0] # Returns cell A1 in the worksheet
57
57
 
58
+ cell = worksheet[0][0]
59
+ cell.value # Returns a properly converted value in the cell (if the file claims that the cell
60
+ # is holding a number, returns a respective Integer or Float, and so on).
61
+
58
62
  ==== Wrappers for accessing Cell properties
59
63
  cell = workbook[0][0][0]
60
64
  cell.is_struckthrough # Returns +true+ if the cell is struckthrough, other boolean properties have same syntax
@@ -229,11 +233,10 @@ It can also operate on +StringIO+ objects, thus eliminating the need to save the
229
233
 
230
234
  RubyXL.class_variable_set(:@@suppress_warnings, true)
231
235
 
232
- == Data validation ("dropdown list")
236
+ == Data validation (colloquially referred to as "dropdown list")
233
237
 
234
238
  worksheet.add_validation_list("A1", [ "value1", "value2" ])
235
239
 
236
-
237
240
  == For more information
238
241
  Take a look at the files in spec/lib/ for rspecs on most methods
239
242
 
@@ -249,5 +252,5 @@ Take a look at the files in spec/lib/ for rspecs on most methods
249
252
 
250
253
  == Copyright
251
254
 
252
- Copyright (c) 2011 Vivek Bhagwat, 2013-2020 Wesha.
255
+ Copyright (c) 2011 Vivek Bhagwat, 2013-2021 Wesha.
253
256
  See LICENSE.txt for further details.
data/Rakefile CHANGED
@@ -10,8 +10,8 @@ rescue Bundler::BundlerError => e
10
10
  exit e.status_code
11
11
  end
12
12
 
13
- require 'jeweler'
14
- Jeweler::Tasks.new do |gem|
13
+ require 'juwelier'
14
+ Juwelier::Tasks.new do |gem|
15
15
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
16
16
  gem.name = "rubyXL"
17
17
  gem.homepage = "http://github.com/gilt/rubyXL"
@@ -23,7 +23,7 @@ Jeweler::Tasks.new do |gem|
23
23
  # gem.required_ruby_version = '>2.1'
24
24
  # dependencies defined in Gemfile
25
25
  end
26
- Jeweler::RubygemsDotOrgTasks.new
26
+ Juwelier::RubygemsDotOrgTasks.new
27
27
 
28
28
  require 'rake/testtask'
29
29
  Rake::TestTask.new(:test) do |test|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.15
1
+ 3.4.20
@@ -253,7 +253,7 @@ module RubyXL
253
253
  def add_hyperlink(l)
254
254
  worksheet.hyperlinks ||= RubyXL::Hyperlinks.new
255
255
  worksheet.hyperlinks << RubyXL::Hyperlink.new(:ref => self.r, :location => l)
256
- # define_attribute(:'r:id', :string)
256
+ # define_relationship
257
257
  # define_attribute(:location, :string)
258
258
  # define_attribute(:tooltip, :string)
259
259
  # define_attribute(:display, :string)
@@ -106,6 +106,21 @@ module RubyXL
106
106
  }
107
107
  }
108
108
 
109
+ # Update merged cells for all rows below
110
+ if self.merged_cells then
111
+ merged_cells.each { |mc|
112
+ next if mc.ref.row_range.last < row_index
113
+
114
+ in_merged_cell = mc.ref.row_range.first < row_index
115
+ mc.ref = RubyXL::Reference.new(
116
+ mc.ref.row_range.first + (in_merged_cell ? 0 : 1),
117
+ mc.ref.row_range.last + 1,
118
+ mc.ref.col_range.first,
119
+ mc.ref.col_range.last,
120
+ )
121
+ }
122
+ end
123
+
109
124
  return new_row
110
125
  end
111
126
 
@@ -121,6 +136,23 @@ module RubyXL
121
136
  row && row.cells.each{ |c| c.row -= 1 unless c.nil? }
122
137
  }
123
138
 
139
+ # Update row number of merged cells
140
+ if self.merged_cells then
141
+ merged_cells.delete_if { |mc| mc.ref.row_range == (row_index..row_index) }
142
+ merged_cells.each { |mc|
143
+ next if mc.ref.row_range.last < row_index
144
+
145
+ in_merged_cell = mc.ref.row_range.first <= row_index
146
+ mc.ref = RubyXL::Reference.new(
147
+ mc.ref.row_range.first - (in_merged_cell ? 0 : 1),
148
+ mc.ref.row_range.last - 1,
149
+ mc.ref.col_range.first,
150
+ mc.ref.col_range.last,
151
+ )
152
+ }
153
+ merged_cells.delete_if { |mc| mc.ref.single_cell? }
154
+ end
155
+
124
156
  return deleted
125
157
  end
126
158
 
@@ -152,6 +184,21 @@ module RubyXL
152
184
 
153
185
  cols.insert_column(column_index)
154
186
 
187
+ # Update merged cells for all rows below
188
+ if self.merged_cells then
189
+ merged_cells.each { |mc|
190
+ next if mc.ref.col_range.last < column_index
191
+
192
+ in_merged_cell = mc.ref.row_range.first < column_index
193
+ mc.ref = RubyXL::Reference.new(
194
+ mc.ref.row_range.first,
195
+ mc.ref.row_range.last,
196
+ mc.ref.col_range.first + (in_merged_cell ? 0 : 1),
197
+ mc.ref.col_range.last + 1,
198
+ )
199
+ }
200
+ end
201
+
155
202
  # TODO: update column numbers
156
203
  end
157
204
 
@@ -171,6 +218,24 @@ module RubyXL
171
218
  }
172
219
 
173
220
  cols.each { |range| range.delete_column(column_index) }
221
+
222
+ # Update row number of merged cells
223
+ return unless self.merged_cells
224
+
225
+ merged_cells.delete_if { |mc| mc.ref.col_range == (column_index..column_index) }
226
+ merged_cells.each { |mc|
227
+ next if mc.ref.col_range.last < column_index
228
+
229
+ in_merged_cell = mc.ref.col_range.first <= column_index
230
+ mc.ref = RubyXL::Reference.new(
231
+ mc.ref.row_range.first,
232
+ mc.ref.row_range.last,
233
+ mc.ref.col_range.first - (in_merged_cell ? 0 : 1),
234
+ mc.ref.col_range.last - 1,
235
+ )
236
+ }
237
+
238
+ merged_cells.delete_if { |mc| mc.ref.single_cell? }
174
239
  end
175
240
 
176
241
  def get_row_style(row_index)
@@ -34,7 +34,7 @@ module RubyXL
34
34
  define_attribute(:horizontalDpi, :int, :default => 600)
35
35
  define_attribute(:verticalDpi, :int, :default => 600)
36
36
  define_attribute(:copies, :int, :default => 1)
37
- define_attribute(:'r:id', :string)
37
+ define_relationship
38
38
  define_element_name 'pageSetup'
39
39
  end
40
40
 
@@ -61,16 +61,40 @@ module RubyXL
61
61
  define_child_node(RubyXL::SheetNames)
62
62
  define_child_node(RubyXL::DefinedNamesExt)
63
63
  define_child_node(RubyXL::SheetDataSet)
64
- define_attribute(:'r:id', :string, :required => true)
64
+ define_relationship(:required => true)
65
65
  define_element_name 'externalBook'
66
66
  end
67
67
 
68
+ # http://www.datypic.com/sc/ooxml/e-ssml_oleItem-1.html
69
+ class OleItem < OOXMLObject
70
+ define_attribute(:name, :string, :required => true)
71
+ define_attribute(:icon, :bool)
72
+ define_attribute(:advise, :bool)
73
+ define_attribute(:preferPic, :bool)
74
+ define_element_name 'oleItem'
75
+ end
76
+
77
+ # http://www.datypic.com/sc/ooxml/e-ssml_oleItems-1.html
78
+ class OleItems < OOXMLContainerObject
79
+ define_child_node(RubyXL::OleItem)
80
+ define_element_name 'oleItems'
81
+ end
82
+
83
+ # http://www.datypic.com/sc/ooxml/t-ssml_CT_OleLink.html
84
+ class OleLink < OOXMLObject
85
+ define_child_node(RubyXL::OleItems, :collection => true)
86
+ define_relationship(:required => true)
87
+ define_attribute(:progId, :string, :required => true)
88
+ define_element_name 'oleLink'
89
+ end
90
+
68
91
  class ExternalLinksFile < OOXMLTopLevelObject
69
92
  CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml'
70
93
  REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink'
71
94
 
72
95
  include RubyXL::RelationshipSupport
73
96
  define_child_node(RubyXL::ExternalBook)
97
+ define_child_node(RubyXL::OleLink)
74
98
 
75
99
  define_element_name 'externalLink'
76
100
  set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil,
@@ -53,6 +53,11 @@ module RubyXL
53
53
  self.send(:attr_accessor, attr_hash[:accessor]) unless attr_hash[:computed]
54
54
  end
55
55
 
56
+ # Defines a `r:id` attribute
57
+ def define_relationship(extra_params = {})
58
+ define_attribute(:'r:id', :string, extra_params)
59
+ end
60
+
56
61
  # Defines a child node of OOXML object.
57
62
  # === Parameters
58
63
  # * +klass+ - Class (descendant of RubyXL::OOXMLObject) of the child nodes. Child node objects will be produced by calling +parse+ method of that class.
@@ -71,7 +71,7 @@ module RubyXL
71
71
  end
72
72
 
73
73
  # Converts +row+ and +col+ zero-based indices to Excel-style cell reference
74
- # (0) A...Z, AA...AZ, BA... ...ZZ, AAA... ...AZZ, BAA... ...XFD (16383)
74
+ # <0> A...Z, AA...AZ, BA... ...ZZ, AAA... ...AZZ, BAA... ...XFD <16383>
75
75
  def self.ind2ref(row = 0, col = 0)
76
76
  str = ''
77
77
 
@@ -88,10 +88,7 @@ module RubyXL
88
88
  # Converts Excel-style cell reference to +row+ and +col+ zero-based indices.
89
89
  def self.ref2ind(str)
90
90
  return [ -1, -1 ] unless str =~ /\A([A-Z]+)(\d+)\Z/
91
-
92
- col = 0
93
- $1.each_byte { |chr| col = col * 26 + (chr - 64) }
94
- [ $2.to_i - 1, col - 1 ]
91
+ [ $2.to_i - 1, $1.each_byte.inject(0) { |col, chr| col * 26 + (chr - 64) } - 1 ]
95
92
  end
96
93
 
97
94
  end
@@ -4,7 +4,7 @@ require 'rubyXL/objects/ooxml_object'
4
4
  module RubyXL
5
5
 
6
6
  class RID < OOXMLObject
7
- define_attribute(:'r:id', :string, :required => true)
7
+ define_relationship(:required => true)
8
8
  end
9
9
 
10
10
  class Relationship < OOXMLObject
@@ -113,7 +113,8 @@ module RubyXL
113
113
  when RubyXL::DataType::INLINE_STRING then is.to_s
114
114
  when RubyXL::DataType::RAW_STRING then raw_value
115
115
  else
116
- if is_date? then workbook.num_to_date(r.to_f)
116
+ if is then is.to_s
117
+ elsif is_date? then workbook.num_to_date(r.to_f)
117
118
  elsif r.is_a?(String) && (r =~ NUMBER_REGEXP) then # Numeric
118
119
  if $1 != '' then r.to_f
119
120
  else r.to_i
@@ -85,7 +85,8 @@ module RubyXL
85
85
  define_element_name 'is'
86
86
 
87
87
  def to_s
88
- str = if t.nil? then '' else t.to_s end
88
+ # `dup` here unfreezes the string since it's not a constant but initial value
89
+ str = if t.nil? then ''.dup else t.to_s end
89
90
  r && r.each { |rtr| str << rtr.to_s if rtr }
90
91
  str
91
92
  end
@@ -1164,7 +1164,7 @@ module RubyXL
1164
1164
  class CT_Hyperlink < OOXMLObject
1165
1165
  define_child_node(RubyXL::CT_EmbeddedWAVAudioFile)
1166
1166
  define_child_node(RubyXL::AExtensionStorageArea)
1167
- define_attribute(:'r:id', :string)
1167
+ define_relationship
1168
1168
  define_attribute(:invalidUrl, :string, :default => '')
1169
1169
  define_attribute(:action, :string, :default => '')
1170
1170
  define_attribute(:tgtFrame, :string, :default => '')
@@ -98,7 +98,7 @@ module RubyXL
98
98
  define_attribute(:name, :string, :required => true)
99
99
  define_attribute(:sheetId, :int, :required => true)
100
100
  define_attribute(:state, RubyXL::ST_Visibility, :default => 'visible')
101
- define_attribute(:'r:id', :string, :required => true)
101
+ define_relationship(:required => true)
102
102
  define_element_name 'sheet'
103
103
  end
104
104
 
@@ -110,7 +110,7 @@ module RubyXL
110
110
 
111
111
  # http://www.datypic.com/sc/ooxml/e-ssml_externalReference-1.html
112
112
  class ExternalReference < OOXMLObject
113
- define_attribute(:'r:id', :string, :required => true)
113
+ define_relationship(:required => true)
114
114
  define_element_name 'externalReference'
115
115
  end
116
116
 
@@ -153,7 +153,7 @@ module RubyXL
153
153
  # http://www.datypic.com/sc/ooxml/e-ssml_pivotCache-1.html
154
154
  class PivotCache < OOXMLObject
155
155
  define_attribute(:cacheId, :int, :required => true)
156
- define_attribute(:'r:id', :string, :required => true)
156
+ define_relationship(:required => true)
157
157
  define_element_name 'pivotCache'
158
158
  end
159
159
 
@@ -427,12 +427,15 @@ module RubyXL
427
427
  end
428
428
 
429
429
  def num_to_date(num)
430
+ return nil if num.nil?
431
+
430
432
  # Bug-for-bug Excel compatibility (https://support.microsoft.com/kb/214058/)
431
- if num && num < MARCH_1_1900 then
433
+ if num < MARCH_1_1900 then
432
434
  num += 1 unless workbook_properties && workbook_properties.date1904
433
435
  end
434
436
 
435
- num && (base_date + num)
437
+ dateparts = num.divmod(1)
438
+ base_date + (dateparts[0] + (dateparts[1] * 86400).round(6) / 86400)
436
439
  end
437
440
 
438
441
  include Enumerable
@@ -88,7 +88,7 @@ module RubyXL
88
88
  define_attribute(:horizontalDpi, :int, :default => 600)
89
89
  define_attribute(:verticalDpi, :int, :default => 600)
90
90
  define_attribute(:copies, :int, :default => 1)
91
- define_attribute(:'r:id', :string)
91
+ define_relationship
92
92
  define_element_name 'pageSetup'
93
93
  end
94
94
 
@@ -302,7 +302,7 @@ module RubyXL
302
302
  # http://www.datypic.com/sc/ooxml/e-ssml_hyperlink-1.html
303
303
  class Hyperlink < OOXMLObject
304
304
  define_attribute(:ref, :ref, :required => true)
305
- define_attribute(:'r:id', :string)
305
+ define_relationship
306
306
  define_attribute(:location, :string)
307
307
  define_attribute(:tooltip, :string)
308
308
  define_attribute(:display, :string)
@@ -323,7 +323,7 @@ module RubyXL
323
323
  define_attribute(:oleUpdate, RubyXL::ST_OleUpdate)
324
324
  define_attribute(:autoLoad, :bool, :default => false)
325
325
  define_attribute(:shapeId, :int, :required => true)
326
- define_attribute(:'r:id', :string)
326
+ define_relationship
327
327
  define_element_name 'oleObject'
328
328
  end
329
329
 
@@ -339,7 +339,7 @@ module RubyXL
339
339
  define_attribute(:ref, :ref)
340
340
  define_attribute(:name, :string)
341
341
  define_attribute(:sheet, :string)
342
- define_attribute(:'r:id', :string)
342
+ define_relationship
343
343
  define_element_name 'dataRef'
344
344
  end
345
345
 
@@ -434,7 +434,7 @@ module RubyXL
434
434
  # http://www.datypic.com/sc/ooxml/e-ssml_control-1.html
435
435
  class EmbeddedControl < OOXMLObject
436
436
  define_attribute(:shapeId, :int, :required => true)
437
- define_attribute(:'r:id', :string, :required => true)
437
+ define_relationship(:required => true)
438
438
  define_attribute(:name, :string)
439
439
  define_element_name 'control'
440
440
  end
@@ -490,7 +490,7 @@ module RubyXL
490
490
  # http://www.datypic.com/sc/ooxml/e-ssml_customPr-1.html
491
491
  class CustomProperty < OOXMLObject
492
492
  define_attribute(:name, :string, :required => true)
493
- define_attribute(:'r:id', :string, :required => true)
493
+ define_relationship(:required => true)
494
494
  define_element_name 'customPr'
495
495
  end
496
496
 
@@ -572,7 +572,7 @@ module RubyXL
572
572
  define_attribute(:previousRow, :uint, :default => 0)
573
573
  define_attribute(:previousCol, :uint, :default => 0)
574
574
  define_attribute(:click, :uint, :default => 0)
575
- define_attribute(:'r:id', :string)
575
+ define_relationship
576
576
  define_child_node(RubyXL::PivotArea)
577
577
  define_element_name 'pivotSelection'
578
578
  end