rubyXL 3.4.10 → 3.4.16

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 (418) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -1
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +23 -23
  5. data/LICENSE.txt +1 -1
  6. data/README.rdoc +6 -1
  7. data/VERSION +1 -1
  8. data/lib/rubyXL/convenience_methods/cell.rb +1 -1
  9. data/lib/rubyXL/convenience_methods/color.rb +5 -3
  10. data/lib/rubyXL/convenience_methods/worksheet.rb +12 -0
  11. data/lib/rubyXL/objects/chartsheet.rb +1 -1
  12. data/lib/rubyXL/objects/data_validation.rb +2 -0
  13. data/lib/rubyXL/objects/document_properties.rb +2 -2
  14. data/lib/rubyXL/objects/external_links.rb +25 -1
  15. data/lib/rubyXL/objects/ooxml_object.rb +10 -0
  16. data/lib/rubyXL/objects/relationships.rb +1 -1
  17. data/lib/rubyXL/objects/sheet_data.rb +2 -2
  18. data/lib/rubyXL/objects/storage.rb +1 -0
  19. data/lib/rubyXL/objects/text.rb +1 -1
  20. data/lib/rubyXL/objects/theme.rb +1 -1
  21. data/lib/rubyXL/objects/workbook.rb +12 -6
  22. data/lib/rubyXL/objects/worksheet.rb +7 -7
  23. data/lib/rubyXL/worksheet.rb +1 -1
  24. data/rdoc/README_rdoc.html +11 -3
  25. data/rdoc/RubyXL.html +4 -2
  26. data/rdoc/RubyXL/AExtension.html +4 -2
  27. data/rdoc/RubyXL/AExtensionStorageArea.html +4 -2
  28. data/rdoc/RubyXL/ActiveX.html +5 -3
  29. data/rdoc/RubyXL/ActiveXBinary.html +4 -2
  30. data/rdoc/RubyXL/AdjustHandleList.html +4 -2
  31. data/rdoc/RubyXL/Alignment.html +4 -2
  32. data/rdoc/RubyXL/AlternateContent.html +4 -2
  33. data/rdoc/RubyXL/Authors.html +4 -2
  34. data/rdoc/RubyXL/AutoFilter.html +4 -2
  35. data/rdoc/RubyXL/AutoFilterColumn.html +4 -2
  36. data/rdoc/RubyXL/BinaryImageFile.html +4 -2
  37. data/rdoc/RubyXL/BodyProperties.html +4 -2
  38. data/rdoc/RubyXL/BooleanNode.html +4 -2
  39. data/rdoc/RubyXL/BooleanValue.html +4 -2
  40. data/rdoc/RubyXL/Border.html +4 -2
  41. data/rdoc/RubyXL/BorderEdge.html +4 -2
  42. data/rdoc/RubyXL/Borders.html +4 -2
  43. data/rdoc/RubyXL/Break.html +4 -2
  44. data/rdoc/RubyXL/BreakList.html +4 -2
  45. data/rdoc/RubyXL/CT_AdjPoint2D.html +4 -2
  46. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +4 -2
  47. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +4 -2
  48. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +4 -2
  49. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +4 -2
  50. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +4 -2
  51. data/rdoc/RubyXL/CT_Backdrop.html +4 -2
  52. data/rdoc/RubyXL/CT_Bevel.html +4 -2
  53. data/rdoc/RubyXL/CT_BiLevelEffect.html +4 -2
  54. data/rdoc/RubyXL/CT_BlendEffect.html +4 -2
  55. data/rdoc/RubyXL/CT_Blip.html +4 -2
  56. data/rdoc/RubyXL/CT_BlipFillProperties.html +4 -2
  57. data/rdoc/RubyXL/CT_BlurEffect.html +4 -2
  58. data/rdoc/RubyXL/CT_Camera.html +4 -2
  59. data/rdoc/RubyXL/CT_Color.html +4 -2
  60. data/rdoc/RubyXL/CT_ColorChangeEffect.html +4 -2
  61. data/rdoc/RubyXL/CT_ColorMapping.html +4 -2
  62. data/rdoc/RubyXL/CT_ColorScheme.html +4 -2
  63. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +4 -2
  64. data/rdoc/RubyXL/CT_ConnectionSite.html +4 -2
  65. data/rdoc/RubyXL/CT_ConnectionSiteList.html +4 -2
  66. data/rdoc/RubyXL/CT_DashStop.html +4 -2
  67. data/rdoc/RubyXL/CT_DashStopList.html +4 -2
  68. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +4 -2
  69. data/rdoc/RubyXL/CT_DuotoneEffect.html +4 -2
  70. data/rdoc/RubyXL/CT_EffectContainer.html +4 -2
  71. data/rdoc/RubyXL/CT_EffectList.html +4 -2
  72. data/rdoc/RubyXL/CT_EffectReference.html +4 -2
  73. data/rdoc/RubyXL/CT_EffectStyleItem.html +4 -2
  74. data/rdoc/RubyXL/CT_EffectStyleList.html +4 -2
  75. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +4 -2
  76. data/rdoc/RubyXL/CT_FillEffect.html +4 -2
  77. data/rdoc/RubyXL/CT_FillOverlayEffect.html +4 -2
  78. data/rdoc/RubyXL/CT_FillStyleList.html +4 -2
  79. data/rdoc/RubyXL/CT_FlatText.html +4 -2
  80. data/rdoc/RubyXL/CT_FontCollection.html +4 -2
  81. data/rdoc/RubyXL/CT_FontReference.html +4 -2
  82. data/rdoc/RubyXL/CT_GeomGuideList.html +4 -2
  83. data/rdoc/RubyXL/CT_GlowEffect.html +4 -2
  84. data/rdoc/RubyXL/CT_GradientFillProperties.html +4 -2
  85. data/rdoc/RubyXL/CT_GradientStop.html +4 -2
  86. data/rdoc/RubyXL/CT_GradientStopList.html +4 -2
  87. data/rdoc/RubyXL/CT_HSLEffect.html +4 -2
  88. data/rdoc/RubyXL/CT_HslColor.html +4 -2
  89. data/rdoc/RubyXL/CT_Hyperlink.html +4 -2
  90. data/rdoc/RubyXL/CT_InnerShadowEffect.html +4 -2
  91. data/rdoc/RubyXL/CT_LightRig.html +4 -2
  92. data/rdoc/RubyXL/CT_LineEndProperties.html +4 -2
  93. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +4 -2
  94. data/rdoc/RubyXL/CT_LineProperties.html +4 -2
  95. data/rdoc/RubyXL/CT_LineStyleList.html +4 -2
  96. data/rdoc/RubyXL/CT_LinearShadeProperties.html +4 -2
  97. data/rdoc/RubyXL/CT_LuminanceEffect.html +4 -2
  98. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +4 -2
  99. data/rdoc/RubyXL/CT_OuterShadowEffect.html +4 -2
  100. data/rdoc/RubyXL/CT_Path2D.html +4 -2
  101. data/rdoc/RubyXL/CT_Path2DArcTo.html +4 -2
  102. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +4 -2
  103. data/rdoc/RubyXL/CT_Path2DList.html +4 -2
  104. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +4 -2
  105. data/rdoc/RubyXL/CT_Path2DTo.html +4 -2
  106. data/rdoc/RubyXL/CT_PathShadeProperties.html +4 -2
  107. data/rdoc/RubyXL/CT_PatternFillProperties.html +4 -2
  108. data/rdoc/RubyXL/CT_Point3D.html +4 -2
  109. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +4 -2
  110. data/rdoc/RubyXL/CT_PresetColor.html +4 -2
  111. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +4 -2
  112. data/rdoc/RubyXL/CT_PresetShadowEffect.html +4 -2
  113. data/rdoc/RubyXL/CT_PresetTextShape.html +4 -2
  114. data/rdoc/RubyXL/CT_ReflectionEffect.html +4 -2
  115. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +4 -2
  116. data/rdoc/RubyXL/CT_RelativeRect.html +4 -2
  117. data/rdoc/RubyXL/CT_SRgbColor.html +4 -2
  118. data/rdoc/RubyXL/CT_ScRgbColor.html +4 -2
  119. data/rdoc/RubyXL/CT_Scene3D.html +4 -2
  120. data/rdoc/RubyXL/CT_SchemeColor.html +4 -2
  121. data/rdoc/RubyXL/CT_Shape3D.html +4 -2
  122. data/rdoc/RubyXL/CT_ShapeStyle.html +4 -2
  123. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +4 -2
  124. data/rdoc/RubyXL/CT_SphereCoords.html +4 -2
  125. data/rdoc/RubyXL/CT_StretchInfoProperties.html +4 -2
  126. data/rdoc/RubyXL/CT_StyleMatrix.html +4 -2
  127. data/rdoc/RubyXL/CT_StyleMatrixReference.html +4 -2
  128. data/rdoc/RubyXL/CT_SupplementalFont.html +4 -2
  129. data/rdoc/RubyXL/CT_SystemColor.html +4 -2
  130. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +4 -2
  131. data/rdoc/RubyXL/CT_TextBlipBullet.html +4 -2
  132. data/rdoc/RubyXL/CT_TextCharBullet.html +4 -2
  133. data/rdoc/RubyXL/CT_TextCharacterProperties.html +4 -2
  134. data/rdoc/RubyXL/CT_TextFont.html +4 -2
  135. data/rdoc/RubyXL/CT_TextListStyle.html +4 -2
  136. data/rdoc/RubyXL/CT_TextNormalAutofit.html +4 -2
  137. data/rdoc/RubyXL/CT_TextParagraphProperties.html +4 -2
  138. data/rdoc/RubyXL/CT_TextSpacing.html +4 -2
  139. data/rdoc/RubyXL/CT_TextTabStop.html +4 -2
  140. data/rdoc/RubyXL/CT_TextTabStopList.html +4 -2
  141. data/rdoc/RubyXL/CT_TileInfoProperties.html +4 -2
  142. data/rdoc/RubyXL/CT_TintEffect.html +4 -2
  143. data/rdoc/RubyXL/CT_Transform2D.html +4 -2
  144. data/rdoc/RubyXL/CT_TransformEffect.html +4 -2
  145. data/rdoc/RubyXL/CT_Vector3D.html +4 -2
  146. data/rdoc/RubyXL/CT_XYAdjustHandle.html +4 -2
  147. data/rdoc/RubyXL/CalculationChain.html +4 -2
  148. data/rdoc/RubyXL/CalculationChainCell.html +4 -2
  149. data/rdoc/RubyXL/CalculationProperties.html +4 -2
  150. data/rdoc/RubyXL/Cell.html +6 -4
  151. data/rdoc/RubyXL/CellConvenienceMethods.html +4 -2
  152. data/rdoc/RubyXL/CellExt.html +4 -2
  153. data/rdoc/RubyXL/CellSmartTag.html +4 -2
  154. data/rdoc/RubyXL/CellSmartTagProperty.html +4 -2
  155. data/rdoc/RubyXL/CellSmartTags.html +4 -2
  156. data/rdoc/RubyXL/CellStyle.html +4 -2
  157. data/rdoc/RubyXL/CellStyleXFs.html +4 -2
  158. data/rdoc/RubyXL/CellStyles.html +4 -2
  159. data/rdoc/RubyXL/CellValue.html +4 -2
  160. data/rdoc/RubyXL/CellWatch.html +4 -2
  161. data/rdoc/RubyXL/CellWatches.html +4 -2
  162. data/rdoc/RubyXL/CellXFs.html +4 -2
  163. data/rdoc/RubyXL/ChartColorsFile.html +4 -2
  164. data/rdoc/RubyXL/ChartFile.html +4 -2
  165. data/rdoc/RubyXL/ChartStyleFile.html +4 -2
  166. data/rdoc/RubyXL/ChartUserShapesFile.html +4 -2
  167. data/rdoc/RubyXL/Chartsheet.html +4 -2
  168. data/rdoc/RubyXL/ChartsheetPageSetup.html +4 -2
  169. data/rdoc/RubyXL/ChartsheetProperties.html +4 -2
  170. data/rdoc/RubyXL/ChartsheetProtection.html +4 -2
  171. data/rdoc/RubyXL/ChartsheetView.html +4 -2
  172. data/rdoc/RubyXL/ChartsheetViews.html +4 -2
  173. data/rdoc/RubyXL/Color.html +4 -2
  174. data/rdoc/RubyXL/ColorConvenienceClasses.html +4 -2
  175. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +6 -4
  176. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +9 -5
  177. data/rdoc/RubyXL/ColorConvenienceMethods.html +4 -2
  178. data/rdoc/RubyXL/ColorFilter.html +4 -2
  179. data/rdoc/RubyXL/ColorScale.html +4 -2
  180. data/rdoc/RubyXL/ColorSet.html +4 -2
  181. data/rdoc/RubyXL/Colors.html +4 -2
  182. data/rdoc/RubyXL/ColumnRange.html +4 -2
  183. data/rdoc/RubyXL/ColumnRanges.html +4 -2
  184. data/rdoc/RubyXL/Comment.html +4 -2
  185. data/rdoc/RubyXL/CommentList.html +4 -2
  186. data/rdoc/RubyXL/CommentsFile.html +4 -2
  187. data/rdoc/RubyXL/ConditionalFormatValue.html +4 -2
  188. data/rdoc/RubyXL/ConditionalFormatting.html +4 -2
  189. data/rdoc/RubyXL/ConditionalFormattingRule.html +4 -2
  190. data/rdoc/RubyXL/Connection.html +4 -2
  191. data/rdoc/RubyXL/ConnectionTable.html +4 -2
  192. data/rdoc/RubyXL/ConnectionTables.html +4 -2
  193. data/rdoc/RubyXL/ConnectionTextField.html +4 -2
  194. data/rdoc/RubyXL/ConnectionTextFields.html +4 -2
  195. data/rdoc/RubyXL/Connections.html +4 -2
  196. data/rdoc/RubyXL/ContentTypeDefault.html +4 -2
  197. data/rdoc/RubyXL/ContentTypeOverride.html +4 -2
  198. data/rdoc/RubyXL/ContentTypes.html +4 -2
  199. data/rdoc/RubyXL/ControlPropertiesFile.html +9 -2
  200. data/rdoc/RubyXL/CorePropertiesFile.html +6 -4
  201. data/rdoc/RubyXL/CustomColor.html +4 -2
  202. data/rdoc/RubyXL/CustomColorList.html +4 -2
  203. data/rdoc/RubyXL/CustomFilter.html +4 -2
  204. data/rdoc/RubyXL/CustomFilters.html +4 -2
  205. data/rdoc/RubyXL/CustomGeometry.html +4 -2
  206. data/rdoc/RubyXL/CustomProperties.html +4 -2
  207. data/rdoc/RubyXL/CustomPropertiesFile.html +4 -2
  208. data/rdoc/RubyXL/CustomProperty.html +4 -2
  209. data/rdoc/RubyXL/CustomPropertyFile.html +4 -2
  210. data/rdoc/RubyXL/CustomSheetView.html +4 -2
  211. data/rdoc/RubyXL/CustomSheetViews.html +4 -2
  212. data/rdoc/RubyXL/CustomWorkbookView.html +4 -2
  213. data/rdoc/RubyXL/CustomWorkbookViews.html +4 -2
  214. data/rdoc/RubyXL/CustomXMLFile.html +4 -2
  215. data/rdoc/RubyXL/DXF.html +4 -2
  216. data/rdoc/RubyXL/DXFs.html +4 -2
  217. data/rdoc/RubyXL/DataBar.html +4 -2
  218. data/rdoc/RubyXL/DataConsolidate.html +4 -2
  219. data/rdoc/RubyXL/DataConsolidationReference.html +4 -2
  220. data/rdoc/RubyXL/DataConsolidationReferences.html +4 -2
  221. data/rdoc/RubyXL/DataType.html +4 -2
  222. data/rdoc/RubyXL/DataValidation.html +4 -2
  223. data/rdoc/RubyXL/DataValidations.html +4 -2
  224. data/rdoc/RubyXL/DateGroupItem.html +4 -2
  225. data/rdoc/RubyXL/DefinedName.html +4 -2
  226. data/rdoc/RubyXL/DefinedNameExt.html +4 -2
  227. data/rdoc/RubyXL/DefinedNames.html +4 -2
  228. data/rdoc/RubyXL/DefinedNamesExt.html +4 -2
  229. data/rdoc/RubyXL/DocumentPropertiesFile.html +4 -2
  230. data/rdoc/RubyXL/DrawingFile.html +4 -2
  231. data/rdoc/RubyXL/DynamicFilter.html +4 -2
  232. data/rdoc/RubyXL/EmbeddedControl.html +4 -2
  233. data/rdoc/RubyXL/EmbeddedControls.html +4 -2
  234. data/rdoc/RubyXL/Extension.html +4 -2
  235. data/rdoc/RubyXL/ExtensionStorageArea.html +4 -2
  236. data/rdoc/RubyXL/Extents.html +4 -2
  237. data/rdoc/RubyXL/ExternalBook.html +4 -2
  238. data/rdoc/RubyXL/ExternalLinksFile.html +5 -3
  239. data/rdoc/RubyXL/ExternalReference.html +4 -2
  240. data/rdoc/RubyXL/ExternalReferences.html +4 -2
  241. data/rdoc/RubyXL/ExtraColorSchemeList.html +4 -2
  242. data/rdoc/RubyXL/FieldItem.html +4 -2
  243. data/rdoc/RubyXL/FileRecoveryProperties.html +4 -2
  244. data/rdoc/RubyXL/FileSharing.html +4 -2
  245. data/rdoc/RubyXL/FileVersion.html +4 -2
  246. data/rdoc/RubyXL/Fill.html +4 -2
  247. data/rdoc/RubyXL/Fills.html +4 -2
  248. data/rdoc/RubyXL/FilterContainer.html +4 -2
  249. data/rdoc/RubyXL/FloatNode.html +4 -2
  250. data/rdoc/RubyXL/FloatValue.html +4 -2
  251. data/rdoc/RubyXL/Font.html +4 -2
  252. data/rdoc/RubyXL/FontConvenienceMethods.html +4 -2
  253. data/rdoc/RubyXL/FontScheme.html +4 -2
  254. data/rdoc/RubyXL/Fonts.html +4 -2
  255. data/rdoc/RubyXL/Formula.html +4 -2
  256. data/rdoc/RubyXL/FunctionGroup.html +4 -2
  257. data/rdoc/RubyXL/FunctionGroups.html +4 -2
  258. data/rdoc/RubyXL/GenericStorageObject.html +4 -2
  259. data/rdoc/RubyXL/GradientFill.html +4 -2
  260. data/rdoc/RubyXL/HeaderFooterSettings.html +4 -2
  261. data/rdoc/RubyXL/Hyperlink.html +4 -2
  262. data/rdoc/RubyXL/HyperlinkRelFile.html +4 -2
  263. data/rdoc/RubyXL/Hyperlinks.html +4 -2
  264. data/rdoc/RubyXL/IconFilter.html +4 -2
  265. data/rdoc/RubyXL/IconSet.html +4 -2
  266. data/rdoc/RubyXL/IgnoredError.html +4 -2
  267. data/rdoc/RubyXL/IgnoredErrors.html +4 -2
  268. data/rdoc/RubyXL/IndexedColors.html +4 -2
  269. data/rdoc/RubyXL/InputCells.html +4 -2
  270. data/rdoc/RubyXL/IntegerNode.html +4 -2
  271. data/rdoc/RubyXL/IntegerValue.html +4 -2
  272. data/rdoc/RubyXL/LegacyCell.html +4 -2
  273. data/rdoc/RubyXL/LegacyWorksheet.html +5 -3
  274. data/rdoc/RubyXL/MRUColors.html +4 -2
  275. data/rdoc/RubyXL/MacrosFile.html +4 -2
  276. data/rdoc/RubyXL/MergedCell.html +4 -2
  277. data/rdoc/RubyXL/MergedCells.html +4 -2
  278. data/rdoc/RubyXL/NumFmt.html +4 -2
  279. data/rdoc/RubyXL/NumberFormat.html +4 -2
  280. data/rdoc/RubyXL/NumberFormats.html +4 -2
  281. data/rdoc/RubyXL/OLEObject.html +4 -2
  282. data/rdoc/RubyXL/OLEObjectFile.html +4 -2
  283. data/rdoc/RubyXL/OLEObjects.html +4 -2
  284. data/rdoc/RubyXL/OLESize.html +4 -2
  285. data/rdoc/RubyXL/OOXMLContainerObject.html +10 -8
  286. data/rdoc/RubyXL/OOXMLIgnored.html +4 -2
  287. data/rdoc/RubyXL/OOXMLObject.html +4 -2
  288. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +42 -5
  289. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +17 -10
  290. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +4 -2
  291. data/rdoc/RubyXL/OOXMLTopLevelObject.html +9 -7
  292. data/rdoc/RubyXL/OdbcOleDbProperties.html +4 -2
  293. data/rdoc/RubyXL/Offset.html +4 -2
  294. data/rdoc/RubyXL/OlapProperties.html +4 -2
  295. data/rdoc/RubyXL/OleItem.html +108 -0
  296. data/rdoc/RubyXL/OleItems.html +108 -0
  297. data/rdoc/RubyXL/OleLink.html +108 -0
  298. data/rdoc/RubyXL/OutlineProperties.html +4 -2
  299. data/rdoc/RubyXL/PageMargins.html +4 -2
  300. data/rdoc/RubyXL/PageSetup.html +4 -2
  301. data/rdoc/RubyXL/PageSetupProperties.html +4 -2
  302. data/rdoc/RubyXL/Pane.html +4 -2
  303. data/rdoc/RubyXL/Parser.html +4 -2
  304. data/rdoc/RubyXL/PatternFill.html +4 -2
  305. data/rdoc/RubyXL/PhoneticProperties.html +4 -2
  306. data/rdoc/RubyXL/PhoneticRun.html +4 -2
  307. data/rdoc/RubyXL/PivotArea.html +4 -2
  308. data/rdoc/RubyXL/PivotCache.html +4 -2
  309. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +4 -2
  310. data/rdoc/RubyXL/PivotCacheRecordsFile.html +4 -2
  311. data/rdoc/RubyXL/PivotCaches.html +4 -2
  312. data/rdoc/RubyXL/PivotReference.html +4 -2
  313. data/rdoc/RubyXL/PivotReferences.html +4 -2
  314. data/rdoc/RubyXL/PivotTableFile.html +4 -2
  315. data/rdoc/RubyXL/PivotTableSelection.html +4 -2
  316. data/rdoc/RubyXL/PresetGeometry.html +4 -2
  317. data/rdoc/RubyXL/PrintOptions.html +4 -2
  318. data/rdoc/RubyXL/PrinterSettingsFile.html +4 -2
  319. data/rdoc/RubyXL/ProtectedRange.html +4 -2
  320. data/rdoc/RubyXL/ProtectedRanges.html +4 -2
  321. data/rdoc/RubyXL/Protection.html +4 -2
  322. data/rdoc/RubyXL/QueryParameter.html +4 -2
  323. data/rdoc/RubyXL/QueryParameters.html +4 -2
  324. data/rdoc/RubyXL/QueryTable.html +4 -2
  325. data/rdoc/RubyXL/QueryTableDeletedField.html +4 -2
  326. data/rdoc/RubyXL/QueryTableDeletedFields.html +4 -2
  327. data/rdoc/RubyXL/QueryTableField.html +4 -2
  328. data/rdoc/RubyXL/QueryTableFields.html +4 -2
  329. data/rdoc/RubyXL/QueryTableRefresh.html +4 -2
  330. data/rdoc/RubyXL/RID.html +4 -2
  331. data/rdoc/RubyXL/RawOOXML.html +4 -2
  332. data/rdoc/RubyXL/Reference.html +4 -2
  333. data/rdoc/RubyXL/Relationship.html +4 -2
  334. data/rdoc/RubyXL/RelationshipSupport.html +4 -2
  335. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +4 -2
  336. data/rdoc/RubyXL/RevisionPointer.html +4 -2
  337. data/rdoc/RubyXL/RichText.html +5 -3
  338. data/rdoc/RubyXL/RichTextRun.html +4 -2
  339. data/rdoc/RubyXL/Row.html +4 -2
  340. data/rdoc/RubyXL/RowExt.html +4 -2
  341. data/rdoc/RubyXL/RunProperties.html +4 -2
  342. data/rdoc/RubyXL/Scenario.html +4 -2
  343. data/rdoc/RubyXL/Scenarios.html +4 -2
  344. data/rdoc/RubyXL/Selection.html +4 -2
  345. data/rdoc/RubyXL/ShapeGuide.html +4 -2
  346. data/rdoc/RubyXL/ShapeTextRectangle.html +4 -2
  347. data/rdoc/RubyXL/SharedStringsTable.html +4 -2
  348. data/rdoc/RubyXL/Sheet.html +4 -2
  349. data/rdoc/RubyXL/SheetCalculationProperties.html +4 -2
  350. data/rdoc/RubyXL/SheetData.html +4 -2
  351. data/rdoc/RubyXL/SheetDataExt.html +4 -2
  352. data/rdoc/RubyXL/SheetDataSet.html +4 -2
  353. data/rdoc/RubyXL/SheetName.html +4 -2
  354. data/rdoc/RubyXL/SheetNames.html +4 -2
  355. data/rdoc/RubyXL/Sheets.html +4 -2
  356. data/rdoc/RubyXL/SlicerCacheFile.html +4 -2
  357. data/rdoc/RubyXL/SlicerFile.html +4 -2
  358. data/rdoc/RubyXL/SmartTagProperties.html +4 -2
  359. data/rdoc/RubyXL/SmartTagType.html +4 -2
  360. data/rdoc/RubyXL/SmartTagTypes.html +4 -2
  361. data/rdoc/RubyXL/SmartTags.html +4 -2
  362. data/rdoc/RubyXL/SortCondition.html +4 -2
  363. data/rdoc/RubyXL/SortState.html +4 -2
  364. data/rdoc/RubyXL/Sqref.html +4 -2
  365. data/rdoc/RubyXL/Stop.html +4 -2
  366. data/rdoc/RubyXL/StringNode.html +4 -2
  367. data/rdoc/RubyXL/StringNodeW3C.html +4 -2
  368. data/rdoc/RubyXL/StringValue.html +4 -2
  369. data/rdoc/RubyXL/Stylesheet.html +4 -2
  370. data/rdoc/RubyXL/TableFile.html +4 -2
  371. data/rdoc/RubyXL/TableParts.html +4 -2
  372. data/rdoc/RubyXL/TableStyle.html +4 -2
  373. data/rdoc/RubyXL/TableStyles.html +4 -2
  374. data/rdoc/RubyXL/Text.html +4 -2
  375. data/rdoc/RubyXL/TextImportSettings.html +4 -2
  376. data/rdoc/RubyXL/Theme.html +4 -2
  377. data/rdoc/RubyXL/ThemeElements.html +4 -2
  378. data/rdoc/RubyXL/ThumbnailFile.html +4 -2
  379. data/rdoc/RubyXL/Top10.html +4 -2
  380. data/rdoc/RubyXL/VMLDrawingFile.html +4 -2
  381. data/rdoc/RubyXL/Variant.html +4 -2
  382. data/rdoc/RubyXL/Vector.html +4 -2
  383. data/rdoc/RubyXL/VectorValue.html +4 -2
  384. data/rdoc/RubyXL/VisualProperties.html +4 -2
  385. data/rdoc/RubyXL/WebPublishObject.html +4 -2
  386. data/rdoc/RubyXL/WebPublishObjects.html +4 -2
  387. data/rdoc/RubyXL/WebPublishingItem.html +4 -2
  388. data/rdoc/RubyXL/WebPublishingItems.html +4 -2
  389. data/rdoc/RubyXL/WebPublishingProperties.html +4 -2
  390. data/rdoc/RubyXL/WebQueryProperties.html +4 -2
  391. data/rdoc/RubyXL/Workbook.html +33 -25
  392. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +4 -2
  393. data/rdoc/RubyXL/WorkbookProperties.html +4 -2
  394. data/rdoc/RubyXL/WorkbookProtection.html +4 -2
  395. data/rdoc/RubyXL/WorkbookRoot.html +4 -2
  396. data/rdoc/RubyXL/WorkbookView.html +4 -2
  397. data/rdoc/RubyXL/WorkbookViews.html +4 -2
  398. data/rdoc/RubyXL/Worksheet.html +4 -2
  399. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +47 -2
  400. data/rdoc/RubyXL/WorksheetDimensions.html +4 -2
  401. data/rdoc/RubyXL/WorksheetFormatProperties.html +4 -2
  402. data/rdoc/RubyXL/WorksheetProperties.html +4 -2
  403. data/rdoc/RubyXL/WorksheetProtection.html +4 -2
  404. data/rdoc/RubyXL/WorksheetView.html +4 -2
  405. data/rdoc/RubyXL/WorksheetViews.html +4 -2
  406. data/rdoc/RubyXL/XF.html +4 -2
  407. data/rdoc/created.rid +20 -20
  408. data/rdoc/index.html +12 -3
  409. data/rdoc/js/navigation.js.gz +0 -0
  410. data/rdoc/js/search_index.js +1 -1
  411. data/rdoc/js/search_index.js.gz +0 -0
  412. data/rdoc/js/searcher.js.gz +0 -0
  413. data/rdoc/table_of_contents.html +838 -3
  414. data/rubyXL.gemspec +20 -27
  415. data/spec/lib/cell_spec.rb +22 -3
  416. data/spec/lib/rgb_color_spec.rb +16 -0
  417. metadata +9 -7
  418. data/test/output/test.xlsx +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6fe23b654603dd0ddf300a80ddd9cadbedacacbe2c17bec142d2b02fb34e282
4
- data.tar.gz: d950f5c59d36d41cf566fb40b40f527b1f147173585c8b1c642176b1c93452d0
3
+ metadata.gz: 4a9327bd67cd3fe0e2cdd599929207e83fbeee4b2125e7f45d5b1c8c8145e8a9
4
+ data.tar.gz: 12b4e09b2a6502679c81b95909e3fd59d287880cc9d4cf0fd0705968e68d858d
5
5
  SHA512:
6
- metadata.gz: a7c3c7659e9883e35f7646ca92de7bce3050b26626cfc12ed513f62699d9fd85759c3bb41011f879e67cdaf28bac2ac6e3275c7ee912140c7c46be15cb4aa2a2
7
- data.tar.gz: a26a4250e5136b177b638b001c56f6e14d03794af0f6c790ee85cc34c2a0403ba69c397ad6c4bf4ac71ba18a66592e478e94c3688473d04c244cea29cd54bc1d
6
+ metadata.gz: 5e74cdd0607641eb9b17a5cc60410de79da04a6cef796f1e31a96673176e740c2fc76bd26fd229a2d06e150b1adf8105a13516fb192787892ae895c3251b6500
7
+ data.tar.gz: 06036705f47f89cee9b769d5eb642d44741f714db4c53caedc0fbac7822d3e24968291a2dea2dba908955c798ca6d729d9101157b854266640202bf3e6504499
@@ -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
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  # Dependencies required to run this gem.
4
- gem "nokogiri", ">= 1.4.4"
4
+ gem "nokogiri", ">= 1.10.8"
5
5
  gem "rubyzip", ">= 1.3.0" , :require => 'zip'
6
6
 
7
7
  # Development dependencies.
@@ -5,11 +5,12 @@ GEM
5
5
  builder (3.2.4)
6
6
  descendants_tracker (0.0.4)
7
7
  thread_safe (~> 0.3, >= 0.3.1)
8
- diff-lcs (1.3)
8
+ diff-lcs (1.4.4)
9
9
  docile (1.3.2)
10
10
  faraday (0.9.2)
11
11
  multipart-post (>= 1.2, < 3)
12
- git (1.5.0)
12
+ git (1.7.0)
13
+ rchardet (~> 1.8)
13
14
  github_api (0.16.0)
14
15
  addressable (~> 2.4.0)
15
16
  descendants_tracker (~> 0.0.4)
@@ -17,7 +18,7 @@ GEM
17
18
  hashie (>= 3.4)
18
19
  mime-types (>= 1.16, < 3.0)
19
20
  oauth2 (~> 1.0)
20
- hashie (4.0.0)
21
+ hashie (4.1.0)
21
22
  highline (2.0.3)
22
23
  jeweler (2.3.9)
23
24
  builder
@@ -30,48 +31,47 @@ GEM
30
31
  rake
31
32
  rdoc
32
33
  semver2
33
- json (2.3.0)
34
34
  jwt (2.2.1)
35
35
  mime-types (2.99.3)
36
36
  mini_portile2 (2.4.0)
37
- multi_json (1.14.1)
37
+ multi_json (1.15.0)
38
38
  multi_xml (0.6.0)
39
39
  multipart-post (2.1.1)
40
- nokogiri (1.10.7)
40
+ nokogiri (1.10.10)
41
41
  mini_portile2 (~> 2.4.0)
42
- oauth2 (1.4.2)
42
+ oauth2 (1.4.4)
43
43
  faraday (>= 0.8, < 2.0)
44
44
  jwt (>= 1.0, < 3.0)
45
45
  multi_json (~> 1.3)
46
46
  multi_xml (~> 0.5)
47
47
  rack (>= 1.2, < 3)
48
- psych (3.1.0)
49
- rack (2.0.8)
48
+ psych (3.2.0)
49
+ rack (2.2.3)
50
50
  rake (13.0.1)
51
- rdoc (6.2.0)
51
+ rchardet (1.8.0)
52
+ rdoc (6.2.1)
52
53
  rspec (3.9.0)
53
54
  rspec-core (~> 3.9.0)
54
55
  rspec-expectations (~> 3.9.0)
55
56
  rspec-mocks (~> 3.9.0)
56
- rspec-core (3.9.0)
57
- rspec-support (~> 3.9.0)
58
- rspec-expectations (3.9.0)
57
+ rspec-core (3.9.2)
58
+ rspec-support (~> 3.9.3)
59
+ rspec-expectations (3.9.2)
59
60
  diff-lcs (>= 1.2.0, < 2.0)
60
61
  rspec-support (~> 3.9.0)
61
- rspec-mocks (3.9.0)
62
+ rspec-mocks (3.9.1)
62
63
  diff-lcs (>= 1.2.0, < 2.0)
63
64
  rspec-support (~> 3.9.0)
64
- rspec-support (3.9.0)
65
+ rspec-support (3.9.3)
65
66
  rspec_junit_formatter (0.4.1)
66
67
  rspec-core (>= 2, < 4, != 2.12.0)
67
- ruby-prof (1.1.0)
68
- rubyzip (2.0.0)
68
+ ruby-prof (1.4.1)
69
+ rubyzip (2.3.0)
69
70
  semver2 (3.4.2)
70
- simplecov (0.17.1)
71
+ simplecov (0.18.5)
71
72
  docile (~> 1.1)
72
- json (>= 1.8, < 3)
73
- simplecov-html (~> 0.10.0)
74
- simplecov-html (0.10.2)
73
+ simplecov-html (~> 0.11)
74
+ simplecov-html (0.12.2)
75
75
  thread_safe (0.3.6)
76
76
 
77
77
  PLATFORMS
@@ -80,7 +80,7 @@ PLATFORMS
80
80
  DEPENDENCIES
81
81
  bundler
82
82
  jeweler
83
- nokogiri (>= 1.4.4)
83
+ nokogiri (>= 1.10.8)
84
84
  rake
85
85
  rspec
86
86
  rspec_junit_formatter
@@ -89,4 +89,4 @@ DEPENDENCIES
89
89
  simplecov
90
90
 
91
91
  BUNDLED WITH
92
- 1.17.3
92
+ 2.1.4
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Vivek Bhagwat, 2013-2014 Wesha
1
+ Copyright (c) 2011 Vivek Bhagwat, 2013-2020 Wesha
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -229,6 +229,11 @@ It can also operate on +StringIO+ objects, thus eliminating the need to save the
229
229
 
230
230
  RubyXL.class_variable_set(:@@suppress_warnings, true)
231
231
 
232
+ == Data validation ("dropdown list")
233
+
234
+ worksheet.add_validation_list("A1", [ "value1", "value2" ])
235
+
236
+
232
237
  == For more information
233
238
  Take a look at the files in spec/lib/ for rspecs on most methods
234
239
 
@@ -244,5 +249,5 @@ Take a look at the files in spec/lib/ for rspecs on most methods
244
249
 
245
250
  == Copyright
246
251
 
247
- Copyright (c) 2011 Vivek Bhagwat, 2013-2016 Wesha.
252
+ Copyright (c) 2011 Vivek Bhagwat, 2013-2020 Wesha.
248
253
  See LICENSE.txt for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.10
1
+ 3.4.16
@@ -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)
@@ -72,9 +72,11 @@ module RubyXL
72
72
  end
73
73
 
74
74
  def to_s
75
- str = r.to_s(16) + g.to_s(16) + b.to_s(16)
76
- str += a.to_s(16) if a && a != 0
77
- str
75
+ if a && a != 0 then
76
+ "%02x%02x%02x%02x" % [ r, g, b, a ]
77
+ else
78
+ "%02x%02x%02x" % [ r, g, b ]
79
+ end
78
80
  end
79
81
 
80
82
  end
@@ -632,6 +632,18 @@ module RubyXL
632
632
  # TODO: add validation to make sure ranges are not intersecting with existing ones
633
633
  merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(start_row, end_row, start_col, end_col))
634
634
  end
635
+
636
+ def add_validation_list(ref, list_arr)
637
+ # "Any double quote characters in the value should be escaped with another double quote.
638
+ # If the value does not contain a comma, newline or double quote, then the String value should be returned unchanged.
639
+ # If the value contains a comma, newline or double quote, then the String value should be returned enclosed in double quotes."
640
+ expr = '"' + list_arr.collect{|str| str.gsub('"', '""')}.join(',') + '"'
641
+ self.data_validations ||= RubyXL::DataValidations.new
642
+ self.data_validations <<
643
+ RubyXL::DataValidation.new({:sqref => RubyXL::Reference.new(ref),
644
+ :formula1 => RubyXL::Formula.new(:expression => expr),
645
+ :type => 'list'})
646
+ end
635
647
  end
636
648
 
637
649
  RubyXL::Worksheet.send(:include, RubyXL::WorksheetConvenienceMethods) # ruby 2.1 compat
@@ -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
 
@@ -11,6 +11,8 @@ module RubyXL
11
11
  define_attribute(:imeMode, RubyXL::ST_DataValidationImeMode, :default => 'noControl')
12
12
  define_attribute(:operator, RubyXL::ST_DataValidationOperator, :default => 'between')
13
13
  define_attribute(:allowBlank, :bool, :default => false)
14
+ # Documentation lies. This property should have been called "HIDE dropdown",
15
+ # since that's what happens when it is set to true.
14
16
  define_attribute(:showDropDown, :bool, :default => false)
15
17
  define_attribute(:showInputMessage, :bool, :default => false)
16
18
  define_attribute(:showErrorMessage, :bool, :default => false)
@@ -127,7 +127,7 @@ module RubyXL
127
127
  end
128
128
 
129
129
  def creator=(v)
130
- self.dc_creator = v && RubyXL::StringNodeW3C.new(:value => v)
130
+ self.dc_creator = v && RubyXL::StringNode.new(:value => v)
131
131
  end
132
132
 
133
133
  def modifier
@@ -135,7 +135,7 @@ module RubyXL
135
135
  end
136
136
 
137
137
  def modifier=(v)
138
- self.cp_last_modified_by = v && RubyXL::StringNodeW3C.new(:value => v)
138
+ self.cp_last_modified_by = v && RubyXL::StringNode.new(:value => v)
139
139
  end
140
140
 
141
141
  def created_at
@@ -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.
@@ -272,6 +277,11 @@ module RubyXL
272
277
  if xml.nil? then
273
278
  seed_xml = Nokogiri::XML('<?xml version = "1.0" standalone ="yes"?>')
274
279
  seed_xml.encoding = 'UTF-8'
280
+
281
+ if Nokogiri.jruby? then # Issue 188 workaround for JRuby
282
+ seed_xml.to_java.strict_error_checking = false
283
+ end
284
+
275
285
  result = self.write_xml(seed_xml)
276
286
  return result if result == ''
277
287
  seed_xml << result
@@ -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
@@ -125,8 +125,8 @@ module RubyXL
125
125
 
126
126
  def inspect
127
127
  str = "#<#{self.class}(#{row},#{column}): #{raw_value.inspect}"
128
- str += " =#{self.formula.expression}" if self.formula
129
- str += ", datatype=#{self.datatype.inspect}, style_index=#{self.style_index.inspect}>"
128
+ str << " =#{self.formula.expression}" if self.formula
129
+ str << ", datatype=#{self.datatype.inspect}, style_index=#{self.style_index.inspect}>"
130
130
  return str
131
131
  end
132
132
 
@@ -97,6 +97,7 @@ module RubyXL
97
97
  end
98
98
 
99
99
  class ControlPropertiesFile < GenericStorageObject
100
+ CONTENT_TYPE = 'application/vnd.ms-excel.controlproperties+xml'
100
101
  REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp'
101
102
  end
102
103
 
@@ -85,7 +85,7 @@ module RubyXL
85
85
  define_element_name 'is'
86
86
 
87
87
  def to_s
88
- str = t.to_s
88
+ str = if t.nil? then '' else t.to_s end
89
89
  r && r.each { |rtr| str << rtr.to_s if rtr }
90
90
  str
91
91
  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
 
@@ -420,16 +420,22 @@ module RubyXL
420
420
  private :base_date
421
421
 
422
422
  def date_to_num(date)
423
- date && (date.ajd - base_date().ajd).to_f
423
+ case date
424
+ when Date, DateTime then (date.ajd - base_date().ajd).to_f
425
+ when Time then ((date.to_r - base_date().to_time.to_r) / 86400).to_f
426
+ end
424
427
  end
425
428
 
426
429
  def num_to_date(num)
430
+ return nil if num.nil?
431
+
427
432
  # Bug-for-bug Excel compatibility (https://support.microsoft.com/kb/214058/)
428
- if num && num < MARCH_1_1900 then
433
+ if num < MARCH_1_1900 then
429
434
  num += 1 unless workbook_properties && workbook_properties.date1904
430
435
  end
431
436
 
432
- num && (base_date + num)
437
+ dateparts = num.divmod(1)
438
+ base_date + (dateparts[0] + (dateparts[1] * 86400).round(6) / 86400)
433
439
  end
434
440
 
435
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