rubyXL 3.3.21 → 3.4.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +60 -0
- data/.codeclimate.yml +3 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +96 -0
- data/LICENSE.txt +1 -1
- data/README.rdoc +47 -16
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/lib/rubyXL.rb +1 -0
- data/lib/rubyXL/cell.rb +1 -26
- data/lib/rubyXL/convenience_methods.rb +5 -982
- data/lib/rubyXL/convenience_methods/cell.rb +272 -0
- data/lib/rubyXL/convenience_methods/color.rb +160 -0
- data/lib/rubyXL/convenience_methods/font.rb +63 -0
- data/lib/rubyXL/convenience_methods/workbook.rb +136 -0
- data/lib/rubyXL/convenience_methods/worksheet.rb +710 -0
- data/lib/rubyXL/objects/border.rb +31 -3
- data/lib/rubyXL/objects/calculation_chain.rb +2 -2
- data/lib/rubyXL/objects/cell_style.rb +8 -8
- data/lib/rubyXL/objects/chartsheet.rb +10 -10
- data/lib/rubyXL/objects/color.rb +6 -4
- data/lib/rubyXL/objects/column_range.rb +10 -10
- data/lib/rubyXL/objects/comments.rb +6 -6
- data/lib/rubyXL/objects/connection.rb +175 -0
- data/lib/rubyXL/objects/container_nodes.rb +2 -2
- data/lib/rubyXL/objects/content_types.rb +2 -2
- data/lib/rubyXL/objects/data_validation.rb +4 -2
- data/lib/rubyXL/objects/document_properties.rb +3 -3
- data/lib/rubyXL/objects/extensions.rb +20 -3
- data/lib/rubyXL/objects/external_links.rb +26 -2
- data/lib/rubyXL/objects/fill.rb +4 -4
- data/lib/rubyXL/objects/filters.rb +12 -12
- data/lib/rubyXL/objects/font.rb +2 -60
- data/lib/rubyXL/objects/formula.rb +1 -1
- data/lib/rubyXL/objects/ooxml_object.rb +15 -3
- data/lib/rubyXL/objects/query_table.rb +104 -0
- data/lib/rubyXL/objects/relationships.rb +8 -3
- data/lib/rubyXL/objects/shared_strings.rb +1 -1
- data/lib/rubyXL/objects/sheet_common.rb +4 -4
- data/lib/rubyXL/objects/sheet_data.rb +48 -11
- data/lib/rubyXL/objects/simple_types.rb +18 -0
- data/lib/rubyXL/objects/storage.rb +25 -1
- data/lib/rubyXL/objects/stylesheet.rb +14 -14
- data/lib/rubyXL/objects/text.rb +8 -8
- data/lib/rubyXL/objects/theme.rb +138 -119
- data/lib/rubyXL/objects/workbook.rb +153 -43
- data/lib/rubyXL/objects/worksheet.rb +118 -107
- data/lib/rubyXL/worksheet.rb +19 -13
- data/rdoc/README_rdoc.html +109 -103
- data/rdoc/RubyXL.html +39 -296
- data/rdoc/RubyXL/AExtension.html +21 -60
- data/rdoc/RubyXL/AExtensionStorageArea.html +12 -17
- data/rdoc/RubyXL/ActiveX.html +154 -0
- data/rdoc/RubyXL/ActiveXBinary.html +106 -0
- data/rdoc/RubyXL/AdjustHandleList.html +13 -19
- data/rdoc/RubyXL/Alignment.html +13 -19
- data/rdoc/RubyXL/AlternateContent.html +12 -17
- data/rdoc/RubyXL/Authors.html +13 -19
- data/rdoc/RubyXL/AutoFilter.html +13 -19
- data/rdoc/RubyXL/AutoFilterColumn.html +13 -19
- data/rdoc/RubyXL/BinaryImageFile.html +12 -25
- data/rdoc/RubyXL/BodyProperties.html +13 -19
- data/rdoc/RubyXL/BooleanNode.html +12 -17
- data/rdoc/RubyXL/BooleanValue.html +12 -17
- data/rdoc/RubyXL/Border.html +76 -53
- data/rdoc/RubyXL/BorderEdge.html +71 -17
- data/rdoc/RubyXL/Borders.html +19 -39
- data/rdoc/RubyXL/Break.html +13 -19
- data/rdoc/RubyXL/BreakList.html +13 -19
- data/rdoc/RubyXL/CT_AdjPoint2D.html +13 -19
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +13 -19
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +13 -19
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +13 -19
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +13 -19
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +13 -19
- data/rdoc/RubyXL/CT_Backdrop.html +13 -19
- data/rdoc/RubyXL/CT_Bevel.html +13 -19
- data/rdoc/RubyXL/CT_BiLevelEffect.html +13 -19
- data/rdoc/RubyXL/CT_BlendEffect.html +13 -19
- data/rdoc/RubyXL/CT_Blip.html +13 -19
- data/rdoc/RubyXL/CT_BlipFillProperties.html +13 -19
- data/rdoc/RubyXL/CT_BlurEffect.html +13 -19
- data/rdoc/RubyXL/CT_Camera.html +13 -19
- data/rdoc/RubyXL/CT_Color.html +13 -19
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +13 -19
- data/rdoc/RubyXL/CT_ColorMapping.html +13 -19
- data/rdoc/RubyXL/CT_ColorScheme.html +13 -19
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +13 -19
- data/rdoc/RubyXL/CT_ConnectionSite.html +13 -19
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +13 -19
- data/rdoc/RubyXL/CT_DashStop.html +13 -19
- data/rdoc/RubyXL/CT_DashStopList.html +13 -19
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +13 -19
- data/rdoc/RubyXL/CT_DuotoneEffect.html +13 -19
- data/rdoc/RubyXL/CT_EffectContainer.html +13 -19
- data/rdoc/RubyXL/CT_EffectList.html +13 -19
- data/rdoc/RubyXL/CT_EffectReference.html +13 -19
- data/rdoc/RubyXL/CT_EffectStyleItem.html +13 -19
- data/rdoc/RubyXL/CT_EffectStyleList.html +13 -19
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +13 -19
- data/rdoc/RubyXL/CT_FillEffect.html +13 -19
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +13 -19
- data/rdoc/RubyXL/CT_FillStyleList.html +13 -19
- data/rdoc/RubyXL/CT_FlatText.html +13 -19
- data/rdoc/RubyXL/CT_FontCollection.html +13 -19
- data/rdoc/RubyXL/CT_FontReference.html +13 -19
- data/rdoc/RubyXL/CT_GeomGuideList.html +13 -19
- data/rdoc/RubyXL/CT_GlowEffect.html +13 -19
- data/rdoc/RubyXL/CT_GradientFillProperties.html +13 -19
- data/rdoc/RubyXL/CT_GradientStop.html +13 -19
- data/rdoc/RubyXL/CT_GradientStopList.html +13 -19
- data/rdoc/RubyXL/CT_HSLEffect.html +13 -19
- data/rdoc/RubyXL/CT_HslColor.html +13 -19
- data/rdoc/RubyXL/CT_Hyperlink.html +13 -19
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +13 -19
- data/rdoc/RubyXL/CT_LightRig.html +13 -19
- data/rdoc/RubyXL/CT_LineEndProperties.html +13 -19
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +13 -19
- data/rdoc/RubyXL/CT_LineProperties.html +13 -19
- data/rdoc/RubyXL/CT_LineStyleList.html +13 -19
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +13 -19
- data/rdoc/RubyXL/CT_LuminanceEffect.html +13 -19
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +13 -19
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +13 -19
- data/rdoc/RubyXL/CT_Path2D.html +13 -19
- data/rdoc/RubyXL/CT_Path2DArcTo.html +13 -19
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +13 -19
- data/rdoc/RubyXL/CT_Path2DList.html +13 -19
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +13 -19
- data/rdoc/RubyXL/CT_Path2DTo.html +13 -19
- data/rdoc/RubyXL/CT_PathShadeProperties.html +13 -19
- data/rdoc/RubyXL/CT_PatternFillProperties.html +13 -19
- data/rdoc/RubyXL/CT_Point3D.html +13 -19
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +13 -19
- data/rdoc/RubyXL/CT_PresetColor.html +13 -19
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +13 -19
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +13 -19
- data/rdoc/RubyXL/CT_PresetTextShape.html +13 -19
- data/rdoc/RubyXL/CT_ReflectionEffect.html +13 -19
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +13 -19
- data/rdoc/RubyXL/CT_RelativeRect.html +13 -19
- data/rdoc/RubyXL/CT_SRgbColor.html +13 -19
- data/rdoc/RubyXL/CT_ScRgbColor.html +13 -19
- data/rdoc/RubyXL/CT_Scene3D.html +13 -19
- data/rdoc/RubyXL/CT_SchemeColor.html +13 -19
- data/rdoc/RubyXL/CT_Shape3D.html +13 -19
- data/rdoc/RubyXL/CT_ShapeStyle.html +13 -19
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +13 -19
- data/rdoc/RubyXL/CT_SphereCoords.html +13 -19
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +13 -19
- data/rdoc/RubyXL/CT_StyleMatrix.html +13 -19
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +13 -19
- data/rdoc/RubyXL/CT_SupplementalFont.html +13 -19
- data/rdoc/RubyXL/CT_SystemColor.html +13 -19
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +13 -19
- data/rdoc/RubyXL/CT_TextBlipBullet.html +13 -19
- data/rdoc/RubyXL/CT_TextCharBullet.html +13 -19
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +13 -19
- data/rdoc/RubyXL/CT_TextFont.html +13 -19
- data/rdoc/RubyXL/CT_TextListStyle.html +13 -19
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +13 -19
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +13 -19
- data/rdoc/RubyXL/CT_TextSpacing.html +13 -19
- data/rdoc/RubyXL/CT_TextTabStop.html +13 -19
- data/rdoc/RubyXL/CT_TextTabStopList.html +13 -19
- data/rdoc/RubyXL/CT_TileInfoProperties.html +13 -19
- data/rdoc/RubyXL/CT_TintEffect.html +13 -19
- data/rdoc/RubyXL/CT_Transform2D.html +13 -19
- data/rdoc/RubyXL/CT_TransformEffect.html +13 -19
- data/rdoc/RubyXL/CT_Vector3D.html +13 -19
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +13 -19
- data/rdoc/RubyXL/CalculationChain.html +17 -45
- data/rdoc/RubyXL/CalculationChainCell.html +13 -19
- data/rdoc/RubyXL/CalculationProperties.html +13 -19
- data/rdoc/RubyXL/Cell.html +144 -204
- data/rdoc/RubyXL/CellConvenienceMethods.html +240 -426
- data/rdoc/RubyXL/CellExt.html +13 -19
- data/rdoc/RubyXL/CellSmartTag.html +13 -19
- data/rdoc/RubyXL/CellSmartTagProperty.html +13 -19
- data/rdoc/RubyXL/CellSmartTags.html +13 -19
- data/rdoc/RubyXL/CellStyle.html +13 -19
- data/rdoc/RubyXL/CellStyleXFs.html +18 -38
- data/rdoc/RubyXL/CellStyles.html +18 -38
- data/rdoc/RubyXL/CellValue.html +18 -38
- data/rdoc/RubyXL/CellWatch.html +13 -19
- data/rdoc/RubyXL/CellWatches.html +13 -19
- data/rdoc/RubyXL/CellXFs.html +19 -39
- data/rdoc/RubyXL/ChartColorsFile.html +12 -25
- data/rdoc/RubyXL/ChartFile.html +19 -49
- data/rdoc/RubyXL/ChartStyleFile.html +12 -25
- data/rdoc/RubyXL/ChartUserShapesFile.html +12 -25
- data/rdoc/RubyXL/Chartsheet.html +19 -67
- data/rdoc/RubyXL/ChartsheetPageSetup.html +13 -19
- data/rdoc/RubyXL/ChartsheetProperties.html +13 -19
- data/rdoc/RubyXL/ChartsheetProtection.html +13 -19
- data/rdoc/RubyXL/ChartsheetView.html +13 -19
- data/rdoc/RubyXL/ChartsheetViews.html +13 -19
- data/rdoc/RubyXL/Color.html +28 -39
- data/rdoc/RubyXL/ColorConvenienceClasses.html +91 -0
- data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +242 -0
- data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +279 -0
- data/rdoc/RubyXL/ColorConvenienceMethods.html +137 -0
- data/rdoc/RubyXL/ColorFilter.html +13 -19
- data/rdoc/RubyXL/ColorScale.html +13 -19
- data/rdoc/RubyXL/ColorSet.html +13 -19
- data/rdoc/RubyXL/Colors.html +13 -19
- data/rdoc/RubyXL/ColumnRange.html +20 -71
- data/rdoc/RubyXL/ColumnRanges.html +20 -79
- data/rdoc/RubyXL/Comment.html +13 -19
- data/rdoc/RubyXL/CommentList.html +13 -19
- data/rdoc/RubyXL/CommentsFile.html +17 -50
- data/rdoc/RubyXL/ConditionalFormatValue.html +13 -19
- data/rdoc/RubyXL/ConditionalFormatting.html +13 -19
- data/rdoc/RubyXL/ConditionalFormattingRule.html +13 -19
- data/rdoc/RubyXL/Connection.html +99 -0
- data/rdoc/RubyXL/ConnectionTable.html +99 -0
- data/rdoc/RubyXL/ConnectionTables.html +99 -0
- data/rdoc/RubyXL/ConnectionTextField.html +99 -0
- data/rdoc/RubyXL/ConnectionTextFields.html +99 -0
- data/rdoc/RubyXL/Connections.html +147 -0
- data/rdoc/RubyXL/ContentTypeDefault.html +12 -17
- data/rdoc/RubyXL/ContentTypeOverride.html +12 -17
- data/rdoc/RubyXL/ContentTypes.html +23 -63
- data/rdoc/RubyXL/ControlPropertiesFile.html +14 -22
- data/rdoc/RubyXL/CorePropertiesFile.html +26 -162
- data/rdoc/RubyXL/CustomColor.html +13 -19
- data/rdoc/RubyXL/CustomColorList.html +13 -19
- data/rdoc/RubyXL/CustomFilter.html +13 -19
- data/rdoc/RubyXL/CustomFilters.html +13 -19
- data/rdoc/RubyXL/CustomGeometry.html +13 -19
- data/rdoc/RubyXL/CustomProperties.html +13 -19
- data/rdoc/RubyXL/CustomPropertiesFile.html +12 -25
- data/rdoc/RubyXL/CustomProperty.html +13 -19
- data/rdoc/RubyXL/CustomPropertyFile.html +108 -0
- data/rdoc/RubyXL/CustomSheetView.html +13 -19
- data/rdoc/RubyXL/CustomSheetViews.html +13 -19
- data/rdoc/RubyXL/CustomWorkbookView.html +13 -19
- data/rdoc/RubyXL/CustomWorkbookViews.html +13 -19
- data/rdoc/RubyXL/CustomXMLFile.html +12 -22
- data/rdoc/RubyXL/DXF.html +13 -19
- data/rdoc/RubyXL/DXFs.html +13 -19
- data/rdoc/RubyXL/DataBar.html +13 -19
- data/rdoc/RubyXL/DataConsolidate.html +13 -19
- data/rdoc/RubyXL/DataConsolidationReference.html +13 -19
- data/rdoc/RubyXL/DataConsolidationReferences.html +13 -19
- data/rdoc/RubyXL/DataType.html +11 -39
- data/rdoc/RubyXL/DataValidation.html +13 -19
- data/rdoc/RubyXL/DataValidations.html +13 -19
- data/rdoc/RubyXL/DateGroupItem.html +13 -19
- data/rdoc/RubyXL/DefinedName.html +13 -19
- data/rdoc/RubyXL/DefinedNameExt.html +13 -19
- data/rdoc/RubyXL/DefinedNames.html +13 -19
- data/rdoc/RubyXL/DefinedNamesExt.html +13 -19
- data/rdoc/RubyXL/DocumentPropertiesFile.html +20 -66
- data/rdoc/RubyXL/DrawingFile.html +19 -49
- data/rdoc/RubyXL/DynamicFilter.html +13 -19
- data/rdoc/RubyXL/EmbeddedControl.html +13 -19
- data/rdoc/RubyXL/EmbeddedControls.html +13 -19
- data/rdoc/RubyXL/Extension.html +13 -19
- data/rdoc/RubyXL/ExtensionStorageArea.html +13 -19
- data/rdoc/RubyXL/Extents.html +13 -19
- data/rdoc/RubyXL/ExternalBook.html +13 -19
- data/rdoc/RubyXL/ExternalLinksFile.html +19 -49
- data/rdoc/RubyXL/ExternalReference.html +13 -19
- data/rdoc/RubyXL/ExternalReferences.html +13 -19
- data/rdoc/RubyXL/ExtraColorSchemeList.html +13 -19
- data/rdoc/RubyXL/FieldItem.html +13 -19
- data/rdoc/RubyXL/FileRecoveryProperties.html +13 -19
- data/rdoc/RubyXL/FileSharing.html +13 -19
- data/rdoc/RubyXL/FileVersion.html +13 -19
- data/rdoc/RubyXL/Fill.html +18 -38
- data/rdoc/RubyXL/Fills.html +18 -38
- data/rdoc/RubyXL/FilterContainer.html +13 -19
- data/rdoc/RubyXL/FloatNode.html +12 -17
- data/rdoc/RubyXL/FloatValue.html +12 -17
- data/rdoc/RubyXL/Font.html +20 -544
- data/rdoc/RubyXL/FontConvenienceMethods.html +414 -0
- data/rdoc/RubyXL/FontScheme.html +13 -19
- data/rdoc/RubyXL/Fonts.html +19 -39
- data/rdoc/RubyXL/Formula.html +13 -19
- data/rdoc/RubyXL/FunctionGroup.html +13 -19
- data/rdoc/RubyXL/FunctionGroups.html +13 -19
- data/rdoc/RubyXL/GenericStorageObject.html +19 -81
- data/rdoc/RubyXL/GradientFill.html +13 -19
- data/rdoc/RubyXL/HeaderFooterSettings.html +13 -19
- data/rdoc/RubyXL/Hyperlink.html +13 -19
- data/rdoc/RubyXL/HyperlinkRelFile.html +12 -22
- data/rdoc/RubyXL/Hyperlinks.html +13 -19
- data/rdoc/RubyXL/IconFilter.html +13 -19
- data/rdoc/RubyXL/IconSet.html +13 -19
- data/rdoc/RubyXL/IgnoredError.html +13 -19
- data/rdoc/RubyXL/IgnoredErrors.html +13 -19
- data/rdoc/RubyXL/IndexedColors.html +13 -19
- data/rdoc/RubyXL/InputCells.html +13 -19
- data/rdoc/RubyXL/IntegerNode.html +12 -17
- data/rdoc/RubyXL/IntegerValue.html +12 -17
- data/rdoc/RubyXL/LegacyCell.html +14 -66
- data/rdoc/RubyXL/LegacyWorksheet.html +40 -100
- data/rdoc/RubyXL/MRUColors.html +13 -19
- data/rdoc/RubyXL/MacrosFile.html +12 -25
- data/rdoc/RubyXL/MergedCell.html +13 -19
- data/rdoc/RubyXL/MergedCells.html +13 -19
- data/rdoc/RubyXL/NumFmt.html +13 -19
- data/rdoc/RubyXL/NumberFormat.html +18 -38
- data/rdoc/RubyXL/NumberFormats.html +18 -44
- data/rdoc/RubyXL/OLEObject.html +13 -19
- data/rdoc/RubyXL/OLEObjectFile.html +12 -25
- data/rdoc/RubyXL/OLEObjects.html +13 -19
- data/rdoc/RubyXL/OLESize.html +13 -19
- data/rdoc/RubyXL/OOXMLContainerObject.html +36 -132
- data/rdoc/RubyXL/OOXMLIgnored.html +163 -0
- data/rdoc/RubyXL/OOXMLObject.html +15 -25
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +88 -179
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +47 -183
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +42 -194
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +37 -133
- data/rdoc/RubyXL/OdbcOleDbProperties.html +99 -0
- data/rdoc/RubyXL/Offset.html +13 -19
- data/rdoc/RubyXL/OlapProperties.html +99 -0
- data/rdoc/RubyXL/OleItem.html +99 -0
- data/rdoc/RubyXL/OleItems.html +99 -0
- data/rdoc/RubyXL/OleLink.html +99 -0
- data/rdoc/RubyXL/OutlineProperties.html +13 -19
- data/rdoc/RubyXL/PageMargins.html +13 -19
- data/rdoc/RubyXL/PageSetup.html +13 -19
- data/rdoc/RubyXL/PageSetupProperties.html +13 -19
- data/rdoc/RubyXL/Pane.html +13 -19
- data/rdoc/RubyXL/Parser.html +20 -53
- data/rdoc/RubyXL/PatternFill.html +13 -19
- data/rdoc/RubyXL/PhoneticProperties.html +13 -19
- data/rdoc/RubyXL/PhoneticRun.html +13 -19
- data/rdoc/RubyXL/PivotArea.html +13 -19
- data/rdoc/RubyXL/PivotCache.html +13 -19
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +14 -30
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +12 -25
- data/rdoc/RubyXL/PivotCaches.html +13 -19
- data/rdoc/RubyXL/PivotReference.html +13 -19
- data/rdoc/RubyXL/PivotReferences.html +13 -19
- data/rdoc/RubyXL/PivotTableFile.html +14 -30
- data/rdoc/RubyXL/PivotTableSelection.html +13 -19
- data/rdoc/RubyXL/PresetGeometry.html +13 -19
- data/rdoc/RubyXL/PrintOptions.html +13 -19
- data/rdoc/RubyXL/PrinterSettingsFile.html +12 -25
- data/rdoc/RubyXL/ProtectedRange.html +13 -19
- data/rdoc/RubyXL/ProtectedRanges.html +13 -19
- data/rdoc/RubyXL/Protection.html +13 -19
- data/rdoc/RubyXL/QueryParameter.html +99 -0
- data/rdoc/RubyXL/QueryParameters.html +99 -0
- data/rdoc/RubyXL/QueryTable.html +155 -0
- data/rdoc/RubyXL/QueryTableDeletedField.html +99 -0
- data/rdoc/RubyXL/QueryTableDeletedFields.html +99 -0
- data/rdoc/RubyXL/QueryTableField.html +99 -0
- data/rdoc/RubyXL/QueryTableFields.html +99 -0
- data/rdoc/RubyXL/QueryTableRefresh.html +99 -0
- data/rdoc/RubyXL/RID.html +12 -17
- data/rdoc/RubyXL/RawOOXML.html +19 -58
- data/rdoc/RubyXL/Reference.html +31 -215
- data/rdoc/RubyXL/Relationship.html +12 -17
- data/rdoc/RubyXL/RelationshipSupport.html +32 -126
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +15 -33
- data/rdoc/RubyXL/RevisionPointer.html +99 -0
- data/rdoc/RubyXL/RichText.html +18 -38
- data/rdoc/RubyXL/RichTextRun.html +17 -37
- data/rdoc/RubyXL/Row.html +53 -152
- data/rdoc/RubyXL/RowExt.html +13 -19
- data/rdoc/RubyXL/RunProperties.html +13 -19
- data/rdoc/RubyXL/Scenario.html +13 -19
- data/rdoc/RubyXL/Scenarios.html +13 -19
- data/rdoc/RubyXL/Selection.html +20 -40
- data/rdoc/RubyXL/ShapeGuide.html +13 -19
- data/rdoc/RubyXL/ShapeTextRectangle.html +13 -19
- data/rdoc/RubyXL/SharedStringsTable.html +31 -140
- data/rdoc/RubyXL/Sheet.html +13 -19
- data/rdoc/RubyXL/SheetCalculationProperties.html +13 -19
- data/rdoc/RubyXL/SheetData.html +20 -53
- data/rdoc/RubyXL/SheetDataExt.html +13 -19
- data/rdoc/RubyXL/SheetDataSet.html +13 -19
- data/rdoc/RubyXL/SheetName.html +13 -19
- data/rdoc/RubyXL/SheetNames.html +13 -19
- data/rdoc/RubyXL/Sheets.html +13 -19
- data/rdoc/RubyXL/SlicerCacheFile.html +12 -25
- data/rdoc/RubyXL/SlicerFile.html +12 -25
- data/rdoc/RubyXL/SmartTagProperties.html +13 -19
- data/rdoc/RubyXL/SmartTagType.html +13 -19
- data/rdoc/RubyXL/SmartTagTypes.html +13 -19
- data/rdoc/RubyXL/SmartTags.html +13 -19
- data/rdoc/RubyXL/SortCondition.html +13 -19
- data/rdoc/RubyXL/SortState.html +13 -19
- data/rdoc/RubyXL/Sqref.html +18 -51
- data/rdoc/RubyXL/Stop.html +13 -19
- data/rdoc/RubyXL/StringNode.html +12 -17
- data/rdoc/RubyXL/StringNodeW3C.html +19 -52
- data/rdoc/RubyXL/StringValue.html +12 -17
- data/rdoc/RubyXL/Stylesheet.html +30 -112
- data/rdoc/RubyXL/TableFile.html +12 -25
- data/rdoc/RubyXL/TableParts.html +12 -17
- data/rdoc/RubyXL/TableStyle.html +13 -19
- data/rdoc/RubyXL/TableStyles.html +13 -19
- data/rdoc/RubyXL/Text.html +19 -63
- data/rdoc/RubyXL/TextImportSettings.html +99 -0
- data/rdoc/RubyXL/Theme.html +58 -63
- data/rdoc/RubyXL/ThemeElements.html +13 -19
- data/rdoc/RubyXL/ThumbnailFile.html +12 -25
- data/rdoc/RubyXL/Top10.html +13 -19
- data/rdoc/RubyXL/VMLDrawingFile.html +15 -32
- data/rdoc/RubyXL/Variant.html +13 -19
- data/rdoc/RubyXL/Vector.html +17 -37
- data/rdoc/RubyXL/VectorValue.html +12 -17
- data/rdoc/RubyXL/VisualProperties.html +13 -19
- data/rdoc/RubyXL/WebPublishObject.html +13 -19
- data/rdoc/RubyXL/WebPublishObjects.html +13 -19
- data/rdoc/RubyXL/WebPublishingItem.html +13 -19
- data/rdoc/RubyXL/WebPublishingItems.html +13 -19
- data/rdoc/RubyXL/WebPublishingProperties.html +13 -19
- data/rdoc/RubyXL/WebQueryProperties.html +99 -0
- data/rdoc/RubyXL/Workbook.html +483 -226
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +149 -857
- data/rdoc/RubyXL/WorkbookProperties.html +13 -19
- data/rdoc/RubyXL/WorkbookProtection.html +13 -19
- data/rdoc/RubyXL/WorkbookRoot.html +23 -109
- data/rdoc/RubyXL/WorkbookView.html +13 -19
- data/rdoc/RubyXL/WorkbookViews.html +13 -19
- data/rdoc/RubyXL/Worksheet.html +70 -122
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +398 -1049
- data/rdoc/RubyXL/WorksheetDimensions.html +13 -19
- data/rdoc/RubyXL/WorksheetFormatProperties.html +12 -17
- data/rdoc/RubyXL/WorksheetProperties.html +13 -19
- data/rdoc/RubyXL/WorksheetProtection.html +13 -19
- data/rdoc/RubyXL/WorksheetView.html +13 -19
- data/rdoc/RubyXL/WorksheetViews.html +13 -19
- data/rdoc/RubyXL/XF.html +13 -19
- data/rdoc/created.rid +45 -38
- data/rdoc/css/fonts.css +6 -6
- data/rdoc/css/rdoc.css +35 -6
- data/rdoc/index.html +43 -363
- data/rdoc/js/darkfish.js +23 -100
- data/rdoc/js/navigation.js +4 -41
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +32 -31
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +7 -6
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +368 -75
- data/rubyXL.gemspec +60 -26
- data/spec/lib/cell_spec.rb +147 -2
- data/spec/lib/color_spec.rb +1 -0
- data/spec/lib/parser_spec.rb +1 -1
- data/spec/lib/rgb_color_spec.rb +16 -0
- data/spec/lib/text_spec.rb +8 -0
- data/spec/lib/workbook_spec.rb +12 -1
- data/spec/lib/worksheet_spec.rb +353 -37
- data/test/test_parse_write.rb +15 -15
- metadata +63 -9
- data/rdoc/js/jquery.js +0 -4
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rubyXL/convenience_methods/color'
|
3
|
+
|
4
|
+
describe RubyXL::RgbColor do
|
5
|
+
describe '.to_s' do
|
6
|
+
it 'should properly translate the color to string' do
|
7
|
+
rgb_color = RubyXL::RgbColor.new
|
8
|
+
|
9
|
+
rgb_color.r = 1
|
10
|
+
rgb_color.g = 2
|
11
|
+
rgb_color.b = 255
|
12
|
+
|
13
|
+
expect(rgb_color.to_s).to eq("0102ff")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/spec/lib/text_spec.rb
CHANGED
@@ -16,6 +16,14 @@ describe RubyXL::Text do
|
|
16
16
|
expect(str).to be
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'should not escape valid XML extended UNICODE characters' do
|
20
|
+
t = RubyXL::Text.new(:value => "\u{10000}\u{10FFFF}")
|
21
|
+
|
22
|
+
xml = t.write_xml[/<t>[^<]+<\/t>/]
|
23
|
+
|
24
|
+
expect(xml).to eq("<t>\u{10000}\u{10FFFF}</t>")
|
25
|
+
end
|
26
|
+
|
19
27
|
end
|
20
28
|
|
21
29
|
end
|
data/spec/lib/workbook_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'rubyXL/convenience_methods/workbook'
|
2
3
|
|
3
4
|
describe RubyXL::Workbook do
|
4
5
|
before do
|
@@ -136,7 +137,7 @@ describe RubyXL::Workbook do
|
|
136
137
|
it "It should not be confused by missing sheet_id" do
|
137
138
|
workbook = RubyXL::Workbook.new
|
138
139
|
workbook[0].sheet_id = 1
|
139
|
-
|
140
|
+
workbook.add_worksheet('Sheet2')
|
140
141
|
workbook.stream
|
141
142
|
end
|
142
143
|
|
@@ -169,6 +170,16 @@ describe RubyXL::Workbook do
|
|
169
170
|
end
|
170
171
|
end
|
171
172
|
|
173
|
+
describe 'defined names' do
|
174
|
+
it 'should add and access defined names properly' do
|
175
|
+
wb = RubyXL::Workbook.new
|
176
|
+
wb.define_new_name('TEST', 'Sheet1!$A$2')
|
172
177
|
|
178
|
+
wb2 = RubyXL::Parser.parse_buffer(wb.stream)
|
179
|
+
expect(wb2.get_defined_name('TEST')).to_not be_nil
|
180
|
+
expect(wb2.get_defined_name('TEST').reference).to eq('Sheet1!$A$2')
|
181
|
+
expect(wb2.get_defined_name('TEST2')).to be_nil
|
182
|
+
end
|
183
|
+
end
|
173
184
|
|
174
185
|
end
|
data/spec/lib/worksheet_spec.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'rubyXL/convenience_methods/worksheet'
|
3
|
+
|
4
|
+
SKIP_ROW_COL = 3
|
2
5
|
|
3
6
|
describe RubyXL::Worksheet do
|
4
|
-
before do
|
7
|
+
before(:each) do
|
5
8
|
@workbook = RubyXL::Workbook.new
|
6
9
|
@worksheet = @workbook.add_worksheet
|
7
10
|
|
8
11
|
(0..10).each do |i|
|
9
12
|
(0..10).each do |j|
|
13
|
+
next if i == SKIP_ROW_COL || j == SKIP_ROW_COL # Skip some rows/cells
|
10
14
|
@worksheet.add_cell(i, j, "#{i}:#{j}", "F#{i}:#{j}")
|
11
15
|
end
|
12
16
|
end
|
@@ -633,14 +637,111 @@ describe RubyXL::Worksheet do
|
|
633
637
|
}.to raise_error(RuntimeError)
|
634
638
|
end
|
635
639
|
|
636
|
-
it 'should properly reindex the cells'
|
640
|
+
it 'should properly reindex the cells' do
|
637
641
|
@worksheet.sheet_data.rows.each_with_index { |row, r|
|
638
|
-
|
639
|
-
expect(
|
640
|
-
|
641
|
-
|
642
|
+
if (SKIP_ROW_COL == r) then
|
643
|
+
expect(row).to be_nil
|
644
|
+
else
|
645
|
+
row.cells.each_with_index { |cell, c|
|
646
|
+
if (SKIP_ROW_COL == c) then
|
647
|
+
expect(cell).to be_nil
|
648
|
+
else
|
649
|
+
expect(cell.row).to eq(r)
|
650
|
+
expect(cell.column).to eq(c)
|
651
|
+
end
|
652
|
+
}
|
653
|
+
end
|
642
654
|
}
|
643
655
|
end
|
656
|
+
|
657
|
+
describe 'merged_cells updating' do
|
658
|
+
context 'merged cells in the row' do
|
659
|
+
# | A1 | B1 | C1 | D1 | E1 |
|
660
|
+
# | A2 | MERGED | E2 |
|
661
|
+
# | A3 | B3 | C3 | D3 | E3 |
|
662
|
+
before do
|
663
|
+
@worksheet.merge_cells(1, 1, 1, 3)
|
664
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
665
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D2"
|
666
|
+
end
|
667
|
+
it 'should delete merged cell' do
|
668
|
+
@worksheet.delete_row(1)
|
669
|
+
expect(@worksheet.merged_cells.size).to eq 0
|
670
|
+
end
|
671
|
+
end
|
672
|
+
context 'merged vertical two cells' do
|
673
|
+
# | A1 | B1 | C1 |
|
674
|
+
# | A2 | MERGED | C2 |
|
675
|
+
# | A3 | | C3 |
|
676
|
+
# | A4 | B4 | C4 |
|
677
|
+
before do
|
678
|
+
@worksheet.merge_cells(1, 1, 2, 1)
|
679
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
680
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:B3"
|
681
|
+
end
|
682
|
+
it 'should delete merged cell' do
|
683
|
+
@worksheet.delete_row(1)
|
684
|
+
expect(@worksheet.merged_cells.size).to eq 0
|
685
|
+
end
|
686
|
+
end
|
687
|
+
context 'merged three or more rows' do
|
688
|
+
# | A1 | B1 | C1 | D1 | E1 |
|
689
|
+
# | A2 | | E2 |
|
690
|
+
# | A3 | MERGED | E3 |
|
691
|
+
# | A4 | | E4 |
|
692
|
+
# | A5 | B5 | C5 | D5 | E5 |
|
693
|
+
before do
|
694
|
+
@worksheet.merge_cells(1, 1, 3, 3)
|
695
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
696
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
|
697
|
+
end
|
698
|
+
# | A2 | | E2 |
|
699
|
+
# | A3 | MERGED | E3 |
|
700
|
+
# | A4 | | E4 |
|
701
|
+
# | A5 | B5 | C5 | D5 | E5 |
|
702
|
+
it 'should updates merged cell when delete above the cell' do
|
703
|
+
@worksheet.delete_row(0)
|
704
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
705
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B1:D3"
|
706
|
+
end
|
707
|
+
# | A1 | B1 | C1 | D1 | E1 |
|
708
|
+
# | A3 | MERGED | E3 |
|
709
|
+
# | A4 | | E4 |
|
710
|
+
# | A5 | B5 | C5 | D5 | E5 |
|
711
|
+
it 'should updates merged cell when delete top of the cell' do
|
712
|
+
@worksheet.delete_row(1)
|
713
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
714
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
|
715
|
+
end
|
716
|
+
# | A1 | B1 | C1 | D1 | E1 |
|
717
|
+
# | A2 | MERGED | E2 |
|
718
|
+
# | A4 | | E4 |
|
719
|
+
# | A5 | B5 | C5 | D5 | E5 |
|
720
|
+
it 'should updates merged cell when delete middle of the cell' do
|
721
|
+
@worksheet.delete_row(2)
|
722
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
723
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
|
724
|
+
end
|
725
|
+
# | A1 | B1 | C1 | D1 | E1 |
|
726
|
+
# | A2 | MERGED | E2 |
|
727
|
+
# | A3 | | E3 |
|
728
|
+
# | A5 | B5 | C5 | D5 | E5 |
|
729
|
+
it 'should updates merged cell when delete bottom of the cell' do
|
730
|
+
@worksheet.delete_row(3)
|
731
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
732
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
|
733
|
+
end
|
734
|
+
# | A1 | B1 | C1 | D1 | E1 |
|
735
|
+
# | A2 | | E2 |
|
736
|
+
# | A3 | MERGED | E3 |
|
737
|
+
# | A4 | | E4 |
|
738
|
+
it 'should not updates merged cell when ldelete below the cell' do
|
739
|
+
@worksheet.delete_row(4)
|
740
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
741
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
|
742
|
+
end
|
743
|
+
end
|
744
|
+
end
|
644
745
|
end
|
645
746
|
|
646
747
|
describe '.insert_row' do
|
@@ -650,8 +751,8 @@ describe RubyXL::Worksheet do
|
|
650
751
|
expect(@worksheet[1][0].value).to eq(@old_cell_value)
|
651
752
|
expect(@worksheet[1][0].formula.expression.to_s).to eq(@old_cell_formula)
|
652
753
|
|
653
|
-
@worksheet.insert_row(
|
654
|
-
expect(@worksheet[
|
754
|
+
@worksheet.insert_row(7)
|
755
|
+
expect(@worksheet[7][0].is_underlined).to be_nil
|
655
756
|
end
|
656
757
|
|
657
758
|
it 'should insert a row skipping nil rows that might exist' do
|
@@ -687,12 +788,62 @@ describe RubyXL::Worksheet do
|
|
687
788
|
|
688
789
|
it 'should properly reindex the cells' do
|
689
790
|
@worksheet.sheet_data.rows.each_with_index { |row, r|
|
690
|
-
|
691
|
-
expect(
|
692
|
-
|
693
|
-
|
791
|
+
if (SKIP_ROW_COL == r) then
|
792
|
+
expect(row).to be_nil
|
793
|
+
else
|
794
|
+
row.cells.each_with_index { |cell, c|
|
795
|
+
if (SKIP_ROW_COL == c) then
|
796
|
+
expect(cell).to be_nil
|
797
|
+
else
|
798
|
+
expect(cell.row).to eq(r)
|
799
|
+
expect(cell.column).to eq(c)
|
800
|
+
end
|
801
|
+
}
|
802
|
+
end
|
694
803
|
}
|
695
804
|
end
|
805
|
+
|
806
|
+
describe 'merged_cells updating' do
|
807
|
+
# | A1 | B1 | C1 | D1 |
|
808
|
+
# | A2 | MERGED | D2 |
|
809
|
+
# | A3 | | D3 |
|
810
|
+
# | A4 | B4 | C4 | D4 |
|
811
|
+
before do
|
812
|
+
@worksheet.merge_cells(1, 1, 2, 2)
|
813
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
814
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
|
815
|
+
end
|
816
|
+
# | A1 | B1 | C1 | D1 |
|
817
|
+
# | | | | |
|
818
|
+
# | A2 | MERGED | D2 |
|
819
|
+
# | A3 | | D3 |
|
820
|
+
# | A4 | B4 | C4 | D4 |
|
821
|
+
it 'should updates merged cell when insert above the cell' do
|
822
|
+
@worksheet.insert_row(1)
|
823
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
824
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B3:C4"
|
825
|
+
end
|
826
|
+
# | A1 | B1 | C1 | D1 |
|
827
|
+
# | A2 | | D2 |
|
828
|
+
# | | MERGED | |
|
829
|
+
# | A3 | | D3 |
|
830
|
+
# | A4 | B4 | C4 | D4 |
|
831
|
+
it 'should updates merged cell when insert into the cell' do
|
832
|
+
@worksheet.insert_row(2)
|
833
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
834
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
|
835
|
+
end
|
836
|
+
# | A1 | B1 | C1 | D1 |
|
837
|
+
# | A2 | MERGED | D2 |
|
838
|
+
# | A3 | | D3 |
|
839
|
+
# | | | | |
|
840
|
+
# | A4 | B4 | C4 | D4 |
|
841
|
+
it 'should not updates merged cell when insert below the cell' do
|
842
|
+
@worksheet.insert_row(3)
|
843
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
844
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
|
845
|
+
end
|
846
|
+
end
|
696
847
|
end
|
697
848
|
|
698
849
|
describe '.delete_column' do
|
@@ -717,8 +868,20 @@ describe RubyXL::Worksheet do
|
|
717
868
|
|
718
869
|
it 'should update cell indices after deleting the column' do
|
719
870
|
@worksheet.delete_column(2)
|
720
|
-
|
721
|
-
|
871
|
+
|
872
|
+
@worksheet.sheet_data.rows.each_with_index { |row, r|
|
873
|
+
if (SKIP_ROW_COL == r) then
|
874
|
+
expect(row).to be_nil
|
875
|
+
else
|
876
|
+
row.cells.each_with_index { |cell, c|
|
877
|
+
if (SKIP_ROW_COL - 1 == c) then
|
878
|
+
expect(cell).to be_nil
|
879
|
+
else
|
880
|
+
expect(cell.row).to eq(r)
|
881
|
+
expect(cell.column).to eq(c)
|
882
|
+
end
|
883
|
+
}
|
884
|
+
end
|
722
885
|
}
|
723
886
|
end
|
724
887
|
|
@@ -730,12 +893,115 @@ describe RubyXL::Worksheet do
|
|
730
893
|
|
731
894
|
it 'should properly reindex the cells' do
|
732
895
|
@worksheet.sheet_data.rows.each_with_index { |row, r|
|
733
|
-
|
734
|
-
expect(
|
735
|
-
|
736
|
-
|
896
|
+
if (SKIP_ROW_COL == r) then
|
897
|
+
expect(row).to be_nil
|
898
|
+
else
|
899
|
+
row.cells.each_with_index { |cell, c|
|
900
|
+
if (SKIP_ROW_COL == c) then
|
901
|
+
expect(cell).to be_nil
|
902
|
+
else
|
903
|
+
expect(cell.row).to eq(r)
|
904
|
+
expect(cell.column).to eq(c)
|
905
|
+
end
|
906
|
+
}
|
907
|
+
end
|
737
908
|
}
|
738
909
|
end
|
910
|
+
|
911
|
+
describe 'merged_cells updating' do
|
912
|
+
context 'merged cells in the column' do
|
913
|
+
# | A1 | B1 | C1 |
|
914
|
+
# | A2 | | C2 |
|
915
|
+
# | A3 | MERGED | C3 |
|
916
|
+
# | A4 | | C4 |
|
917
|
+
# | A5 | B5 | C5 |
|
918
|
+
before do
|
919
|
+
@worksheet.merge_cells(1, 1, 3, 1)
|
920
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
921
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:B4"
|
922
|
+
end
|
923
|
+
it 'should delete merged cell' do
|
924
|
+
@worksheet.delete_column(1)
|
925
|
+
expect(@worksheet.merged_cells.size).to eq 0
|
926
|
+
end
|
927
|
+
end
|
928
|
+
context 'merged horizontal two cells' do
|
929
|
+
# | A1 | B1 | C1 | D1 |
|
930
|
+
# | A2 | MERGED | D2 |
|
931
|
+
# | A3 | B3 | C3 | D3 |
|
932
|
+
before do
|
933
|
+
@worksheet.merge_cells(1, 1, 1, 2)
|
934
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
935
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C2"
|
936
|
+
end
|
937
|
+
it 'should delete merged cell' do
|
938
|
+
@worksheet.delete_column(1)
|
939
|
+
expect(@worksheet.merged_cells.size).to eq 0
|
940
|
+
end
|
941
|
+
end
|
942
|
+
context 'merged three or more columns' do
|
943
|
+
# | A1 | B1 | C1 | D1 | E1 |
|
944
|
+
# | A2 | | E2 |
|
945
|
+
# | A3 | MERGED | E3 |
|
946
|
+
# | A4 | | E4 |
|
947
|
+
# | A5 | B5 | C5 | D5 | E5 |
|
948
|
+
before do
|
949
|
+
@worksheet.merge_cells(1, 1, 3, 3)
|
950
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
951
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
|
952
|
+
end
|
953
|
+
# | B1 | C1 | D1 | E1 |
|
954
|
+
# | | E2 |
|
955
|
+
# | MERGED | E3 |
|
956
|
+
# | | E4 |
|
957
|
+
# | B5 | C5 | D5 | E5 |
|
958
|
+
it 'should updates merged cell when delete before the cell' do
|
959
|
+
@worksheet.delete_column(0)
|
960
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
961
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "A2:C4"
|
962
|
+
end
|
963
|
+
# | A1 | C1 | D1 | E1 |
|
964
|
+
# | A2 | | E2 |
|
965
|
+
# | A3 | MERGED | E3 |
|
966
|
+
# | A4 | | E4 |
|
967
|
+
# | A5 | C5 | D5 | E5 |
|
968
|
+
it 'should updates merged cell when delete left of the cell' do
|
969
|
+
@worksheet.delete_column(1)
|
970
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
971
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
|
972
|
+
end
|
973
|
+
# | A1 | B1 | D1 | E1 |
|
974
|
+
# | A2 | | E2 |
|
975
|
+
# | A3 | MERGED | E3 |
|
976
|
+
# | A4 | | E4 |
|
977
|
+
# | A5 | B5 | D5 | E5 |
|
978
|
+
it 'should updates merged cell when delete center of the cell' do
|
979
|
+
@worksheet.delete_column(2)
|
980
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
981
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
|
982
|
+
end
|
983
|
+
# | A1 | B1 | C1 | E1 |
|
984
|
+
# | A2 | | E2 |
|
985
|
+
# | A3 | MERGED | E3 |
|
986
|
+
# | A4 | | E4 |
|
987
|
+
# | A5 | B5 | C5 | E5 |
|
988
|
+
it 'should updates merged cell when delete right of the cell' do
|
989
|
+
@worksheet.delete_column(3)
|
990
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
991
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
|
992
|
+
end
|
993
|
+
# | A1 | B1 | C1 | D1 |
|
994
|
+
# | A2 | |
|
995
|
+
# | A3 | MERGED |
|
996
|
+
# | A4 | |
|
997
|
+
# | A5 | B5 | C5 | D5 |
|
998
|
+
it 'should not updates merged cell when delete after the cell' do
|
999
|
+
@worksheet.delete_column(4)
|
1000
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
1001
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
|
1002
|
+
end
|
1003
|
+
end
|
1004
|
+
end
|
739
1005
|
end
|
740
1006
|
|
741
1007
|
describe '.insert_column' do
|
@@ -780,12 +1046,59 @@ describe RubyXL::Worksheet do
|
|
780
1046
|
|
781
1047
|
it 'should properly reindex the cells' do
|
782
1048
|
@worksheet.sheet_data.rows.each_with_index { |row, r|
|
783
|
-
|
784
|
-
expect(
|
785
|
-
|
786
|
-
|
1049
|
+
if (SKIP_ROW_COL == r) then
|
1050
|
+
expect(row).to be_nil
|
1051
|
+
else
|
1052
|
+
row.cells.each_with_index { |cell, c|
|
1053
|
+
if (SKIP_ROW_COL == c) then
|
1054
|
+
expect(cell).to be_nil
|
1055
|
+
else
|
1056
|
+
expect(cell.row).to eq(r)
|
1057
|
+
expect(cell.column).to eq(c)
|
1058
|
+
end
|
1059
|
+
}
|
1060
|
+
end
|
787
1061
|
}
|
788
1062
|
end
|
1063
|
+
|
1064
|
+
describe 'merged_cells updating' do
|
1065
|
+
# | A1 | B1 | C1 | D1 |
|
1066
|
+
# | A2 | MERGED | D2 |
|
1067
|
+
# | A3 | | D3 |
|
1068
|
+
# | A4 | B4 | C4 | D4 |
|
1069
|
+
before do
|
1070
|
+
@worksheet.merge_cells(1, 1, 2, 2)
|
1071
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
1072
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
|
1073
|
+
end
|
1074
|
+
# | A1 | | B1 | C1 | D1 |
|
1075
|
+
# | A2 | | MERGED | D2 |
|
1076
|
+
# | A3 | | | D3 |
|
1077
|
+
# | A4 | | B4 | C4 | D4 |
|
1078
|
+
it 'should updates merged cell when insert before the cell' do
|
1079
|
+
@worksheet.insert_column(1)
|
1080
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
1081
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "C2:D3"
|
1082
|
+
end
|
1083
|
+
# | A1 | B1 | | C1 | D1 |
|
1084
|
+
# | A2 | MERGED | D2 |
|
1085
|
+
# | A3 | | D3 |
|
1086
|
+
# | A4 | B4 | | C4 | D4 |
|
1087
|
+
it 'should updates merged cell when insert into the cell' do
|
1088
|
+
@worksheet.insert_column(2)
|
1089
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
1090
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
|
1091
|
+
end
|
1092
|
+
# | A1 | B1 | C1 | | D1 |
|
1093
|
+
# | A2 | MERGED | | D2 |
|
1094
|
+
# | A3 | | | D3 |
|
1095
|
+
# | A4 | B4 | C4 | | D4 |
|
1096
|
+
it 'should not updates merged cell when insert after the cell' do
|
1097
|
+
@worksheet.insert_column(3)
|
1098
|
+
expect(@worksheet.merged_cells.size).to eq 1
|
1099
|
+
expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
|
1100
|
+
end
|
1101
|
+
end
|
789
1102
|
end
|
790
1103
|
|
791
1104
|
describe '.insert_cell' do
|
@@ -805,8 +1118,19 @@ describe RubyXL::Worksheet do
|
|
805
1118
|
|
806
1119
|
it 'should update cell indices after inserting the cell' do
|
807
1120
|
@worksheet.insert_cell(0, 0, 'test', nil, :right)
|
808
|
-
@worksheet
|
809
|
-
|
1121
|
+
@worksheet.sheet_data.rows.each_with_index { |row, r|
|
1122
|
+
if (SKIP_ROW_COL == r) then
|
1123
|
+
expect(row).to be_nil
|
1124
|
+
else
|
1125
|
+
row.cells.each_with_index { |cell, c|
|
1126
|
+
if ((r == 0) && (SKIP_ROW_COL + 1 == c)) || ((r != 0) && (SKIP_ROW_COL == c)) then
|
1127
|
+
expect(cell).to be_nil
|
1128
|
+
else
|
1129
|
+
expect(cell.row).to eq(r)
|
1130
|
+
expect(cell.column).to eq(c)
|
1131
|
+
end
|
1132
|
+
}
|
1133
|
+
end
|
810
1134
|
}
|
811
1135
|
end
|
812
1136
|
|
@@ -855,7 +1179,11 @@ describe RubyXL::Worksheet do
|
|
855
1179
|
it 'should update cell indices after deleting the cell' do
|
856
1180
|
@worksheet.delete_cell(4, 0, :left)
|
857
1181
|
@worksheet[0].cells.each_with_index { |cell, i|
|
858
|
-
|
1182
|
+
if SKIP_ROW_COL == i then
|
1183
|
+
expect(cell).to be_nil
|
1184
|
+
else
|
1185
|
+
expect(cell.column).to eq(i)
|
1186
|
+
end
|
859
1187
|
}
|
860
1188
|
end
|
861
1189
|
|
@@ -985,12 +1313,6 @@ describe RubyXL::Worksheet do
|
|
985
1313
|
end
|
986
1314
|
|
987
1315
|
describe '.get_row_alignment' do
|
988
|
-
it 'should cause error if a negative argument is passed in' do
|
989
|
-
expect {
|
990
|
-
@worksheet.get_row_alignment(-1, true)
|
991
|
-
}.to raise_error(RuntimeError)
|
992
|
-
end
|
993
|
-
|
994
1316
|
it 'should return nil if no horizontal alignment specified for row' do
|
995
1317
|
expect(@worksheet.get_row_alignment(0, true)).to be_nil
|
996
1318
|
end
|
@@ -1028,12 +1350,6 @@ describe RubyXL::Worksheet do
|
|
1028
1350
|
expect(@worksheet.get_row_border(0, :top)).to eq('thin')
|
1029
1351
|
end
|
1030
1352
|
|
1031
|
-
it 'should cause error if a negative argument is passed in' do
|
1032
|
-
expect {
|
1033
|
-
@worksheet.get_row_border(-1, :top)
|
1034
|
-
}.to raise_error(RuntimeError)
|
1035
|
-
end
|
1036
|
-
|
1037
1353
|
it 'should return nil if a row which does not exist is passed in' do
|
1038
1354
|
expect(@worksheet.get_row_border(11, :top)).to be_nil
|
1039
1355
|
end
|