rubyXL 3.1.0 → 3.1.2
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.
- data/Gemfile +1 -1
- data/README.rdoc +3 -3
- data/VERSION +1 -1
- data/lib/rubyXL.rb +1 -17
- data/lib/rubyXL/cell.rb +22 -3
- data/lib/rubyXL/objects/content_types.rb +2 -3
- data/lib/rubyXL/objects/document_properties.rb +1 -0
- data/lib/rubyXL/objects/ooxml_object.rb +2 -30
- data/lib/rubyXL/objects/relationships.rb +42 -10
- data/lib/rubyXL/objects/root.rb +10 -18
- data/lib/rubyXL/objects/sheet_data.rb +1 -0
- data/lib/rubyXL/objects/storage.rb +1 -4
- data/lib/rubyXL/objects/text.rb +1 -0
- data/lib/rubyXL/objects/workbook.rb +8 -0
- data/lib/rubyXL/objects/worksheet.rb +2 -0
- data/lib/rubyXL/worksheet.rb +49 -88
- data/rdoc/README_rdoc.html +28 -28
- data/rdoc/RubyXL.html +1 -1
- data/rdoc/RubyXL/AExtension.html +1 -1
- data/rdoc/RubyXL/AExtensionStorageArea.html +1 -1
- data/rdoc/RubyXL/AdjustHandleList.html +1 -1
- data/rdoc/RubyXL/Alignment.html +1 -1
- data/rdoc/RubyXL/AlternateContent.html +1 -1
- data/rdoc/RubyXL/Authors.html +1 -1
- data/rdoc/RubyXL/AutoFilter.html +1 -1
- data/rdoc/RubyXL/AutoFilterColumn.html +1 -1
- data/rdoc/RubyXL/BinaryImageFile.html +1 -1
- data/rdoc/RubyXL/BodyProperties.html +1 -1
- data/rdoc/RubyXL/BooleanNode.html +1 -1
- data/rdoc/RubyXL/BooleanValue.html +1 -1
- data/rdoc/RubyXL/Border.html +1 -1
- data/rdoc/RubyXL/BorderEdge.html +1 -1
- data/rdoc/RubyXL/Borders.html +1 -1
- data/rdoc/RubyXL/Break.html +1 -1
- data/rdoc/RubyXL/BreakList.html +1 -1
- data/rdoc/RubyXL/CT_AdjPoint2D.html +1 -1
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +1 -1
- data/rdoc/RubyXL/CT_Backdrop.html +1 -1
- data/rdoc/RubyXL/CT_Bevel.html +1 -1
- data/rdoc/RubyXL/CT_BiLevelEffect.html +1 -1
- data/rdoc/RubyXL/CT_BlendEffect.html +1 -1
- data/rdoc/RubyXL/CT_Blip.html +1 -1
- data/rdoc/RubyXL/CT_BlipFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_BlurEffect.html +1 -1
- data/rdoc/RubyXL/CT_Camera.html +1 -1
- data/rdoc/RubyXL/CT_Color.html +1 -1
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +1 -1
- data/rdoc/RubyXL/CT_ColorMapping.html +1 -1
- data/rdoc/RubyXL/CT_ColorScheme.html +1 -1
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +1 -1
- data/rdoc/RubyXL/CT_ConnectionSite.html +1 -1
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +1 -1
- data/rdoc/RubyXL/CT_DashStop.html +1 -1
- data/rdoc/RubyXL/CT_DashStopList.html +1 -1
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +1 -1
- data/rdoc/RubyXL/CT_DuotoneEffect.html +1 -1
- data/rdoc/RubyXL/CT_EffectContainer.html +1 -1
- data/rdoc/RubyXL/CT_EffectList.html +1 -1
- data/rdoc/RubyXL/CT_EffectReference.html +1 -1
- data/rdoc/RubyXL/CT_EffectStyleItem.html +1 -1
- data/rdoc/RubyXL/CT_EffectStyleList.html +1 -1
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +1 -1
- data/rdoc/RubyXL/CT_FillEffect.html +1 -1
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +1 -1
- data/rdoc/RubyXL/CT_FillStyleList.html +1 -1
- data/rdoc/RubyXL/CT_FlatText.html +1 -1
- data/rdoc/RubyXL/CT_FontCollection.html +1 -1
- data/rdoc/RubyXL/CT_FontReference.html +1 -1
- data/rdoc/RubyXL/CT_GeomGuideList.html +1 -1
- data/rdoc/RubyXL/CT_GlowEffect.html +1 -1
- data/rdoc/RubyXL/CT_GradientFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_GradientStop.html +1 -1
- data/rdoc/RubyXL/CT_GradientStopList.html +1 -1
- data/rdoc/RubyXL/CT_HSLEffect.html +1 -1
- data/rdoc/RubyXL/CT_HslColor.html +1 -1
- data/rdoc/RubyXL/CT_Hyperlink.html +1 -1
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_LightRig.html +1 -1
- data/rdoc/RubyXL/CT_LineEndProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineStyleList.html +1 -1
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +1 -1
- data/rdoc/RubyXL/CT_LuminanceEffect.html +1 -1
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +1 -1
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_Path2D.html +1 -1
- data/rdoc/RubyXL/CT_Path2DArcTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DList.html +1 -1
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DTo.html +1 -1
- data/rdoc/RubyXL/CT_PathShadeProperties.html +1 -1
- data/rdoc/RubyXL/CT_PatternFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_Point3D.html +1 -1
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +1 -1
- data/rdoc/RubyXL/CT_PresetColor.html +1 -1
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +1 -1
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_PresetTextShape.html +1 -1
- data/rdoc/RubyXL/CT_ReflectionEffect.html +1 -1
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +1 -1
- data/rdoc/RubyXL/CT_RelativeRect.html +1 -1
- data/rdoc/RubyXL/CT_SRgbColor.html +1 -1
- data/rdoc/RubyXL/CT_ScRgbColor.html +1 -1
- data/rdoc/RubyXL/CT_Scene3D.html +1 -1
- data/rdoc/RubyXL/CT_SchemeColor.html +1 -1
- data/rdoc/RubyXL/CT_Shape3D.html +1 -1
- data/rdoc/RubyXL/CT_ShapeStyle.html +1 -1
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +1 -1
- data/rdoc/RubyXL/CT_SphereCoords.html +1 -1
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +1 -1
- data/rdoc/RubyXL/CT_StyleMatrix.html +1 -1
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +1 -1
- data/rdoc/RubyXL/CT_SupplementalFont.html +1 -1
- data/rdoc/RubyXL/CT_SystemColor.html +1 -1
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextBlipBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextCharBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +1 -1
- data/rdoc/RubyXL/CT_TextFont.html +1 -1
- data/rdoc/RubyXL/CT_TextListStyle.html +1 -1
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +1 -1
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +1 -1
- data/rdoc/RubyXL/CT_TextSpacing.html +1 -1
- data/rdoc/RubyXL/CT_TextTabStop.html +1 -1
- data/rdoc/RubyXL/CT_TextTabStopList.html +1 -1
- data/rdoc/RubyXL/CT_TileInfoProperties.html +1 -1
- data/rdoc/RubyXL/CT_TintEffect.html +1 -1
- data/rdoc/RubyXL/CT_Transform2D.html +1 -1
- data/rdoc/RubyXL/CT_TransformEffect.html +1 -1
- data/rdoc/RubyXL/CT_Vector3D.html +1 -1
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +1 -1
- data/rdoc/RubyXL/CalculationChain.html +2 -2
- data/rdoc/RubyXL/CalculationChainCell.html +1 -1
- data/rdoc/RubyXL/CalculationProperties.html +1 -1
- data/rdoc/RubyXL/Cell.html +11 -11
- data/rdoc/RubyXL/CellSmartTag.html +1 -1
- data/rdoc/RubyXL/CellSmartTagProperty.html +1 -1
- data/rdoc/RubyXL/CellSmartTags.html +1 -1
- data/rdoc/RubyXL/CellStyle.html +1 -1
- data/rdoc/RubyXL/CellStyleXFs.html +1 -1
- data/rdoc/RubyXL/CellStyles.html +1 -1
- data/rdoc/RubyXL/CellValue.html +3 -3
- data/rdoc/RubyXL/CellWatch.html +1 -1
- data/rdoc/RubyXL/CellWatches.html +1 -1
- data/rdoc/RubyXL/CellXFs.html +1 -1
- data/rdoc/RubyXL/ChartColorsFile.html +1 -1
- data/rdoc/RubyXL/ChartFile.html +1 -1
- data/rdoc/RubyXL/ChartRelationshipsFile.html +1 -1
- data/rdoc/RubyXL/ChartStyleFile.html +1 -1
- data/rdoc/RubyXL/ChartUserShapesFile.html +1 -1
- data/rdoc/RubyXL/Chartsheet.html +1 -1
- data/rdoc/RubyXL/ChartsheetPageSetup.html +1 -1
- data/rdoc/RubyXL/ChartsheetProperties.html +1 -1
- data/rdoc/RubyXL/ChartsheetProtection.html +1 -1
- data/rdoc/RubyXL/ChartsheetView.html +1 -1
- data/rdoc/RubyXL/ChartsheetViews.html +1 -1
- data/rdoc/RubyXL/Color.html +3 -3
- data/rdoc/RubyXL/ColorFilter.html +1 -1
- data/rdoc/RubyXL/ColorScale.html +1 -1
- data/rdoc/RubyXL/ColorSet.html +1 -1
- data/rdoc/RubyXL/Colors.html +1 -1
- data/rdoc/RubyXL/ColumnRange.html +1 -1
- data/rdoc/RubyXL/ColumnRanges.html +1 -1
- data/rdoc/RubyXL/Comment.html +1 -1
- data/rdoc/RubyXL/CommentList.html +1 -1
- data/rdoc/RubyXL/CommentsFile.html +1 -1
- data/rdoc/RubyXL/ConditionalFormatValue.html +1 -1
- data/rdoc/RubyXL/ConditionalFormatting.html +1 -1
- data/rdoc/RubyXL/ConditionalFormattingRule.html +1 -1
- data/rdoc/RubyXL/ContentTypeDefault.html +1 -1
- data/rdoc/RubyXL/ContentTypeOverride.html +1 -1
- data/rdoc/RubyXL/ContentTypes.html +30 -51
- data/rdoc/RubyXL/ControlPropertiesFile.html +1 -1
- data/rdoc/RubyXL/CorePropertiesFile.html +1 -1
- data/rdoc/RubyXL/CustomColor.html +1 -1
- data/rdoc/RubyXL/CustomColorList.html +1 -1
- data/rdoc/RubyXL/CustomFilter.html +1 -1
- data/rdoc/RubyXL/CustomFilters.html +1 -1
- data/rdoc/RubyXL/CustomGeometry.html +1 -1
- data/rdoc/RubyXL/CustomProperties.html +1 -1
- data/rdoc/RubyXL/CustomPropertiesFile.html +1 -1
- data/rdoc/RubyXL/CustomProperty.html +1 -1
- data/rdoc/RubyXL/CustomSheetView.html +1 -1
- data/rdoc/RubyXL/CustomSheetViews.html +1 -1
- data/rdoc/RubyXL/CustomWorkbookView.html +1 -1
- data/rdoc/RubyXL/CustomWorkbookViews.html +1 -1
- data/rdoc/RubyXL/CustomXMLFile.html +1 -1
- data/rdoc/RubyXL/DXF.html +1 -1
- data/rdoc/RubyXL/DXFs.html +1 -1
- data/rdoc/RubyXL/DataBar.html +1 -1
- data/rdoc/RubyXL/DataConsolidate.html +1 -1
- data/rdoc/RubyXL/DataConsolidationReference.html +1 -1
- data/rdoc/RubyXL/DataConsolidationReferences.html +1 -1
- data/rdoc/RubyXL/DataType.html +1 -1
- data/rdoc/RubyXL/DataValidation.html +1 -1
- data/rdoc/RubyXL/DataValidations.html +1 -1
- data/rdoc/RubyXL/DateGroupItem.html +1 -1
- data/rdoc/RubyXL/DefinedName.html +1 -1
- data/rdoc/RubyXL/DefinedNames.html +1 -1
- data/rdoc/RubyXL/DocumentPropertiesFile.html +9 -9
- data/rdoc/RubyXL/DrawingFile.html +2 -2
- data/rdoc/RubyXL/DrawingRelationshipsFile.html +1 -1
- data/rdoc/RubyXL/DynamicFilter.html +1 -1
- data/rdoc/RubyXL/EmbeddedControl.html +1 -1
- data/rdoc/RubyXL/EmbeddedControls.html +1 -1
- data/rdoc/RubyXL/Extension.html +1 -1
- data/rdoc/RubyXL/ExtensionStorageArea.html +1 -1
- data/rdoc/RubyXL/Extents.html +1 -1
- data/rdoc/RubyXL/ExternalLinksFile.html +1 -1
- data/rdoc/RubyXL/ExternalReference.html +1 -1
- data/rdoc/RubyXL/ExternalReferences.html +1 -1
- data/rdoc/RubyXL/ExtraColorSchemeList.html +1 -1
- data/rdoc/RubyXL/FieldItem.html +1 -1
- data/rdoc/RubyXL/FileRecoveryProperties.html +1 -1
- data/rdoc/RubyXL/FileSharing.html +1 -1
- data/rdoc/RubyXL/FileVersion.html +1 -1
- data/rdoc/RubyXL/Fill.html +1 -1
- data/rdoc/RubyXL/Fills.html +1 -1
- data/rdoc/RubyXL/FilterContainer.html +1 -1
- data/rdoc/RubyXL/FloatNode.html +1 -1
- data/rdoc/RubyXL/FloatValue.html +1 -1
- data/rdoc/RubyXL/Font.html +3 -3
- data/rdoc/RubyXL/FontScheme.html +1 -1
- data/rdoc/RubyXL/Fonts.html +1 -1
- data/rdoc/RubyXL/Formula.html +1 -1
- data/rdoc/RubyXL/FunctionGroup.html +1 -1
- data/rdoc/RubyXL/FunctionGroups.html +1 -1
- data/rdoc/RubyXL/GenericStorageObject.html +20 -41
- data/rdoc/RubyXL/GradientFill.html +1 -1
- data/rdoc/RubyXL/HeaderFooterSettings.html +1 -1
- data/rdoc/RubyXL/Hyperlink.html +1 -1
- data/rdoc/RubyXL/HyperlinkRelFile.html +1 -1
- data/rdoc/RubyXL/Hyperlinks.html +1 -1
- data/rdoc/RubyXL/IconFilter.html +1 -1
- data/rdoc/RubyXL/IconSet.html +1 -1
- data/rdoc/RubyXL/IgnoredError.html +1 -1
- data/rdoc/RubyXL/IgnoredErrors.html +1 -1
- data/rdoc/RubyXL/IndexedColors.html +1 -1
- data/rdoc/RubyXL/InputCells.html +1 -1
- data/rdoc/RubyXL/IntegerNode.html +1 -1
- data/rdoc/RubyXL/IntegerValue.html +1 -1
- data/rdoc/RubyXL/LegacyCell.html +96 -46
- data/rdoc/RubyXL/LegacyWorkbook.html +7 -7
- data/rdoc/RubyXL/LegacyWorksheet.html +198 -110
- data/rdoc/RubyXL/MRUColors.html +1 -1
- data/rdoc/RubyXL/MacrosFile.html +1 -1
- data/rdoc/RubyXL/MergedCell.html +1 -1
- data/rdoc/RubyXL/MergedCells.html +1 -1
- data/rdoc/RubyXL/NumFmt.html +1 -1
- data/rdoc/RubyXL/NumberFormat.html +2 -2
- data/rdoc/RubyXL/NumberFormats.html +1 -1
- data/rdoc/RubyXL/OLEObject.html +1 -1
- data/rdoc/RubyXL/OLEObjects.html +1 -1
- data/rdoc/RubyXL/OLESize.html +1 -1
- data/rdoc/RubyXL/OOXMLContainerObject.html +1 -1
- data/rdoc/RubyXL/OOXMLObject.html +1 -1
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +13 -13
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +1 -1
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +29 -50
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +1 -1
- data/rdoc/RubyXL/Offset.html +1 -1
- data/rdoc/RubyXL/OutlineProperties.html +1 -1
- data/rdoc/RubyXL/PageMargins.html +1 -1
- data/rdoc/RubyXL/PageSetup.html +1 -1
- data/rdoc/RubyXL/PageSetupProperties.html +1 -1
- data/rdoc/RubyXL/Pane.html +1 -1
- data/rdoc/RubyXL/Parser.html +1 -1
- data/rdoc/RubyXL/PatternFill.html +1 -1
- data/rdoc/RubyXL/PhoneticProperties.html +1 -1
- data/rdoc/RubyXL/PhoneticRun.html +1 -1
- data/rdoc/RubyXL/PivotArea.html +1 -1
- data/rdoc/RubyXL/PivotCache.html +1 -1
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +1 -1
- data/rdoc/RubyXL/PivotCaches.html +1 -1
- data/rdoc/RubyXL/PivotReference.html +1 -1
- data/rdoc/RubyXL/PivotReferences.html +1 -1
- data/rdoc/RubyXL/PivotTableFile.html +1 -1
- data/rdoc/RubyXL/PivotTableSelection.html +1 -1
- data/rdoc/RubyXL/PresetGeometry.html +1 -1
- data/rdoc/RubyXL/PrintOptions.html +1 -1
- data/rdoc/RubyXL/PrinterSettingsFile.html +1 -1
- data/rdoc/RubyXL/ProtectedRange.html +1 -1
- data/rdoc/RubyXL/ProtectedRanges.html +1 -1
- data/rdoc/RubyXL/Protection.html +1 -1
- data/rdoc/RubyXL/REL_CLASS.html +1 -1
- data/rdoc/RubyXL/RID.html +1 -1
- data/rdoc/RubyXL/RawOOXML.html +1 -1
- data/rdoc/RubyXL/Reference.html +5 -5
- data/rdoc/RubyXL/Relationship.html +1 -1
- data/rdoc/RubyXL/RelationshipSupport.html +1 -1
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +98 -0
- data/rdoc/RubyXL/RichText.html +1 -1
- data/rdoc/RubyXL/RichTextRun.html +1 -1
- data/rdoc/RubyXL/RootRelationships.html +1 -1
- data/rdoc/RubyXL/Row.html +1 -1
- data/rdoc/RubyXL/RunProperties.html +1 -1
- data/rdoc/RubyXL/Scenario.html +1 -1
- data/rdoc/RubyXL/Scenarios.html +1 -1
- data/rdoc/RubyXL/Selection.html +1 -1
- data/rdoc/RubyXL/ShapeGuide.html +1 -1
- data/rdoc/RubyXL/ShapeTextRectangle.html +1 -1
- data/rdoc/RubyXL/SharedStringsTable.html +2 -2
- data/rdoc/RubyXL/Sheet.html +1 -1
- data/rdoc/RubyXL/SheetCalculationProperties.html +1 -1
- data/rdoc/RubyXL/SheetData.html +1 -1
- data/rdoc/RubyXL/SheetRelationshipsFile.html +1 -1
- data/rdoc/RubyXL/Sheets.html +1 -1
- data/rdoc/RubyXL/SlicerCacheFile.html +1 -1
- data/rdoc/RubyXL/SlicerFile.html +1 -1
- data/rdoc/RubyXL/SmartTagProperties.html +1 -1
- data/rdoc/RubyXL/SmartTagType.html +1 -1
- data/rdoc/RubyXL/SmartTagTypes.html +1 -1
- data/rdoc/RubyXL/SmartTags.html +1 -1
- data/rdoc/RubyXL/SortCondition.html +1 -1
- data/rdoc/RubyXL/SortState.html +1 -1
- data/rdoc/RubyXL/Sqref.html +2 -2
- data/rdoc/RubyXL/Stop.html +1 -1
- data/rdoc/RubyXL/StringNode.html +1 -1
- data/rdoc/RubyXL/StringNodeW3C.html +1 -1
- data/rdoc/RubyXL/StringValue.html +1 -1
- data/rdoc/RubyXL/Stylesheet.html +1 -1
- data/rdoc/RubyXL/TableFile.html +1 -1
- data/rdoc/RubyXL/TableParts.html +1 -1
- data/rdoc/RubyXL/TableStyle.html +1 -1
- data/rdoc/RubyXL/TableStyles.html +1 -1
- data/rdoc/RubyXL/Text.html +4 -4
- data/rdoc/RubyXL/Theme.html +1 -1
- data/rdoc/RubyXL/ThemeElements.html +1 -1
- data/rdoc/RubyXL/ThumbnailFile.html +1 -1
- data/rdoc/RubyXL/Top10.html +1 -1
- data/rdoc/RubyXL/VMLDrawingFile.html +1 -1
- data/rdoc/RubyXL/Variant.html +1 -1
- data/rdoc/RubyXL/Vector.html +1 -1
- data/rdoc/RubyXL/VectorValue.html +1 -1
- data/rdoc/RubyXL/VisualProperties.html +1 -1
- data/rdoc/RubyXL/WebPublishObject.html +1 -1
- data/rdoc/RubyXL/WebPublishObjects.html +1 -1
- data/rdoc/RubyXL/WebPublishingItem.html +1 -1
- data/rdoc/RubyXL/WebPublishingItems.html +1 -1
- data/rdoc/RubyXL/WebPublishingProperties.html +1 -1
- data/rdoc/RubyXL/Workbook.html +1 -1
- data/rdoc/RubyXL/WorkbookProperties.html +1 -1
- data/rdoc/RubyXL/WorkbookProtection.html +1 -1
- data/rdoc/RubyXL/WorkbookRelationships.html +1 -1
- data/rdoc/RubyXL/WorkbookRoot.html +6 -52
- data/rdoc/RubyXL/WorkbookView.html +1 -1
- data/rdoc/RubyXL/WorkbookViews.html +1 -1
- data/rdoc/RubyXL/Worksheet.html +1 -1
- data/rdoc/RubyXL/WorksheetDimensions.html +1 -1
- data/rdoc/RubyXL/WorksheetFormatProperties.html +1 -1
- data/rdoc/RubyXL/WorksheetProperties.html +1 -1
- data/rdoc/RubyXL/WorksheetProtection.html +1 -1
- data/rdoc/RubyXL/WorksheetView.html +1 -1
- data/rdoc/RubyXL/WorksheetViews.html +1 -1
- data/rdoc/RubyXL/XF.html +1 -1
- data/rdoc/created.rid +37 -37
- data/rdoc/index.html +2 -2
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/table_of_contents.html +57 -62
- data/rubyXL.gemspec +9 -9
- data/spec/lib/cell_spec.rb +15 -23
- data/spec/lib/worksheet_spec.rb +40 -164
- metadata +82 -93
- checksums.yaml +0 -7
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
|
@@ -114,9 +114,9 @@ Please note: these methods are being phased out in favor of the OOXML object mod
|
|
|
114
114
|
==== Changing Borders
|
|
115
115
|
# Possible weights: hairline, thin, medium, thick
|
|
116
116
|
# Possible "directions": top, bottom, left, right, diagonal
|
|
117
|
-
worksheet.sheet_data[0][0].
|
|
118
|
-
worksheet.
|
|
119
|
-
worksheet.
|
|
117
|
+
worksheet.sheet_data[0][0].change_border(:top, 'thin') # Sets A1 to have a top, thin border
|
|
118
|
+
worksheet.change_row_border(0, :left, 'hairline') # Sets first row to have a left, hairline border
|
|
119
|
+
worksheet.change_column_border(0, :diagonal, 'medium') # Sets first column to have diagonal, medium border
|
|
120
120
|
|
|
121
121
|
==== Changing Alignment
|
|
122
122
|
===== Horizontal
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.1.
|
|
1
|
+
3.1.2
|
data/lib/rubyXL.rb
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
require 'rubyXL/objects/relationships'
|
|
2
|
-
require 'rubyXL/workbook'
|
|
3
|
-
require 'rubyXL/worksheet'
|
|
4
|
-
require 'rubyXL/cell'
|
|
5
|
-
require 'rubyXL/objects/reference'
|
|
6
|
-
require 'rubyXL/objects/column_range'
|
|
7
|
-
require 'rubyXL/objects/stylesheet'
|
|
8
|
-
require 'rubyXL/objects/shared_strings'
|
|
9
|
-
require 'rubyXL/objects/worksheet'
|
|
10
|
-
require 'rubyXL/objects/chartsheet'
|
|
11
|
-
require 'rubyXL/objects/calculation_chain'
|
|
12
|
-
require 'rubyXL/objects/content_types'
|
|
13
|
-
require 'rubyXL/objects/theme'
|
|
14
|
-
require 'rubyXL/objects/comments'
|
|
15
1
|
require 'rubyXL/objects/root'
|
|
16
|
-
require 'rubyXL/objects/
|
|
17
|
-
require 'rubyXL/objects/document_properties'
|
|
18
|
-
require 'rubyXL/objects/storage'
|
|
2
|
+
require 'rubyXL/objects/reference'
|
|
19
3
|
require 'rubyXL/parser'
|
|
20
4
|
|
|
21
5
|
module RubyXL
|
data/lib/rubyXL/cell.rb
CHANGED
|
@@ -19,10 +19,10 @@ module RubyXL
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
# changes fill color of cell
|
|
22
|
-
def change_fill(rgb='ffffff')
|
|
22
|
+
def change_fill(rgb = 'ffffff')
|
|
23
23
|
validate_worksheet
|
|
24
24
|
Color.validate_color(rgb)
|
|
25
|
-
self.style_index = workbook.modify_fill(self.style_index,rgb)
|
|
25
|
+
self.style_index = workbook.modify_fill(self.style_index, rgb)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# Changes font name of cell
|
|
@@ -120,22 +120,27 @@ module RubyXL
|
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
def change_border_top(weight = 'thin')
|
|
123
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_border` instead."
|
|
123
124
|
change_border(:top, weight)
|
|
124
125
|
end
|
|
125
126
|
|
|
126
127
|
def change_border_left(weight = 'thin')
|
|
128
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_border` instead."
|
|
127
129
|
change_border(:left, weight)
|
|
128
130
|
end
|
|
129
131
|
|
|
130
132
|
def change_border_right(weight = 'thin')
|
|
133
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_border` instead."
|
|
131
134
|
change_border(:right, weight)
|
|
132
135
|
end
|
|
133
136
|
|
|
134
137
|
def change_border_bottom(weight = 'thin')
|
|
138
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_border` instead."
|
|
135
139
|
change_border(:bottom, weight)
|
|
136
140
|
end
|
|
137
141
|
|
|
138
142
|
def change_border_diagonal(weight = 'thin')
|
|
143
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_border` instead."
|
|
139
144
|
change_border(:diagonal, weight)
|
|
140
145
|
end
|
|
141
146
|
|
|
@@ -256,6 +261,20 @@ module RubyXL
|
|
|
256
261
|
return str
|
|
257
262
|
end
|
|
258
263
|
|
|
264
|
+
# Performs correct modification based on what type of change_type is specified
|
|
265
|
+
def font_switch(change_type, arg)
|
|
266
|
+
case change_type
|
|
267
|
+
when Worksheet::NAME then change_font_name(arg)
|
|
268
|
+
when Worksheet::SIZE then change_font_size(arg)
|
|
269
|
+
when Worksheet::COLOR then change_font_color(arg)
|
|
270
|
+
when Worksheet::ITALICS then change_font_italics(arg)
|
|
271
|
+
when Worksheet::BOLD then change_font_bold(arg)
|
|
272
|
+
when Worksheet::UNDERLINE then change_font_underline(arg)
|
|
273
|
+
when Worksheet::STRIKETHROUGH then change_font_strikethrough(arg)
|
|
274
|
+
else raise 'Invalid change_type'
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
|
|
259
278
|
private
|
|
260
279
|
|
|
261
280
|
def get_border(direction)
|
|
@@ -278,7 +297,7 @@ module RubyXL
|
|
|
278
297
|
|
|
279
298
|
def validate_worksheet()
|
|
280
299
|
return if @worksheet && @worksheet[row] && @worksheet[row][column] == self
|
|
281
|
-
raise "
|
|
300
|
+
raise "Cell #{self} is not in worksheet #{worksheet}"
|
|
282
301
|
end
|
|
283
302
|
|
|
284
303
|
def get_cell_xf
|
|
@@ -15,6 +15,8 @@ module RubyXL
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
class ContentTypes < OOXMLTopLevelObject
|
|
18
|
+
SAVE_ORDER = 999 # Must be saved last, so it has time to accumulate overrides from all others.
|
|
19
|
+
|
|
18
20
|
attr_accessor :owner
|
|
19
21
|
|
|
20
22
|
define_child_node(RubyXL::ContentTypeDefault, :collection => true, :accessor => :defaults)
|
|
@@ -31,9 +33,6 @@ module RubyXL
|
|
|
31
33
|
self.class.xlsx_path
|
|
32
34
|
end
|
|
33
35
|
|
|
34
|
-
def self.save_order
|
|
35
|
-
999 # Must be saved last, so it has time to accumulate overrides from all others.
|
|
36
|
-
end
|
|
37
36
|
|
|
38
37
|
def add_override(obj)
|
|
39
38
|
return unless obj.class.const_defined?(:CONTENT_TYPE)
|
|
@@ -394,16 +394,14 @@ module RubyXL
|
|
|
394
394
|
# Extension class providing functionality for top-level OOXML objects that are represented by
|
|
395
395
|
# their own <tt>.xml</tt> files in <tt>.xslx</tt> zip container.
|
|
396
396
|
class OOXMLTopLevelObject < OOXMLObject
|
|
397
|
+
SAVE_ORDER = 500
|
|
398
|
+
|
|
397
399
|
# Prototype method. For top-level OOXML object, returns the path at which the current object's XML file
|
|
398
400
|
# is located within the <tt>.xslx</tt> zip container.
|
|
399
401
|
def xlsx_path
|
|
400
402
|
raise 'Subclass responsebility'
|
|
401
403
|
end
|
|
402
404
|
|
|
403
|
-
def self.save_order
|
|
404
|
-
500
|
|
405
|
-
end
|
|
406
|
-
|
|
407
405
|
# Sets the list of namespaces on this object to be added when writing out XML. Valid only on top-level objects.
|
|
408
406
|
# === Parameters
|
|
409
407
|
# * +namespace_hash+ - Hash of namespaces in the form of <tt>"prefix" => "url"</tt>
|
|
@@ -449,32 +447,6 @@ module RubyXL
|
|
|
449
447
|
@workbook.root.rels_hash[self.class].index{ |f| f.equal?(self) }.to_i + 1
|
|
450
448
|
end
|
|
451
449
|
|
|
452
|
-
def self.define_relationship(klass, accessor = nil)
|
|
453
|
-
relationships = obtain_class_variable(:@@ooxml_relationships)
|
|
454
|
-
relationships[klass] = accessor
|
|
455
|
-
end
|
|
456
|
-
|
|
457
|
-
def attach_relationship(rid, rf)
|
|
458
|
-
relationships = obtain_class_variable(:@@ooxml_relationships)
|
|
459
|
-
klass = rf.class
|
|
460
|
-
if relationships.has_key?(klass) then
|
|
461
|
-
accessor = relationships[klass]
|
|
462
|
-
case accessor
|
|
463
|
-
when NilClass then
|
|
464
|
-
# Relationship is known, but we don't have a special accessor for it, store as generic
|
|
465
|
-
store_relationship(rf)
|
|
466
|
-
when false then
|
|
467
|
-
# Do nothing, the code will perform attaching on its own
|
|
468
|
-
else
|
|
469
|
-
container = self.send(accessor)
|
|
470
|
-
if container.is_a?(Array) then container << rf
|
|
471
|
-
else self.send("#{accessor}=", rf)
|
|
472
|
-
end
|
|
473
|
-
end
|
|
474
|
-
else store_relationship(rf, :unknown)
|
|
475
|
-
end
|
|
476
|
-
end
|
|
477
|
-
|
|
478
450
|
end
|
|
479
451
|
|
|
480
452
|
end
|
|
@@ -15,6 +15,8 @@ module RubyXL
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
class OOXMLRelationshipsFile < OOXMLTopLevelObject
|
|
18
|
+
SAVE_ORDER = 0
|
|
19
|
+
|
|
18
20
|
define_child_node(RubyXL::Relationship, :collection => true, :accessor => :relationships)
|
|
19
21
|
define_element_name 'Relationships'
|
|
20
22
|
set_namespaces('http://schemas.openxmlformats.org/package/2006/relationships' => '')
|
|
@@ -38,10 +40,6 @@ module RubyXL
|
|
|
38
40
|
end
|
|
39
41
|
protected :add_relationship
|
|
40
42
|
|
|
41
|
-
def self.save_order
|
|
42
|
-
0
|
|
43
|
-
end
|
|
44
|
-
|
|
45
43
|
def find_by_rid(r_id)
|
|
46
44
|
relationships.find { |r| r.id == r_id }
|
|
47
45
|
end
|
|
@@ -176,7 +174,20 @@ module RubyXL
|
|
|
176
174
|
|
|
177
175
|
module RelationshipSupport
|
|
178
176
|
|
|
177
|
+
module ClassMehods
|
|
178
|
+
def define_relationship(klass, accessor = nil)
|
|
179
|
+
class_variable_get(:@@ooxml_relationships)[klass] = accessor
|
|
180
|
+
attr_accessor(accessor) if accessor
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def self.included(klass)
|
|
185
|
+
klass.class_variable_set(:@@ooxml_relationships, {})
|
|
186
|
+
klass.extend RelationshipSupport::ClassMehods
|
|
187
|
+
end
|
|
188
|
+
|
|
179
189
|
attr_accessor :generic_storage, :relationship_container
|
|
190
|
+
|
|
180
191
|
def related_objects # Override this method
|
|
181
192
|
[]
|
|
182
193
|
end
|
|
@@ -196,12 +207,6 @@ module RubyXL
|
|
|
196
207
|
res
|
|
197
208
|
end
|
|
198
209
|
|
|
199
|
-
def store_relationship(related_file, unknown = false)
|
|
200
|
-
self.generic_storage ||= []
|
|
201
|
-
puts "WARNING: #{self.class} is not aware what to do with #{related_file.class}" if unknown
|
|
202
|
-
self.generic_storage << related_file
|
|
203
|
-
end
|
|
204
|
-
|
|
205
210
|
def load_relationships(dir_path, base_file_name = '')
|
|
206
211
|
self.relationship_container = self.class.const_get(:REL_CLASS).load_relationship_file(dir_path, base_file_name)
|
|
207
212
|
return if relationship_container.nil?
|
|
@@ -211,6 +216,33 @@ module RubyXL
|
|
|
211
216
|
}
|
|
212
217
|
end
|
|
213
218
|
|
|
219
|
+
def attach_relationship(rid, rf)
|
|
220
|
+
relationships = self.class.class_variable_get(:@@ooxml_relationships)
|
|
221
|
+
klass = rf.class
|
|
222
|
+
if relationships.has_key?(klass) then
|
|
223
|
+
accessor = relationships[klass]
|
|
224
|
+
case accessor
|
|
225
|
+
when NilClass then
|
|
226
|
+
# Relationship is known, but we don't have a special accessor for it, store as generic
|
|
227
|
+
store_relationship(rf)
|
|
228
|
+
when false then
|
|
229
|
+
# Do nothing, the code will perform attaching on its own
|
|
230
|
+
else
|
|
231
|
+
container = self.send(accessor)
|
|
232
|
+
if container.is_a?(Array) then container << rf
|
|
233
|
+
else self.send("#{accessor}=", rf)
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
else store_relationship(rf, :unknown)
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
def store_relationship(related_file, unknown = false)
|
|
241
|
+
self.generic_storage ||= []
|
|
242
|
+
puts "WARNING: #{self.class} is not aware what to do with #{related_file.class}" if unknown
|
|
243
|
+
self.generic_storage << related_file
|
|
244
|
+
end
|
|
245
|
+
|
|
214
246
|
end
|
|
215
247
|
|
|
216
248
|
end
|
data/lib/rubyXL/objects/root.rb
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
require 'zip'
|
|
2
2
|
require 'rubyXL/objects/relationships'
|
|
3
|
+
require 'rubyXL/objects/document_properties'
|
|
4
|
+
require 'rubyXL/objects/content_types'
|
|
5
|
+
require 'rubyXL/objects/workbook'
|
|
3
6
|
|
|
4
7
|
module RubyXL
|
|
5
8
|
|
|
@@ -14,27 +17,16 @@ module RubyXL
|
|
|
14
17
|
|
|
15
18
|
include RubyXL::RelationshipSupport
|
|
16
19
|
|
|
20
|
+
define_relationship(RubyXL::ThumbnailFile, :thumbnail)
|
|
21
|
+
define_relationship(RubyXL::CorePropertiesFile, :core_properties)
|
|
22
|
+
define_relationship(RubyXL::DocumentPropertiesFile, :document_properties)
|
|
23
|
+
define_relationship(RubyXL::CustomPropertiesFile, :custom_properties)
|
|
24
|
+
define_relationship(RubyXL::Workbook, :workbook)
|
|
25
|
+
|
|
17
26
|
def related_objects
|
|
18
27
|
[ content_types, thumbnail, core_properties, document_properties, custom_properties, workbook ]
|
|
19
28
|
end
|
|
20
29
|
|
|
21
|
-
# define_relationship(RubyXL::ThumbnailFile, :thumbnail)
|
|
22
|
-
# define_relationship(RubyXL::CorePropertiesFile, :core_properties)
|
|
23
|
-
# define_relationship(RubyXL::DocumentPropertiesFile, :document_properties)
|
|
24
|
-
# define_relationship(RubyXL::CustomPropertiesFile, :custom_properties)
|
|
25
|
-
# define_relationship(RubyXL::Workbook, :workbook)
|
|
26
|
-
|
|
27
|
-
def attach_relationship(rid, rf)
|
|
28
|
-
case rf
|
|
29
|
-
when RubyXL::ThumbnailFile then self.thumbnail = rf
|
|
30
|
-
when RubyXL::CorePropertiesFile then self.core_properties = rf
|
|
31
|
-
when RubyXL::DocumentPropertiesFile then self.document_properties = rf
|
|
32
|
-
when RubyXL::CustomPropertiesFile then self.custom_properties = rf
|
|
33
|
-
when RubyXL::Workbook then self.workbook = rf
|
|
34
|
-
else store_relationship(rf, :unknown)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
30
|
def self.default
|
|
39
31
|
obj = self.new
|
|
40
32
|
obj.document_properties = RubyXL::DocumentPropertiesFile.new
|
|
@@ -56,7 +48,7 @@ module RubyXL
|
|
|
56
48
|
self.rels_hash[obj.class] << obj
|
|
57
49
|
}
|
|
58
50
|
|
|
59
|
-
self.rels_hash.keys.sort_by{ |c| c
|
|
51
|
+
self.rels_hash.keys.sort_by{ |c| c::SAVE_ORDER }.each { |klass|
|
|
60
52
|
puts "<-- DEBUG: saving related #{klass} files" if @@debug
|
|
61
53
|
self.rels_hash[klass].each { |obj|
|
|
62
54
|
obj.workbook = workbook if obj.respond_to?(:workbook=)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module RubyXL
|
|
2
2
|
|
|
3
3
|
class GenericStorageObject
|
|
4
|
+
SAVE_ORDER = 0
|
|
4
5
|
|
|
5
6
|
attr_accessor :xlsx_path, :data, :workbook, :generic_storage
|
|
6
7
|
|
|
@@ -11,10 +12,6 @@ module RubyXL
|
|
|
11
12
|
@generic_storage = []
|
|
12
13
|
end
|
|
13
14
|
|
|
14
|
-
def self.save_order
|
|
15
|
-
0
|
|
16
|
-
end
|
|
17
|
-
|
|
18
15
|
def self.parse_file(dirpath, file_path = nil)
|
|
19
16
|
file_path ||= self.xlsx_path
|
|
20
17
|
obj = self.new
|
data/lib/rubyXL/objects/text.rb
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
require 'rubyXL/objects/ooxml_object'
|
|
2
|
+
require 'rubyXL/objects/shared_strings'
|
|
3
|
+
require 'rubyXL/objects/stylesheet'
|
|
4
|
+
require 'rubyXL/objects/theme'
|
|
5
|
+
require 'rubyXL/objects/calculation_chain'
|
|
6
|
+
require 'rubyXL/objects/worksheet'
|
|
7
|
+
require 'rubyXL/objects/chartsheet'
|
|
8
|
+
require 'rubyXL/objects/relationships'
|
|
2
9
|
require 'rubyXL/objects/simple_types'
|
|
3
10
|
require 'rubyXL/objects/extensions'
|
|
11
|
+
require 'rubyXL/workbook'
|
|
4
12
|
|
|
5
13
|
module RubyXL
|
|
6
14
|
|
|
@@ -6,9 +6,11 @@ require 'rubyXL/objects/sheet_common'
|
|
|
6
6
|
require 'rubyXL/objects/text'
|
|
7
7
|
require 'rubyXL/objects/formula'
|
|
8
8
|
require 'rubyXL/objects/sheet_data'
|
|
9
|
+
require 'rubyXL/objects/column_range'
|
|
9
10
|
require 'rubyXL/objects/filters'
|
|
10
11
|
require 'rubyXL/objects/data_validation'
|
|
11
12
|
require 'rubyXL/objects/comments'
|
|
13
|
+
require 'rubyXL/worksheet'
|
|
12
14
|
|
|
13
15
|
module RubyXL
|
|
14
16
|
|
data/lib/rubyXL/worksheet.rb
CHANGED
|
@@ -159,54 +159,63 @@ module LegacyWorksheet
|
|
|
159
159
|
change_row_font(row, Worksheet::STRIKETHROUGH, struckthrough, font)
|
|
160
160
|
end
|
|
161
161
|
|
|
162
|
-
def change_row_height(row = 0, height=10)
|
|
162
|
+
def change_row_height(row = 0, height = 10)
|
|
163
163
|
validate_workbook
|
|
164
164
|
ensure_cell_exists(row)
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
height = Float(height)
|
|
170
|
-
else
|
|
171
|
-
raise 'You must enter a number for the height'
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
sheet_data.rows[row].ht = height
|
|
175
|
-
sheet_data.rows[row].custom_height = true
|
|
166
|
+
c = sheet_data.rows[row]
|
|
167
|
+
c.ht = height
|
|
168
|
+
c.custom_height = true
|
|
176
169
|
end
|
|
177
170
|
|
|
178
|
-
def change_row_horizontal_alignment(row = 0,alignment='center')
|
|
171
|
+
def change_row_horizontal_alignment(row = 0, alignment = 'center')
|
|
179
172
|
validate_workbook
|
|
180
173
|
validate_nonnegative(row)
|
|
181
|
-
change_row_alignment(row,alignment,true)
|
|
174
|
+
change_row_alignment(row, alignment, true)
|
|
182
175
|
end
|
|
183
176
|
|
|
184
|
-
def change_row_vertical_alignment(row = 0,alignment='center')
|
|
177
|
+
def change_row_vertical_alignment(row = 0, alignment = 'center')
|
|
185
178
|
validate_workbook
|
|
186
179
|
validate_nonnegative(row)
|
|
187
|
-
change_row_alignment(row,alignment,false)
|
|
180
|
+
change_row_alignment(row, alignment, false)
|
|
188
181
|
end
|
|
189
182
|
|
|
190
183
|
def change_row_border_top(row = 0, weight = 'thin')
|
|
184
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_row_border` instead."
|
|
191
185
|
change_row_border(row, :top, weight)
|
|
192
186
|
end
|
|
193
187
|
|
|
194
188
|
def change_row_border_left(row = 0, weight = 'thin')
|
|
189
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_row_border` instead."
|
|
195
190
|
change_row_border(row, :left, weight)
|
|
196
191
|
end
|
|
197
192
|
|
|
198
193
|
def change_row_border_right(row = 0, weight = 'thin')
|
|
194
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_row_border` instead."
|
|
199
195
|
change_row_border(row, :right, weight)
|
|
200
196
|
end
|
|
201
197
|
|
|
202
198
|
def change_row_border_bottom(row = 0, weight = 'thin')
|
|
199
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_row_border` instead."
|
|
203
200
|
change_row_border(row, :bottom, weight)
|
|
204
201
|
end
|
|
205
202
|
|
|
206
203
|
def change_row_border_diagonal(row = 0, weight = 'thin')
|
|
204
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_row_border` instead."
|
|
207
205
|
change_row_border(row, :diagonal, weight)
|
|
208
206
|
end
|
|
209
207
|
|
|
208
|
+
def change_row_border(row, direction, weight)
|
|
209
|
+
validate_workbook
|
|
210
|
+
ensure_cell_exists(row)
|
|
211
|
+
|
|
212
|
+
sheet_data.rows[row].style_index = @workbook.modify_border(get_row_style(row), direction, weight)
|
|
213
|
+
|
|
214
|
+
sheet_data[row].cells.each { |c|
|
|
215
|
+
c.change_border(direction, weight) unless c.nil?
|
|
216
|
+
}
|
|
217
|
+
end
|
|
218
|
+
|
|
210
219
|
# Changes font name of column
|
|
211
220
|
def change_column_font_name(column_index = 0, font_name = 'Verdana')
|
|
212
221
|
xf = get_col_xf(column_index)
|
|
@@ -298,25 +307,42 @@ module LegacyWorksheet
|
|
|
298
307
|
end
|
|
299
308
|
|
|
300
309
|
def change_column_border_top(column_index, weight = 'thin')
|
|
310
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_column_border` instead."
|
|
301
311
|
change_column_border(column_index, :top, weight)
|
|
302
312
|
end
|
|
303
313
|
|
|
304
314
|
def change_column_border_left(column_index, weight = 'thin')
|
|
315
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_column_border` instead."
|
|
305
316
|
change_column_border(column_index, :left, weight)
|
|
306
317
|
end
|
|
307
318
|
|
|
308
319
|
def change_column_border_right(column_index, weight = 'thin')
|
|
320
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_column_border` instead."
|
|
309
321
|
change_column_border(column_index, :right, weight)
|
|
310
322
|
end
|
|
311
323
|
|
|
312
324
|
def change_column_border_bottom(column_index, weight = 'thin')
|
|
325
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_column_border` instead."
|
|
313
326
|
change_column_border(column_index, :bottom, weight)
|
|
314
327
|
end
|
|
315
328
|
|
|
316
329
|
def change_column_border_diagonal(column_index, weight = 'thin')
|
|
330
|
+
warn "[DEPRECATION] `#{__method__}` is deprecated. Please use `change_column_border` instead."
|
|
317
331
|
change_column_border(column_index, :diagonal, weight)
|
|
318
332
|
end
|
|
319
333
|
|
|
334
|
+
def change_column_border(column_index, direction, weight)
|
|
335
|
+
validate_workbook
|
|
336
|
+
ensure_cell_exists(0, column_index)
|
|
337
|
+
|
|
338
|
+
cols.get_range(column_index).style_index = @workbook.modify_border(get_col_style(column_index), direction, weight)
|
|
339
|
+
|
|
340
|
+
sheet_data.rows.each { |row|
|
|
341
|
+
c = row.cells[column_index]
|
|
342
|
+
c.change_border(direction, weight) unless c.nil?
|
|
343
|
+
}
|
|
344
|
+
end
|
|
345
|
+
|
|
320
346
|
# merges cells within a rectangular range
|
|
321
347
|
def merge_cells(row1 = 0, col1 = 0, row2 = 0, col2 = 0)
|
|
322
348
|
validate_workbook
|
|
@@ -741,14 +767,14 @@ module LegacyWorksheet
|
|
|
741
767
|
# Helper method to update the row styles array
|
|
742
768
|
# change_type - NAME or SIZE or COLOR etc
|
|
743
769
|
# main method to change font, called from each separate font mutator method
|
|
744
|
-
def change_row_font(
|
|
770
|
+
def change_row_font(row_index, change_type, arg, font)
|
|
745
771
|
validate_workbook
|
|
746
|
-
ensure_cell_exists(
|
|
747
|
-
|
|
748
|
-
xf = workbook.register_new_font(font, get_row_xf(row))
|
|
749
|
-
sheet_data.rows[row].style_index = workbook.register_new_xf(xf, get_row_style(row))
|
|
772
|
+
ensure_cell_exists(row_index)
|
|
750
773
|
|
|
751
|
-
|
|
774
|
+
xf = workbook.register_new_font(font, get_row_xf(row_index))
|
|
775
|
+
row = sheet_data[row_index]
|
|
776
|
+
row.style_index = workbook.register_new_xf(xf, get_row_style(row_index))
|
|
777
|
+
row.cells.each { |c| c.font_switch(change_type, arg) unless c.nil? }
|
|
752
778
|
end
|
|
753
779
|
|
|
754
780
|
# Helper method to update the fonts and cell styles array
|
|
@@ -758,56 +784,14 @@ module LegacyWorksheet
|
|
|
758
784
|
ensure_cell_exists(0, column_index)
|
|
759
785
|
|
|
760
786
|
xf = workbook.register_new_font(font, xf)
|
|
761
|
-
|
|
762
787
|
cols.get_range(column_index).style_index = workbook.register_new_xf(xf, get_col_style(column_index))
|
|
763
788
|
|
|
764
789
|
sheet_data.rows.each { |row|
|
|
765
|
-
c = row[column_index]
|
|
766
|
-
font_switch(
|
|
790
|
+
c = row && row[column_index]
|
|
791
|
+
c.font_switch(change_type, arg) unless c.nil?
|
|
767
792
|
}
|
|
768
793
|
end
|
|
769
794
|
|
|
770
|
-
#performs correct modification based on what type of change_type is specified
|
|
771
|
-
def font_switch(c,change_type,arg)
|
|
772
|
-
case change_type
|
|
773
|
-
when Worksheet::NAME
|
|
774
|
-
unless arg.is_a?String
|
|
775
|
-
raise 'Not a String'
|
|
776
|
-
end
|
|
777
|
-
c.change_font_name(arg)
|
|
778
|
-
when Worksheet::SIZE
|
|
779
|
-
unless arg.is_a?(Integer) || arg.is_a?(Float)
|
|
780
|
-
raise 'Not a Number'
|
|
781
|
-
end
|
|
782
|
-
c.change_font_size(arg)
|
|
783
|
-
when Worksheet::COLOR
|
|
784
|
-
Color.validate_color(arg)
|
|
785
|
-
c.change_font_color(arg)
|
|
786
|
-
when Worksheet::ITALICS
|
|
787
|
-
unless arg == !!arg
|
|
788
|
-
raise 'Not a boolean'
|
|
789
|
-
end
|
|
790
|
-
c.change_font_italics(arg)
|
|
791
|
-
when Worksheet::BOLD
|
|
792
|
-
unless arg == !!arg
|
|
793
|
-
raise 'Not a boolean'
|
|
794
|
-
end
|
|
795
|
-
c.change_font_bold(arg)
|
|
796
|
-
when Worksheet::UNDERLINE
|
|
797
|
-
unless arg == !!arg
|
|
798
|
-
raise 'Not a boolean'
|
|
799
|
-
end
|
|
800
|
-
c.change_font_underline(arg)
|
|
801
|
-
when Worksheet::STRIKETHROUGH
|
|
802
|
-
unless arg == !!arg
|
|
803
|
-
raise 'Not a boolean'
|
|
804
|
-
end
|
|
805
|
-
c.change_font_strikethrough(arg)
|
|
806
|
-
else
|
|
807
|
-
raise 'Invalid change_type'
|
|
808
|
-
end
|
|
809
|
-
end
|
|
810
|
-
|
|
811
795
|
# Ensures that cell with +row_index+ and +column_index+ exists in
|
|
812
796
|
# +sheet_data+ arrays, growing them up if necessary.
|
|
813
797
|
def ensure_cell_exists(row_index, column_index = 0)
|
|
@@ -891,29 +875,6 @@ module LegacyWorksheet
|
|
|
891
875
|
}
|
|
892
876
|
end
|
|
893
877
|
|
|
894
|
-
def change_row_border(row, direction, weight)
|
|
895
|
-
validate_workbook
|
|
896
|
-
ensure_cell_exists(row)
|
|
897
|
-
|
|
898
|
-
sheet_data.rows[row].style_index = @workbook.modify_border(get_row_style(row), direction, weight)
|
|
899
|
-
|
|
900
|
-
sheet_data[row].cells.each { |c|
|
|
901
|
-
c.change_border(direction, weight) unless c.nil?
|
|
902
|
-
}
|
|
903
|
-
end
|
|
904
|
-
|
|
905
|
-
def change_column_border(column_index, direction, weight)
|
|
906
|
-
validate_workbook
|
|
907
|
-
ensure_cell_exists(0, column_index)
|
|
908
|
-
|
|
909
|
-
cols.get_range(column_index).style_index = @workbook.modify_border(get_col_style(column_index), direction, weight)
|
|
910
|
-
|
|
911
|
-
sheet_data.rows.each { |row|
|
|
912
|
-
c = row.cells[column_index]
|
|
913
|
-
c.change_border(direction, weight) unless c.nil?
|
|
914
|
-
}
|
|
915
|
-
end
|
|
916
|
-
|
|
917
878
|
def validate_nonnegative(row_or_col)
|
|
918
879
|
raise 'Row and Column arguments must be nonnegative' if row_or_col < 0
|
|
919
880
|
end
|