rubyXL-ptr 3.3.27
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.
- checksums.yaml +7 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +229 -0
- data/Rakefile +103 -0
- data/VERSION +1 -0
- data/lib/rubyXL.rb +12 -0
- data/lib/rubyXL/cell.rb +54 -0
- data/lib/rubyXL/convenience_methods.rb +1122 -0
- data/lib/rubyXL/objects/border.rb +74 -0
- data/lib/rubyXL/objects/calculation_chain.rb +31 -0
- data/lib/rubyXL/objects/cell_style.rb +65 -0
- data/lib/rubyXL/objects/chartsheet.rb +92 -0
- data/lib/rubyXL/objects/color.rb +27 -0
- data/lib/rubyXL/objects/column_range.rb +92 -0
- data/lib/rubyXL/objects/comments.rb +47 -0
- data/lib/rubyXL/objects/container_nodes.rb +135 -0
- data/lib/rubyXL/objects/content_types.rb +77 -0
- data/lib/rubyXL/objects/data_validation.rb +37 -0
- data/lib/rubyXL/objects/document_properties.rb +159 -0
- data/lib/rubyXL/objects/extensions.rb +40 -0
- data/lib/rubyXL/objects/external_links.rb +85 -0
- data/lib/rubyXL/objects/fill.rb +55 -0
- data/lib/rubyXL/objects/filters.rb +120 -0
- data/lib/rubyXL/objects/font.rb +48 -0
- data/lib/rubyXL/objects/formula.rb +24 -0
- data/lib/rubyXL/objects/ooxml_object.rb +460 -0
- data/lib/rubyXL/objects/reference.rb +110 -0
- data/lib/rubyXL/objects/relationships.rb +213 -0
- data/lib/rubyXL/objects/root.rb +86 -0
- data/lib/rubyXL/objects/shared_strings.rb +70 -0
- data/lib/rubyXL/objects/sheet_common.rb +51 -0
- data/lib/rubyXL/objects/sheet_data.rb +188 -0
- data/lib/rubyXL/objects/simple_types.rb +232 -0
- data/lib/rubyXL/objects/storage.rb +182 -0
- data/lib/rubyXL/objects/stylesheet.rb +232 -0
- data/lib/rubyXL/objects/text.rb +94 -0
- data/lib/rubyXL/objects/theme.rb +1716 -0
- data/lib/rubyXL/objects/workbook.rb +464 -0
- data/lib/rubyXL/objects/worksheet.rb +748 -0
- data/lib/rubyXL/parser.rb +29 -0
- data/lib/rubyXL/worksheet.rb +105 -0
- data/rdoc/README_rdoc.html +475 -0
- data/rdoc/RubyXL.html +598 -0
- data/rdoc/RubyXL/AExtension.html +223 -0
- data/rdoc/RubyXL/AExtensionStorageArea.html +103 -0
- data/rdoc/RubyXL/ActiveX.html +182 -0
- data/rdoc/RubyXL/ActiveXBinary.html +117 -0
- data/rdoc/RubyXL/AdjustHandleList.html +106 -0
- data/rdoc/RubyXL/Alignment.html +106 -0
- data/rdoc/RubyXL/AlternateContent.html +103 -0
- data/rdoc/RubyXL/Authors.html +106 -0
- data/rdoc/RubyXL/AutoFilter.html +106 -0
- data/rdoc/RubyXL/AutoFilterColumn.html +106 -0
- data/rdoc/RubyXL/BinaryImageFile.html +122 -0
- data/rdoc/RubyXL/BodyProperties.html +106 -0
- data/rdoc/RubyXL/BooleanNode.html +103 -0
- data/rdoc/RubyXL/BooleanValue.html +103 -0
- data/rdoc/RubyXL/Border.html +275 -0
- data/rdoc/RubyXL/BorderEdge.html +189 -0
- data/rdoc/RubyXL/Borders.html +157 -0
- data/rdoc/RubyXL/Break.html +106 -0
- data/rdoc/RubyXL/BreakList.html +106 -0
- data/rdoc/RubyXL/CT_AdjPoint2D.html +106 -0
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +106 -0
- data/rdoc/RubyXL/CT_Backdrop.html +106 -0
- data/rdoc/RubyXL/CT_Bevel.html +106 -0
- data/rdoc/RubyXL/CT_BiLevelEffect.html +106 -0
- data/rdoc/RubyXL/CT_BlendEffect.html +106 -0
- data/rdoc/RubyXL/CT_Blip.html +106 -0
- data/rdoc/RubyXL/CT_BlipFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_BlurEffect.html +106 -0
- data/rdoc/RubyXL/CT_Camera.html +106 -0
- data/rdoc/RubyXL/CT_Color.html +106 -0
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +106 -0
- data/rdoc/RubyXL/CT_ColorMapping.html +106 -0
- data/rdoc/RubyXL/CT_ColorScheme.html +106 -0
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +106 -0
- data/rdoc/RubyXL/CT_ConnectionSite.html +106 -0
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +106 -0
- data/rdoc/RubyXL/CT_DashStop.html +106 -0
- data/rdoc/RubyXL/CT_DashStopList.html +106 -0
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +106 -0
- data/rdoc/RubyXL/CT_DuotoneEffect.html +106 -0
- data/rdoc/RubyXL/CT_EffectContainer.html +106 -0
- data/rdoc/RubyXL/CT_EffectList.html +106 -0
- data/rdoc/RubyXL/CT_EffectReference.html +106 -0
- data/rdoc/RubyXL/CT_EffectStyleItem.html +106 -0
- data/rdoc/RubyXL/CT_EffectStyleList.html +106 -0
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +106 -0
- data/rdoc/RubyXL/CT_FillEffect.html +106 -0
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +106 -0
- data/rdoc/RubyXL/CT_FillStyleList.html +106 -0
- data/rdoc/RubyXL/CT_FlatText.html +106 -0
- data/rdoc/RubyXL/CT_FontCollection.html +106 -0
- data/rdoc/RubyXL/CT_FontReference.html +106 -0
- data/rdoc/RubyXL/CT_GeomGuideList.html +106 -0
- data/rdoc/RubyXL/CT_GlowEffect.html +106 -0
- data/rdoc/RubyXL/CT_GradientFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_GradientStop.html +106 -0
- data/rdoc/RubyXL/CT_GradientStopList.html +106 -0
- data/rdoc/RubyXL/CT_HSLEffect.html +106 -0
- data/rdoc/RubyXL/CT_HslColor.html +106 -0
- data/rdoc/RubyXL/CT_Hyperlink.html +106 -0
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_LightRig.html +106 -0
- data/rdoc/RubyXL/CT_LineEndProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineStyleList.html +106 -0
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +106 -0
- data/rdoc/RubyXL/CT_LuminanceEffect.html +106 -0
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +106 -0
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_Path2D.html +106 -0
- data/rdoc/RubyXL/CT_Path2DArcTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DList.html +106 -0
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DTo.html +106 -0
- data/rdoc/RubyXL/CT_PathShadeProperties.html +106 -0
- data/rdoc/RubyXL/CT_PatternFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_Point3D.html +106 -0
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +106 -0
- data/rdoc/RubyXL/CT_PresetColor.html +106 -0
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +106 -0
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_PresetTextShape.html +106 -0
- data/rdoc/RubyXL/CT_ReflectionEffect.html +106 -0
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +106 -0
- data/rdoc/RubyXL/CT_RelativeRect.html +106 -0
- data/rdoc/RubyXL/CT_SRgbColor.html +106 -0
- data/rdoc/RubyXL/CT_ScRgbColor.html +106 -0
- data/rdoc/RubyXL/CT_Scene3D.html +106 -0
- data/rdoc/RubyXL/CT_SchemeColor.html +106 -0
- data/rdoc/RubyXL/CT_Shape3D.html +106 -0
- data/rdoc/RubyXL/CT_ShapeStyle.html +106 -0
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +106 -0
- data/rdoc/RubyXL/CT_SphereCoords.html +106 -0
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +106 -0
- data/rdoc/RubyXL/CT_StyleMatrix.html +106 -0
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +106 -0
- data/rdoc/RubyXL/CT_SupplementalFont.html +106 -0
- data/rdoc/RubyXL/CT_SystemColor.html +106 -0
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextBlipBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextCharBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +106 -0
- data/rdoc/RubyXL/CT_TextFont.html +106 -0
- data/rdoc/RubyXL/CT_TextListStyle.html +106 -0
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +106 -0
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +106 -0
- data/rdoc/RubyXL/CT_TextSpacing.html +106 -0
- data/rdoc/RubyXL/CT_TextTabStop.html +106 -0
- data/rdoc/RubyXL/CT_TextTabStopList.html +106 -0
- data/rdoc/RubyXL/CT_TileInfoProperties.html +106 -0
- data/rdoc/RubyXL/CT_TintEffect.html +106 -0
- data/rdoc/RubyXL/CT_Transform2D.html +106 -0
- data/rdoc/RubyXL/CT_TransformEffect.html +106 -0
- data/rdoc/RubyXL/CT_Vector3D.html +106 -0
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +106 -0
- data/rdoc/RubyXL/CalculationChain.html +176 -0
- data/rdoc/RubyXL/CalculationChainCell.html +106 -0
- data/rdoc/RubyXL/CalculationProperties.html +106 -0
- data/rdoc/RubyXL/Cell.html +558 -0
- data/rdoc/RubyXL/CellConvenienceMethods.html +1211 -0
- data/rdoc/RubyXL/CellExt.html +106 -0
- data/rdoc/RubyXL/CellSmartTag.html +106 -0
- data/rdoc/RubyXL/CellSmartTagProperty.html +106 -0
- data/rdoc/RubyXL/CellSmartTags.html +106 -0
- data/rdoc/RubyXL/CellStyle.html +106 -0
- data/rdoc/RubyXL/CellStyleXFs.html +157 -0
- data/rdoc/RubyXL/CellStyles.html +157 -0
- data/rdoc/RubyXL/CellValue.html +158 -0
- data/rdoc/RubyXL/CellWatch.html +106 -0
- data/rdoc/RubyXL/CellWatches.html +106 -0
- data/rdoc/RubyXL/CellXFs.html +161 -0
- data/rdoc/RubyXL/ChartColorsFile.html +122 -0
- data/rdoc/RubyXL/ChartFile.html +189 -0
- data/rdoc/RubyXL/ChartStyleFile.html +122 -0
- data/rdoc/RubyXL/ChartUserShapesFile.html +122 -0
- data/rdoc/RubyXL/Chartsheet.html +260 -0
- data/rdoc/RubyXL/ChartsheetPageSetup.html +106 -0
- data/rdoc/RubyXL/ChartsheetProperties.html +106 -0
- data/rdoc/RubyXL/ChartsheetProtection.html +106 -0
- data/rdoc/RubyXL/ChartsheetView.html +106 -0
- data/rdoc/RubyXL/ChartsheetViews.html +106 -0
- data/rdoc/RubyXL/Color.html +175 -0
- data/rdoc/RubyXL/ColorFilter.html +106 -0
- data/rdoc/RubyXL/ColorScale.html +106 -0
- data/rdoc/RubyXL/ColorSet.html +106 -0
- data/rdoc/RubyXL/Colors.html +106 -0
- data/rdoc/RubyXL/ColumnRange.html +245 -0
- data/rdoc/RubyXL/ColumnRanges.html +289 -0
- data/rdoc/RubyXL/Comment.html +106 -0
- data/rdoc/RubyXL/CommentList.html +106 -0
- data/rdoc/RubyXL/CommentsFile.html +197 -0
- data/rdoc/RubyXL/ConditionalFormatValue.html +106 -0
- data/rdoc/RubyXL/ConditionalFormatting.html +106 -0
- data/rdoc/RubyXL/ConditionalFormattingRule.html +106 -0
- data/rdoc/RubyXL/ContentTypeDefault.html +103 -0
- data/rdoc/RubyXL/ContentTypeOverride.html +103 -0
- data/rdoc/RubyXL/ContentTypes.html +248 -0
- data/rdoc/RubyXL/ControlPropertiesFile.html +117 -0
- data/rdoc/RubyXL/CorePropertiesFile.html +474 -0
- data/rdoc/RubyXL/CustomColor.html +106 -0
- data/rdoc/RubyXL/CustomColorList.html +106 -0
- data/rdoc/RubyXL/CustomFilter.html +106 -0
- data/rdoc/RubyXL/CustomFilters.html +106 -0
- data/rdoc/RubyXL/CustomGeometry.html +106 -0
- data/rdoc/RubyXL/CustomProperties.html +106 -0
- data/rdoc/RubyXL/CustomPropertiesFile.html +122 -0
- data/rdoc/RubyXL/CustomProperty.html +106 -0
- data/rdoc/RubyXL/CustomSheetView.html +106 -0
- data/rdoc/RubyXL/CustomSheetViews.html +106 -0
- data/rdoc/RubyXL/CustomWorkbookView.html +106 -0
- data/rdoc/RubyXL/CustomWorkbookViews.html +106 -0
- data/rdoc/RubyXL/CustomXMLFile.html +117 -0
- data/rdoc/RubyXL/DXF.html +106 -0
- data/rdoc/RubyXL/DXFs.html +106 -0
- data/rdoc/RubyXL/DataBar.html +106 -0
- data/rdoc/RubyXL/DataConsolidate.html +106 -0
- data/rdoc/RubyXL/DataConsolidationReference.html +106 -0
- data/rdoc/RubyXL/DataConsolidationReferences.html +106 -0
- data/rdoc/RubyXL/DataType.html +143 -0
- data/rdoc/RubyXL/DataValidation.html +106 -0
- data/rdoc/RubyXL/DataValidations.html +106 -0
- data/rdoc/RubyXL/DateGroupItem.html +106 -0
- data/rdoc/RubyXL/DefinedName.html +106 -0
- data/rdoc/RubyXL/DefinedNameExt.html +106 -0
- data/rdoc/RubyXL/DefinedNames.html +106 -0
- data/rdoc/RubyXL/DefinedNamesExt.html +106 -0
- data/rdoc/RubyXL/DocumentPropertiesFile.html +255 -0
- data/rdoc/RubyXL/DrawingFile.html +188 -0
- data/rdoc/RubyXL/DynamicFilter.html +106 -0
- data/rdoc/RubyXL/EmbeddedControl.html +106 -0
- data/rdoc/RubyXL/EmbeddedControls.html +106 -0
- data/rdoc/RubyXL/Extension.html +106 -0
- data/rdoc/RubyXL/ExtensionStorageArea.html +106 -0
- data/rdoc/RubyXL/Extents.html +106 -0
- data/rdoc/RubyXL/ExternalBook.html +106 -0
- data/rdoc/RubyXL/ExternalLinksFile.html +184 -0
- data/rdoc/RubyXL/ExternalReference.html +106 -0
- data/rdoc/RubyXL/ExternalReferences.html +106 -0
- data/rdoc/RubyXL/ExtraColorSchemeList.html +106 -0
- data/rdoc/RubyXL/FieldItem.html +106 -0
- data/rdoc/RubyXL/FileRecoveryProperties.html +106 -0
- data/rdoc/RubyXL/FileSharing.html +106 -0
- data/rdoc/RubyXL/FileVersion.html +106 -0
- data/rdoc/RubyXL/Fill.html +157 -0
- data/rdoc/RubyXL/Fills.html +157 -0
- data/rdoc/RubyXL/FilterContainer.html +106 -0
- data/rdoc/RubyXL/FloatNode.html +103 -0
- data/rdoc/RubyXL/FloatValue.html +103 -0
- data/rdoc/RubyXL/Font.html +184 -0
- data/rdoc/RubyXL/FontConvenienceMethods.html +603 -0
- data/rdoc/RubyXL/FontScheme.html +106 -0
- data/rdoc/RubyXL/Fonts.html +157 -0
- data/rdoc/RubyXL/Formula.html +106 -0
- data/rdoc/RubyXL/FunctionGroup.html +106 -0
- data/rdoc/RubyXL/FunctionGroups.html +106 -0
- data/rdoc/RubyXL/GenericStorageObject.html +298 -0
- data/rdoc/RubyXL/GradientFill.html +106 -0
- data/rdoc/RubyXL/HeaderFooterSettings.html +106 -0
- data/rdoc/RubyXL/Hyperlink.html +106 -0
- data/rdoc/RubyXL/HyperlinkRelFile.html +117 -0
- data/rdoc/RubyXL/Hyperlinks.html +106 -0
- data/rdoc/RubyXL/IconFilter.html +106 -0
- data/rdoc/RubyXL/IconSet.html +106 -0
- data/rdoc/RubyXL/IgnoredError.html +106 -0
- data/rdoc/RubyXL/IgnoredErrors.html +106 -0
- data/rdoc/RubyXL/IndexedColors.html +106 -0
- data/rdoc/RubyXL/InputCells.html +106 -0
- data/rdoc/RubyXL/IntegerNode.html +103 -0
- data/rdoc/RubyXL/IntegerValue.html +103 -0
- data/rdoc/RubyXL/LegacyCell.html +181 -0
- data/rdoc/RubyXL/LegacyWorksheet.html +355 -0
- data/rdoc/RubyXL/MRUColors.html +106 -0
- data/rdoc/RubyXL/MacrosFile.html +122 -0
- data/rdoc/RubyXL/MergedCell.html +106 -0
- data/rdoc/RubyXL/MergedCells.html +106 -0
- data/rdoc/RubyXL/NumFmt.html +106 -0
- data/rdoc/RubyXL/NumberFormat.html +158 -0
- data/rdoc/RubyXL/NumberFormats.html +172 -0
- data/rdoc/RubyXL/OLEObject.html +106 -0
- data/rdoc/RubyXL/OLEObjectFile.html +122 -0
- data/rdoc/RubyXL/OLEObjects.html +106 -0
- data/rdoc/RubyXL/OLESize.html +106 -0
- data/rdoc/RubyXL/OOXMLContainerObject.html +394 -0
- data/rdoc/RubyXL/OOXMLObject.html +118 -0
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +532 -0
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +564 -0
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +603 -0
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +384 -0
- data/rdoc/RubyXL/Offset.html +106 -0
- data/rdoc/RubyXL/OutlineProperties.html +106 -0
- data/rdoc/RubyXL/PageMargins.html +106 -0
- data/rdoc/RubyXL/PageSetup.html +106 -0
- data/rdoc/RubyXL/PageSetupProperties.html +106 -0
- data/rdoc/RubyXL/Pane.html +106 -0
- data/rdoc/RubyXL/Parser.html +204 -0
- data/rdoc/RubyXL/PatternFill.html +106 -0
- data/rdoc/RubyXL/PhoneticProperties.html +106 -0
- data/rdoc/RubyXL/PhoneticRun.html +106 -0
- data/rdoc/RubyXL/PivotArea.html +106 -0
- data/rdoc/RubyXL/PivotCache.html +106 -0
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +133 -0
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +122 -0
- data/rdoc/RubyXL/PivotCaches.html +106 -0
- data/rdoc/RubyXL/PivotReference.html +106 -0
- data/rdoc/RubyXL/PivotReferences.html +106 -0
- data/rdoc/RubyXL/PivotTableFile.html +133 -0
- data/rdoc/RubyXL/PivotTableSelection.html +106 -0
- data/rdoc/RubyXL/PresetGeometry.html +106 -0
- data/rdoc/RubyXL/PrintOptions.html +106 -0
- data/rdoc/RubyXL/PrinterSettingsFile.html +122 -0
- data/rdoc/RubyXL/ProtectedRange.html +106 -0
- data/rdoc/RubyXL/ProtectedRanges.html +106 -0
- data/rdoc/RubyXL/Protection.html +106 -0
- data/rdoc/RubyXL/RID.html +103 -0
- data/rdoc/RubyXL/RawOOXML.html +223 -0
- data/rdoc/RubyXL/Reference.html +640 -0
- data/rdoc/RubyXL/Relationship.html +103 -0
- data/rdoc/RubyXL/RelationshipSupport.html +419 -0
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +148 -0
- data/rdoc/RubyXL/RichText.html +159 -0
- data/rdoc/RubyXL/RichTextRun.html +157 -0
- data/rdoc/RubyXL/Row.html +439 -0
- data/rdoc/RubyXL/RowExt.html +106 -0
- data/rdoc/RubyXL/RunProperties.html +106 -0
- data/rdoc/RubyXL/Scenario.html +106 -0
- data/rdoc/RubyXL/Scenarios.html +106 -0
- data/rdoc/RubyXL/Selection.html +165 -0
- data/rdoc/RubyXL/ShapeGuide.html +106 -0
- data/rdoc/RubyXL/ShapeTextRectangle.html +106 -0
- data/rdoc/RubyXL/SharedStringsTable.html +424 -0
- data/rdoc/RubyXL/Sheet.html +106 -0
- data/rdoc/RubyXL/SheetCalculationProperties.html +106 -0
- data/rdoc/RubyXL/SheetData.html +192 -0
- data/rdoc/RubyXL/SheetDataExt.html +106 -0
- data/rdoc/RubyXL/SheetDataSet.html +106 -0
- data/rdoc/RubyXL/SheetName.html +106 -0
- data/rdoc/RubyXL/SheetNames.html +106 -0
- data/rdoc/RubyXL/Sheets.html +106 -0
- data/rdoc/RubyXL/SlicerCacheFile.html +122 -0
- data/rdoc/RubyXL/SlicerFile.html +122 -0
- data/rdoc/RubyXL/SmartTagProperties.html +106 -0
- data/rdoc/RubyXL/SmartTagType.html +106 -0
- data/rdoc/RubyXL/SmartTagTypes.html +106 -0
- data/rdoc/RubyXL/SmartTags.html +106 -0
- data/rdoc/RubyXL/SortCondition.html +106 -0
- data/rdoc/RubyXL/SortState.html +106 -0
- data/rdoc/RubyXL/Sqref.html +197 -0
- data/rdoc/RubyXL/Stop.html +106 -0
- data/rdoc/RubyXL/StringNode.html +103 -0
- data/rdoc/RubyXL/StringNodeW3C.html +197 -0
- data/rdoc/RubyXL/StringValue.html +103 -0
- data/rdoc/RubyXL/Stylesheet.html +354 -0
- data/rdoc/RubyXL/TableFile.html +122 -0
- data/rdoc/RubyXL/TableParts.html +103 -0
- data/rdoc/RubyXL/TableStyle.html +106 -0
- data/rdoc/RubyXL/TableStyles.html +106 -0
- data/rdoc/RubyXL/Text.html +216 -0
- data/rdoc/RubyXL/Theme.html +535 -0
- data/rdoc/RubyXL/ThemeElements.html +106 -0
- data/rdoc/RubyXL/ThumbnailFile.html +122 -0
- data/rdoc/RubyXL/Top10.html +106 -0
- data/rdoc/RubyXL/VMLDrawingFile.html +134 -0
- data/rdoc/RubyXL/Variant.html +106 -0
- data/rdoc/RubyXL/Vector.html +161 -0
- data/rdoc/RubyXL/VectorValue.html +103 -0
- data/rdoc/RubyXL/VisualProperties.html +106 -0
- data/rdoc/RubyXL/WebPublishObject.html +106 -0
- data/rdoc/RubyXL/WebPublishObjects.html +106 -0
- data/rdoc/RubyXL/WebPublishingItem.html +106 -0
- data/rdoc/RubyXL/WebPublishingItems.html +106 -0
- data/rdoc/RubyXL/WebPublishingProperties.html +106 -0
- data/rdoc/RubyXL/Workbook.html +633 -0
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +1321 -0
- data/rdoc/RubyXL/WorkbookProperties.html +106 -0
- data/rdoc/RubyXL/WorkbookProtection.html +106 -0
- data/rdoc/RubyXL/WorkbookRoot.html +402 -0
- data/rdoc/RubyXL/WorkbookView.html +106 -0
- data/rdoc/RubyXL/WorkbookViews.html +106 -0
- data/rdoc/RubyXL/Worksheet.html +433 -0
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +2861 -0
- data/rdoc/RubyXL/WorksheetDimensions.html +106 -0
- data/rdoc/RubyXL/WorksheetFormatProperties.html +103 -0
- data/rdoc/RubyXL/WorksheetProperties.html +106 -0
- data/rdoc/RubyXL/WorksheetProtection.html +106 -0
- data/rdoc/RubyXL/WorksheetView.html +106 -0
- data/rdoc/RubyXL/WorksheetViews.html +106 -0
- data/rdoc/RubyXL/XF.html +106 -0
- data/rdoc/created.rid +38 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +590 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +796 -0
- data/rdoc/js/darkfish.js +161 -0
- data/rdoc/js/jquery.js +4 -0
- data/rdoc/js/navigation.js +142 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +109 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +229 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +2758 -0
- data/rubyXL.gemspec +516 -0
- data/spec/lib/cell_spec.rb +515 -0
- data/spec/lib/color_spec.rb +13 -0
- data/spec/lib/parser_spec.rb +118 -0
- data/spec/lib/reference_spec.rb +28 -0
- data/spec/lib/stylesheet_spec.rb +28 -0
- data/spec/lib/text_spec.rb +29 -0
- data/spec/lib/workbook_spec.rb +174 -0
- data/spec/lib/worksheet_spec.rb +1363 -0
- data/spec/spec_helper.rb +11 -0
- data/test/input/.gitkeep +0 -0
- data/test/output/.gitkeep +0 -0
- data/test/test_parse_write.rb +15 -0
- data/tmp/.gitignore +1 -0
- metadata +615 -0
|
@@ -0,0 +1,2861 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>module RubyXL::WorksheetConvenienceMethods - rubyXL 3.3.27</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../";
|
|
11
|
+
var index_rel_prefix = "../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../js/jquery.js"></script>
|
|
15
|
+
<script src="../js/darkfish.js"></script>
|
|
16
|
+
|
|
17
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
|
18
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<body id="top" role="document" class="module">
|
|
23
|
+
<nav role="navigation">
|
|
24
|
+
<div id="project-navigation">
|
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
26
|
+
<h2>
|
|
27
|
+
<a href="../index.html" rel="home">Home</a>
|
|
28
|
+
</h2>
|
|
29
|
+
|
|
30
|
+
<div id="table-of-contents-navigation">
|
|
31
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
32
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
33
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
39
|
+
<div id="search-field-wrapper">
|
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
|
47
|
+
aria-busy="false" aria-expanded="false"
|
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
49
|
+
</form>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
<div id="class-metadata">
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<!-- Method Quickref -->
|
|
62
|
+
<div id="method-list-section" class="nav-section">
|
|
63
|
+
<h3>Methods</h3>
|
|
64
|
+
|
|
65
|
+
<ul class="link-list" role="directory">
|
|
66
|
+
|
|
67
|
+
<li ><a href="#method-i-change_column_alignment">#change_column_alignment</a>
|
|
68
|
+
|
|
69
|
+
<li ><a href="#method-i-change_column_bold">#change_column_bold</a>
|
|
70
|
+
|
|
71
|
+
<li ><a href="#method-i-change_column_border">#change_column_border</a>
|
|
72
|
+
|
|
73
|
+
<li ><a href="#method-i-change_column_border_color">#change_column_border_color</a>
|
|
74
|
+
|
|
75
|
+
<li ><a href="#method-i-change_column_fill">#change_column_fill</a>
|
|
76
|
+
|
|
77
|
+
<li ><a href="#method-i-change_column_font">#change_column_font</a>
|
|
78
|
+
|
|
79
|
+
<li ><a href="#method-i-change_column_font_color">#change_column_font_color</a>
|
|
80
|
+
|
|
81
|
+
<li ><a href="#method-i-change_column_font_name">#change_column_font_name</a>
|
|
82
|
+
|
|
83
|
+
<li ><a href="#method-i-change_column_font_size">#change_column_font_size</a>
|
|
84
|
+
|
|
85
|
+
<li ><a href="#method-i-change_column_horizontal_alignment">#change_column_horizontal_alignment</a>
|
|
86
|
+
|
|
87
|
+
<li ><a href="#method-i-change_column_italics">#change_column_italics</a>
|
|
88
|
+
|
|
89
|
+
<li ><a href="#method-i-change_column_strikethrough">#change_column_strikethrough</a>
|
|
90
|
+
|
|
91
|
+
<li ><a href="#method-i-change_column_underline">#change_column_underline</a>
|
|
92
|
+
|
|
93
|
+
<li ><a href="#method-i-change_column_vertical_alignment">#change_column_vertical_alignment</a>
|
|
94
|
+
|
|
95
|
+
<li ><a href="#method-i-change_column_width">#change_column_width</a>
|
|
96
|
+
|
|
97
|
+
<li ><a href="#method-i-change_column_width_raw">#change_column_width_raw</a>
|
|
98
|
+
|
|
99
|
+
<li ><a href="#method-i-change_row_alignment">#change_row_alignment</a>
|
|
100
|
+
|
|
101
|
+
<li ><a href="#method-i-change_row_bold">#change_row_bold</a>
|
|
102
|
+
|
|
103
|
+
<li ><a href="#method-i-change_row_border">#change_row_border</a>
|
|
104
|
+
|
|
105
|
+
<li ><a href="#method-i-change_row_border_color">#change_row_border_color</a>
|
|
106
|
+
|
|
107
|
+
<li ><a href="#method-i-change_row_fill">#change_row_fill</a>
|
|
108
|
+
|
|
109
|
+
<li ><a href="#method-i-change_row_font">#change_row_font</a>
|
|
110
|
+
|
|
111
|
+
<li ><a href="#method-i-change_row_font_color">#change_row_font_color</a>
|
|
112
|
+
|
|
113
|
+
<li ><a href="#method-i-change_row_font_name">#change_row_font_name</a>
|
|
114
|
+
|
|
115
|
+
<li ><a href="#method-i-change_row_font_size">#change_row_font_size</a>
|
|
116
|
+
|
|
117
|
+
<li ><a href="#method-i-change_row_height">#change_row_height</a>
|
|
118
|
+
|
|
119
|
+
<li ><a href="#method-i-change_row_horizontal_alignment">#change_row_horizontal_alignment</a>
|
|
120
|
+
|
|
121
|
+
<li ><a href="#method-i-change_row_italics">#change_row_italics</a>
|
|
122
|
+
|
|
123
|
+
<li ><a href="#method-i-change_row_strikethrough">#change_row_strikethrough</a>
|
|
124
|
+
|
|
125
|
+
<li ><a href="#method-i-change_row_underline">#change_row_underline</a>
|
|
126
|
+
|
|
127
|
+
<li ><a href="#method-i-change_row_vertical_alignment">#change_row_vertical_alignment</a>
|
|
128
|
+
|
|
129
|
+
<li ><a href="#method-i-column_font">#column_font</a>
|
|
130
|
+
|
|
131
|
+
<li ><a href="#method-i-delete_cell">#delete_cell</a>
|
|
132
|
+
|
|
133
|
+
<li ><a href="#method-i-delete_column">#delete_column</a>
|
|
134
|
+
|
|
135
|
+
<li ><a href="#method-i-delete_row">#delete_row</a>
|
|
136
|
+
|
|
137
|
+
<li ><a href="#method-i-get_col_style">#get_col_style</a>
|
|
138
|
+
|
|
139
|
+
<li ><a href="#method-i-get_cols_style_index">#get_cols_style_index</a>
|
|
140
|
+
|
|
141
|
+
<li ><a href="#method-i-get_column_alignment">#get_column_alignment</a>
|
|
142
|
+
|
|
143
|
+
<li ><a href="#method-i-get_column_border">#get_column_border</a>
|
|
144
|
+
|
|
145
|
+
<li ><a href="#method-i-get_column_border_color">#get_column_border_color</a>
|
|
146
|
+
|
|
147
|
+
<li ><a href="#method-i-get_column_fill">#get_column_fill</a>
|
|
148
|
+
|
|
149
|
+
<li ><a href="#method-i-get_column_font_color">#get_column_font_color</a>
|
|
150
|
+
|
|
151
|
+
<li ><a href="#method-i-get_column_font_name">#get_column_font_name</a>
|
|
152
|
+
|
|
153
|
+
<li ><a href="#method-i-get_column_font_size">#get_column_font_size</a>
|
|
154
|
+
|
|
155
|
+
<li ><a href="#method-i-get_column_width">#get_column_width</a>
|
|
156
|
+
|
|
157
|
+
<li ><a href="#method-i-get_column_width_raw">#get_column_width_raw</a>
|
|
158
|
+
|
|
159
|
+
<li ><a href="#method-i-get_row_alignment">#get_row_alignment</a>
|
|
160
|
+
|
|
161
|
+
<li ><a href="#method-i-get_row_border">#get_row_border</a>
|
|
162
|
+
|
|
163
|
+
<li ><a href="#method-i-get_row_border_color">#get_row_border_color</a>
|
|
164
|
+
|
|
165
|
+
<li ><a href="#method-i-get_row_fill">#get_row_fill</a>
|
|
166
|
+
|
|
167
|
+
<li ><a href="#method-i-get_row_font_color">#get_row_font_color</a>
|
|
168
|
+
|
|
169
|
+
<li ><a href="#method-i-get_row_font_name">#get_row_font_name</a>
|
|
170
|
+
|
|
171
|
+
<li ><a href="#method-i-get_row_font_size">#get_row_font_size</a>
|
|
172
|
+
|
|
173
|
+
<li ><a href="#method-i-get_row_height">#get_row_height</a>
|
|
174
|
+
|
|
175
|
+
<li ><a href="#method-i-get_row_style">#get_row_style</a>
|
|
176
|
+
|
|
177
|
+
<li ><a href="#method-i-insert_cell">#insert_cell</a>
|
|
178
|
+
|
|
179
|
+
<li ><a href="#method-i-insert_column">#insert_column</a>
|
|
180
|
+
|
|
181
|
+
<li ><a href="#method-i-insert_row">#insert_row</a>
|
|
182
|
+
|
|
183
|
+
<li ><a href="#method-i-is_column_bolded">#is_column_bolded</a>
|
|
184
|
+
|
|
185
|
+
<li ><a href="#method-i-is_column_italicized">#is_column_italicized</a>
|
|
186
|
+
|
|
187
|
+
<li ><a href="#method-i-is_column_struckthrough">#is_column_struckthrough</a>
|
|
188
|
+
|
|
189
|
+
<li ><a href="#method-i-is_column_underlined">#is_column_underlined</a>
|
|
190
|
+
|
|
191
|
+
<li ><a href="#method-i-is_row_bolded">#is_row_bolded</a>
|
|
192
|
+
|
|
193
|
+
<li ><a href="#method-i-is_row_italicized">#is_row_italicized</a>
|
|
194
|
+
|
|
195
|
+
<li ><a href="#method-i-is_row_struckthrough">#is_row_struckthrough</a>
|
|
196
|
+
|
|
197
|
+
<li ><a href="#method-i-is_row_underlined">#is_row_underlined</a>
|
|
198
|
+
|
|
199
|
+
<li ><a href="#method-i-merge_cells">#merge_cells</a>
|
|
200
|
+
|
|
201
|
+
<li ><a href="#method-i-row_font">#row_font</a>
|
|
202
|
+
|
|
203
|
+
</ul>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
</div>
|
|
207
|
+
</nav>
|
|
208
|
+
|
|
209
|
+
<main role="main" aria-labelledby="module-RubyXL::WorksheetConvenienceMethods">
|
|
210
|
+
<h1 id="module-RubyXL::WorksheetConvenienceMethods" class="module">
|
|
211
|
+
module RubyXL::WorksheetConvenienceMethods
|
|
212
|
+
</h1>
|
|
213
|
+
|
|
214
|
+
<section class="description">
|
|
215
|
+
|
|
216
|
+
</section>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<section class="constants-list">
|
|
228
|
+
<header>
|
|
229
|
+
<h3>Constants</h3>
|
|
230
|
+
</header>
|
|
231
|
+
<dl>
|
|
232
|
+
|
|
233
|
+
<dt id="BOLD">BOLD
|
|
234
|
+
|
|
235
|
+
<dd>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
<dt id="COLOR">COLOR
|
|
239
|
+
|
|
240
|
+
<dd>
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
<dt id="ITALICS">ITALICS
|
|
244
|
+
|
|
245
|
+
<dd>
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
<dt id="NAME">NAME
|
|
249
|
+
|
|
250
|
+
<dd>
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
<dt id="SIZE">SIZE
|
|
254
|
+
|
|
255
|
+
<dd>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
<dt id="STRIKETHROUGH">STRIKETHROUGH
|
|
259
|
+
|
|
260
|
+
<dd>
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<dt id="UNDERLINE">UNDERLINE
|
|
264
|
+
|
|
265
|
+
<dd>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
</dl>
|
|
269
|
+
</section>
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
276
|
+
<header>
|
|
277
|
+
<h3>Public Instance Methods</h3>
|
|
278
|
+
</header>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<div id="method-i-change_column_alignment" class="method-detail ">
|
|
282
|
+
|
|
283
|
+
<div class="method-heading">
|
|
284
|
+
<span class="method-name">change_column_alignment</span><span
|
|
285
|
+
class="method-args">(column_index, &block)</span>
|
|
286
|
+
|
|
287
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
288
|
+
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
<div class="method-description">
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
<div class="method-source-code" id="change_column_alignment-source">
|
|
300
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 802</span>
|
|
301
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_alignment</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
302
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
303
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
304
|
+
|
|
305
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">get_range</span>(<span class="ruby-identifier">column_index</span>).<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_alignment</span>(<span class="ruby-identifier">get_col_style</span>(<span class="ruby-identifier">column_index</span>), <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
306
|
+
<span class="ruby-comment"># Excel gets confused if width is not explicitly set for a column that had alignment changes</span>
|
|
307
|
+
<span class="ruby-identifier">change_column_width</span>(<span class="ruby-identifier">column_index</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">get_column_width_raw</span>(<span class="ruby-identifier">column_index</span>).<span class="ruby-identifier">nil?</span>
|
|
308
|
+
|
|
309
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
|
|
310
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
|
311
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
|
312
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_alignment</span>(<span class="ruby-identifier">c</span>.<span class="ruby-identifier">style_index</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
313
|
+
}
|
|
314
|
+
<span class="ruby-keyword">end</span></pre>
|
|
315
|
+
</div>
|
|
316
|
+
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<div id="method-i-change_column_bold" class="method-detail ">
|
|
326
|
+
|
|
327
|
+
<div class="method-heading">
|
|
328
|
+
<span class="method-name">change_column_bold</span><span
|
|
329
|
+
class="method-args">(column_index, bolded = false)</span>
|
|
330
|
+
|
|
331
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
332
|
+
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
<div class="method-description">
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
<div class="method-source-code" id="change_column_bold-source">
|
|
344
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 735</span>
|
|
345
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_bold</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">bolded</span> = <span class="ruby-keyword">false</span>)
|
|
346
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
|
347
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">dup</span>
|
|
348
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_bold</span>(<span class="ruby-identifier">bolded</span>)
|
|
349
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">BOLD</span>, <span class="ruby-identifier">bolded</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
350
|
+
<span class="ruby-keyword">end</span></pre>
|
|
351
|
+
</div>
|
|
352
|
+
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
<div id="method-i-change_column_border" class="method-detail ">
|
|
362
|
+
|
|
363
|
+
<div class="method-heading">
|
|
364
|
+
<span class="method-name">change_column_border</span><span
|
|
365
|
+
class="method-args">(column_index, direction, weight)</span>
|
|
366
|
+
|
|
367
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
368
|
+
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
<div class="method-description">
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
<div class="method-source-code" id="change_column_border-source">
|
|
380
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 764</span>
|
|
381
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_border</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
|
382
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
383
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
384
|
+
|
|
385
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">get_range</span>(<span class="ruby-identifier">column_index</span>).<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_border</span>(<span class="ruby-identifier">get_col_style</span>(<span class="ruby-identifier">column_index</span>), <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
|
386
|
+
|
|
387
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
|
|
388
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column_index</span>]
|
|
389
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_border</span>(<span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
|
390
|
+
}
|
|
391
|
+
<span class="ruby-keyword">end</span></pre>
|
|
392
|
+
</div>
|
|
393
|
+
|
|
394
|
+
</div>
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
<div id="method-i-change_column_border_color" class="method-detail ">
|
|
403
|
+
|
|
404
|
+
<div class="method-heading">
|
|
405
|
+
<span class="method-name">change_column_border_color</span><span
|
|
406
|
+
class="method-args">(column_index, direction, color)</span>
|
|
407
|
+
|
|
408
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
409
|
+
|
|
410
|
+
</div>
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
<div class="method-description">
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
<div class="method-source-code" id="change_column_border_color-source">
|
|
421
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 776</span>
|
|
422
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_border_color</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">color</span>)
|
|
423
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
424
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
425
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">color</span>)
|
|
426
|
+
|
|
427
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">get_range</span>(<span class="ruby-identifier">column_index</span>).<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_border_color</span>(<span class="ruby-identifier">get_col_style</span>(<span class="ruby-identifier">column_index</span>), <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">color</span>)
|
|
428
|
+
|
|
429
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
|
|
430
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column_index</span>]
|
|
431
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_border_color</span>(<span class="ruby-identifier">direction</span>, <span class="ruby-identifier">color</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
|
432
|
+
}
|
|
433
|
+
<span class="ruby-keyword">end</span></pre>
|
|
434
|
+
</div>
|
|
435
|
+
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
</div>
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
<div id="method-i-change_column_fill" class="method-detail ">
|
|
445
|
+
|
|
446
|
+
<div class="method-heading">
|
|
447
|
+
<span class="method-name">change_column_fill</span><span
|
|
448
|
+
class="method-args">(column_index, color_code = 'ffffff')</span>
|
|
449
|
+
|
|
450
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
451
|
+
|
|
452
|
+
</div>
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
<div class="method-description">
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
<div class="method-source-code" id="change_column_fill-source">
|
|
463
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 532</span>
|
|
464
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_fill</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">color_code</span> = <span class="ruby-string">'ffffff'</span>)
|
|
465
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
466
|
+
<span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">color_code</span>)
|
|
467
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
468
|
+
|
|
469
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">get_range</span>(<span class="ruby-identifier">column_index</span>).<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_fill</span>(<span class="ruby-identifier">get_col_style</span>(<span class="ruby-identifier">column_index</span>), <span class="ruby-identifier">color_code</span>)
|
|
470
|
+
|
|
471
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
|
|
472
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
|
473
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_fill</span>(<span class="ruby-identifier">color_code</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>
|
|
474
|
+
}
|
|
475
|
+
<span class="ruby-keyword">end</span></pre>
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
</div>
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
<div id="method-i-change_column_font" class="method-detail ">
|
|
487
|
+
|
|
488
|
+
<div class="method-heading">
|
|
489
|
+
<span class="method-name">change_column_font</span><span
|
|
490
|
+
class="method-args">(column_index, change_type, arg, font, xf)</span>
|
|
491
|
+
|
|
492
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
493
|
+
|
|
494
|
+
</div>
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
<div class="method-description">
|
|
498
|
+
|
|
499
|
+
<p>Helper method to update the fonts and cell styles array main method to
|
|
500
|
+
change font, called from each separate font mutator method</p>
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
<div class="method-source-code" id="change_column_font-source">
|
|
506
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 692</span>
|
|
507
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">change_type</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
508
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
509
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
510
|
+
|
|
511
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">register_new_font</span>(<span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
512
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">get_range</span>(<span class="ruby-identifier">column_index</span>).<span class="ruby-identifier">style_index</span> = <span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">register_new_xf</span>(<span class="ruby-identifier">xf</span>)
|
|
513
|
+
|
|
514
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
|
|
515
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
|
516
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">font_switch</span>(<span class="ruby-identifier">change_type</span>, <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
|
517
|
+
}
|
|
518
|
+
<span class="ruby-keyword">end</span></pre>
|
|
519
|
+
</div>
|
|
520
|
+
|
|
521
|
+
</div>
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
</div>
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
<div id="method-i-change_column_font_color" class="method-detail ">
|
|
530
|
+
|
|
531
|
+
<div class="method-heading">
|
|
532
|
+
<span class="method-name">change_column_font_color</span><span
|
|
533
|
+
class="method-args">(column_index, font_color='000000')</span>
|
|
534
|
+
|
|
535
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
536
|
+
|
|
537
|
+
</div>
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
<div class="method-description">
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
<div class="method-source-code" id="change_column_font_color-source">
|
|
548
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 719</span>
|
|
549
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_font_color</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">font_color</span>=<span class="ruby-string">'000000'</span>)
|
|
550
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
551
|
+
|
|
552
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
|
553
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">dup</span>
|
|
554
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_rgb_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
555
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">COLOR</span>, <span class="ruby-identifier">font_color</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
556
|
+
<span class="ruby-keyword">end</span></pre>
|
|
557
|
+
</div>
|
|
558
|
+
|
|
559
|
+
</div>
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
</div>
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
<div id="method-i-change_column_font_name" class="method-detail ">
|
|
568
|
+
|
|
569
|
+
<div class="method-heading">
|
|
570
|
+
<span class="method-name">change_column_font_name</span><span
|
|
571
|
+
class="method-args">(column_index = 0, font_name = 'Verdana')</span>
|
|
572
|
+
|
|
573
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
574
|
+
|
|
575
|
+
</div>
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
<div class="method-description">
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
<div class="method-source-code" id="change_column_font_name-source">
|
|
586
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 705</span>
|
|
587
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_font_name</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">font_name</span> = <span class="ruby-string">'Verdana'</span>)
|
|
588
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
|
589
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">dup</span>
|
|
590
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_name</span>(<span class="ruby-identifier">font_name</span>)
|
|
591
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">NAME</span>, <span class="ruby-identifier">font_name</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
592
|
+
<span class="ruby-keyword">end</span></pre>
|
|
593
|
+
</div>
|
|
594
|
+
|
|
595
|
+
</div>
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
</div>
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
<div id="method-i-change_column_font_size" class="method-detail ">
|
|
604
|
+
|
|
605
|
+
<div class="method-heading">
|
|
606
|
+
<span class="method-name">change_column_font_size</span><span
|
|
607
|
+
class="method-args">(column_index, font_size=10)</span>
|
|
608
|
+
|
|
609
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
610
|
+
|
|
611
|
+
</div>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
<div class="method-description">
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
<div class="method-source-code" id="change_column_font_size-source">
|
|
622
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 712</span>
|
|
623
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_font_size</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">font_size</span>=<span class="ruby-value">10</span>)
|
|
624
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
|
625
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">dup</span>
|
|
626
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_size</span>(<span class="ruby-identifier">font_size</span>)
|
|
627
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">SIZE</span>, <span class="ruby-identifier">font_size</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
628
|
+
<span class="ruby-keyword">end</span></pre>
|
|
629
|
+
</div>
|
|
630
|
+
|
|
631
|
+
</div>
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
</div>
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
<div id="method-i-change_column_horizontal_alignment" class="method-detail ">
|
|
640
|
+
|
|
641
|
+
<div class="method-heading">
|
|
642
|
+
<span class="method-name">change_column_horizontal_alignment</span><span
|
|
643
|
+
class="method-args">(column_index, alignment = 'center')</span>
|
|
644
|
+
|
|
645
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
646
|
+
|
|
647
|
+
</div>
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
<div class="method-description">
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
<div class="method-source-code" id="change_column_horizontal_alignment-source">
|
|
658
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 756</span>
|
|
659
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_horizontal_alignment</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">alignment</span> = <span class="ruby-string">'center'</span>)
|
|
660
|
+
<span class="ruby-identifier">change_column_alignment</span>(<span class="ruby-identifier">column_index</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">horizontal</span> = <span class="ruby-identifier">alignment</span> }
|
|
661
|
+
<span class="ruby-keyword">end</span></pre>
|
|
662
|
+
</div>
|
|
663
|
+
|
|
664
|
+
</div>
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
</div>
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
<div id="method-i-change_column_italics" class="method-detail ">
|
|
673
|
+
|
|
674
|
+
<div class="method-heading">
|
|
675
|
+
<span class="method-name">change_column_italics</span><span
|
|
676
|
+
class="method-args">(column_index, italicized = false)</span>
|
|
677
|
+
|
|
678
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
679
|
+
|
|
680
|
+
</div>
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
<div class="method-description">
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
<div class="method-source-code" id="change_column_italics-source">
|
|
691
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 728</span>
|
|
692
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_italics</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">italicized</span> = <span class="ruby-keyword">false</span>)
|
|
693
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
|
694
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">dup</span>
|
|
695
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_italic</span>(<span class="ruby-identifier">italicized</span>)
|
|
696
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">ITALICS</span>, <span class="ruby-identifier">italicized</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
697
|
+
<span class="ruby-keyword">end</span></pre>
|
|
698
|
+
</div>
|
|
699
|
+
|
|
700
|
+
</div>
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
</div>
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
<div id="method-i-change_column_strikethrough" class="method-detail ">
|
|
709
|
+
|
|
710
|
+
<div class="method-heading">
|
|
711
|
+
<span class="method-name">change_column_strikethrough</span><span
|
|
712
|
+
class="method-args">(column_index, struckthrough=false)</span>
|
|
713
|
+
|
|
714
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
715
|
+
|
|
716
|
+
</div>
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
<div class="method-description">
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
<div class="method-source-code" id="change_column_strikethrough-source">
|
|
727
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 749</span>
|
|
728
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_strikethrough</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">struckthrough</span>=<span class="ruby-keyword">false</span>)
|
|
729
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
|
730
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">dup</span>
|
|
731
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_strikethrough</span>(<span class="ruby-identifier">struckthrough</span>)
|
|
732
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">STRIKETHROUGH</span>, <span class="ruby-identifier">struckthrough</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
733
|
+
<span class="ruby-keyword">end</span></pre>
|
|
734
|
+
</div>
|
|
735
|
+
|
|
736
|
+
</div>
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
</div>
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
<div id="method-i-change_column_underline" class="method-detail ">
|
|
745
|
+
|
|
746
|
+
<div class="method-heading">
|
|
747
|
+
<span class="method-name">change_column_underline</span><span
|
|
748
|
+
class="method-args">(column_index, underlined = false)</span>
|
|
749
|
+
|
|
750
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
751
|
+
|
|
752
|
+
</div>
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
<div class="method-description">
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
<div class="method-source-code" id="change_column_underline-source">
|
|
763
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 742</span>
|
|
764
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_underline</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">underlined</span> = <span class="ruby-keyword">false</span>)
|
|
765
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
|
766
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">font_id</span>].<span class="ruby-identifier">dup</span>
|
|
767
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_underline</span>(<span class="ruby-identifier">underlined</span>)
|
|
768
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">UNDERLINE</span>, <span class="ruby-identifier">underlined</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
|
769
|
+
<span class="ruby-keyword">end</span></pre>
|
|
770
|
+
</div>
|
|
771
|
+
|
|
772
|
+
</div>
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
</div>
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
<div id="method-i-change_column_vertical_alignment" class="method-detail ">
|
|
781
|
+
|
|
782
|
+
<div class="method-heading">
|
|
783
|
+
<span class="method-name">change_column_vertical_alignment</span><span
|
|
784
|
+
class="method-args">(column_index, alignment = 'center')</span>
|
|
785
|
+
|
|
786
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
787
|
+
|
|
788
|
+
</div>
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
<div class="method-description">
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
<div class="method-source-code" id="change_column_vertical_alignment-source">
|
|
799
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 760</span>
|
|
800
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_vertical_alignment</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">alignment</span> = <span class="ruby-string">'center'</span>)
|
|
801
|
+
<span class="ruby-identifier">change_column_alignment</span>(<span class="ruby-identifier">column_index</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">vertical</span> = <span class="ruby-identifier">alignment</span> }
|
|
802
|
+
<span class="ruby-keyword">end</span></pre>
|
|
803
|
+
</div>
|
|
804
|
+
|
|
805
|
+
</div>
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
</div>
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
<div id="method-i-change_column_width" class="method-detail ">
|
|
814
|
+
|
|
815
|
+
<div class="method-heading">
|
|
816
|
+
<span class="method-name">change_column_width</span><span
|
|
817
|
+
class="method-args">(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)</span>
|
|
818
|
+
|
|
819
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
820
|
+
|
|
821
|
+
</div>
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
<div class="method-description">
|
|
825
|
+
|
|
826
|
+
<p>Get column width measured in number of digits, as per <a
|
|
827
|
+
href="http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx">msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx</a></p>
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
<div class="method-source-code" id="change_column_width-source">
|
|
833
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 515</span>
|
|
834
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_width</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">width_in_chars</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">ColumnRange</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_WIDTH</span>)
|
|
835
|
+
<span class="ruby-identifier">change_column_width_raw</span>(<span class="ruby-identifier">column_index</span>, ((<span class="ruby-identifier">width_in_chars</span> <span class="ruby-operator">+</span> (<span class="ruby-value">5.0</span> <span class="ruby-operator">/</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Font</span><span class="ruby-operator">::</span><span class="ruby-constant">MAX_DIGIT_WIDTH</span>)) <span class="ruby-operator">*</span> <span class="ruby-value">256</span>).<span class="ruby-identifier">to_i</span> <span class="ruby-operator">/</span> <span class="ruby-value">256.0</span>)
|
|
836
|
+
<span class="ruby-keyword">end</span></pre>
|
|
837
|
+
</div>
|
|
838
|
+
|
|
839
|
+
</div>
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
</div>
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
<div id="method-i-change_column_width_raw" class="method-detail ">
|
|
848
|
+
|
|
849
|
+
<div class="method-heading">
|
|
850
|
+
<span class="method-name">change_column_width_raw</span><span
|
|
851
|
+
class="method-args">(column_index, width)</span>
|
|
852
|
+
|
|
853
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
854
|
+
|
|
855
|
+
</div>
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
<div class="method-description">
|
|
859
|
+
|
|
860
|
+
<p>Set raw column width value</p>
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
<div class="method-source-code" id="change_column_width_raw-source">
|
|
866
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 505</span>
|
|
867
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_width_raw</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">width</span>)
|
|
868
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
869
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
870
|
+
<span class="ruby-identifier">range</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">get_range</span>(<span class="ruby-identifier">column_index</span>)
|
|
871
|
+
<span class="ruby-identifier">range</span>.<span class="ruby-identifier">width</span> = <span class="ruby-identifier">width</span>
|
|
872
|
+
<span class="ruby-identifier">range</span>.<span class="ruby-identifier">custom_width</span> = <span class="ruby-keyword">true</span>
|
|
873
|
+
<span class="ruby-keyword">end</span></pre>
|
|
874
|
+
</div>
|
|
875
|
+
|
|
876
|
+
</div>
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
</div>
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
<div id="method-i-change_row_alignment" class="method-detail ">
|
|
885
|
+
|
|
886
|
+
<div class="method-heading">
|
|
887
|
+
<span class="method-name">change_row_alignment</span><span
|
|
888
|
+
class="method-args">(row, &block)</span>
|
|
889
|
+
|
|
890
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
891
|
+
|
|
892
|
+
</div>
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
<div class="method-description">
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
<div class="method-source-code" id="change_row_alignment-source">
|
|
903
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 789</span>
|
|
904
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_alignment</span>(<span class="ruby-identifier">row</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
905
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
906
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
907
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
908
|
+
|
|
909
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_alignment</span>(<span class="ruby-identifier">get_row_style</span>(<span class="ruby-identifier">row</span>), <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
910
|
+
|
|
911
|
+
<span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
|
912
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
|
913
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_alignment</span>(<span class="ruby-identifier">c</span>.<span class="ruby-identifier">style_index</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
914
|
+
}
|
|
915
|
+
<span class="ruby-keyword">end</span></pre>
|
|
916
|
+
</div>
|
|
917
|
+
|
|
918
|
+
</div>
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
</div>
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
<div id="method-i-change_row_bold" class="method-detail ">
|
|
927
|
+
|
|
928
|
+
<div class="method-heading">
|
|
929
|
+
<span class="method-name">change_row_bold</span><span
|
|
930
|
+
class="method-args">(row = 0, bolded = false)</span>
|
|
931
|
+
|
|
932
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
933
|
+
|
|
934
|
+
</div>
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
<div class="method-description">
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
<div class="method-source-code" id="change_row_bold-source">
|
|
945
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 660</span>
|
|
946
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_bold</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">bolded</span> = <span class="ruby-keyword">false</span>)
|
|
947
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
948
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
949
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_bold</span>(<span class="ruby-identifier">bolded</span>)
|
|
950
|
+
<span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">BOLD</span>, <span class="ruby-identifier">bolded</span>, <span class="ruby-identifier">font</span>)
|
|
951
|
+
<span class="ruby-keyword">end</span></pre>
|
|
952
|
+
</div>
|
|
953
|
+
|
|
954
|
+
</div>
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
</div>
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
<div id="method-i-change_row_border" class="method-detail ">
|
|
963
|
+
|
|
964
|
+
<div class="method-heading">
|
|
965
|
+
<span class="method-name">change_row_border</span><span
|
|
966
|
+
class="method-args">(row, direction, weight)</span>
|
|
967
|
+
|
|
968
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
969
|
+
|
|
970
|
+
</div>
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
<div class="method-description">
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
<div class="method-source-code" id="change_row_border-source">
|
|
981
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 586</span>
|
|
982
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
|
983
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
984
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
985
|
+
|
|
986
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_border</span>(<span class="ruby-identifier">get_row_style</span>(<span class="ruby-identifier">row</span>), <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
|
987
|
+
|
|
988
|
+
<span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
|
989
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_border</span>(<span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
|
990
|
+
}
|
|
991
|
+
<span class="ruby-keyword">end</span></pre>
|
|
992
|
+
</div>
|
|
993
|
+
|
|
994
|
+
</div>
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
</div>
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
<div id="method-i-change_row_border_color" class="method-detail ">
|
|
1003
|
+
|
|
1004
|
+
<div class="method-heading">
|
|
1005
|
+
<span class="method-name">change_row_border_color</span><span
|
|
1006
|
+
class="method-args">(row, direction, color = '000000')</span>
|
|
1007
|
+
|
|
1008
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1009
|
+
|
|
1010
|
+
</div>
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
<div class="method-description">
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
<div class="method-source-code" id="change_row_border_color-source">
|
|
1021
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 597</span>
|
|
1022
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_border_color</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">color</span> = <span class="ruby-string">'000000'</span>)
|
|
1023
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1024
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1025
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">color</span>)
|
|
1026
|
+
|
|
1027
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_border_color</span>(<span class="ruby-identifier">get_row_style</span>(<span class="ruby-identifier">row</span>), <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">color</span>)
|
|
1028
|
+
|
|
1029
|
+
<span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
|
1030
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_border_color</span>(<span class="ruby-identifier">direction</span>, <span class="ruby-identifier">color</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
|
1031
|
+
}
|
|
1032
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1033
|
+
</div>
|
|
1034
|
+
|
|
1035
|
+
</div>
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
</div>
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
<div id="method-i-change_row_fill" class="method-detail ">
|
|
1044
|
+
|
|
1045
|
+
<div class="method-heading">
|
|
1046
|
+
<span class="method-name">change_row_fill</span><span
|
|
1047
|
+
class="method-args">(row_index = 0, rgb = 'ffffff')</span>
|
|
1048
|
+
|
|
1049
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1050
|
+
|
|
1051
|
+
</div>
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
<div class="method-description">
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
<div class="method-source-code" id="change_row_fill-source">
|
|
1062
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 609</span>
|
|
1063
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_fill</span>(<span class="ruby-identifier">row_index</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">rgb</span> = <span class="ruby-string">'ffffff'</span>)
|
|
1064
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1065
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
|
1066
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">rgb</span>)
|
|
1067
|
+
|
|
1068
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row_index</span>].<span class="ruby-identifier">style_index</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_fill</span>(<span class="ruby-identifier">get_row_style</span>(<span class="ruby-identifier">row_index</span>), <span class="ruby-identifier">rgb</span>)
|
|
1069
|
+
<span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row_index</span>].<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_fill</span>(<span class="ruby-identifier">rgb</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span> }
|
|
1070
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1071
|
+
</div>
|
|
1072
|
+
|
|
1073
|
+
</div>
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
</div>
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
<div id="method-i-change_row_font" class="method-detail ">
|
|
1082
|
+
|
|
1083
|
+
<div class="method-heading">
|
|
1084
|
+
<span class="method-name">change_row_font</span><span
|
|
1085
|
+
class="method-args">(row_index, change_type, arg, font)</span>
|
|
1086
|
+
|
|
1087
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1088
|
+
|
|
1089
|
+
</div>
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
<div class="method-description">
|
|
1093
|
+
|
|
1094
|
+
<p>Helper method to update the row styles array change_type - <a
|
|
1095
|
+
href="WorksheetConvenienceMethods.html#NAME">NAME</a> or <a
|
|
1096
|
+
href="WorksheetConvenienceMethods.html#SIZE">SIZE</a> or <a
|
|
1097
|
+
href="WorksheetConvenienceMethods.html#COLOR">COLOR</a> etc main method to
|
|
1098
|
+
change font, called from each separate font mutator method</p>
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
<div class="method-source-code" id="change_row_font-source">
|
|
1104
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 621</span>
|
|
1105
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row_index</span>, <span class="ruby-identifier">change_type</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">font</span>)
|
|
1106
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1107
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
|
1108
|
+
|
|
1109
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">register_new_font</span>(<span class="ruby-identifier">font</span>, <span class="ruby-identifier">get_row_xf</span>(<span class="ruby-identifier">row_index</span>))
|
|
1110
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row_index</span>]
|
|
1111
|
+
<span class="ruby-identifier">row</span>.<span class="ruby-identifier">style_index</span> = <span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">register_new_xf</span>(<span class="ruby-identifier">xf</span>)
|
|
1112
|
+
<span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">font_switch</span>(<span class="ruby-identifier">change_type</span>, <span class="ruby-identifier">arg</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span> }
|
|
1113
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1114
|
+
</div>
|
|
1115
|
+
|
|
1116
|
+
</div>
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
</div>
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
<div id="method-i-change_row_font_color" class="method-detail ">
|
|
1125
|
+
|
|
1126
|
+
<div class="method-heading">
|
|
1127
|
+
<span class="method-name">change_row_font_color</span><span
|
|
1128
|
+
class="method-args">(row = 0, font_color = '000000')</span>
|
|
1129
|
+
|
|
1130
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1131
|
+
|
|
1132
|
+
</div>
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
<div class="method-description">
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
<div class="method-source-code" id="change_row_font_color-source">
|
|
1143
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 645</span>
|
|
1144
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_font_color</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">font_color</span> = <span class="ruby-string">'000000'</span>)
|
|
1145
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1146
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
1147
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
1148
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_rgb_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
1149
|
+
<span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">COLOR</span>, <span class="ruby-identifier">font_color</span>, <span class="ruby-identifier">font</span>)
|
|
1150
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1151
|
+
</div>
|
|
1152
|
+
|
|
1153
|
+
</div>
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
</div>
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
<div id="method-i-change_row_font_name" class="method-detail ">
|
|
1162
|
+
|
|
1163
|
+
<div class="method-heading">
|
|
1164
|
+
<span class="method-name">change_row_font_name</span><span
|
|
1165
|
+
class="method-args">(row = 0, font_name = 'Verdana')</span>
|
|
1166
|
+
|
|
1167
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1168
|
+
|
|
1169
|
+
</div>
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
<div class="method-description">
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
<div class="method-source-code" id="change_row_font_name-source">
|
|
1180
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 631</span>
|
|
1181
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_font_name</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">font_name</span> = <span class="ruby-string">'Verdana'</span>)
|
|
1182
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1183
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
1184
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_name</span>(<span class="ruby-identifier">font_name</span>)
|
|
1185
|
+
<span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">NAME</span>, <span class="ruby-identifier">font_name</span>, <span class="ruby-identifier">font</span>)
|
|
1186
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1187
|
+
</div>
|
|
1188
|
+
|
|
1189
|
+
</div>
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
</div>
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
<div id="method-i-change_row_font_size" class="method-detail ">
|
|
1198
|
+
|
|
1199
|
+
<div class="method-heading">
|
|
1200
|
+
<span class="method-name">change_row_font_size</span><span
|
|
1201
|
+
class="method-args">(row = 0, font_size=10)</span>
|
|
1202
|
+
|
|
1203
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1204
|
+
|
|
1205
|
+
</div>
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
|
+
<div class="method-description">
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
<div class="method-source-code" id="change_row_font_size-source">
|
|
1216
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 638</span>
|
|
1217
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_font_size</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">font_size</span>=<span class="ruby-value">10</span>)
|
|
1218
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1219
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
1220
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_size</span>(<span class="ruby-identifier">font_size</span>)
|
|
1221
|
+
<span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">SIZE</span>, <span class="ruby-identifier">font_size</span>, <span class="ruby-identifier">font</span>)
|
|
1222
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1223
|
+
</div>
|
|
1224
|
+
|
|
1225
|
+
</div>
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
</div>
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
<div id="method-i-change_row_height" class="method-detail ">
|
|
1234
|
+
|
|
1235
|
+
<div class="method-heading">
|
|
1236
|
+
<span class="method-name">change_row_height</span><span
|
|
1237
|
+
class="method-args">(row = 0, height = 10)</span>
|
|
1238
|
+
|
|
1239
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1240
|
+
|
|
1241
|
+
</div>
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
<div class="method-description">
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
<div class="method-source-code" id="change_row_height-source">
|
|
1252
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 681</span>
|
|
1253
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_height</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">height</span> = <span class="ruby-value">10</span>)
|
|
1254
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1255
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1256
|
+
|
|
1257
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>]
|
|
1258
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">ht</span> = <span class="ruby-identifier">height</span>
|
|
1259
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">custom_height</span> = <span class="ruby-keyword">true</span>
|
|
1260
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1261
|
+
</div>
|
|
1262
|
+
|
|
1263
|
+
</div>
|
|
1264
|
+
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
</div>
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
<div id="method-i-change_row_horizontal_alignment" class="method-detail ">
|
|
1272
|
+
|
|
1273
|
+
<div class="method-heading">
|
|
1274
|
+
<span class="method-name">change_row_horizontal_alignment</span><span
|
|
1275
|
+
class="method-args">(row = 0, alignment = 'center')</span>
|
|
1276
|
+
|
|
1277
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1278
|
+
|
|
1279
|
+
</div>
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
<div class="method-description">
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
<div class="method-source-code" id="change_row_horizontal_alignment-source">
|
|
1290
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 574</span>
|
|
1291
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_horizontal_alignment</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">alignment</span> = <span class="ruby-string">'center'</span>)
|
|
1292
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1293
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
1294
|
+
<span class="ruby-identifier">change_row_alignment</span>(<span class="ruby-identifier">row</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">horizontal</span> = <span class="ruby-identifier">alignment</span> }
|
|
1295
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1296
|
+
</div>
|
|
1297
|
+
|
|
1298
|
+
</div>
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
</div>
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
<div id="method-i-change_row_italics" class="method-detail ">
|
|
1307
|
+
|
|
1308
|
+
<div class="method-heading">
|
|
1309
|
+
<span class="method-name">change_row_italics</span><span
|
|
1310
|
+
class="method-args">(row = 0, italicized = false)</span>
|
|
1311
|
+
|
|
1312
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1313
|
+
|
|
1314
|
+
</div>
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
<div class="method-description">
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
<div class="method-source-code" id="change_row_italics-source">
|
|
1325
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 653</span>
|
|
1326
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_italics</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">italicized</span> = <span class="ruby-keyword">false</span>)
|
|
1327
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1328
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
1329
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_italic</span>(<span class="ruby-identifier">italicized</span>)
|
|
1330
|
+
<span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">ITALICS</span>, <span class="ruby-identifier">italicized</span>, <span class="ruby-identifier">font</span>)
|
|
1331
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1332
|
+
</div>
|
|
1333
|
+
|
|
1334
|
+
</div>
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
</div>
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
<div id="method-i-change_row_strikethrough" class="method-detail ">
|
|
1343
|
+
|
|
1344
|
+
<div class="method-heading">
|
|
1345
|
+
<span class="method-name">change_row_strikethrough</span><span
|
|
1346
|
+
class="method-args">(row = 0, struckthrough=false)</span>
|
|
1347
|
+
|
|
1348
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1349
|
+
|
|
1350
|
+
</div>
|
|
1351
|
+
|
|
1352
|
+
|
|
1353
|
+
<div class="method-description">
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
<div class="method-source-code" id="change_row_strikethrough-source">
|
|
1361
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 674</span>
|
|
1362
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_strikethrough</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">struckthrough</span>=<span class="ruby-keyword">false</span>)
|
|
1363
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1364
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
1365
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_strikethrough</span>(<span class="ruby-identifier">struckthrough</span>)
|
|
1366
|
+
<span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">STRIKETHROUGH</span>, <span class="ruby-identifier">struckthrough</span>, <span class="ruby-identifier">font</span>)
|
|
1367
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1368
|
+
</div>
|
|
1369
|
+
|
|
1370
|
+
</div>
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
</div>
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
<div id="method-i-change_row_underline" class="method-detail ">
|
|
1379
|
+
|
|
1380
|
+
<div class="method-heading">
|
|
1381
|
+
<span class="method-name">change_row_underline</span><span
|
|
1382
|
+
class="method-args">(row = 0, underlined=false)</span>
|
|
1383
|
+
|
|
1384
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1385
|
+
|
|
1386
|
+
</div>
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
<div class="method-description">
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
|
|
1396
|
+
<div class="method-source-code" id="change_row_underline-source">
|
|
1397
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 667</span>
|
|
1398
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_underline</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">underlined</span>=<span class="ruby-keyword">false</span>)
|
|
1399
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1400
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
1401
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_underline</span>(<span class="ruby-identifier">underlined</span>)
|
|
1402
|
+
<span class="ruby-identifier">change_row_font</span>(<span class="ruby-identifier">row</span>, <span class="ruby-constant">Worksheet</span><span class="ruby-operator">::</span><span class="ruby-constant">UNDERLINE</span>, <span class="ruby-identifier">underlined</span>, <span class="ruby-identifier">font</span>)
|
|
1403
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1404
|
+
</div>
|
|
1405
|
+
|
|
1406
|
+
</div>
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
</div>
|
|
1412
|
+
|
|
1413
|
+
|
|
1414
|
+
<div id="method-i-change_row_vertical_alignment" class="method-detail ">
|
|
1415
|
+
|
|
1416
|
+
<div class="method-heading">
|
|
1417
|
+
<span class="method-name">change_row_vertical_alignment</span><span
|
|
1418
|
+
class="method-args">(row = 0, alignment = 'center')</span>
|
|
1419
|
+
|
|
1420
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1421
|
+
|
|
1422
|
+
</div>
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
<div class="method-description">
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
<div class="method-source-code" id="change_row_vertical_alignment-source">
|
|
1433
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 580</span>
|
|
1434
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_vertical_alignment</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">alignment</span> = <span class="ruby-string">'center'</span>)
|
|
1435
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1436
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
1437
|
+
<span class="ruby-identifier">change_row_alignment</span>(<span class="ruby-identifier">row</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">vertical</span> = <span class="ruby-identifier">alignment</span> }
|
|
1438
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1439
|
+
</div>
|
|
1440
|
+
|
|
1441
|
+
</div>
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
|
|
1446
|
+
</div>
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
<div id="method-i-column_font" class="method-detail ">
|
|
1450
|
+
|
|
1451
|
+
<div class="method-heading">
|
|
1452
|
+
<span class="method-name">column_font</span><span
|
|
1453
|
+
class="method-args">(col)</span>
|
|
1454
|
+
|
|
1455
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1456
|
+
|
|
1457
|
+
</div>
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
<div class="method-description">
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
|
|
1467
|
+
<div class="method-source-code" id="column_font-source">
|
|
1468
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 561</span>
|
|
1469
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
1470
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1471
|
+
|
|
1472
|
+
<span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">fonts</span>[<span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">get_cols_style_index</span>(<span class="ruby-identifier">col</span>)].<span class="ruby-identifier">font_id</span>]
|
|
1473
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1474
|
+
</div>
|
|
1475
|
+
|
|
1476
|
+
</div>
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
|
|
1481
|
+
</div>
|
|
1482
|
+
|
|
1483
|
+
|
|
1484
|
+
<div id="method-i-delete_cell" class="method-detail ">
|
|
1485
|
+
|
|
1486
|
+
<div class="method-heading">
|
|
1487
|
+
<span class="method-name">delete_cell</span><span
|
|
1488
|
+
class="method-args">(row_index = 0, column_index=0, shift=nil)</span>
|
|
1489
|
+
|
|
1490
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1491
|
+
|
|
1492
|
+
</div>
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
<div class="method-description">
|
|
1496
|
+
|
|
1497
|
+
<p>by default, only sets cell to nil if :left is specified, method will shift
|
|
1498
|
+
row contents to the right of the deleted cell to the left if :up is
|
|
1499
|
+
specified, method will shift column contents below the deleted cell upward</p>
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
<div class="method-source-code" id="delete_cell-source">
|
|
1505
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 245</span>
|
|
1506
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete_cell</span>(<span class="ruby-identifier">row_index</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">shift</span>=<span class="ruby-keyword">nil</span>)
|
|
1507
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1508
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row_index</span>)
|
|
1509
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
|
1510
|
+
|
|
1511
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row_index</span>]
|
|
1512
|
+
<span class="ruby-identifier">old_cell</span> = <span class="ruby-identifier">row</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
|
1513
|
+
|
|
1514
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">shift</span>
|
|
1515
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">then</span>
|
|
1516
|
+
<span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column_index</span>] = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>
|
|
1517
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:left</span> <span class="ruby-keyword">then</span>
|
|
1518
|
+
<span class="ruby-identifier">row</span>.<span class="ruby-identifier">delete_cell_shift_left</span>(<span class="ruby-identifier">column_index</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>
|
|
1519
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:up</span> <span class="ruby-keyword">then</span>
|
|
1520
|
+
(<span class="ruby-identifier">row_index</span><span class="ruby-operator">...</span>(<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
|
1521
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column_index</span>] = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column_index</span>]
|
|
1522
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">row</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Cell</span>)
|
|
1523
|
+
}
|
|
1524
|
+
<span class="ruby-keyword">else</span>
|
|
1525
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'invalid shift option'</span>
|
|
1526
|
+
<span class="ruby-keyword">end</span>
|
|
1527
|
+
|
|
1528
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">old_cell</span>
|
|
1529
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1530
|
+
</div>
|
|
1531
|
+
|
|
1532
|
+
</div>
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
</div>
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
<div id="method-i-delete_column" class="method-detail ">
|
|
1541
|
+
|
|
1542
|
+
<div class="method-heading">
|
|
1543
|
+
<span class="method-name">delete_column</span><span
|
|
1544
|
+
class="method-args">(column_index = 0)</span>
|
|
1545
|
+
|
|
1546
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1547
|
+
|
|
1548
|
+
</div>
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
<div class="method-description">
|
|
1552
|
+
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
|
|
1558
|
+
<div class="method-source-code" id="delete_column-source">
|
|
1559
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 354</span>
|
|
1560
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete_column</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
|
1561
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1562
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
|
1563
|
+
|
|
1564
|
+
<span class="ruby-comment"># Delete column</span>
|
|
1565
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">column_index</span>) }
|
|
1566
|
+
|
|
1567
|
+
<span class="ruby-comment"># Update column numbers for cells to the right of the deleted column</span>
|
|
1568
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span>, <span class="ruby-identifier">row_index</span><span class="ruby-operator">|</span>
|
|
1569
|
+
<span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span>, <span class="ruby-identifier">ci</span><span class="ruby-operator">|</span>
|
|
1570
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">column</span> = <span class="ruby-identifier">ci</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Cell</span>)
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">range</span><span class="ruby-operator">|</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">delete_column</span>(<span class="ruby-identifier">column_index</span>) }
|
|
1575
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1576
|
+
</div>
|
|
1577
|
+
|
|
1578
|
+
</div>
|
|
1579
|
+
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
|
|
1583
|
+
</div>
|
|
1584
|
+
|
|
1585
|
+
|
|
1586
|
+
<div id="method-i-delete_row" class="method-detail ">
|
|
1587
|
+
|
|
1588
|
+
<div class="method-heading">
|
|
1589
|
+
<span class="method-name">delete_row</span><span
|
|
1590
|
+
class="method-args">(row_index=0)</span>
|
|
1591
|
+
|
|
1592
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1593
|
+
|
|
1594
|
+
</div>
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
<div class="method-description">
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
<div class="method-source-code" id="delete_row-source">
|
|
1605
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 310</span>
|
|
1606
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete_row</span>(<span class="ruby-identifier">row_index</span>=<span class="ruby-value">0</span>)
|
|
1607
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1608
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row_index</span>)
|
|
1609
|
+
|
|
1610
|
+
<span class="ruby-identifier">deleted</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">row_index</span>)
|
|
1611
|
+
|
|
1612
|
+
<span class="ruby-comment"># Update row number of each cell</span>
|
|
1613
|
+
<span class="ruby-identifier">row_index</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
|
1614
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">index</span>]
|
|
1615
|
+
<span class="ruby-identifier">row</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">row</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span> }
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">deleted</span>
|
|
1619
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1620
|
+
</div>
|
|
1621
|
+
|
|
1622
|
+
</div>
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
|
|
1627
|
+
</div>
|
|
1628
|
+
|
|
1629
|
+
|
|
1630
|
+
<div id="method-i-get_col_style" class="method-detail ">
|
|
1631
|
+
|
|
1632
|
+
<div class="method-heading">
|
|
1633
|
+
<span class="method-name">get_col_style</span><span
|
|
1634
|
+
class="method-args">(column_index)</span>
|
|
1635
|
+
|
|
1636
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1637
|
+
|
|
1638
|
+
</div>
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
<div class="method-description">
|
|
1642
|
+
|
|
1643
|
+
<p>Helper method to get the style index for a column</p>
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
|
|
1647
|
+
|
|
1648
|
+
<div class="method-source-code" id="get_col_style-source">
|
|
1649
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 520</span>
|
|
1650
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_col_style</span>(<span class="ruby-identifier">column_index</span>)
|
|
1651
|
+
<span class="ruby-identifier">range</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">locate_range</span>(<span class="ruby-identifier">column_index</span>)
|
|
1652
|
+
(<span class="ruby-identifier">range</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">style_index</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
|
|
1653
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1654
|
+
</div>
|
|
1655
|
+
|
|
1656
|
+
</div>
|
|
1657
|
+
|
|
1658
|
+
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
</div>
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
<div id="method-i-get_cols_style_index" class="method-detail ">
|
|
1665
|
+
|
|
1666
|
+
<div class="method-heading">
|
|
1667
|
+
<span class="method-name">get_cols_style_index</span><span
|
|
1668
|
+
class="method-args">(column_index)</span>
|
|
1669
|
+
|
|
1670
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1671
|
+
|
|
1672
|
+
</div>
|
|
1673
|
+
|
|
1674
|
+
|
|
1675
|
+
<div class="method-description">
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
<div class="method-source-code" id="get_cols_style_index-source">
|
|
1683
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 446</span>
|
|
1684
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_cols_style_index</span>(<span class="ruby-identifier">column_index</span>)
|
|
1685
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
|
1686
|
+
<span class="ruby-identifier">range</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">locate_range</span>(<span class="ruby-identifier">column_index</span>)
|
|
1687
|
+
(<span class="ruby-identifier">range</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">style_index</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
|
|
1688
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1689
|
+
</div>
|
|
1690
|
+
|
|
1691
|
+
</div>
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
|
|
1696
|
+
</div>
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
<div id="method-i-get_column_alignment" class="method-detail ">
|
|
1700
|
+
|
|
1701
|
+
<div class="method-heading">
|
|
1702
|
+
<span class="method-name">get_column_alignment</span><span
|
|
1703
|
+
class="method-args">(col, type)</span>
|
|
1704
|
+
|
|
1705
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1706
|
+
|
|
1707
|
+
</div>
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
<div class="method-description">
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
<div class="method-source-code" id="get_column_alignment-source">
|
|
1718
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 567</span>
|
|
1719
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_alignment</span>(<span class="ruby-identifier">col</span>, <span class="ruby-identifier">type</span>)
|
|
1720
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1721
|
+
|
|
1722
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">get_cols_style_index</span>(<span class="ruby-identifier">col</span>)]
|
|
1723
|
+
<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">alignment</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">xf</span>.<span class="ruby-identifier">alignment</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span>)
|
|
1724
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1725
|
+
</div>
|
|
1726
|
+
|
|
1727
|
+
</div>
|
|
1728
|
+
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
|
|
1732
|
+
</div>
|
|
1733
|
+
|
|
1734
|
+
|
|
1735
|
+
<div id="method-i-get_column_border" class="method-detail ">
|
|
1736
|
+
|
|
1737
|
+
<div class="method-heading">
|
|
1738
|
+
<span class="method-name">get_column_border</span><span
|
|
1739
|
+
class="method-args">(col, border_direction)</span>
|
|
1740
|
+
|
|
1741
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1742
|
+
|
|
1743
|
+
</div>
|
|
1744
|
+
|
|
1745
|
+
|
|
1746
|
+
<div class="method-description">
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
<div class="method-source-code" id="get_column_border-source">
|
|
1754
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 545</span>
|
|
1755
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-identifier">border_direction</span>)
|
|
1756
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1757
|
+
|
|
1758
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">get_cols_style_index</span>(<span class="ruby-identifier">col</span>)]
|
|
1759
|
+
<span class="ruby-identifier">border</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">borders</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">border_id</span>]
|
|
1760
|
+
<span class="ruby-identifier">border</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">border</span>.<span class="ruby-identifier">get_edge_style</span>(<span class="ruby-identifier">border_direction</span>)
|
|
1761
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1762
|
+
</div>
|
|
1763
|
+
|
|
1764
|
+
</div>
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
</div>
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
<div id="method-i-get_column_border_color" class="method-detail ">
|
|
1773
|
+
|
|
1774
|
+
<div class="method-heading">
|
|
1775
|
+
<span class="method-name">get_column_border_color</span><span
|
|
1776
|
+
class="method-args">(col, border_direction)</span>
|
|
1777
|
+
|
|
1778
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1779
|
+
|
|
1780
|
+
</div>
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
<div class="method-description">
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
<div class="method-source-code" id="get_column_border_color-source">
|
|
1791
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 553</span>
|
|
1792
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_border_color</span>(<span class="ruby-identifier">col</span>, <span class="ruby-identifier">border_direction</span>)
|
|
1793
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1794
|
+
|
|
1795
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">cell_xfs</span>[<span class="ruby-identifier">get_cols_style_index</span>(<span class="ruby-identifier">col</span>)]
|
|
1796
|
+
<span class="ruby-identifier">border</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">borders</span>[<span class="ruby-identifier">xf</span>.<span class="ruby-identifier">border_id</span>]
|
|
1797
|
+
<span class="ruby-identifier">border</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">border</span>.<span class="ruby-identifier">get_edge_color</span>(<span class="ruby-identifier">border_direction</span>)
|
|
1798
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1799
|
+
</div>
|
|
1800
|
+
|
|
1801
|
+
</div>
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
|
|
1805
|
+
|
|
1806
|
+
</div>
|
|
1807
|
+
|
|
1808
|
+
|
|
1809
|
+
<div id="method-i-get_column_fill" class="method-detail ">
|
|
1810
|
+
|
|
1811
|
+
<div class="method-heading">
|
|
1812
|
+
<span class="method-name">get_column_fill</span><span
|
|
1813
|
+
class="method-args">(col=0)</span>
|
|
1814
|
+
|
|
1815
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1816
|
+
|
|
1817
|
+
</div>
|
|
1818
|
+
|
|
1819
|
+
|
|
1820
|
+
<div class="method-description">
|
|
1821
|
+
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
<div class="method-source-code" id="get_column_fill-source">
|
|
1828
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 525</span>
|
|
1829
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_fill</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
1830
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1831
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">col</span>)
|
|
1832
|
+
|
|
1833
|
+
<span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">get_fill_color</span>(<span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>))
|
|
1834
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1835
|
+
</div>
|
|
1836
|
+
|
|
1837
|
+
</div>
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
|
|
1841
|
+
|
|
1842
|
+
</div>
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
<div id="method-i-get_column_font_color" class="method-detail ">
|
|
1846
|
+
|
|
1847
|
+
<div class="method-heading">
|
|
1848
|
+
<span class="method-name">get_column_font_color</span><span
|
|
1849
|
+
class="method-args">(col = 0)</span>
|
|
1850
|
+
|
|
1851
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1852
|
+
|
|
1853
|
+
</div>
|
|
1854
|
+
|
|
1855
|
+
|
|
1856
|
+
<div class="method-description">
|
|
1857
|
+
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
<div class="method-source-code" id="get_column_font_color-source">
|
|
1864
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 462</span>
|
|
1865
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_font_color</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
|
1866
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
1867
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> (<span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_rgb_color</span> <span class="ruby-operator">||</span> <span class="ruby-string">'000000'</span>)
|
|
1868
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1869
|
+
</div>
|
|
1870
|
+
|
|
1871
|
+
</div>
|
|
1872
|
+
|
|
1873
|
+
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
</div>
|
|
1877
|
+
|
|
1878
|
+
|
|
1879
|
+
<div id="method-i-get_column_font_name" class="method-detail ">
|
|
1880
|
+
|
|
1881
|
+
<div class="method-heading">
|
|
1882
|
+
<span class="method-name">get_column_font_name</span><span
|
|
1883
|
+
class="method-args">(col = 0)</span>
|
|
1884
|
+
|
|
1885
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1886
|
+
|
|
1887
|
+
</div>
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
<div class="method-description">
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
<div class="method-source-code" id="get_column_font_name-source">
|
|
1898
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 452</span>
|
|
1899
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_font_name</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
|
1900
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
1901
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_name</span>
|
|
1902
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1903
|
+
</div>
|
|
1904
|
+
|
|
1905
|
+
</div>
|
|
1906
|
+
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
|
|
1910
|
+
</div>
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
<div id="method-i-get_column_font_size" class="method-detail ">
|
|
1914
|
+
|
|
1915
|
+
<div class="method-heading">
|
|
1916
|
+
<span class="method-name">get_column_font_size</span><span
|
|
1917
|
+
class="method-args">(col = 0)</span>
|
|
1918
|
+
|
|
1919
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1920
|
+
|
|
1921
|
+
</div>
|
|
1922
|
+
|
|
1923
|
+
|
|
1924
|
+
<div class="method-description">
|
|
1925
|
+
|
|
1926
|
+
|
|
1927
|
+
|
|
1928
|
+
|
|
1929
|
+
|
|
1930
|
+
|
|
1931
|
+
<div class="method-source-code" id="get_column_font_size-source">
|
|
1932
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 457</span>
|
|
1933
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_font_size</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
|
1934
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
1935
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_size</span>
|
|
1936
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1937
|
+
</div>
|
|
1938
|
+
|
|
1939
|
+
</div>
|
|
1940
|
+
|
|
1941
|
+
|
|
1942
|
+
|
|
1943
|
+
|
|
1944
|
+
</div>
|
|
1945
|
+
|
|
1946
|
+
|
|
1947
|
+
<div id="method-i-get_column_width" class="method-detail ">
|
|
1948
|
+
|
|
1949
|
+
<div class="method-heading">
|
|
1950
|
+
<span class="method-name">get_column_width</span><span
|
|
1951
|
+
class="method-args">(column_index = 0)</span>
|
|
1952
|
+
|
|
1953
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1954
|
+
|
|
1955
|
+
</div>
|
|
1956
|
+
|
|
1957
|
+
|
|
1958
|
+
<div class="method-description">
|
|
1959
|
+
|
|
1960
|
+
<p>Get column width measured in number of digits, as per <a
|
|
1961
|
+
href="http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx">msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx</a></p>
|
|
1962
|
+
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
|
|
1966
|
+
<div class="method-source-code" id="get_column_width-source">
|
|
1967
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 498</span>
|
|
1968
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_width</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
|
1969
|
+
<span class="ruby-identifier">width</span> = <span class="ruby-identifier">get_column_width_raw</span>(<span class="ruby-identifier">column_index</span>)
|
|
1970
|
+
<span class="ruby-keyword">return</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">ColumnRange</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_WIDTH</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">width</span>.<span class="ruby-identifier">nil?</span>
|
|
1971
|
+
(<span class="ruby-identifier">width</span> <span class="ruby-operator">-</span> (<span class="ruby-value">5.0</span> <span class="ruby-operator">/</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Font</span><span class="ruby-operator">::</span><span class="ruby-constant">MAX_DIGIT_WIDTH</span>)).<span class="ruby-identifier">round</span>
|
|
1972
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1973
|
+
</div>
|
|
1974
|
+
|
|
1975
|
+
</div>
|
|
1976
|
+
|
|
1977
|
+
|
|
1978
|
+
|
|
1979
|
+
|
|
1980
|
+
</div>
|
|
1981
|
+
|
|
1982
|
+
|
|
1983
|
+
<div id="method-i-get_column_width_raw" class="method-detail ">
|
|
1984
|
+
|
|
1985
|
+
<div class="method-heading">
|
|
1986
|
+
<span class="method-name">get_column_width_raw</span><span
|
|
1987
|
+
class="method-args">(column_index = 0)</span>
|
|
1988
|
+
|
|
1989
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1990
|
+
|
|
1991
|
+
</div>
|
|
1992
|
+
|
|
1993
|
+
|
|
1994
|
+
<div class="method-description">
|
|
1995
|
+
|
|
1996
|
+
<p>Get raw column width value as stored in the file</p>
|
|
1997
|
+
|
|
1998
|
+
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
<div class="method-source-code" id="get_column_width_raw-source">
|
|
2002
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 488</span>
|
|
2003
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_width_raw</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
|
2004
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2005
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
|
2006
|
+
|
|
2007
|
+
<span class="ruby-identifier">range</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">locate_range</span>(<span class="ruby-identifier">column_index</span>)
|
|
2008
|
+
<span class="ruby-identifier">range</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">width</span>
|
|
2009
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2010
|
+
</div>
|
|
2011
|
+
|
|
2012
|
+
</div>
|
|
2013
|
+
|
|
2014
|
+
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
</div>
|
|
2018
|
+
|
|
2019
|
+
|
|
2020
|
+
<div id="method-i-get_row_alignment" class="method-detail ">
|
|
2021
|
+
|
|
2022
|
+
<div class="method-heading">
|
|
2023
|
+
<span class="method-name">get_row_alignment</span><span
|
|
2024
|
+
class="method-args">(row, is_horizontal)</span>
|
|
2025
|
+
|
|
2026
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2027
|
+
|
|
2028
|
+
</div>
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
<div class="method-description">
|
|
2032
|
+
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
|
|
2038
|
+
<div class="method-source-code" id="get_row_alignment-source">
|
|
2039
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 435</span>
|
|
2040
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_alignment</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">is_horizontal</span>)
|
|
2041
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2042
|
+
|
|
2043
|
+
<span class="ruby-identifier">xf_obj</span> = <span class="ruby-identifier">get_row_xf</span>(<span class="ruby-identifier">row</span>)
|
|
2044
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">xf_obj</span>.<span class="ruby-identifier">alignment</span>.<span class="ruby-identifier">nil?</span>
|
|
2045
|
+
|
|
2046
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">is_horizontal</span> <span class="ruby-keyword">then</span> <span class="ruby-keyword">return</span> <span class="ruby-identifier">xf_obj</span>.<span class="ruby-identifier">alignment</span>.<span class="ruby-identifier">horizontal</span>
|
|
2047
|
+
<span class="ruby-keyword">else</span> <span class="ruby-keyword">return</span> <span class="ruby-identifier">xf_obj</span>.<span class="ruby-identifier">alignment</span>.<span class="ruby-identifier">vertical</span>
|
|
2048
|
+
<span class="ruby-keyword">end</span>
|
|
2049
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2050
|
+
</div>
|
|
2051
|
+
|
|
2052
|
+
</div>
|
|
2053
|
+
|
|
2054
|
+
|
|
2055
|
+
|
|
2056
|
+
|
|
2057
|
+
</div>
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
<div id="method-i-get_row_border" class="method-detail ">
|
|
2061
|
+
|
|
2062
|
+
<div class="method-heading">
|
|
2063
|
+
<span class="method-name">get_row_border</span><span
|
|
2064
|
+
class="method-args">(row, border_direction)</span>
|
|
2065
|
+
|
|
2066
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2067
|
+
|
|
2068
|
+
</div>
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
<div class="method-description">
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
|
|
2075
|
+
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
<div class="method-source-code" id="get_row_border-source">
|
|
2079
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 417</span>
|
|
2080
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">border_direction</span>)
|
|
2081
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2082
|
+
|
|
2083
|
+
<span class="ruby-identifier">border</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">borders</span>[<span class="ruby-identifier">get_row_xf</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">border_id</span>]
|
|
2084
|
+
<span class="ruby-identifier">border</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">border</span>.<span class="ruby-identifier">get_edge_style</span>(<span class="ruby-identifier">border_direction</span>)
|
|
2085
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2086
|
+
</div>
|
|
2087
|
+
|
|
2088
|
+
</div>
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
|
|
2092
|
+
|
|
2093
|
+
</div>
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
<div id="method-i-get_row_border_color" class="method-detail ">
|
|
2097
|
+
|
|
2098
|
+
<div class="method-heading">
|
|
2099
|
+
<span class="method-name">get_row_border_color</span><span
|
|
2100
|
+
class="method-args">(row, border_direction)</span>
|
|
2101
|
+
|
|
2102
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2103
|
+
|
|
2104
|
+
</div>
|
|
2105
|
+
|
|
2106
|
+
|
|
2107
|
+
<div class="method-description">
|
|
2108
|
+
|
|
2109
|
+
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
|
|
2114
|
+
<div class="method-source-code" id="get_row_border_color-source">
|
|
2115
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 424</span>
|
|
2116
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_border_color</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">border_direction</span>)
|
|
2117
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2118
|
+
|
|
2119
|
+
<span class="ruby-identifier">border</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">borders</span>[<span class="ruby-identifier">get_row_xf</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">border_id</span>]
|
|
2120
|
+
<span class="ruby-identifier">border</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">border</span>.<span class="ruby-identifier">get_edge_color</span>(<span class="ruby-identifier">border_direction</span>)
|
|
2121
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2122
|
+
</div>
|
|
2123
|
+
|
|
2124
|
+
</div>
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
</div>
|
|
2130
|
+
|
|
2131
|
+
|
|
2132
|
+
<div id="method-i-get_row_fill" class="method-detail ">
|
|
2133
|
+
|
|
2134
|
+
<div class="method-heading">
|
|
2135
|
+
<span class="method-name">get_row_fill</span><span
|
|
2136
|
+
class="method-args">(row = 0)</span>
|
|
2137
|
+
|
|
2138
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2139
|
+
|
|
2140
|
+
</div>
|
|
2141
|
+
|
|
2142
|
+
|
|
2143
|
+
<div class="method-description">
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
|
|
2150
|
+
<div class="method-source-code" id="get_row_fill-source">
|
|
2151
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 376</span>
|
|
2152
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_fill</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2153
|
+
(<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>]) <span class="ruby-operator">&&</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">get_fill_color</span>
|
|
2154
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2155
|
+
</div>
|
|
2156
|
+
|
|
2157
|
+
</div>
|
|
2158
|
+
|
|
2159
|
+
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
</div>
|
|
2163
|
+
|
|
2164
|
+
|
|
2165
|
+
<div id="method-i-get_row_font_color" class="method-detail ">
|
|
2166
|
+
|
|
2167
|
+
<div class="method-heading">
|
|
2168
|
+
<span class="method-name">get_row_font_color</span><span
|
|
2169
|
+
class="method-args">(row = 0)</span>
|
|
2170
|
+
|
|
2171
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2172
|
+
|
|
2173
|
+
</div>
|
|
2174
|
+
|
|
2175
|
+
|
|
2176
|
+
<div class="method-description">
|
|
2177
|
+
|
|
2178
|
+
|
|
2179
|
+
|
|
2180
|
+
|
|
2181
|
+
|
|
2182
|
+
|
|
2183
|
+
<div class="method-source-code" id="get_row_font_color-source">
|
|
2184
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 388</span>
|
|
2185
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_font_color</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2186
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)
|
|
2187
|
+
<span class="ruby-identifier">color</span> = <span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">color</span>
|
|
2188
|
+
<span class="ruby-identifier">color</span> <span class="ruby-operator">&&</span> (<span class="ruby-identifier">color</span>.<span class="ruby-identifier">rgb</span> <span class="ruby-operator">||</span> <span class="ruby-string">'000000'</span>)
|
|
2189
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2190
|
+
</div>
|
|
2191
|
+
|
|
2192
|
+
</div>
|
|
2193
|
+
|
|
2194
|
+
|
|
2195
|
+
|
|
2196
|
+
|
|
2197
|
+
</div>
|
|
2198
|
+
|
|
2199
|
+
|
|
2200
|
+
<div id="method-i-get_row_font_name" class="method-detail ">
|
|
2201
|
+
|
|
2202
|
+
<div class="method-heading">
|
|
2203
|
+
<span class="method-name">get_row_font_name</span><span
|
|
2204
|
+
class="method-args">(row = 0)</span>
|
|
2205
|
+
|
|
2206
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2207
|
+
|
|
2208
|
+
</div>
|
|
2209
|
+
|
|
2210
|
+
|
|
2211
|
+
<div class="method-description">
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
|
|
2218
|
+
<div class="method-source-code" id="get_row_font_name-source">
|
|
2219
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 380</span>
|
|
2220
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_font_name</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2221
|
+
(<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)) <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_name</span>
|
|
2222
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2223
|
+
</div>
|
|
2224
|
+
|
|
2225
|
+
</div>
|
|
2226
|
+
|
|
2227
|
+
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
</div>
|
|
2231
|
+
|
|
2232
|
+
|
|
2233
|
+
<div id="method-i-get_row_font_size" class="method-detail ">
|
|
2234
|
+
|
|
2235
|
+
<div class="method-heading">
|
|
2236
|
+
<span class="method-name">get_row_font_size</span><span
|
|
2237
|
+
class="method-args">(row = 0)</span>
|
|
2238
|
+
|
|
2239
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2240
|
+
|
|
2241
|
+
</div>
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
<div class="method-description">
|
|
2245
|
+
|
|
2246
|
+
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
|
|
2250
|
+
|
|
2251
|
+
<div class="method-source-code" id="get_row_font_size-source">
|
|
2252
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 384</span>
|
|
2253
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_font_size</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2254
|
+
(<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)) <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_size</span>
|
|
2255
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2256
|
+
</div>
|
|
2257
|
+
|
|
2258
|
+
</div>
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
|
|
2262
|
+
|
|
2263
|
+
</div>
|
|
2264
|
+
|
|
2265
|
+
|
|
2266
|
+
<div id="method-i-get_row_height" class="method-detail ">
|
|
2267
|
+
|
|
2268
|
+
<div class="method-heading">
|
|
2269
|
+
<span class="method-name">get_row_height</span><span
|
|
2270
|
+
class="method-args">(row = 0)</span>
|
|
2271
|
+
|
|
2272
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2273
|
+
|
|
2274
|
+
</div>
|
|
2275
|
+
|
|
2276
|
+
|
|
2277
|
+
<div class="method-description">
|
|
2278
|
+
|
|
2279
|
+
|
|
2280
|
+
|
|
2281
|
+
|
|
2282
|
+
|
|
2283
|
+
|
|
2284
|
+
<div class="method-source-code" id="get_row_height-source">
|
|
2285
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 410</span>
|
|
2286
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_height</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2287
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2288
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
2289
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>]
|
|
2290
|
+
<span class="ruby-identifier">row</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">ht</span> <span class="ruby-operator">||</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Row</span><span class="ruby-operator">::</span><span class="ruby-constant">DEFAULT_HEIGHT</span>
|
|
2291
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2292
|
+
</div>
|
|
2293
|
+
|
|
2294
|
+
</div>
|
|
2295
|
+
|
|
2296
|
+
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+
</div>
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
<div id="method-i-get_row_style" class="method-detail ">
|
|
2303
|
+
|
|
2304
|
+
<div class="method-heading">
|
|
2305
|
+
<span class="method-name">get_row_style</span><span
|
|
2306
|
+
class="method-args">(row_index)</span>
|
|
2307
|
+
|
|
2308
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2309
|
+
|
|
2310
|
+
</div>
|
|
2311
|
+
|
|
2312
|
+
|
|
2313
|
+
<div class="method-description">
|
|
2314
|
+
|
|
2315
|
+
|
|
2316
|
+
|
|
2317
|
+
|
|
2318
|
+
|
|
2319
|
+
|
|
2320
|
+
<div class="method-source-code" id="get_row_style-source">
|
|
2321
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 371</span>
|
|
2322
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_style</span>(<span class="ruby-identifier">row_index</span>)
|
|
2323
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row_index</span>]
|
|
2324
|
+
(<span class="ruby-identifier">row</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">style_index</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
|
|
2325
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2326
|
+
</div>
|
|
2327
|
+
|
|
2328
|
+
</div>
|
|
2329
|
+
|
|
2330
|
+
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
</div>
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
<div id="method-i-insert_cell" class="method-detail ">
|
|
2337
|
+
|
|
2338
|
+
<div class="method-heading">
|
|
2339
|
+
<span class="method-name">insert_cell</span><span
|
|
2340
|
+
class="method-args">(row = 0, col = 0, data = nil, formula = nil, shift = nil)</span>
|
|
2341
|
+
|
|
2342
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2343
|
+
|
|
2344
|
+
</div>
|
|
2345
|
+
|
|
2346
|
+
|
|
2347
|
+
<div class="method-description">
|
|
2348
|
+
|
|
2349
|
+
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
|
|
2353
|
+
|
|
2354
|
+
<div class="method-source-code" id="insert_cell-source">
|
|
2355
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 222</span>
|
|
2356
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_cell</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">data</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">formula</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">shift</span> = <span class="ruby-keyword">nil</span>)
|
|
2357
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2358
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">col</span>)
|
|
2359
|
+
|
|
2360
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">shift</span>
|
|
2361
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">then</span> <span class="ruby-comment"># No shifting at all</span>
|
|
2362
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:right</span> <span class="ruby-keyword">then</span>
|
|
2363
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">insert_cell_shift_right</span>(<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">col</span>)
|
|
2364
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:down</span> <span class="ruby-keyword">then</span>
|
|
2365
|
+
<span class="ruby-identifier">add_row</span>(<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">size</span>, <span class="ruby-value">:cells</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">size</span>))
|
|
2366
|
+
(<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">downto</span>(<span class="ruby-identifier">row</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
|
2367
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>] = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>]
|
|
2368
|
+
}
|
|
2369
|
+
<span class="ruby-keyword">else</span>
|
|
2370
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'invalid shift option'</span>
|
|
2371
|
+
<span class="ruby-keyword">end</span>
|
|
2372
|
+
|
|
2373
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">add_cell</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">col</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">formula</span>)
|
|
2374
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2375
|
+
</div>
|
|
2376
|
+
|
|
2377
|
+
</div>
|
|
2378
|
+
|
|
2379
|
+
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
</div>
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
<div id="method-i-insert_column" class="method-detail ">
|
|
2386
|
+
|
|
2387
|
+
<div class="method-heading">
|
|
2388
|
+
<span class="method-name">insert_column</span><span
|
|
2389
|
+
class="method-args">(column_index = 0)</span>
|
|
2390
|
+
|
|
2391
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2392
|
+
|
|
2393
|
+
</div>
|
|
2394
|
+
|
|
2395
|
+
|
|
2396
|
+
<div class="method-description">
|
|
2397
|
+
|
|
2398
|
+
<p>Inserts column at <code>column_index</code>, pushes everything right, takes
|
|
2399
|
+
styles from column to left NOTE: use of this method will break formulas
|
|
2400
|
+
which reference cells which are being “pushed right”</p>
|
|
2401
|
+
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
<div class="method-source-code" id="insert_column-source">
|
|
2406
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 327</span>
|
|
2407
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_column</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
|
2408
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2409
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
2410
|
+
|
|
2411
|
+
<span class="ruby-identifier">old_range</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">get_range</span>(<span class="ruby-identifier">column_index</span>)
|
|
2412
|
+
|
|
2413
|
+
<span class="ruby-comment">#go through each cell in column</span>
|
|
2414
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span>, <span class="ruby-identifier">row_index</span><span class="ruby-operator">|</span>
|
|
2415
|
+
<span class="ruby-identifier">old_cell</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
|
2416
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-keyword">nil</span>
|
|
2417
|
+
|
|
2418
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">old_cell</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">old_cell</span>.<span class="ruby-identifier">style_index</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</span>
|
|
2419
|
+
<span class="ruby-identifier">old_range</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">old_range</span>.<span class="ruby-identifier">style_index</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">old_cell</span>.<span class="ruby-identifier">style_index</span> <span class="ruby-keyword">then</span>
|
|
2420
|
+
|
|
2421
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Cell</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:style_index</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">old_cell</span>.<span class="ruby-identifier">style_index</span>, <span class="ruby-value">:worksheet</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>,
|
|
2422
|
+
<span class="ruby-value">:row</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">row_index</span>, <span class="ruby-value">:column</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">column_index</span>,
|
|
2423
|
+
<span class="ruby-value">:datatype</span> =<span class="ruby-operator">></span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">DataType</span><span class="ruby-operator">::</span><span class="ruby-constant">SHARED_STRING</span>)
|
|
2424
|
+
<span class="ruby-keyword">end</span>
|
|
2425
|
+
|
|
2426
|
+
<span class="ruby-identifier">row</span>.<span class="ruby-identifier">insert_cell_shift_right</span>(<span class="ruby-identifier">c</span>, <span class="ruby-identifier">column_index</span>)
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">insert_column</span>(<span class="ruby-identifier">column_index</span>)
|
|
2430
|
+
|
|
2431
|
+
<span class="ruby-comment"># TODO: update column numbers</span>
|
|
2432
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2433
|
+
</div>
|
|
2434
|
+
|
|
2435
|
+
</div>
|
|
2436
|
+
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
|
|
2440
|
+
</div>
|
|
2441
|
+
|
|
2442
|
+
|
|
2443
|
+
<div id="method-i-insert_row" class="method-detail ">
|
|
2444
|
+
|
|
2445
|
+
<div class="method-heading">
|
|
2446
|
+
<span class="method-name">insert_row</span><span
|
|
2447
|
+
class="method-args">(row_index = 0)</span>
|
|
2448
|
+
|
|
2449
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2450
|
+
|
|
2451
|
+
</div>
|
|
2452
|
+
|
|
2453
|
+
|
|
2454
|
+
<div class="method-description">
|
|
2455
|
+
|
|
2456
|
+
<p>Inserts row at row_index, pushes down, copies style from the row above
|
|
2457
|
+
(that's what Excel 2013 does!) NOTE: use of this method will break
|
|
2458
|
+
formulas which reference cells which are being “pushed down”</p>
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
<div class="method-source-code" id="insert_row-source">
|
|
2464
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 272</span>
|
|
2465
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_row</span>(<span class="ruby-identifier">row_index</span> = <span class="ruby-value">0</span>)
|
|
2466
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2467
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
|
2468
|
+
|
|
2469
|
+
<span class="ruby-identifier">old_row</span> = <span class="ruby-identifier">new_cells</span> = <span class="ruby-keyword">nil</span>
|
|
2470
|
+
|
|
2471
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">row_index</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> <span class="ruby-keyword">then</span>
|
|
2472
|
+
<span class="ruby-identifier">old_row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
|
|
2473
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">old_row</span> <span class="ruby-keyword">then</span>
|
|
2474
|
+
<span class="ruby-identifier">new_cells</span> = <span class="ruby-identifier">old_row</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
|
2475
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">then</span> <span class="ruby-keyword">nil</span>
|
|
2476
|
+
<span class="ruby-keyword">else</span> <span class="ruby-identifier">nc</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Cell</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:style_index</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">style_index</span>)
|
|
2477
|
+
<span class="ruby-identifier">nc</span>.<span class="ruby-identifier">worksheet</span> = <span class="ruby-keyword">self</span>
|
|
2478
|
+
<span class="ruby-identifier">nc</span>
|
|
2479
|
+
<span class="ruby-keyword">end</span>
|
|
2480
|
+
}
|
|
2481
|
+
<span class="ruby-keyword">end</span>
|
|
2482
|
+
<span class="ruby-keyword">end</span>
|
|
2483
|
+
|
|
2484
|
+
<span class="ruby-identifier">row0</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-value">0</span>]
|
|
2485
|
+
<span class="ruby-identifier">new_cells</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>((<span class="ruby-identifier">row0</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">row0</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">size</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>)
|
|
2486
|
+
|
|
2487
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-identifier">row_index</span>, <span class="ruby-keyword">nil</span>)
|
|
2488
|
+
<span class="ruby-identifier">new_row</span> = <span class="ruby-identifier">add_row</span>(<span class="ruby-identifier">row_index</span>, <span class="ruby-value">:cells</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">new_cells</span>, <span class="ruby-value">:style_index</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">old_row</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">old_row</span>.<span class="ruby-identifier">style_index</span>)
|
|
2489
|
+
|
|
2490
|
+
<span class="ruby-comment"># Update row values for all rows below</span>
|
|
2491
|
+
<span class="ruby-identifier">row_index</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
|
2492
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">r</span>]
|
|
2493
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">nil?</span>
|
|
2494
|
+
<span class="ruby-identifier">row</span>.<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">each_with_index</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">cell</span>, <span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
|
2495
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">nil?</span>
|
|
2496
|
+
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">r</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">r</span>, <span class="ruby-identifier">c</span>)
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">new_row</span>
|
|
2501
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2502
|
+
</div>
|
|
2503
|
+
|
|
2504
|
+
</div>
|
|
2505
|
+
|
|
2506
|
+
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
</div>
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
<div id="method-i-is_column_bolded" class="method-detail ">
|
|
2513
|
+
|
|
2514
|
+
<div class="method-heading">
|
|
2515
|
+
<span class="method-name">is_column_bolded</span><span
|
|
2516
|
+
class="method-args">(col = 0)</span>
|
|
2517
|
+
|
|
2518
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2519
|
+
|
|
2520
|
+
</div>
|
|
2521
|
+
|
|
2522
|
+
|
|
2523
|
+
<div class="method-description">
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
|
|
2527
|
+
|
|
2528
|
+
|
|
2529
|
+
|
|
2530
|
+
<div class="method-source-code" id="is_column_bolded-source">
|
|
2531
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 472</span>
|
|
2532
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_column_bolded</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
|
2533
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2534
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_bold</span>
|
|
2535
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2536
|
+
</div>
|
|
2537
|
+
|
|
2538
|
+
</div>
|
|
2539
|
+
|
|
2540
|
+
|
|
2541
|
+
|
|
2542
|
+
|
|
2543
|
+
</div>
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
<div id="method-i-is_column_italicized" class="method-detail ">
|
|
2547
|
+
|
|
2548
|
+
<div class="method-heading">
|
|
2549
|
+
<span class="method-name">is_column_italicized</span><span
|
|
2550
|
+
class="method-args">(col = 0)</span>
|
|
2551
|
+
|
|
2552
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2553
|
+
|
|
2554
|
+
</div>
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
<div class="method-description">
|
|
2558
|
+
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
|
|
2564
|
+
<div class="method-source-code" id="is_column_italicized-source">
|
|
2565
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 467</span>
|
|
2566
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_column_italicized</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
|
2567
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2568
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_italic</span>
|
|
2569
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2570
|
+
</div>
|
|
2571
|
+
|
|
2572
|
+
</div>
|
|
2573
|
+
|
|
2574
|
+
|
|
2575
|
+
|
|
2576
|
+
|
|
2577
|
+
</div>
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
<div id="method-i-is_column_struckthrough" class="method-detail ">
|
|
2581
|
+
|
|
2582
|
+
<div class="method-heading">
|
|
2583
|
+
<span class="method-name">is_column_struckthrough</span><span
|
|
2584
|
+
class="method-args">(col = 0)</span>
|
|
2585
|
+
|
|
2586
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2587
|
+
|
|
2588
|
+
</div>
|
|
2589
|
+
|
|
2590
|
+
|
|
2591
|
+
<div class="method-description">
|
|
2592
|
+
|
|
2593
|
+
|
|
2594
|
+
|
|
2595
|
+
|
|
2596
|
+
|
|
2597
|
+
|
|
2598
|
+
<div class="method-source-code" id="is_column_struckthrough-source">
|
|
2599
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 482</span>
|
|
2600
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_column_struckthrough</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
|
2601
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2602
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_strikethrough</span>
|
|
2603
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2604
|
+
</div>
|
|
2605
|
+
|
|
2606
|
+
</div>
|
|
2607
|
+
|
|
2608
|
+
|
|
2609
|
+
|
|
2610
|
+
|
|
2611
|
+
</div>
|
|
2612
|
+
|
|
2613
|
+
|
|
2614
|
+
<div id="method-i-is_column_underlined" class="method-detail ">
|
|
2615
|
+
|
|
2616
|
+
<div class="method-heading">
|
|
2617
|
+
<span class="method-name">is_column_underlined</span><span
|
|
2618
|
+
class="method-args">(col = 0)</span>
|
|
2619
|
+
|
|
2620
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2621
|
+
|
|
2622
|
+
</div>
|
|
2623
|
+
|
|
2624
|
+
|
|
2625
|
+
<div class="method-description">
|
|
2626
|
+
|
|
2627
|
+
|
|
2628
|
+
|
|
2629
|
+
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
<div class="method-source-code" id="is_column_underlined-source">
|
|
2633
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 477</span>
|
|
2634
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_column_underlined</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
|
2635
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2636
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_underlined</span>
|
|
2637
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2638
|
+
</div>
|
|
2639
|
+
|
|
2640
|
+
</div>
|
|
2641
|
+
|
|
2642
|
+
|
|
2643
|
+
|
|
2644
|
+
|
|
2645
|
+
</div>
|
|
2646
|
+
|
|
2647
|
+
|
|
2648
|
+
<div id="method-i-is_row_bolded" class="method-detail ">
|
|
2649
|
+
|
|
2650
|
+
<div class="method-heading">
|
|
2651
|
+
<span class="method-name">is_row_bolded</span><span
|
|
2652
|
+
class="method-args">(row = 0)</span>
|
|
2653
|
+
|
|
2654
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2655
|
+
|
|
2656
|
+
</div>
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
<div class="method-description">
|
|
2660
|
+
|
|
2661
|
+
|
|
2662
|
+
|
|
2663
|
+
|
|
2664
|
+
|
|
2665
|
+
|
|
2666
|
+
<div class="method-source-code" id="is_row_bolded-source">
|
|
2667
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 398</span>
|
|
2668
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_row_bolded</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2669
|
+
(<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)) <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_bold</span>
|
|
2670
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2671
|
+
</div>
|
|
2672
|
+
|
|
2673
|
+
</div>
|
|
2674
|
+
|
|
2675
|
+
|
|
2676
|
+
|
|
2677
|
+
|
|
2678
|
+
</div>
|
|
2679
|
+
|
|
2680
|
+
|
|
2681
|
+
<div id="method-i-is_row_italicized" class="method-detail ">
|
|
2682
|
+
|
|
2683
|
+
<div class="method-heading">
|
|
2684
|
+
<span class="method-name">is_row_italicized</span><span
|
|
2685
|
+
class="method-args">(row = 0)</span>
|
|
2686
|
+
|
|
2687
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2688
|
+
|
|
2689
|
+
</div>
|
|
2690
|
+
|
|
2691
|
+
|
|
2692
|
+
<div class="method-description">
|
|
2693
|
+
|
|
2694
|
+
|
|
2695
|
+
|
|
2696
|
+
|
|
2697
|
+
|
|
2698
|
+
|
|
2699
|
+
<div class="method-source-code" id="is_row_italicized-source">
|
|
2700
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 394</span>
|
|
2701
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_row_italicized</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2702
|
+
(<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)) <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_italic</span>
|
|
2703
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2704
|
+
</div>
|
|
2705
|
+
|
|
2706
|
+
</div>
|
|
2707
|
+
|
|
2708
|
+
|
|
2709
|
+
|
|
2710
|
+
|
|
2711
|
+
</div>
|
|
2712
|
+
|
|
2713
|
+
|
|
2714
|
+
<div id="method-i-is_row_struckthrough" class="method-detail ">
|
|
2715
|
+
|
|
2716
|
+
<div class="method-heading">
|
|
2717
|
+
<span class="method-name">is_row_struckthrough</span><span
|
|
2718
|
+
class="method-args">(row = 0)</span>
|
|
2719
|
+
|
|
2720
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2721
|
+
|
|
2722
|
+
</div>
|
|
2723
|
+
|
|
2724
|
+
|
|
2725
|
+
<div class="method-description">
|
|
2726
|
+
|
|
2727
|
+
|
|
2728
|
+
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
|
|
2732
|
+
<div class="method-source-code" id="is_row_struckthrough-source">
|
|
2733
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 406</span>
|
|
2734
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_row_struckthrough</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2735
|
+
(<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)) <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_strikethrough</span>
|
|
2736
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2737
|
+
</div>
|
|
2738
|
+
|
|
2739
|
+
</div>
|
|
2740
|
+
|
|
2741
|
+
|
|
2742
|
+
|
|
2743
|
+
|
|
2744
|
+
</div>
|
|
2745
|
+
|
|
2746
|
+
|
|
2747
|
+
<div id="method-i-is_row_underlined" class="method-detail ">
|
|
2748
|
+
|
|
2749
|
+
<div class="method-heading">
|
|
2750
|
+
<span class="method-name">is_row_underlined</span><span
|
|
2751
|
+
class="method-args">(row = 0)</span>
|
|
2752
|
+
|
|
2753
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2754
|
+
|
|
2755
|
+
</div>
|
|
2756
|
+
|
|
2757
|
+
|
|
2758
|
+
<div class="method-description">
|
|
2759
|
+
|
|
2760
|
+
|
|
2761
|
+
|
|
2762
|
+
|
|
2763
|
+
|
|
2764
|
+
|
|
2765
|
+
<div class="method-source-code" id="is_row_underlined-source">
|
|
2766
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 402</span>
|
|
2767
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_row_underlined</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2768
|
+
(<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)) <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_underlined</span>
|
|
2769
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2770
|
+
</div>
|
|
2771
|
+
|
|
2772
|
+
</div>
|
|
2773
|
+
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
|
|
2777
|
+
</div>
|
|
2778
|
+
|
|
2779
|
+
|
|
2780
|
+
<div id="method-i-merge_cells" class="method-detail ">
|
|
2781
|
+
|
|
2782
|
+
<div class="method-heading">
|
|
2783
|
+
<span class="method-name">merge_cells</span><span
|
|
2784
|
+
class="method-args">(start_row, start_col, end_row, end_col)</span>
|
|
2785
|
+
|
|
2786
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2787
|
+
|
|
2788
|
+
</div>
|
|
2789
|
+
|
|
2790
|
+
|
|
2791
|
+
<div class="method-description">
|
|
2792
|
+
|
|
2793
|
+
<p>Merges cells within a rectangular area</p>
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
|
|
2797
|
+
|
|
2798
|
+
<div class="method-source-code" id="merge_cells-source">
|
|
2799
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 818</span>
|
|
2800
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">merge_cells</span>(<span class="ruby-identifier">start_row</span>, <span class="ruby-identifier">start_col</span>, <span class="ruby-identifier">end_row</span>, <span class="ruby-identifier">end_col</span>)
|
|
2801
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2802
|
+
|
|
2803
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">merged_cells</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">MergedCells</span>.<span class="ruby-identifier">new</span>
|
|
2804
|
+
<span class="ruby-comment"># TODO: add validation to make sure ranges are not intersecting with existing ones</span>
|
|
2805
|
+
<span class="ruby-identifier">merged_cells</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">MergedCell</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:ref</span> =<span class="ruby-operator">></span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">start_row</span>, <span class="ruby-identifier">end_row</span>, <span class="ruby-identifier">start_col</span>, <span class="ruby-identifier">end_col</span>))
|
|
2806
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2807
|
+
</div>
|
|
2808
|
+
|
|
2809
|
+
</div>
|
|
2810
|
+
|
|
2811
|
+
|
|
2812
|
+
|
|
2813
|
+
|
|
2814
|
+
</div>
|
|
2815
|
+
|
|
2816
|
+
|
|
2817
|
+
<div id="method-i-row_font" class="method-detail ">
|
|
2818
|
+
|
|
2819
|
+
<div class="method-heading">
|
|
2820
|
+
<span class="method-name">row_font</span><span
|
|
2821
|
+
class="method-args">(row)</span>
|
|
2822
|
+
|
|
2823
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2824
|
+
|
|
2825
|
+
</div>
|
|
2826
|
+
|
|
2827
|
+
|
|
2828
|
+
<div class="method-description">
|
|
2829
|
+
|
|
2830
|
+
|
|
2831
|
+
|
|
2832
|
+
|
|
2833
|
+
|
|
2834
|
+
|
|
2835
|
+
<div class="method-source-code" id="row_font-source">
|
|
2836
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods.rb, line 431</span>
|
|
2837
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)
|
|
2838
|
+
(<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>]) <span class="ruby-operator">&&</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">get_font</span>
|
|
2839
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2840
|
+
</div>
|
|
2841
|
+
|
|
2842
|
+
</div>
|
|
2843
|
+
|
|
2844
|
+
|
|
2845
|
+
|
|
2846
|
+
|
|
2847
|
+
</div>
|
|
2848
|
+
|
|
2849
|
+
|
|
2850
|
+
</section>
|
|
2851
|
+
|
|
2852
|
+
</section>
|
|
2853
|
+
</main>
|
|
2854
|
+
|
|
2855
|
+
|
|
2856
|
+
<footer id="validator-badges" role="contentinfo">
|
|
2857
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
2858
|
+
<p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.1.0.
|
|
2859
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
2860
|
+
</footer>
|
|
2861
|
+
|