rubyXL 3.4.5 → 3.4.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (425) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -1
  3. data/Gemfile +3 -3
  4. data/Gemfile.lock +76 -51
  5. data/LICENSE.txt +1 -1
  6. data/README.rdoc +10 -2
  7. data/Rakefile +3 -3
  8. data/VERSION +1 -1
  9. data/lib/rubyXL/convenience_methods/cell.rb +11 -1
  10. data/lib/rubyXL/convenience_methods/color.rb +5 -3
  11. data/lib/rubyXL/convenience_methods/worksheet.rb +77 -0
  12. data/lib/rubyXL/objects/chartsheet.rb +1 -1
  13. data/lib/rubyXL/objects/data_validation.rb +2 -0
  14. data/lib/rubyXL/objects/document_properties.rb +2 -2
  15. data/lib/rubyXL/objects/external_links.rb +25 -1
  16. data/lib/rubyXL/objects/ooxml_object.rb +13 -1
  17. data/lib/rubyXL/objects/relationships.rb +1 -1
  18. data/lib/rubyXL/objects/sheet_data.rb +11 -4
  19. data/lib/rubyXL/objects/storage.rb +1 -0
  20. data/lib/rubyXL/objects/text.rb +1 -1
  21. data/lib/rubyXL/objects/theme.rb +1 -1
  22. data/lib/rubyXL/objects/workbook.rb +24 -10
  23. data/lib/rubyXL/objects/worksheet.rb +7 -7
  24. data/lib/rubyXL/worksheet.rb +2 -0
  25. data/rdoc/README_rdoc.html +22 -10
  26. data/rdoc/RubyXL/AExtension.html +14 -51
  27. data/rdoc/RubyXL/AExtensionStorageArea.html +10 -14
  28. data/rdoc/RubyXL/ActiveX.html +16 -42
  29. data/rdoc/RubyXL/ActiveXBinary.html +10 -19
  30. data/rdoc/RubyXL/AdjustHandleList.html +10 -14
  31. data/rdoc/RubyXL/Alignment.html +10 -14
  32. data/rdoc/RubyXL/AlternateContent.html +10 -14
  33. data/rdoc/RubyXL/Authors.html +10 -14
  34. data/rdoc/RubyXL/AutoFilter.html +10 -14
  35. data/rdoc/RubyXL/AutoFilterColumn.html +10 -14
  36. data/rdoc/RubyXL/BinaryImageFile.html +10 -22
  37. data/rdoc/RubyXL/BodyProperties.html +10 -14
  38. data/rdoc/RubyXL/BooleanNode.html +10 -14
  39. data/rdoc/RubyXL/BooleanValue.html +10 -14
  40. data/rdoc/RubyXL/Border.html +13 -70
  41. data/rdoc/RubyXL/BorderEdge.html +13 -44
  42. data/rdoc/RubyXL/Borders.html +13 -31
  43. data/rdoc/RubyXL/Break.html +10 -14
  44. data/rdoc/RubyXL/BreakList.html +10 -14
  45. data/rdoc/RubyXL/CT_AdjPoint2D.html +10 -14
  46. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +10 -14
  47. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +10 -14
  48. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +10 -14
  49. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +10 -14
  50. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +10 -14
  51. data/rdoc/RubyXL/CT_Backdrop.html +10 -14
  52. data/rdoc/RubyXL/CT_Bevel.html +10 -14
  53. data/rdoc/RubyXL/CT_BiLevelEffect.html +10 -14
  54. data/rdoc/RubyXL/CT_BlendEffect.html +10 -14
  55. data/rdoc/RubyXL/CT_Blip.html +10 -14
  56. data/rdoc/RubyXL/CT_BlipFillProperties.html +10 -14
  57. data/rdoc/RubyXL/CT_BlurEffect.html +10 -14
  58. data/rdoc/RubyXL/CT_Camera.html +10 -14
  59. data/rdoc/RubyXL/CT_Color.html +10 -14
  60. data/rdoc/RubyXL/CT_ColorChangeEffect.html +10 -14
  61. data/rdoc/RubyXL/CT_ColorMapping.html +10 -14
  62. data/rdoc/RubyXL/CT_ColorScheme.html +10 -14
  63. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +10 -14
  64. data/rdoc/RubyXL/CT_ConnectionSite.html +10 -14
  65. data/rdoc/RubyXL/CT_ConnectionSiteList.html +10 -14
  66. data/rdoc/RubyXL/CT_DashStop.html +10 -14
  67. data/rdoc/RubyXL/CT_DashStopList.html +10 -14
  68. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +10 -14
  69. data/rdoc/RubyXL/CT_DuotoneEffect.html +10 -14
  70. data/rdoc/RubyXL/CT_EffectContainer.html +10 -14
  71. data/rdoc/RubyXL/CT_EffectList.html +10 -14
  72. data/rdoc/RubyXL/CT_EffectReference.html +10 -14
  73. data/rdoc/RubyXL/CT_EffectStyleItem.html +10 -14
  74. data/rdoc/RubyXL/CT_EffectStyleList.html +10 -14
  75. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +10 -14
  76. data/rdoc/RubyXL/CT_FillEffect.html +10 -14
  77. data/rdoc/RubyXL/CT_FillOverlayEffect.html +10 -14
  78. data/rdoc/RubyXL/CT_FillStyleList.html +10 -14
  79. data/rdoc/RubyXL/CT_FlatText.html +10 -14
  80. data/rdoc/RubyXL/CT_FontCollection.html +10 -14
  81. data/rdoc/RubyXL/CT_FontReference.html +10 -14
  82. data/rdoc/RubyXL/CT_GeomGuideList.html +10 -14
  83. data/rdoc/RubyXL/CT_GlowEffect.html +10 -14
  84. data/rdoc/RubyXL/CT_GradientFillProperties.html +10 -14
  85. data/rdoc/RubyXL/CT_GradientStop.html +10 -14
  86. data/rdoc/RubyXL/CT_GradientStopList.html +10 -14
  87. data/rdoc/RubyXL/CT_HSLEffect.html +10 -14
  88. data/rdoc/RubyXL/CT_HslColor.html +10 -14
  89. data/rdoc/RubyXL/CT_Hyperlink.html +10 -14
  90. data/rdoc/RubyXL/CT_InnerShadowEffect.html +10 -14
  91. data/rdoc/RubyXL/CT_LightRig.html +10 -14
  92. data/rdoc/RubyXL/CT_LineEndProperties.html +10 -14
  93. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +10 -14
  94. data/rdoc/RubyXL/CT_LineProperties.html +10 -14
  95. data/rdoc/RubyXL/CT_LineStyleList.html +10 -14
  96. data/rdoc/RubyXL/CT_LinearShadeProperties.html +10 -14
  97. data/rdoc/RubyXL/CT_LuminanceEffect.html +10 -14
  98. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +10 -14
  99. data/rdoc/RubyXL/CT_OuterShadowEffect.html +10 -14
  100. data/rdoc/RubyXL/CT_Path2D.html +10 -14
  101. data/rdoc/RubyXL/CT_Path2DArcTo.html +10 -14
  102. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +10 -14
  103. data/rdoc/RubyXL/CT_Path2DList.html +10 -14
  104. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +10 -14
  105. data/rdoc/RubyXL/CT_Path2DTo.html +10 -14
  106. data/rdoc/RubyXL/CT_PathShadeProperties.html +10 -14
  107. data/rdoc/RubyXL/CT_PatternFillProperties.html +10 -14
  108. data/rdoc/RubyXL/CT_Point3D.html +10 -14
  109. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +10 -14
  110. data/rdoc/RubyXL/CT_PresetColor.html +10 -14
  111. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +10 -14
  112. data/rdoc/RubyXL/CT_PresetShadowEffect.html +10 -14
  113. data/rdoc/RubyXL/CT_PresetTextShape.html +10 -14
  114. data/rdoc/RubyXL/CT_ReflectionEffect.html +10 -14
  115. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +10 -14
  116. data/rdoc/RubyXL/CT_RelativeRect.html +10 -14
  117. data/rdoc/RubyXL/CT_SRgbColor.html +10 -14
  118. data/rdoc/RubyXL/CT_ScRgbColor.html +10 -14
  119. data/rdoc/RubyXL/CT_Scene3D.html +10 -14
  120. data/rdoc/RubyXL/CT_SchemeColor.html +10 -14
  121. data/rdoc/RubyXL/CT_Shape3D.html +10 -14
  122. data/rdoc/RubyXL/CT_ShapeStyle.html +10 -14
  123. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +10 -14
  124. data/rdoc/RubyXL/CT_SphereCoords.html +10 -14
  125. data/rdoc/RubyXL/CT_StretchInfoProperties.html +10 -14
  126. data/rdoc/RubyXL/CT_StyleMatrix.html +10 -14
  127. data/rdoc/RubyXL/CT_StyleMatrixReference.html +10 -14
  128. data/rdoc/RubyXL/CT_SupplementalFont.html +10 -14
  129. data/rdoc/RubyXL/CT_SystemColor.html +10 -14
  130. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +10 -14
  131. data/rdoc/RubyXL/CT_TextBlipBullet.html +10 -14
  132. data/rdoc/RubyXL/CT_TextCharBullet.html +10 -14
  133. data/rdoc/RubyXL/CT_TextCharacterProperties.html +10 -14
  134. data/rdoc/RubyXL/CT_TextFont.html +10 -14
  135. data/rdoc/RubyXL/CT_TextListStyle.html +10 -14
  136. data/rdoc/RubyXL/CT_TextNormalAutofit.html +10 -14
  137. data/rdoc/RubyXL/CT_TextParagraphProperties.html +10 -14
  138. data/rdoc/RubyXL/CT_TextSpacing.html +10 -14
  139. data/rdoc/RubyXL/CT_TextTabStop.html +10 -14
  140. data/rdoc/RubyXL/CT_TextTabStopList.html +10 -14
  141. data/rdoc/RubyXL/CT_TileInfoProperties.html +10 -14
  142. data/rdoc/RubyXL/CT_TintEffect.html +10 -14
  143. data/rdoc/RubyXL/CT_Transform2D.html +10 -14
  144. data/rdoc/RubyXL/CT_TransformEffect.html +10 -14
  145. data/rdoc/RubyXL/CT_Vector3D.html +10 -14
  146. data/rdoc/RubyXL/CT_XYAdjustHandle.html +10 -14
  147. data/rdoc/RubyXL/CalculationChain.html +13 -39
  148. data/rdoc/RubyXL/CalculationChainCell.html +10 -14
  149. data/rdoc/RubyXL/CalculationProperties.html +10 -14
  150. data/rdoc/RubyXL/Cell.html +28 -221
  151. data/rdoc/RubyXL/CellConvenienceMethods.html +70 -475
  152. data/rdoc/RubyXL/CellExt.html +10 -14
  153. data/rdoc/RubyXL/CellSmartTag.html +10 -14
  154. data/rdoc/RubyXL/CellSmartTagProperty.html +10 -14
  155. data/rdoc/RubyXL/CellSmartTags.html +10 -14
  156. data/rdoc/RubyXL/CellStyle.html +10 -14
  157. data/rdoc/RubyXL/CellStyleXFs.html +13 -31
  158. data/rdoc/RubyXL/CellStyles.html +13 -31
  159. data/rdoc/RubyXL/CellValue.html +13 -31
  160. data/rdoc/RubyXL/CellWatch.html +10 -14
  161. data/rdoc/RubyXL/CellWatches.html +10 -14
  162. data/rdoc/RubyXL/CellXFs.html +13 -31
  163. data/rdoc/RubyXL/ChartColorsFile.html +10 -22
  164. data/rdoc/RubyXL/ChartFile.html +15 -44
  165. data/rdoc/RubyXL/ChartStyleFile.html +10 -22
  166. data/rdoc/RubyXL/ChartUserShapesFile.html +10 -22
  167. data/rdoc/RubyXL/Chartsheet.html +15 -61
  168. data/rdoc/RubyXL/ChartsheetPageSetup.html +10 -14
  169. data/rdoc/RubyXL/ChartsheetProperties.html +10 -14
  170. data/rdoc/RubyXL/ChartsheetProtection.html +10 -14
  171. data/rdoc/RubyXL/ChartsheetView.html +10 -14
  172. data/rdoc/RubyXL/ChartsheetViews.html +10 -14
  173. data/rdoc/RubyXL/Color.html +13 -36
  174. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +15 -60
  175. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +19 -76
  176. data/rdoc/RubyXL/ColorConvenienceClasses.html +8 -11
  177. data/rdoc/RubyXL/ColorConvenienceMethods.html +11 -28
  178. data/rdoc/RubyXL/ColorFilter.html +10 -14
  179. data/rdoc/RubyXL/ColorScale.html +10 -14
  180. data/rdoc/RubyXL/ColorSet.html +10 -14
  181. data/rdoc/RubyXL/Colors.html +10 -14
  182. data/rdoc/RubyXL/ColumnRange.html +13 -62
  183. data/rdoc/RubyXL/ColumnRanges.html +13 -70
  184. data/rdoc/RubyXL/Comment.html +10 -14
  185. data/rdoc/RubyXL/CommentList.html +10 -14
  186. data/rdoc/RubyXL/CommentsFile.html +13 -44
  187. data/rdoc/RubyXL/ConditionalFormatValue.html +10 -14
  188. data/rdoc/RubyXL/ConditionalFormatting.html +10 -14
  189. data/rdoc/RubyXL/ConditionalFormattingRule.html +10 -14
  190. data/rdoc/RubyXL/Connection.html +10 -14
  191. data/rdoc/RubyXL/ConnectionTable.html +10 -14
  192. data/rdoc/RubyXL/ConnectionTables.html +10 -14
  193. data/rdoc/RubyXL/ConnectionTextField.html +10 -14
  194. data/rdoc/RubyXL/ConnectionTextFields.html +10 -14
  195. data/rdoc/RubyXL/Connections.html +13 -39
  196. data/rdoc/RubyXL/ContentTypeDefault.html +10 -14
  197. data/rdoc/RubyXL/ContentTypeOverride.html +10 -14
  198. data/rdoc/RubyXL/ContentTypes.html +13 -52
  199. data/rdoc/RubyXL/ControlPropertiesFile.html +12 -19
  200. data/rdoc/RubyXL/CorePropertiesFile.html +15 -150
  201. data/rdoc/RubyXL/CustomColor.html +10 -14
  202. data/rdoc/RubyXL/CustomColorList.html +10 -14
  203. data/rdoc/RubyXL/CustomFilter.html +10 -14
  204. data/rdoc/RubyXL/CustomFilters.html +10 -14
  205. data/rdoc/RubyXL/CustomGeometry.html +10 -14
  206. data/rdoc/RubyXL/CustomProperties.html +10 -14
  207. data/rdoc/RubyXL/CustomPropertiesFile.html +10 -22
  208. data/rdoc/RubyXL/CustomProperty.html +10 -14
  209. data/rdoc/RubyXL/CustomPropertyFile.html +10 -22
  210. data/rdoc/RubyXL/CustomSheetView.html +10 -14
  211. data/rdoc/RubyXL/CustomSheetViews.html +10 -14
  212. data/rdoc/RubyXL/CustomWorkbookView.html +10 -14
  213. data/rdoc/RubyXL/CustomWorkbookViews.html +10 -14
  214. data/rdoc/RubyXL/CustomXMLFile.html +10 -19
  215. data/rdoc/RubyXL/DXF.html +10 -14
  216. data/rdoc/RubyXL/DXFs.html +10 -14
  217. data/rdoc/RubyXL/DataBar.html +10 -14
  218. data/rdoc/RubyXL/DataConsolidate.html +10 -14
  219. data/rdoc/RubyXL/DataConsolidationReference.html +10 -14
  220. data/rdoc/RubyXL/DataConsolidationReferences.html +10 -14
  221. data/rdoc/RubyXL/DataType.html +8 -34
  222. data/rdoc/RubyXL/DataValidation.html +10 -14
  223. data/rdoc/RubyXL/DataValidations.html +10 -14
  224. data/rdoc/RubyXL/DateGroupItem.html +10 -14
  225. data/rdoc/RubyXL/DefinedName.html +10 -14
  226. data/rdoc/RubyXL/DefinedNameExt.html +10 -14
  227. data/rdoc/RubyXL/DefinedNames.html +10 -14
  228. data/rdoc/RubyXL/DefinedNamesExt.html +10 -14
  229. data/rdoc/RubyXL/DocumentPropertiesFile.html +13 -57
  230. data/rdoc/RubyXL/DrawingFile.html +15 -44
  231. data/rdoc/RubyXL/DynamicFilter.html +10 -14
  232. data/rdoc/RubyXL/EmbeddedControl.html +10 -14
  233. data/rdoc/RubyXL/EmbeddedControls.html +10 -14
  234. data/rdoc/RubyXL/Extension.html +10 -14
  235. data/rdoc/RubyXL/ExtensionStorageArea.html +10 -14
  236. data/rdoc/RubyXL/Extents.html +10 -14
  237. data/rdoc/RubyXL/ExternalBook.html +10 -14
  238. data/rdoc/RubyXL/ExternalLinksFile.html +16 -45
  239. data/rdoc/RubyXL/ExternalReference.html +10 -14
  240. data/rdoc/RubyXL/ExternalReferences.html +10 -14
  241. data/rdoc/RubyXL/ExtraColorSchemeList.html +10 -14
  242. data/rdoc/RubyXL/FieldItem.html +10 -14
  243. data/rdoc/RubyXL/FileRecoveryProperties.html +10 -14
  244. data/rdoc/RubyXL/FileSharing.html +10 -14
  245. data/rdoc/RubyXL/FileVersion.html +10 -14
  246. data/rdoc/RubyXL/Fill.html +13 -31
  247. data/rdoc/RubyXL/Fills.html +13 -31
  248. data/rdoc/RubyXL/FilterContainer.html +10 -14
  249. data/rdoc/RubyXL/FloatNode.html +10 -14
  250. data/rdoc/RubyXL/FloatValue.html +10 -14
  251. data/rdoc/RubyXL/Font.html +13 -36
  252. data/rdoc/RubyXL/FontConvenienceMethods.html +11 -197
  253. data/rdoc/RubyXL/FontScheme.html +10 -14
  254. data/rdoc/RubyXL/Fonts.html +13 -31
  255. data/rdoc/RubyXL/Formula.html +10 -14
  256. data/rdoc/RubyXL/FunctionGroup.html +10 -14
  257. data/rdoc/RubyXL/FunctionGroups.html +10 -14
  258. data/rdoc/RubyXL/GenericStorageObject.html +14 -75
  259. data/rdoc/RubyXL/GradientFill.html +10 -14
  260. data/rdoc/RubyXL/HeaderFooterSettings.html +10 -14
  261. data/rdoc/RubyXL/Hyperlink.html +10 -14
  262. data/rdoc/RubyXL/HyperlinkRelFile.html +10 -19
  263. data/rdoc/RubyXL/Hyperlinks.html +10 -14
  264. data/rdoc/RubyXL/IconFilter.html +10 -14
  265. data/rdoc/RubyXL/IconSet.html +10 -14
  266. data/rdoc/RubyXL/IgnoredError.html +10 -14
  267. data/rdoc/RubyXL/IgnoredErrors.html +10 -14
  268. data/rdoc/RubyXL/IndexedColors.html +10 -14
  269. data/rdoc/RubyXL/InputCells.html +10 -14
  270. data/rdoc/RubyXL/IntegerNode.html +10 -14
  271. data/rdoc/RubyXL/IntegerValue.html +10 -14
  272. data/rdoc/RubyXL/LegacyCell.html +11 -28
  273. data/rdoc/RubyXL/LegacyWorksheet.html +16 -88
  274. data/rdoc/RubyXL/MRUColors.html +10 -14
  275. data/rdoc/RubyXL/MacrosFile.html +10 -22
  276. data/rdoc/RubyXL/MergedCell.html +10 -14
  277. data/rdoc/RubyXL/MergedCells.html +10 -14
  278. data/rdoc/RubyXL/NumFmt.html +10 -14
  279. data/rdoc/RubyXL/NumberFormat.html +13 -31
  280. data/rdoc/RubyXL/NumberFormats.html +13 -36
  281. data/rdoc/RubyXL/OLEObject.html +10 -14
  282. data/rdoc/RubyXL/OLEObjectFile.html +10 -22
  283. data/rdoc/RubyXL/OLEObjects.html +10 -14
  284. data/rdoc/RubyXL/OLESize.html +10 -14
  285. data/rdoc/RubyXL/OOXMLContainerObject.html +24 -116
  286. data/rdoc/RubyXL/OOXMLIgnored.html +14 -46
  287. data/rdoc/RubyXL/OOXMLObject.html +12 -19
  288. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +39 -84
  289. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +28 -141
  290. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +15 -169
  291. data/rdoc/RubyXL/OOXMLTopLevelObject.html +19 -103
  292. data/rdoc/RubyXL/OdbcOleDbProperties.html +10 -14
  293. data/rdoc/RubyXL/Offset.html +10 -14
  294. data/rdoc/RubyXL/OlapProperties.html +10 -14
  295. data/rdoc/RubyXL/OleItem.html +99 -0
  296. data/rdoc/RubyXL/OleItems.html +99 -0
  297. data/rdoc/RubyXL/OleLink.html +99 -0
  298. data/rdoc/RubyXL/OutlineProperties.html +10 -14
  299. data/rdoc/RubyXL/PageMargins.html +10 -14
  300. data/rdoc/RubyXL/PageSetup.html +10 -14
  301. data/rdoc/RubyXL/PageSetupProperties.html +10 -14
  302. data/rdoc/RubyXL/Pane.html +10 -14
  303. data/rdoc/RubyXL/Parser.html +13 -44
  304. data/rdoc/RubyXL/PatternFill.html +10 -14
  305. data/rdoc/RubyXL/PhoneticProperties.html +10 -14
  306. data/rdoc/RubyXL/PhoneticRun.html +10 -14
  307. data/rdoc/RubyXL/PivotArea.html +10 -14
  308. data/rdoc/RubyXL/PivotCache.html +10 -14
  309. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +12 -27
  310. data/rdoc/RubyXL/PivotCacheRecordsFile.html +10 -22
  311. data/rdoc/RubyXL/PivotCaches.html +10 -14
  312. data/rdoc/RubyXL/PivotReference.html +10 -14
  313. data/rdoc/RubyXL/PivotReferences.html +10 -14
  314. data/rdoc/RubyXL/PivotTableFile.html +12 -27
  315. data/rdoc/RubyXL/PivotTableSelection.html +10 -14
  316. data/rdoc/RubyXL/PresetGeometry.html +10 -14
  317. data/rdoc/RubyXL/PrintOptions.html +10 -14
  318. data/rdoc/RubyXL/PrinterSettingsFile.html +10 -22
  319. data/rdoc/RubyXL/ProtectedRange.html +10 -14
  320. data/rdoc/RubyXL/ProtectedRanges.html +10 -14
  321. data/rdoc/RubyXL/Protection.html +10 -14
  322. data/rdoc/RubyXL/QueryParameter.html +10 -14
  323. data/rdoc/RubyXL/QueryParameters.html +10 -14
  324. data/rdoc/RubyXL/QueryTable.html +15 -44
  325. data/rdoc/RubyXL/QueryTableDeletedField.html +10 -14
  326. data/rdoc/RubyXL/QueryTableDeletedFields.html +10 -14
  327. data/rdoc/RubyXL/QueryTableField.html +10 -14
  328. data/rdoc/RubyXL/QueryTableFields.html +10 -14
  329. data/rdoc/RubyXL/QueryTableRefresh.html +10 -14
  330. data/rdoc/RubyXL/RID.html +10 -14
  331. data/rdoc/RubyXL/RawOOXML.html +14 -51
  332. data/rdoc/RubyXL/Reference.html +14 -192
  333. data/rdoc/RubyXL/Relationship.html +10 -14
  334. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +11 -28
  335. data/rdoc/RubyXL/RelationshipSupport.html +14 -108
  336. data/rdoc/RubyXL/RevisionPointer.html +10 -14
  337. data/rdoc/RubyXL/RichText.html +14 -32
  338. data/rdoc/RubyXL/RichTextRun.html +13 -31
  339. data/rdoc/RubyXL/Row.html +22 -154
  340. data/rdoc/RubyXL/RowExt.html +10 -14
  341. data/rdoc/RubyXL/RunProperties.html +10 -14
  342. data/rdoc/RubyXL/Scenario.html +10 -14
  343. data/rdoc/RubyXL/Scenarios.html +10 -14
  344. data/rdoc/RubyXL/Selection.html +13 -31
  345. data/rdoc/RubyXL/ShapeGuide.html +10 -14
  346. data/rdoc/RubyXL/ShapeTextRectangle.html +10 -14
  347. data/rdoc/RubyXL/SharedStringsTable.html +14 -121
  348. data/rdoc/RubyXL/Sheet.html +10 -14
  349. data/rdoc/RubyXL/SheetCalculationProperties.html +10 -14
  350. data/rdoc/RubyXL/SheetData.html +15 -46
  351. data/rdoc/RubyXL/SheetDataExt.html +10 -14
  352. data/rdoc/RubyXL/SheetDataSet.html +10 -14
  353. data/rdoc/RubyXL/SheetName.html +10 -14
  354. data/rdoc/RubyXL/SheetNames.html +10 -14
  355. data/rdoc/RubyXL/Sheets.html +10 -14
  356. data/rdoc/RubyXL/SlicerCacheFile.html +10 -22
  357. data/rdoc/RubyXL/SlicerFile.html +10 -22
  358. data/rdoc/RubyXL/SmartTagProperties.html +10 -14
  359. data/rdoc/RubyXL/SmartTagType.html +10 -14
  360. data/rdoc/RubyXL/SmartTagTypes.html +10 -14
  361. data/rdoc/RubyXL/SmartTags.html +10 -14
  362. data/rdoc/RubyXL/SortCondition.html +10 -14
  363. data/rdoc/RubyXL/SortState.html +10 -14
  364. data/rdoc/RubyXL/Sqref.html +14 -46
  365. data/rdoc/RubyXL/Stop.html +10 -14
  366. data/rdoc/RubyXL/StringNode.html +10 -14
  367. data/rdoc/RubyXL/StringNodeW3C.html +14 -46
  368. data/rdoc/RubyXL/StringValue.html +10 -14
  369. data/rdoc/RubyXL/Stylesheet.html +14 -94
  370. data/rdoc/RubyXL/TableFile.html +10 -22
  371. data/rdoc/RubyXL/TableParts.html +10 -14
  372. data/rdoc/RubyXL/TableStyle.html +10 -14
  373. data/rdoc/RubyXL/TableStyles.html +10 -14
  374. data/rdoc/RubyXL/Text.html +13 -52
  375. data/rdoc/RubyXL/TextImportSettings.html +10 -14
  376. data/rdoc/RubyXL/Theme.html +14 -67
  377. data/rdoc/RubyXL/ThemeElements.html +10 -14
  378. data/rdoc/RubyXL/ThumbnailFile.html +10 -22
  379. data/rdoc/RubyXL/Top10.html +10 -14
  380. data/rdoc/RubyXL/VMLDrawingFile.html +12 -27
  381. data/rdoc/RubyXL/Variant.html +10 -14
  382. data/rdoc/RubyXL/Vector.html +13 -31
  383. data/rdoc/RubyXL/VectorValue.html +10 -14
  384. data/rdoc/RubyXL/VisualProperties.html +10 -14
  385. data/rdoc/RubyXL/WebPublishObject.html +10 -14
  386. data/rdoc/RubyXL/WebPublishObjects.html +10 -14
  387. data/rdoc/RubyXL/WebPublishingItem.html +10 -14
  388. data/rdoc/RubyXL/WebPublishingItems.html +10 -14
  389. data/rdoc/RubyXL/WebPublishingProperties.html +10 -14
  390. data/rdoc/RubyXL/WebQueryProperties.html +10 -14
  391. data/rdoc/RubyXL/Workbook.html +76 -465
  392. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +11 -223
  393. data/rdoc/RubyXL/WorkbookProperties.html +10 -14
  394. data/rdoc/RubyXL/WorkbookProtection.html +10 -14
  395. data/rdoc/RubyXL/WorkbookRoot.html +16 -101
  396. data/rdoc/RubyXL/WorkbookView.html +10 -14
  397. data/rdoc/RubyXL/WorkbookViews.html +10 -14
  398. data/rdoc/RubyXL/Worksheet.html +16 -132
  399. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +171 -987
  400. data/rdoc/RubyXL/WorksheetDimensions.html +10 -14
  401. data/rdoc/RubyXL/WorksheetFormatProperties.html +10 -14
  402. data/rdoc/RubyXL/WorksheetProperties.html +10 -14
  403. data/rdoc/RubyXL/WorksheetProtection.html +10 -14
  404. data/rdoc/RubyXL/WorksheetView.html +10 -14
  405. data/rdoc/RubyXL/WorksheetViews.html +10 -14
  406. data/rdoc/RubyXL/XF.html +10 -14
  407. data/rdoc/RubyXL.html +11 -321
  408. data/rdoc/created.rid +26 -26
  409. data/rdoc/css/rdoc.css +55 -6
  410. data/rdoc/index.html +13 -390
  411. data/rdoc/js/darkfish.js +22 -99
  412. data/rdoc/js/navigation.js +4 -40
  413. data/rdoc/js/navigation.js.gz +0 -0
  414. data/rdoc/js/search.js +32 -31
  415. data/rdoc/js/search_index.js +1 -1
  416. data/rdoc/js/search_index.js.gz +0 -0
  417. data/rdoc/js/searcher.js +6 -6
  418. data/rdoc/js/searcher.js.gz +0 -0
  419. data/rdoc/table_of_contents.html +33 -7
  420. data/rubyXL.gemspec +24 -31
  421. data/spec/lib/cell_spec.rb +44 -2
  422. data/spec/lib/rgb_color_spec.rb +16 -0
  423. data/spec/lib/worksheet_spec.rb +301 -0
  424. metadata +12 -10
  425. data/rdoc/js/jquery.js +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53aa01a7410e56ceddd46b083a1ca53b2ad3ec782976cb77db150441fedfbab2
4
- data.tar.gz: 7e8c66f4228d45f300111ec2f9412728b3cf35e4ac66fd0937b7033499bca1f0
3
+ metadata.gz: 333f7f90125b86bfef6f8f87b70009a2e77cd44e70eb84fc22d9c3a820e69b5b
4
+ data.tar.gz: eead0bf9e502b9df52536d9f34582f2637071d8b4cb1d8902f57f79a95badbc1
5
5
  SHA512:
6
- metadata.gz: 4997f0c54a30b6253f971800dd019f6bcb42f059321813a24c73b0adfd638455fdfdf54d017f9c60da4133584d833415e346bf33bb16fddd9a451f9bdd30b750
7
- data.tar.gz: 3f55d83b463cea9b5e65d50dedaaec91871157f2b7933261085f67e690c4a4968b1b18d236a5f22cf41384203af797cb3c9b2613a241da734a3dd4366f7f611e
6
+ metadata.gz: 533d23c78736a6320243772d38b0a322bb071005f34448903a1f93da7ab5c4ee51f10dd47419a4bd18f192f44b1d90df0d38ce77bd16dbc7e362e02faab6c971
7
+ data.tar.gz: 10a36c58a4b4d74f3d6d63c58e24c4e90664487337d049bfabf36b7ddb40032538d78271faf614d246983e50de0f9502369ee434ed47e11160039e38658548f8
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
@@ -1,14 +1,14 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  # Dependencies required to run this gem.
4
- gem "nokogiri", ">= 1.4.4"
5
- gem "rubyzip", ">= 1.1.6" , :require => 'zip'
4
+ gem "nokogiri", ">= 1.10.8"
5
+ gem "rubyzip", ">= 1.3.0" , :require => 'zip'
6
6
 
7
7
  # Development dependencies.
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,102 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.4.0)
5
- builder (3.2.3)
4
+ addressable (2.8.0)
5
+ public_suffix (>= 2.0.2, < 5.0)
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.3)
9
- docile (1.3.1)
10
- faraday (0.9.2)
9
+ diff-lcs (1.4.4)
10
+ docile (1.4.0)
11
+ faraday (1.6.0)
12
+ faraday-em_http (~> 1.0)
13
+ faraday-em_synchrony (~> 1.0)
14
+ faraday-excon (~> 1.1)
15
+ faraday-httpclient (~> 1.0.1)
16
+ faraday-net_http (~> 1.0)
17
+ faraday-net_http_persistent (~> 1.1)
18
+ faraday-patron (~> 1.0)
19
+ faraday-rack (~> 1.0)
11
20
  multipart-post (>= 1.2, < 3)
12
- git (1.5.0)
13
- github_api (0.16.0)
14
- addressable (~> 2.4.0)
21
+ ruby2_keywords (>= 0.0.4)
22
+ faraday-em_http (1.0.0)
23
+ faraday-em_synchrony (1.0.0)
24
+ faraday-excon (1.1.0)
25
+ faraday-httpclient (1.0.1)
26
+ faraday-net_http (1.0.1)
27
+ faraday-net_http_persistent (1.2.0)
28
+ faraday-patron (1.0.0)
29
+ faraday-rack (1.0.0)
30
+ git (1.9.1)
31
+ rchardet (~> 1.8)
32
+ github_api (0.19.0)
33
+ addressable (~> 2.4)
15
34
  descendants_tracker (~> 0.0.4)
16
- faraday (~> 0.8, < 0.10)
17
- hashie (>= 3.4)
18
- mime-types (>= 1.16, < 3.0)
35
+ faraday (>= 0.8, < 2)
36
+ hashie (~> 3.5, >= 3.5.2)
19
37
  oauth2 (~> 1.0)
20
38
  hashie (3.6.0)
21
- highline (2.0.2)
22
- jeweler (2.3.9)
39
+ highline (2.0.3)
40
+ juwelier (2.4.9)
23
41
  builder
24
42
  bundler
25
- git (>= 1.2.5)
26
- github_api (~> 0.16.0)
27
- highline (>= 1.6.15)
28
- nokogiri (>= 1.5.10)
43
+ git
44
+ github_api
45
+ highline
46
+ kamelcase (~> 0)
47
+ nokogiri
29
48
  psych
30
49
  rake
31
50
  rdoc
32
51
  semver2
33
- json (2.2.0)
34
- jwt (2.2.1)
35
- mime-types (2.99.3)
36
- mini_portile2 (2.4.0)
37
- multi_json (1.13.1)
52
+ jwt (2.2.3)
53
+ kamelcase (0.0.2)
54
+ semver2 (~> 3)
55
+ mini_portile2 (2.6.1)
56
+ multi_json (1.15.0)
38
57
  multi_xml (0.6.0)
39
58
  multipart-post (2.1.1)
40
- nokogiri (1.10.3)
41
- mini_portile2 (~> 2.4.0)
42
- oauth2 (1.4.1)
43
- faraday (>= 0.8, < 0.16.0)
59
+ nokogiri (1.12.1)
60
+ mini_portile2 (~> 2.6.1)
61
+ racc (~> 1.4)
62
+ oauth2 (1.4.7)
63
+ faraday (>= 0.8, < 2.0)
44
64
  jwt (>= 1.0, < 3.0)
45
65
  multi_json (~> 1.3)
46
66
  multi_xml (~> 0.5)
47
67
  rack (>= 1.2, < 3)
48
- psych (3.1.0)
49
- rack (2.0.7)
50
- rake (12.3.2)
51
- rdoc (6.1.1)
52
- rspec (3.8.0)
53
- rspec-core (~> 3.8.0)
54
- rspec-expectations (~> 3.8.0)
55
- rspec-mocks (~> 3.8.0)
56
- rspec-core (3.8.0)
57
- rspec-support (~> 3.8.0)
58
- rspec-expectations (3.8.4)
68
+ psych (4.0.1)
69
+ public_suffix (4.0.6)
70
+ racc (1.5.2)
71
+ rack (2.2.3)
72
+ rake (13.0.6)
73
+ rchardet (1.8.0)
74
+ rdoc (6.3.2)
75
+ rspec (3.10.0)
76
+ rspec-core (~> 3.10.0)
77
+ rspec-expectations (~> 3.10.0)
78
+ rspec-mocks (~> 3.10.0)
79
+ rspec-core (3.10.1)
80
+ rspec-support (~> 3.10.0)
81
+ rspec-expectations (3.10.1)
59
82
  diff-lcs (>= 1.2.0, < 2.0)
60
- rspec-support (~> 3.8.0)
61
- rspec-mocks (3.8.0)
83
+ rspec-support (~> 3.10.0)
84
+ rspec-mocks (3.10.2)
62
85
  diff-lcs (>= 1.2.0, < 2.0)
63
- rspec-support (~> 3.8.0)
64
- rspec-support (3.8.2)
86
+ rspec-support (~> 3.10.0)
87
+ rspec-support (3.10.2)
65
88
  rspec_junit_formatter (0.4.1)
66
89
  rspec-core (>= 2, < 4, != 2.12.0)
67
- ruby-prof (0.18.0)
68
- rubyzip (1.2.3)
90
+ ruby-prof (1.4.3)
91
+ ruby2_keywords (0.0.5)
92
+ rubyzip (2.3.2)
69
93
  semver2 (3.4.2)
70
- simplecov (0.16.1)
94
+ simplecov (0.21.2)
71
95
  docile (~> 1.1)
72
- json (>= 1.8, < 3)
73
- simplecov-html (~> 0.10.0)
74
- simplecov-html (0.10.2)
96
+ simplecov-html (~> 0.11)
97
+ simplecov_json_formatter (~> 0.1)
98
+ simplecov-html (0.12.3)
99
+ simplecov_json_formatter (0.1.3)
75
100
  thread_safe (0.3.6)
76
101
 
77
102
  PLATFORMS
@@ -79,14 +104,14 @@ PLATFORMS
79
104
 
80
105
  DEPENDENCIES
81
106
  bundler
82
- jeweler
83
- nokogiri (>= 1.4.4)
107
+ juwelier
108
+ nokogiri (>= 1.10.8)
84
109
  rake
85
110
  rspec
86
111
  rspec_junit_formatter
87
112
  ruby-prof
88
- rubyzip (>= 1.1.6)
113
+ rubyzip (>= 1.3.0)
89
114
  simplecov
90
115
 
91
116
  BUNDLED WITH
92
- 1.17.3
117
+ 2.2.25
data/LICENSE.txt CHANGED
@@ -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
data/README.rdoc CHANGED
@@ -39,7 +39,7 @@ If you do not care about your RAM usage, just include them all at once by adding
39
39
  ==== Accessing a Worksheet
40
40
  workbook.worksheets[0] # Returns first worksheet
41
41
  workbook[0] # Returns first worksheet
42
- workbook['Sheet1'] # Finds and returns worksheet titled "Sheet1"
42
+ workbook['Sheet1'] # Finds and returns worksheet titled "Sheet1". Note that sheet names in Excel are limited to 31 character.
43
43
 
44
44
  ==== Accessing a Row (Array of Cells)
45
45
  Please note that worksheet is a _sparse_ array of rows. Your code *must* expect that any row it plucks from the array may be <tt>nil</tt>.
@@ -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,6 +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
 
236
+ == Data validation (colloquially referred to as "dropdown list")
237
+
238
+ worksheet.add_validation_list("A1", [ "value1", "value2" ])
239
+
232
240
  == For more information
233
241
  Take a look at the files in spec/lib/ for rspecs on most methods
234
242
 
@@ -244,5 +252,5 @@ Take a look at the files in spec/lib/ for rspecs on most methods
244
252
 
245
253
  == Copyright
246
254
 
247
- Copyright (c) 2011 Vivek Bhagwat, 2013-2016 Wesha.
255
+ Copyright (c) 2011 Vivek Bhagwat, 2013-2021 Wesha.
248
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.5
1
+ 3.4.18
@@ -19,6 +19,16 @@ module RubyXL
19
19
  self.raw_value = data
20
20
  end
21
21
 
22
+ def remove_formula
23
+ self.formula = nil
24
+
25
+ calculation_chain = workbook && workbook.calculation_chain
26
+ calculation_cells = calculation_chain && calculation_chain.cells
27
+ calculation_cells && calculation_cells.reject! { |c|
28
+ c.ref.col_range.c == self.column && c.ref.row_range.begin == self.row
29
+ }
30
+ end
31
+
22
32
  def get_border(direction)
23
33
  validate_worksheet
24
34
  get_cell_border.get_edge_style(direction)
@@ -243,7 +253,7 @@ module RubyXL
243
253
  def add_hyperlink(l)
244
254
  worksheet.hyperlinks ||= RubyXL::Hyperlinks.new
245
255
  worksheet.hyperlinks << RubyXL::Hyperlink.new(:ref => self.r, :location => l)
246
- # define_attribute(:'r:id', :string)
256
+ # define_relationship
247
257
  # define_attribute(:location, :string)
248
258
  # define_attribute(:tooltip, :string)
249
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
@@ -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)
@@ -632,6 +697,18 @@ module RubyXL
632
697
  # TODO: add validation to make sure ranges are not intersecting with existing ones
633
698
  merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(start_row, end_row, start_col, end_col))
634
699
  end
700
+
701
+ def add_validation_list(ref, list_arr)
702
+ # "Any double quote characters in the value should be escaped with another double quote.
703
+ # If the value does not contain a comma, newline or double quote, then the String value should be returned unchanged.
704
+ # If the value contains a comma, newline or double quote, then the String value should be returned enclosed in double quotes."
705
+ expr = '"' + list_arr.collect{|str| str.gsub('"', '""')}.join(',') + '"'
706
+ self.data_validations ||= RubyXL::DataValidations.new
707
+ self.data_validations <<
708
+ RubyXL::DataValidation.new({:sqref => RubyXL::Reference.new(ref),
709
+ :formula1 => RubyXL::Formula.new(:expression => expr),
710
+ :type => 'list'})
711
+ end
635
712
  end
636
713
 
637
714
  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.
@@ -144,7 +149,9 @@ module RubyXL
144
149
  node.element_children.each { |child_node|
145
150
 
146
151
  ns = child_node.namespace
147
- prefix = known_namespaces[ns.href] || ns.prefix
152
+ prefix = if known_namespaces.has_key?(ns.href) then known_namespaces[ns.href]
153
+ else ns.prefix
154
+ end
148
155
 
149
156
  child_node_name = case prefix
150
157
  when '', nil then child_node.name
@@ -270,6 +277,11 @@ module RubyXL
270
277
  if xml.nil? then
271
278
  seed_xml = Nokogiri::XML('<?xml version = "1.0" standalone ="yes"?>')
272
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
+
273
285
  result = self.write_xml(seed_xml)
274
286
  return result if result == ''
275
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
@@ -92,7 +92,13 @@ module RubyXL
92
92
  end
93
93
 
94
94
  def is_date?
95
- return false unless raw_value =~ NUMBER_REGEXP # Only fully numeric values can be dates
95
+ return false unless # Only fully numeric values can be dates
96
+ case raw_value
97
+ when Numeric then true
98
+ when String then raw_value =~ NUMBER_REGEXP
99
+ else false
100
+ end
101
+
96
102
  num_fmt = self.number_format
97
103
  num_fmt && num_fmt.is_date_format?
98
104
  end
@@ -107,7 +113,8 @@ module RubyXL
107
113
  when RubyXL::DataType::INLINE_STRING then is.to_s
108
114
  when RubyXL::DataType::RAW_STRING then raw_value
109
115
  else
110
- 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)
111
118
  elsif r.is_a?(String) && (r =~ NUMBER_REGEXP) then # Numeric
112
119
  if $1 != '' then r.to_f
113
120
  else r.to_i
@@ -119,8 +126,8 @@ module RubyXL
119
126
 
120
127
  def inspect
121
128
  str = "#<#{self.class}(#{row},#{column}): #{raw_value.inspect}"
122
- str += " =#{self.formula.expression}" if self.formula
123
- str += ", datatype=#{self.datatype.inspect}, style_index=#{self.style_index.inspect}>"
129
+ str << " =#{self.formula.expression}" if self.formula
130
+ str << ", datatype=#{self.datatype.inspect}, style_index=#{self.style_index.inspect}>"
124
131
  return str
125
132
  end
126
133
 
@@ -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 => '')