rubyXL 1.2.10 → 3.4.33
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/.circleci/config.yml +60 -0
- data/.codeclimate.yml +3 -0
- data/.rubocop.yml +124 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +18 -14
- data/LICENSE.txt +1 -1
- data/README.rdoc +170 -100
- data/Rakefile +76 -26
- data/VERSION +1 -1
- data/lib/rubyXL/cell.rb +13 -447
- data/lib/rubyXL/convenience_methods/cell.rb +276 -0
- data/lib/rubyXL/convenience_methods/color.rb +156 -0
- data/lib/rubyXL/convenience_methods/font.rb +63 -0
- data/lib/rubyXL/convenience_methods/workbook.rb +137 -0
- data/lib/rubyXL/convenience_methods/worksheet.rb +734 -0
- data/lib/rubyXL/convenience_methods.rb +5 -0
- data/lib/rubyXL/objects/border.rb +71 -0
- data/lib/rubyXL/objects/calculation_chain.rb +31 -0
- data/lib/rubyXL/objects/cell_style.rb +63 -0
- data/lib/rubyXL/objects/chartsheet.rb +88 -0
- data/lib/rubyXL/objects/color.rb +25 -0
- data/lib/rubyXL/objects/column_range.rb +93 -0
- data/lib/rubyXL/objects/comments.rb +44 -0
- data/lib/rubyXL/objects/connection.rb +175 -0
- data/lib/rubyXL/objects/container_nodes.rb +131 -0
- data/lib/rubyXL/objects/content_types.rb +74 -0
- data/lib/rubyXL/objects/data_validation.rb +37 -0
- data/lib/rubyXL/objects/document_properties.rb +156 -0
- data/lib/rubyXL/objects/extensions.rb +51 -0
- data/lib/rubyXL/objects/external_links.rb +115 -0
- data/lib/rubyXL/objects/fill.rb +52 -0
- data/lib/rubyXL/objects/filters.rb +118 -0
- data/lib/rubyXL/objects/font.rb +43 -0
- data/lib/rubyXL/objects/formula.rb +22 -0
- data/lib/rubyXL/objects/ooxml_object.rb +469 -0
- data/lib/rubyXL/objects/query_table.rb +106 -0
- data/lib/rubyXL/objects/reference.rb +119 -0
- data/lib/rubyXL/objects/relationships.rb +213 -0
- data/lib/rubyXL/objects/root.rb +84 -0
- data/lib/rubyXL/objects/shared_strings.rb +67 -0
- data/lib/rubyXL/objects/sheet_common.rb +49 -0
- data/lib/rubyXL/objects/sheet_data.rb +219 -0
- data/lib/rubyXL/objects/simple_types.rb +249 -0
- data/lib/rubyXL/objects/storage.rb +193 -0
- data/lib/rubyXL/objects/stylesheet.rb +224 -0
- data/lib/rubyXL/objects/text.rb +92 -0
- data/lib/rubyXL/objects/theme.rb +1730 -0
- data/lib/rubyXL/objects/workbook.rb +572 -0
- data/lib/rubyXL/objects/worksheet.rb +762 -0
- data/lib/rubyXL/parser.rb +18 -459
- data/lib/rubyXL/worksheet.rb +73 -1461
- data/lib/rubyXL.rb +9 -7
- data/rdoc/README_rdoc.html +534 -0
- data/rdoc/RubyXL/AExtension.html +187 -0
- data/rdoc/RubyXL/AExtensionStorageArea.html +97 -0
- data/rdoc/RubyXL/ActiveX.html +156 -0
- data/rdoc/RubyXL/ActiveXBinary.html +106 -0
- data/rdoc/RubyXL/AdjustHandleList.html +99 -0
- data/rdoc/RubyXL/Alignment.html +99 -0
- data/rdoc/RubyXL/AlternateContent.html +97 -0
- data/rdoc/RubyXL/AlternateUrls.html +99 -0
- data/rdoc/RubyXL/Authors.html +99 -0
- data/rdoc/RubyXL/AutoFilter.html +99 -0
- data/rdoc/RubyXL/AutoFilterColumn.html +99 -0
- data/rdoc/RubyXL/BinaryImageFile.html +108 -0
- data/rdoc/RubyXL/BodyProperties.html +99 -0
- data/rdoc/RubyXL/BooleanNode.html +97 -0
- data/rdoc/RubyXL/BooleanValue.html +97 -0
- data/rdoc/RubyXL/Border.html +223 -0
- data/rdoc/RubyXL/BorderEdge.html +160 -0
- data/rdoc/RubyXL/Borders.html +138 -0
- data/rdoc/RubyXL/Break.html +99 -0
- data/rdoc/RubyXL/BreakList.html +99 -0
- data/rdoc/RubyXL/CT_AdjPoint2D.html +99 -0
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +99 -0
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +99 -0
- data/rdoc/RubyXL/CT_Backdrop.html +99 -0
- data/rdoc/RubyXL/CT_Bevel.html +99 -0
- data/rdoc/RubyXL/CT_BiLevelEffect.html +99 -0
- data/rdoc/RubyXL/CT_BlendEffect.html +99 -0
- data/rdoc/RubyXL/CT_Blip.html +99 -0
- data/rdoc/RubyXL/CT_BlipFillProperties.html +99 -0
- data/rdoc/RubyXL/CT_BlurEffect.html +99 -0
- data/rdoc/RubyXL/CT_Camera.html +99 -0
- data/rdoc/RubyXL/CT_Color.html +99 -0
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +99 -0
- data/rdoc/RubyXL/CT_ColorMapping.html +99 -0
- data/rdoc/RubyXL/CT_ColorScheme.html +99 -0
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +99 -0
- data/rdoc/RubyXL/CT_ConnectionSite.html +99 -0
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +99 -0
- data/rdoc/RubyXL/CT_DashStop.html +99 -0
- data/rdoc/RubyXL/CT_DashStopList.html +99 -0
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +99 -0
- data/rdoc/RubyXL/CT_DuotoneEffect.html +99 -0
- data/rdoc/RubyXL/CT_EffectContainer.html +99 -0
- data/rdoc/RubyXL/CT_EffectList.html +99 -0
- data/rdoc/RubyXL/CT_EffectReference.html +99 -0
- data/rdoc/RubyXL/CT_EffectStyleItem.html +99 -0
- data/rdoc/RubyXL/CT_EffectStyleList.html +99 -0
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +99 -0
- data/rdoc/RubyXL/CT_FillEffect.html +99 -0
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +99 -0
- data/rdoc/RubyXL/CT_FillStyleList.html +99 -0
- data/rdoc/RubyXL/CT_FlatText.html +99 -0
- data/rdoc/RubyXL/CT_FontCollection.html +99 -0
- data/rdoc/RubyXL/CT_FontReference.html +99 -0
- data/rdoc/RubyXL/CT_GeomGuideList.html +99 -0
- data/rdoc/RubyXL/CT_GlowEffect.html +99 -0
- data/rdoc/RubyXL/CT_GradientFillProperties.html +99 -0
- data/rdoc/RubyXL/CT_GradientStop.html +99 -0
- data/rdoc/RubyXL/CT_GradientStopList.html +99 -0
- data/rdoc/RubyXL/CT_HSLEffect.html +99 -0
- data/rdoc/RubyXL/CT_HslColor.html +99 -0
- data/rdoc/RubyXL/CT_Hyperlink.html +99 -0
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +99 -0
- data/rdoc/RubyXL/CT_LightRig.html +99 -0
- data/rdoc/RubyXL/CT_LineEndProperties.html +99 -0
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +99 -0
- data/rdoc/RubyXL/CT_LineProperties.html +99 -0
- data/rdoc/RubyXL/CT_LineStyleList.html +99 -0
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +99 -0
- data/rdoc/RubyXL/CT_LuminanceEffect.html +99 -0
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +99 -0
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +99 -0
- data/rdoc/RubyXL/CT_Path2D.html +99 -0
- data/rdoc/RubyXL/CT_Path2DArcTo.html +99 -0
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +99 -0
- data/rdoc/RubyXL/CT_Path2DList.html +99 -0
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +99 -0
- data/rdoc/RubyXL/CT_Path2DTo.html +99 -0
- data/rdoc/RubyXL/CT_PathShadeProperties.html +99 -0
- data/rdoc/RubyXL/CT_PatternFillProperties.html +99 -0
- data/rdoc/RubyXL/CT_Point3D.html +99 -0
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +99 -0
- data/rdoc/RubyXL/CT_PresetColor.html +99 -0
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +99 -0
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +99 -0
- data/rdoc/RubyXL/CT_PresetTextShape.html +99 -0
- data/rdoc/RubyXL/CT_ReflectionEffect.html +99 -0
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +99 -0
- data/rdoc/RubyXL/CT_RelativeRect.html +99 -0
- data/rdoc/RubyXL/CT_SRgbColor.html +99 -0
- data/rdoc/RubyXL/CT_ScRgbColor.html +99 -0
- data/rdoc/RubyXL/CT_Scene3D.html +99 -0
- data/rdoc/RubyXL/CT_SchemeColor.html +99 -0
- data/rdoc/RubyXL/CT_Shape3D.html +99 -0
- data/rdoc/RubyXL/CT_ShapeStyle.html +99 -0
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +99 -0
- data/rdoc/RubyXL/CT_SphereCoords.html +99 -0
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +99 -0
- data/rdoc/RubyXL/CT_StyleMatrix.html +99 -0
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +99 -0
- data/rdoc/RubyXL/CT_SupplementalFont.html +99 -0
- data/rdoc/RubyXL/CT_SystemColor.html +99 -0
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +99 -0
- data/rdoc/RubyXL/CT_TextBlipBullet.html +99 -0
- data/rdoc/RubyXL/CT_TextCharBullet.html +99 -0
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +99 -0
- data/rdoc/RubyXL/CT_TextFont.html +99 -0
- data/rdoc/RubyXL/CT_TextListStyle.html +99 -0
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +99 -0
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +99 -0
- data/rdoc/RubyXL/CT_TextSpacing.html +99 -0
- data/rdoc/RubyXL/CT_TextTabStop.html +99 -0
- data/rdoc/RubyXL/CT_TextTabStopList.html +99 -0
- data/rdoc/RubyXL/CT_TileInfoProperties.html +99 -0
- data/rdoc/RubyXL/CT_TintEffect.html +99 -0
- data/rdoc/RubyXL/CT_Transform2D.html +99 -0
- data/rdoc/RubyXL/CT_TransformEffect.html +99 -0
- data/rdoc/RubyXL/CT_Vector3D.html +99 -0
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +99 -0
- data/rdoc/RubyXL/CalculationChain.html +149 -0
- data/rdoc/RubyXL/CalculationChainCell.html +99 -0
- data/rdoc/RubyXL/CalculationProperties.html +99 -0
- data/rdoc/RubyXL/Cell.html +510 -0
- data/rdoc/RubyXL/CellConvenienceMethods.html +1077 -0
- data/rdoc/RubyXL/CellExt.html +99 -0
- data/rdoc/RubyXL/CellSmartTag.html +99 -0
- data/rdoc/RubyXL/CellSmartTagProperty.html +99 -0
- data/rdoc/RubyXL/CellSmartTags.html +99 -0
- data/rdoc/RubyXL/CellStyle.html +99 -0
- data/rdoc/RubyXL/CellStyleXFs.html +138 -0
- data/rdoc/RubyXL/CellStyles.html +138 -0
- data/rdoc/RubyXL/CellValue.html +139 -0
- data/rdoc/RubyXL/CellWatch.html +99 -0
- data/rdoc/RubyXL/CellWatches.html +99 -0
- data/rdoc/RubyXL/CellXFs.html +139 -0
- data/rdoc/RubyXL/ChartColorsFile.html +108 -0
- data/rdoc/RubyXL/ChartFile.html +160 -0
- data/rdoc/RubyXL/ChartStyleFile.html +108 -0
- data/rdoc/RubyXL/ChartUserShapesFile.html +108 -0
- data/rdoc/RubyXL/Chartsheet.html +213 -0
- data/rdoc/RubyXL/ChartsheetPageSetup.html +99 -0
- data/rdoc/RubyXL/ChartsheetProperties.html +99 -0
- data/rdoc/RubyXL/ChartsheetProtection.html +99 -0
- data/rdoc/RubyXL/ChartsheetView.html +99 -0
- data/rdoc/RubyXL/ChartsheetViews.html +99 -0
- data/rdoc/RubyXL/Color.html +151 -0
- data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +246 -0
- data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +285 -0
- data/rdoc/RubyXL/ColorConvenienceClasses.html +91 -0
- data/rdoc/RubyXL/ColorConvenienceMethods.html +139 -0
- data/rdoc/RubyXL/ColorFilter.html +99 -0
- data/rdoc/RubyXL/ColorScale.html +99 -0
- data/rdoc/RubyXL/ColorSet.html +99 -0
- data/rdoc/RubyXL/Colors.html +99 -0
- data/rdoc/RubyXL/ColumnRange.html +230 -0
- data/rdoc/RubyXL/ColumnRanges.html +237 -0
- data/rdoc/RubyXL/Comment.html +99 -0
- data/rdoc/RubyXL/CommentList.html +99 -0
- data/rdoc/RubyXL/CommentsFile.html +165 -0
- data/rdoc/RubyXL/ConditionalFormatValue.html +99 -0
- data/rdoc/RubyXL/ConditionalFormatting.html +99 -0
- data/rdoc/RubyXL/ConditionalFormattingRule.html +99 -0
- data/rdoc/RubyXL/Connection.html +99 -0
- data/rdoc/RubyXL/ConnectionTable.html +99 -0
- data/rdoc/RubyXL/ConnectionTables.html +99 -0
- data/rdoc/RubyXL/ConnectionTextField.html +99 -0
- data/rdoc/RubyXL/ConnectionTextFields.html +99 -0
- data/rdoc/RubyXL/Connections.html +149 -0
- data/rdoc/RubyXL/ContentTypeDefault.html +97 -0
- data/rdoc/RubyXL/ContentTypeOverride.html +97 -0
- data/rdoc/RubyXL/ContentTypes.html +211 -0
- data/rdoc/RubyXL/ControlPropertiesFile.html +108 -0
- data/rdoc/RubyXL/CorePropertiesFile.html +355 -0
- data/rdoc/RubyXL/CustomColor.html +99 -0
- data/rdoc/RubyXL/CustomColorList.html +99 -0
- data/rdoc/RubyXL/CustomFilter.html +99 -0
- data/rdoc/RubyXL/CustomFilters.html +99 -0
- data/rdoc/RubyXL/CustomGeometry.html +99 -0
- data/rdoc/RubyXL/CustomProperties.html +99 -0
- data/rdoc/RubyXL/CustomPropertiesFile.html +108 -0
- data/rdoc/RubyXL/CustomProperty.html +99 -0
- data/rdoc/RubyXL/CustomPropertyFile.html +108 -0
- data/rdoc/RubyXL/CustomSheetView.html +99 -0
- data/rdoc/RubyXL/CustomSheetViews.html +99 -0
- data/rdoc/RubyXL/CustomWorkbookView.html +99 -0
- data/rdoc/RubyXL/CustomWorkbookViews.html +99 -0
- data/rdoc/RubyXL/CustomXMLFile.html +106 -0
- data/rdoc/RubyXL/DXF.html +99 -0
- data/rdoc/RubyXL/DXFs.html +99 -0
- data/rdoc/RubyXL/DataBar.html +99 -0
- data/rdoc/RubyXL/DataConsolidate.html +99 -0
- data/rdoc/RubyXL/DataConsolidationReference.html +99 -0
- data/rdoc/RubyXL/DataConsolidationReferences.html +99 -0
- data/rdoc/RubyXL/DataType.html +114 -0
- data/rdoc/RubyXL/DataValidation.html +99 -0
- data/rdoc/RubyXL/DataValidations.html +99 -0
- data/rdoc/RubyXL/DateGroupItem.html +99 -0
- data/rdoc/RubyXL/DefinedName.html +99 -0
- data/rdoc/RubyXL/DefinedNameExt.html +99 -0
- data/rdoc/RubyXL/DefinedNames.html +99 -0
- data/rdoc/RubyXL/DefinedNamesExt.html +99 -0
- data/rdoc/RubyXL/DocumentPropertiesFile.html +213 -0
- data/rdoc/RubyXL/DrawingFile.html +159 -0
- data/rdoc/RubyXL/DynamicFilter.html +99 -0
- data/rdoc/RubyXL/EmbeddedControl.html +99 -0
- data/rdoc/RubyXL/EmbeddedControls.html +99 -0
- data/rdoc/RubyXL/Extension.html +99 -0
- data/rdoc/RubyXL/ExtensionStorageArea.html +99 -0
- data/rdoc/RubyXL/Extents.html +99 -0
- data/rdoc/RubyXL/ExternalBook.html +99 -0
- data/rdoc/RubyXL/ExternalLinksFile.html +155 -0
- data/rdoc/RubyXL/ExternalReference.html +99 -0
- data/rdoc/RubyXL/ExternalReferences.html +99 -0
- data/rdoc/RubyXL/ExtraColorSchemeList.html +99 -0
- data/rdoc/RubyXL/FieldItem.html +99 -0
- data/rdoc/RubyXL/FileRecoveryProperties.html +99 -0
- data/rdoc/RubyXL/FileSharing.html +99 -0
- data/rdoc/RubyXL/FileVersion.html +99 -0
- data/rdoc/RubyXL/Fill.html +138 -0
- data/rdoc/RubyXL/Fills.html +138 -0
- data/rdoc/RubyXL/FilterContainer.html +99 -0
- data/rdoc/RubyXL/FloatNode.html +97 -0
- data/rdoc/RubyXL/FloatValue.html +97 -0
- data/rdoc/RubyXL/Font.html +148 -0
- data/rdoc/RubyXL/FontConvenienceMethods.html +442 -0
- data/rdoc/RubyXL/FontScheme.html +99 -0
- data/rdoc/RubyXL/Fonts.html +138 -0
- data/rdoc/RubyXL/Formula.html +99 -0
- data/rdoc/RubyXL/FunctionGroup.html +99 -0
- data/rdoc/RubyXL/FunctionGroups.html +99 -0
- data/rdoc/RubyXL/GenericStorageObject.html +241 -0
- data/rdoc/RubyXL/GradientFill.html +99 -0
- data/rdoc/RubyXL/HeaderFooterSettings.html +99 -0
- data/rdoc/RubyXL/Hyperlink.html +99 -0
- data/rdoc/RubyXL/HyperlinkRelFile.html +106 -0
- data/rdoc/RubyXL/Hyperlinks.html +99 -0
- data/rdoc/RubyXL/IconFilter.html +99 -0
- data/rdoc/RubyXL/IconSet.html +99 -0
- data/rdoc/RubyXL/IgnoredError.html +99 -0
- data/rdoc/RubyXL/IgnoredErrors.html +99 -0
- data/rdoc/RubyXL/IndexedColors.html +99 -0
- data/rdoc/RubyXL/InputCells.html +99 -0
- data/rdoc/RubyXL/IntegerNode.html +97 -0
- data/rdoc/RubyXL/IntegerValue.html +97 -0
- data/rdoc/RubyXL/LegacyCell.html +130 -0
- data/rdoc/RubyXL/LegacyWorksheet.html +306 -0
- data/rdoc/RubyXL/MRUColors.html +99 -0
- data/rdoc/RubyXL/MacrosFile.html +108 -0
- data/rdoc/RubyXL/MergedCell.html +99 -0
- data/rdoc/RubyXL/MergedCells.html +99 -0
- data/rdoc/RubyXL/NumFmt.html +99 -0
- data/rdoc/RubyXL/NumberFormat.html +139 -0
- data/rdoc/RubyXL/NumberFormats.html +147 -0
- data/rdoc/RubyXL/OLEObject.html +99 -0
- data/rdoc/RubyXL/OLEObjectFile.html +108 -0
- data/rdoc/RubyXL/OLEObjects.html +99 -0
- data/rdoc/RubyXL/OLESize.html +99 -0
- data/rdoc/RubyXL/OOXMLContainerObject.html +309 -0
- data/rdoc/RubyXL/OOXMLIgnored.html +167 -0
- data/rdoc/RubyXL/OOXMLObject.html +107 -0
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +455 -0
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +442 -0
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +470 -0
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +297 -0
- data/rdoc/RubyXL/OdbcOleDbProperties.html +99 -0
- data/rdoc/RubyXL/Offset.html +99 -0
- data/rdoc/RubyXL/OlapProperties.html +99 -0
- data/rdoc/RubyXL/OleItem.html +99 -0
- data/rdoc/RubyXL/OleItems.html +99 -0
- data/rdoc/RubyXL/OleLink.html +99 -0
- data/rdoc/RubyXL/OutlineProperties.html +99 -0
- data/rdoc/RubyXL/PageMargins.html +99 -0
- data/rdoc/RubyXL/PageSetup.html +99 -0
- data/rdoc/RubyXL/PageSetupProperties.html +99 -0
- data/rdoc/RubyXL/Pane.html +99 -0
- data/rdoc/RubyXL/Parser.html +174 -0
- data/rdoc/RubyXL/PatternFill.html +99 -0
- data/rdoc/RubyXL/PersonMetadata.html +108 -0
- data/rdoc/RubyXL/PhoneticProperties.html +99 -0
- data/rdoc/RubyXL/PhoneticRun.html +99 -0
- data/rdoc/RubyXL/PivotArea.html +99 -0
- data/rdoc/RubyXL/PivotCache.html +99 -0
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +116 -0
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +108 -0
- data/rdoc/RubyXL/PivotCaches.html +99 -0
- data/rdoc/RubyXL/PivotReference.html +99 -0
- data/rdoc/RubyXL/PivotReferences.html +99 -0
- data/rdoc/RubyXL/PivotTableFile.html +116 -0
- data/rdoc/RubyXL/PivotTableSelection.html +99 -0
- data/rdoc/RubyXL/PresetGeometry.html +99 -0
- data/rdoc/RubyXL/PrintOptions.html +99 -0
- data/rdoc/RubyXL/PrinterSettingsFile.html +108 -0
- data/rdoc/RubyXL/ProtectedRange.html +99 -0
- data/rdoc/RubyXL/ProtectedRanges.html +99 -0
- data/rdoc/RubyXL/Protection.html +99 -0
- data/rdoc/RubyXL/QueryParameter.html +99 -0
- data/rdoc/RubyXL/QueryParameters.html +99 -0
- data/rdoc/RubyXL/QueryTable.html +157 -0
- data/rdoc/RubyXL/QueryTableDeletedField.html +99 -0
- data/rdoc/RubyXL/QueryTableDeletedFields.html +99 -0
- data/rdoc/RubyXL/QueryTableField.html +99 -0
- data/rdoc/RubyXL/QueryTableFields.html +99 -0
- data/rdoc/RubyXL/QueryTableRefresh.html +99 -0
- data/rdoc/RubyXL/RID.html +97 -0
- data/rdoc/RubyXL/RawOOXML.html +187 -0
- data/rdoc/RubyXL/Reference.html +510 -0
- data/rdoc/RubyXL/Relationship.html +97 -0
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +131 -0
- data/rdoc/RubyXL/RelationshipSupport.html +336 -0
- data/rdoc/RubyXL/RevisionPointer.html +99 -0
- data/rdoc/RubyXL/RichText.html +141 -0
- data/rdoc/RubyXL/RichTextRun.html +138 -0
- data/rdoc/RubyXL/Row.html +357 -0
- data/rdoc/RubyXL/RowExt.html +99 -0
- data/rdoc/RubyXL/RunProperties.html +99 -0
- data/rdoc/RubyXL/Scenario.html +99 -0
- data/rdoc/RubyXL/Scenarios.html +99 -0
- data/rdoc/RubyXL/Selection.html +146 -0
- data/rdoc/RubyXL/ShapeGuide.html +99 -0
- data/rdoc/RubyXL/ShapeTextRectangle.html +99 -0
- data/rdoc/RubyXL/SharedStringsTable.html +328 -0
- data/rdoc/RubyXL/Sheet.html +99 -0
- data/rdoc/RubyXL/SheetCalculationProperties.html +99 -0
- data/rdoc/RubyXL/SheetData.html +162 -0
- data/rdoc/RubyXL/SheetDataExt.html +99 -0
- data/rdoc/RubyXL/SheetDataSet.html +99 -0
- data/rdoc/RubyXL/SheetMetadata.html +108 -0
- data/rdoc/RubyXL/SheetName.html +99 -0
- data/rdoc/RubyXL/SheetNames.html +99 -0
- data/rdoc/RubyXL/Sheets.html +99 -0
- data/rdoc/RubyXL/SlicerCacheFile.html +108 -0
- data/rdoc/RubyXL/SlicerFile.html +108 -0
- data/rdoc/RubyXL/SmartTagProperties.html +99 -0
- data/rdoc/RubyXL/SmartTagType.html +99 -0
- data/rdoc/RubyXL/SmartTagTypes.html +99 -0
- data/rdoc/RubyXL/SmartTags.html +99 -0
- data/rdoc/RubyXL/SortCondition.html +99 -0
- data/rdoc/RubyXL/SortState.html +99 -0
- data/rdoc/RubyXL/Sqref.html +167 -0
- data/rdoc/RubyXL/Stop.html +99 -0
- data/rdoc/RubyXL/StringNode.html +97 -0
- data/rdoc/RubyXL/StringNodeW3C.html +167 -0
- data/rdoc/RubyXL/StringValue.html +97 -0
- data/rdoc/RubyXL/Stylesheet.html +281 -0
- data/rdoc/RubyXL/TableFile.html +108 -0
- data/rdoc/RubyXL/TableParts.html +97 -0
- data/rdoc/RubyXL/TableStyle.html +99 -0
- data/rdoc/RubyXL/TableStyles.html +99 -0
- data/rdoc/RubyXL/Text.html +175 -0
- data/rdoc/RubyXL/TextImportSettings.html +99 -0
- data/rdoc/RubyXL/Theme.html +535 -0
- data/rdoc/RubyXL/ThemeElements.html +99 -0
- data/rdoc/RubyXL/ThumbnailFile.html +108 -0
- data/rdoc/RubyXL/Top10.html +99 -0
- data/rdoc/RubyXL/VMLDrawingFile.html +116 -0
- data/rdoc/RubyXL/Variant.html +99 -0
- data/rdoc/RubyXL/Vector.html +142 -0
- data/rdoc/RubyXL/VectorValue.html +97 -0
- data/rdoc/RubyXL/VisualProperties.html +99 -0
- data/rdoc/RubyXL/WebPublishObject.html +99 -0
- data/rdoc/RubyXL/WebPublishObjects.html +99 -0
- data/rdoc/RubyXL/WebPublishingItem.html +99 -0
- data/rdoc/RubyXL/WebPublishingItems.html +99 -0
- data/rdoc/RubyXL/WebPublishingProperties.html +99 -0
- data/rdoc/RubyXL/WebQueryProperties.html +99 -0
- data/rdoc/RubyXL/Workbook.html +948 -0
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +596 -0
- data/rdoc/RubyXL/WorkbookProperties.html +99 -0
- data/rdoc/RubyXL/WorkbookProtection.html +99 -0
- data/rdoc/RubyXL/WorkbookRoot.html +325 -0
- data/rdoc/RubyXL/WorkbookView.html +99 -0
- data/rdoc/RubyXL/WorkbookViews.html +99 -0
- data/rdoc/RubyXL/Worksheet.html +418 -0
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +2205 -0
- data/rdoc/RubyXL/WorksheetDimensions.html +99 -0
- data/rdoc/RubyXL/WorksheetFormatProperties.html +97 -0
- data/rdoc/RubyXL/WorksheetProperties.html +99 -0
- data/rdoc/RubyXL/WorksheetProtection.html +99 -0
- data/rdoc/RubyXL/WorksheetView.html +99 -0
- data/rdoc/RubyXL/WorksheetViews.html +99 -0
- data/rdoc/RubyXL/XF.html +99 -0
- data/rdoc/RubyXL.html +338 -0
- data/rdoc/created.rid +45 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +687 -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 +477 -0
- data/rdoc/js/darkfish.js +97 -0
- data/rdoc/js/navigation.js +105 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +110 -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 +3021 -0
- data/rubyXL.gemspec +521 -60
- data/spec/lib/cell_spec.rb +386 -143
- data/spec/lib/color_spec.rb +11 -4
- data/spec/lib/parser_spec.rb +90 -38
- data/spec/lib/reference_spec.rb +64 -0
- data/spec/lib/rgb_color_spec.rb +29 -0
- data/spec/lib/stylesheet_spec.rb +27 -0
- data/spec/lib/text_spec.rb +27 -0
- data/spec/lib/workbook_spec.rb +168 -22
- data/spec/lib/worksheet_spec.rb +1207 -1220
- data/spec/spec_helper.rb +13 -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 +634 -168
- data/Gemfile.lock +0 -34
- data/lib/.DS_Store +0 -0
- data/lib/rubyXL/Hash.rb +0 -60
- data/lib/rubyXL/color.rb +0 -14
- data/lib/rubyXL/private_class.rb +0 -265
- data/lib/rubyXL/workbook.rb +0 -450
- data/lib/rubyXL/writer/app_writer.rb +0 -62
- data/lib/rubyXL/writer/calc_chain_writer.rb +0 -33
- data/lib/rubyXL/writer/content_types_writer.rb +0 -77
- data/lib/rubyXL/writer/core_writer.rb +0 -51
- data/lib/rubyXL/writer/root_rels_writer.rb +0 -25
- data/lib/rubyXL/writer/shared_strings_writer.rb +0 -30
- data/lib/rubyXL/writer/styles_writer.rb +0 -407
- data/lib/rubyXL/writer/theme_writer.rb +0 -343
- data/lib/rubyXL/writer/workbook_rels_writer.rb +0 -59
- data/lib/rubyXL/writer/workbook_writer.rb +0 -77
- data/lib/rubyXL/writer/worksheet_writer.rb +0 -230
- data/lib/rubyXL/zip.rb +0 -20
- data/spec/lib/hash_spec.rb +0 -28
@@ -0,0 +1,2205 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module RubyXL::WorksheetConvenienceMethods - rubyXL 3.4.33</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<!-- Method Quickref -->
|
65
|
+
<div id="method-list-section" class="nav-section">
|
66
|
+
<h3>Methods</h3>
|
67
|
+
|
68
|
+
<ul class="link-list" role="directory">
|
69
|
+
<li ><a href="#method-i-add_validation_list">#add_validation_list</a>
|
70
|
+
<li ><a href="#method-i-change_column_alignment">#change_column_alignment</a>
|
71
|
+
<li ><a href="#method-i-change_column_bold">#change_column_bold</a>
|
72
|
+
<li ><a href="#method-i-change_column_border">#change_column_border</a>
|
73
|
+
<li ><a href="#method-i-change_column_border_color">#change_column_border_color</a>
|
74
|
+
<li ><a href="#method-i-change_column_fill">#change_column_fill</a>
|
75
|
+
<li ><a href="#method-i-change_column_font">#change_column_font</a>
|
76
|
+
<li ><a href="#method-i-change_column_font_color">#change_column_font_color</a>
|
77
|
+
<li ><a href="#method-i-change_column_font_name">#change_column_font_name</a>
|
78
|
+
<li ><a href="#method-i-change_column_font_size">#change_column_font_size</a>
|
79
|
+
<li ><a href="#method-i-change_column_horizontal_alignment">#change_column_horizontal_alignment</a>
|
80
|
+
<li ><a href="#method-i-change_column_italics">#change_column_italics</a>
|
81
|
+
<li ><a href="#method-i-change_column_strikethrough">#change_column_strikethrough</a>
|
82
|
+
<li ><a href="#method-i-change_column_underline">#change_column_underline</a>
|
83
|
+
<li ><a href="#method-i-change_column_vertical_alignment">#change_column_vertical_alignment</a>
|
84
|
+
<li ><a href="#method-i-change_column_width">#change_column_width</a>
|
85
|
+
<li ><a href="#method-i-change_column_width_raw">#change_column_width_raw</a>
|
86
|
+
<li ><a href="#method-i-change_row_alignment">#change_row_alignment</a>
|
87
|
+
<li ><a href="#method-i-change_row_bold">#change_row_bold</a>
|
88
|
+
<li ><a href="#method-i-change_row_border">#change_row_border</a>
|
89
|
+
<li ><a href="#method-i-change_row_border_color">#change_row_border_color</a>
|
90
|
+
<li ><a href="#method-i-change_row_fill">#change_row_fill</a>
|
91
|
+
<li ><a href="#method-i-change_row_font">#change_row_font</a>
|
92
|
+
<li ><a href="#method-i-change_row_font_color">#change_row_font_color</a>
|
93
|
+
<li ><a href="#method-i-change_row_font_name">#change_row_font_name</a>
|
94
|
+
<li ><a href="#method-i-change_row_font_size">#change_row_font_size</a>
|
95
|
+
<li ><a href="#method-i-change_row_height">#change_row_height</a>
|
96
|
+
<li ><a href="#method-i-change_row_horizontal_alignment">#change_row_horizontal_alignment</a>
|
97
|
+
<li ><a href="#method-i-change_row_italics">#change_row_italics</a>
|
98
|
+
<li ><a href="#method-i-change_row_strikethrough">#change_row_strikethrough</a>
|
99
|
+
<li ><a href="#method-i-change_row_underline">#change_row_underline</a>
|
100
|
+
<li ><a href="#method-i-change_row_vertical_alignment">#change_row_vertical_alignment</a>
|
101
|
+
<li ><a href="#method-i-column_font">#column_font</a>
|
102
|
+
<li ><a href="#method-i-delete_cell">#delete_cell</a>
|
103
|
+
<li ><a href="#method-i-delete_column">#delete_column</a>
|
104
|
+
<li ><a href="#method-i-delete_row">#delete_row</a>
|
105
|
+
<li ><a href="#method-i-get_col_style">#get_col_style</a>
|
106
|
+
<li ><a href="#method-i-get_cols_style_index">#get_cols_style_index</a>
|
107
|
+
<li ><a href="#method-i-get_column_alignment">#get_column_alignment</a>
|
108
|
+
<li ><a href="#method-i-get_column_border">#get_column_border</a>
|
109
|
+
<li ><a href="#method-i-get_column_border_color">#get_column_border_color</a>
|
110
|
+
<li ><a href="#method-i-get_column_fill">#get_column_fill</a>
|
111
|
+
<li ><a href="#method-i-get_column_font_color">#get_column_font_color</a>
|
112
|
+
<li ><a href="#method-i-get_column_font_name">#get_column_font_name</a>
|
113
|
+
<li ><a href="#method-i-get_column_font_size">#get_column_font_size</a>
|
114
|
+
<li ><a href="#method-i-get_column_width">#get_column_width</a>
|
115
|
+
<li ><a href="#method-i-get_column_width_raw">#get_column_width_raw</a>
|
116
|
+
<li ><a href="#method-i-get_row_alignment">#get_row_alignment</a>
|
117
|
+
<li ><a href="#method-i-get_row_border">#get_row_border</a>
|
118
|
+
<li ><a href="#method-i-get_row_border_color">#get_row_border_color</a>
|
119
|
+
<li ><a href="#method-i-get_row_fill">#get_row_fill</a>
|
120
|
+
<li ><a href="#method-i-get_row_font_color">#get_row_font_color</a>
|
121
|
+
<li ><a href="#method-i-get_row_font_name">#get_row_font_name</a>
|
122
|
+
<li ><a href="#method-i-get_row_font_size">#get_row_font_size</a>
|
123
|
+
<li ><a href="#method-i-get_row_height">#get_row_height</a>
|
124
|
+
<li ><a href="#method-i-get_row_style">#get_row_style</a>
|
125
|
+
<li ><a href="#method-i-insert_cell">#insert_cell</a>
|
126
|
+
<li ><a href="#method-i-insert_column">#insert_column</a>
|
127
|
+
<li ><a href="#method-i-insert_row">#insert_row</a>
|
128
|
+
<li ><a href="#method-i-is_column_bolded">#is_column_bolded</a>
|
129
|
+
<li ><a href="#method-i-is_column_italicized">#is_column_italicized</a>
|
130
|
+
<li ><a href="#method-i-is_column_struckthrough">#is_column_struckthrough</a>
|
131
|
+
<li ><a href="#method-i-is_column_underlined">#is_column_underlined</a>
|
132
|
+
<li ><a href="#method-i-is_row_bolded">#is_row_bolded</a>
|
133
|
+
<li ><a href="#method-i-is_row_italicized">#is_row_italicized</a>
|
134
|
+
<li ><a href="#method-i-is_row_struckthrough">#is_row_struckthrough</a>
|
135
|
+
<li ><a href="#method-i-is_row_underlined">#is_row_underlined</a>
|
136
|
+
<li ><a href="#method-i-merge_cells">#merge_cells</a>
|
137
|
+
<li ><a href="#method-i-row_font">#row_font</a>
|
138
|
+
</ul>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</nav>
|
143
|
+
|
144
|
+
<main role="main" aria-labelledby="module-RubyXL::WorksheetConvenienceMethods">
|
145
|
+
<h1 id="module-RubyXL::WorksheetConvenienceMethods" class="module">
|
146
|
+
module RubyXL::WorksheetConvenienceMethods
|
147
|
+
</h1>
|
148
|
+
|
149
|
+
<section class="description">
|
150
|
+
|
151
|
+
</section>
|
152
|
+
|
153
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
154
|
+
|
155
|
+
|
156
|
+
<section class="constants-list">
|
157
|
+
<header>
|
158
|
+
<h3>Constants</h3>
|
159
|
+
</header>
|
160
|
+
<dl>
|
161
|
+
<dt id="BOLD">BOLD
|
162
|
+
<dd>
|
163
|
+
<dt id="COLOR">COLOR
|
164
|
+
<dd>
|
165
|
+
<dt id="ITALICS">ITALICS
|
166
|
+
<dd>
|
167
|
+
<dt id="NAME">NAME
|
168
|
+
<dd>
|
169
|
+
<dt id="SIZE">SIZE
|
170
|
+
<dd>
|
171
|
+
<dt id="STRIKETHROUGH">STRIKETHROUGH
|
172
|
+
<dd>
|
173
|
+
<dt id="UNDERLINE">UNDERLINE
|
174
|
+
<dd>
|
175
|
+
</dl>
|
176
|
+
</section>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
181
|
+
<header>
|
182
|
+
<h3>Public Instance Methods</h3>
|
183
|
+
</header>
|
184
|
+
|
185
|
+
<div id="method-i-add_validation_list" class="method-detail ">
|
186
|
+
<div class="method-header">
|
187
|
+
<div class="method-heading">
|
188
|
+
<span class="method-name">add_validation_list</span><span
|
189
|
+
class="method-args">(ref, list_arr)</span>
|
190
|
+
<span class="method-click-advice">click to toggle source</span>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div class="method-description">
|
195
|
+
|
196
|
+
|
197
|
+
<div class="method-source-code" id="add_validation_list-source">
|
198
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 720</span>
|
199
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_validation_list</span>(<span class="ruby-identifier">ref</span>, <span class="ruby-identifier">list_arr</span>)
|
200
|
+
<span class="ruby-comment"># "Any double quote characters in the value should be escaped with another double quote.</span>
|
201
|
+
<span class="ruby-comment"># If the value does not contain a comma, newline or double quote, then the String value should be returned unchanged.</span>
|
202
|
+
<span class="ruby-comment"># If the value contains a comma, newline or double quote, then the String value should be returned enclosed in double quotes."</span>
|
203
|
+
<span class="ruby-identifier">expr</span> = <span class="ruby-string">'"'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">list_arr</span>.<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">str</span><span class="ruby-operator">|</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'"'</span>, <span class="ruby-string">'""'</span>) }.<span class="ruby-identifier">join</span>(<span class="ruby-string">','</span>) <span class="ruby-operator">+</span> <span class="ruby-string">'"'</span>
|
204
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">data_validations</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">DataValidations</span>.<span class="ruby-identifier">new</span>
|
205
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">data_validations</span> <span class="ruby-operator"><<</span>
|
206
|
+
<span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">DataValidation</span>.<span class="ruby-identifier">new</span>({<span class="ruby-value">:sqref</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">ref</span>),
|
207
|
+
<span class="ruby-value">:formula1</span> <span class="ruby-operator">=></span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Formula</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:expression</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">expr</span>),
|
208
|
+
<span class="ruby-value">:type</span> <span class="ruby-operator">=></span> <span class="ruby-string">'list'</span>})
|
209
|
+
<span class="ruby-keyword">end</span></pre>
|
210
|
+
</div>
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div id="method-i-change_column_alignment" class="method-detail ">
|
217
|
+
<div class="method-header">
|
218
|
+
<div class="method-heading">
|
219
|
+
<span class="method-name">change_column_alignment</span><span
|
220
|
+
class="method-args">(column_index, &block)</span>
|
221
|
+
<span class="method-click-advice">click to toggle source</span>
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div class="method-description">
|
226
|
+
|
227
|
+
|
228
|
+
<div class="method-source-code" id="change_column_alignment-source">
|
229
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 675</span>
|
230
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_alignment</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
231
|
+
<span class="ruby-identifier">validate_workbook</span>
|
232
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
233
|
+
|
234
|
+
<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>)
|
235
|
+
<span class="ruby-comment"># Excel gets confused if width is not explicitly set for a column that had alignment changes</span>
|
236
|
+
<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>
|
237
|
+
|
238
|
+
<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>
|
239
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">nil?</span>
|
240
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
241
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
242
|
+
<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>)
|
243
|
+
}
|
244
|
+
<span class="ruby-keyword">end</span></pre>
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<div id="method-i-change_column_bold" class="method-detail ">
|
252
|
+
<div class="method-header">
|
253
|
+
<div class="method-heading">
|
254
|
+
<span class="method-name">change_column_bold</span><span
|
255
|
+
class="method-args">(column_index, bolded = false)</span>
|
256
|
+
<span class="method-click-advice">click to toggle source</span>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
<div class="method-description">
|
261
|
+
|
262
|
+
|
263
|
+
<div class="method-source-code" id="change_column_bold-source">
|
264
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 606</span>
|
265
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_bold</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">bolded</span> = <span class="ruby-keyword">false</span>)
|
266
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
267
|
+
<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>
|
268
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_bold</span>(<span class="ruby-identifier">bolded</span>)
|
269
|
+
<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>)
|
270
|
+
<span class="ruby-keyword">end</span></pre>
|
271
|
+
</div>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div id="method-i-change_column_border" class="method-detail ">
|
278
|
+
<div class="method-header">
|
279
|
+
<div class="method-heading">
|
280
|
+
<span class="method-name">change_column_border</span><span
|
281
|
+
class="method-args">(column_index, direction, weight)</span>
|
282
|
+
<span class="method-click-advice">click to toggle source</span>
|
283
|
+
</div>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
<div class="method-description">
|
287
|
+
|
288
|
+
|
289
|
+
<div class="method-source-code" id="change_column_border-source">
|
290
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 635</span>
|
291
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_border</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
292
|
+
<span class="ruby-identifier">validate_workbook</span>
|
293
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
294
|
+
|
295
|
+
<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>)
|
296
|
+
|
297
|
+
<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>
|
298
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">nil?</span>
|
299
|
+
<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>]
|
300
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
301
|
+
<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>)
|
302
|
+
}
|
303
|
+
<span class="ruby-keyword">end</span></pre>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
|
308
|
+
</div>
|
309
|
+
|
310
|
+
<div id="method-i-change_column_border_color" class="method-detail ">
|
311
|
+
<div class="method-header">
|
312
|
+
<div class="method-heading">
|
313
|
+
<span class="method-name">change_column_border_color</span><span
|
314
|
+
class="method-args">(column_index, direction, color)</span>
|
315
|
+
<span class="method-click-advice">click to toggle source</span>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div class="method-description">
|
320
|
+
|
321
|
+
|
322
|
+
<div class="method-source-code" id="change_column_border_color-source">
|
323
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 649</span>
|
324
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_border_color</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">color</span>)
|
325
|
+
<span class="ruby-identifier">validate_workbook</span>
|
326
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
327
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">color</span>)
|
328
|
+
|
329
|
+
<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>)
|
330
|
+
|
331
|
+
<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>
|
332
|
+
<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>]
|
333
|
+
<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>
|
334
|
+
}
|
335
|
+
<span class="ruby-keyword">end</span></pre>
|
336
|
+
</div>
|
337
|
+
</div>
|
338
|
+
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
<div id="method-i-change_column_fill" class="method-detail ">
|
343
|
+
<div class="method-header">
|
344
|
+
<div class="method-heading">
|
345
|
+
<span class="method-name">change_column_fill</span><span
|
346
|
+
class="method-args">(column_index, color_code = 'ffffff')</span>
|
347
|
+
<span class="method-click-advice">click to toggle source</span>
|
348
|
+
</div>
|
349
|
+
</div>
|
350
|
+
|
351
|
+
<div class="method-description">
|
352
|
+
|
353
|
+
|
354
|
+
<div class="method-source-code" id="change_column_fill-source">
|
355
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 401</span>
|
356
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_fill</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">color_code</span> = <span class="ruby-string">'ffffff'</span>)
|
357
|
+
<span class="ruby-identifier">validate_workbook</span>
|
358
|
+
<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>)
|
359
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
360
|
+
|
361
|
+
<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>)
|
362
|
+
|
363
|
+
<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>
|
364
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">nil?</span>
|
365
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
366
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
367
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_fill</span>(<span class="ruby-identifier">color_code</span>)
|
368
|
+
}
|
369
|
+
<span class="ruby-keyword">end</span></pre>
|
370
|
+
</div>
|
371
|
+
</div>
|
372
|
+
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
<div id="method-i-change_column_font" class="method-detail ">
|
377
|
+
<div class="method-header">
|
378
|
+
<div class="method-heading">
|
379
|
+
<span class="method-name">change_column_font</span><span
|
380
|
+
class="method-args">(column_index, change_type, arg, font, xf)</span>
|
381
|
+
<span class="method-click-advice">click to toggle source</span>
|
382
|
+
</div>
|
383
|
+
</div>
|
384
|
+
|
385
|
+
<div class="method-description">
|
386
|
+
<p>Helper method to update the fonts and cell styles array main method to change font, called from each separate font mutator method</p>
|
387
|
+
|
388
|
+
<div class="method-source-code" id="change_column_font-source">
|
389
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 563</span>
|
390
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
391
|
+
<span class="ruby-identifier">validate_workbook</span>
|
392
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
393
|
+
|
394
|
+
<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>)
|
395
|
+
<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>)
|
396
|
+
|
397
|
+
<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>
|
398
|
+
<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>]
|
399
|
+
<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>
|
400
|
+
}
|
401
|
+
<span class="ruby-keyword">end</span></pre>
|
402
|
+
</div>
|
403
|
+
</div>
|
404
|
+
|
405
|
+
|
406
|
+
</div>
|
407
|
+
|
408
|
+
<div id="method-i-change_column_font_color" class="method-detail ">
|
409
|
+
<div class="method-header">
|
410
|
+
<div class="method-heading">
|
411
|
+
<span class="method-name">change_column_font_color</span><span
|
412
|
+
class="method-args">(column_index, font_color='000000')</span>
|
413
|
+
<span class="method-click-advice">click to toggle source</span>
|
414
|
+
</div>
|
415
|
+
</div>
|
416
|
+
|
417
|
+
<div class="method-description">
|
418
|
+
|
419
|
+
|
420
|
+
<div class="method-source-code" id="change_column_font_color-source">
|
421
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 590</span>
|
422
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
423
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">font_color</span>)
|
424
|
+
|
425
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
426
|
+
<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>
|
427
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_rgb_color</span>(<span class="ruby-identifier">font_color</span>)
|
428
|
+
<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>)
|
429
|
+
<span class="ruby-keyword">end</span></pre>
|
430
|
+
</div>
|
431
|
+
</div>
|
432
|
+
|
433
|
+
|
434
|
+
</div>
|
435
|
+
|
436
|
+
<div id="method-i-change_column_font_name" class="method-detail ">
|
437
|
+
<div class="method-header">
|
438
|
+
<div class="method-heading">
|
439
|
+
<span class="method-name">change_column_font_name</span><span
|
440
|
+
class="method-args">(column_index = 0, font_name = 'Verdana')</span>
|
441
|
+
<span class="method-click-advice">click to toggle source</span>
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
|
445
|
+
<div class="method-description">
|
446
|
+
|
447
|
+
|
448
|
+
<div class="method-source-code" id="change_column_font_name-source">
|
449
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 576</span>
|
450
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
451
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
452
|
+
<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>
|
453
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_name</span>(<span class="ruby-identifier">font_name</span>)
|
454
|
+
<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>)
|
455
|
+
<span class="ruby-keyword">end</span></pre>
|
456
|
+
</div>
|
457
|
+
</div>
|
458
|
+
|
459
|
+
|
460
|
+
</div>
|
461
|
+
|
462
|
+
<div id="method-i-change_column_font_size" class="method-detail ">
|
463
|
+
<div class="method-header">
|
464
|
+
<div class="method-heading">
|
465
|
+
<span class="method-name">change_column_font_size</span><span
|
466
|
+
class="method-args">(column_index, font_size=10)</span>
|
467
|
+
<span class="method-click-advice">click to toggle source</span>
|
468
|
+
</div>
|
469
|
+
</div>
|
470
|
+
|
471
|
+
<div class="method-description">
|
472
|
+
|
473
|
+
|
474
|
+
<div class="method-source-code" id="change_column_font_size-source">
|
475
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 583</span>
|
476
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
477
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
478
|
+
<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>
|
479
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_size</span>(<span class="ruby-identifier">font_size</span>)
|
480
|
+
<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>)
|
481
|
+
<span class="ruby-keyword">end</span></pre>
|
482
|
+
</div>
|
483
|
+
</div>
|
484
|
+
|
485
|
+
|
486
|
+
</div>
|
487
|
+
|
488
|
+
<div id="method-i-change_column_horizontal_alignment" class="method-detail ">
|
489
|
+
<div class="method-header">
|
490
|
+
<div class="method-heading">
|
491
|
+
<span class="method-name">change_column_horizontal_alignment</span><span
|
492
|
+
class="method-args">(column_index, alignment = 'center')</span>
|
493
|
+
<span class="method-click-advice">click to toggle source</span>
|
494
|
+
</div>
|
495
|
+
</div>
|
496
|
+
|
497
|
+
<div class="method-description">
|
498
|
+
|
499
|
+
|
500
|
+
<div class="method-source-code" id="change_column_horizontal_alignment-source">
|
501
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 627</span>
|
502
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_horizontal_alignment</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">alignment</span> = <span class="ruby-string">'center'</span>)
|
503
|
+
<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> }
|
504
|
+
<span class="ruby-keyword">end</span></pre>
|
505
|
+
</div>
|
506
|
+
</div>
|
507
|
+
|
508
|
+
|
509
|
+
</div>
|
510
|
+
|
511
|
+
<div id="method-i-change_column_italics" class="method-detail ">
|
512
|
+
<div class="method-header">
|
513
|
+
<div class="method-heading">
|
514
|
+
<span class="method-name">change_column_italics</span><span
|
515
|
+
class="method-args">(column_index, italicized = false)</span>
|
516
|
+
<span class="method-click-advice">click to toggle source</span>
|
517
|
+
</div>
|
518
|
+
</div>
|
519
|
+
|
520
|
+
<div class="method-description">
|
521
|
+
|
522
|
+
|
523
|
+
<div class="method-source-code" id="change_column_italics-source">
|
524
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 599</span>
|
525
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_italics</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">italicized</span> = <span class="ruby-keyword">false</span>)
|
526
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
527
|
+
<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>
|
528
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_italic</span>(<span class="ruby-identifier">italicized</span>)
|
529
|
+
<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>)
|
530
|
+
<span class="ruby-keyword">end</span></pre>
|
531
|
+
</div>
|
532
|
+
</div>
|
533
|
+
|
534
|
+
|
535
|
+
</div>
|
536
|
+
|
537
|
+
<div id="method-i-change_column_strikethrough" class="method-detail ">
|
538
|
+
<div class="method-header">
|
539
|
+
<div class="method-heading">
|
540
|
+
<span class="method-name">change_column_strikethrough</span><span
|
541
|
+
class="method-args">(column_index, struckthrough=false)</span>
|
542
|
+
<span class="method-click-advice">click to toggle source</span>
|
543
|
+
</div>
|
544
|
+
</div>
|
545
|
+
|
546
|
+
<div class="method-description">
|
547
|
+
|
548
|
+
|
549
|
+
<div class="method-source-code" id="change_column_strikethrough-source">
|
550
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 620</span>
|
551
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_strikethrough</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">struckthrough</span>=<span class="ruby-keyword">false</span>)
|
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_strikethrough</span>(<span class="ruby-identifier">struckthrough</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">STRIKETHROUGH</span>, <span class="ruby-identifier">struckthrough</span>, <span class="ruby-identifier">font</span>, <span class="ruby-identifier">xf</span>)
|
556
|
+
<span class="ruby-keyword">end</span></pre>
|
557
|
+
</div>
|
558
|
+
</div>
|
559
|
+
|
560
|
+
|
561
|
+
</div>
|
562
|
+
|
563
|
+
<div id="method-i-change_column_underline" class="method-detail ">
|
564
|
+
<div class="method-header">
|
565
|
+
<div class="method-heading">
|
566
|
+
<span class="method-name">change_column_underline</span><span
|
567
|
+
class="method-args">(column_index, underlined = false)</span>
|
568
|
+
<span class="method-click-advice">click to toggle source</span>
|
569
|
+
</div>
|
570
|
+
</div>
|
571
|
+
|
572
|
+
<div class="method-description">
|
573
|
+
|
574
|
+
|
575
|
+
<div class="method-source-code" id="change_column_underline-source">
|
576
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 613</span>
|
577
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_underline</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">underlined</span> = <span class="ruby-keyword">false</span>)
|
578
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">column_index</span>)
|
579
|
+
<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>
|
580
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_underline</span>(<span class="ruby-identifier">underlined</span>)
|
581
|
+
<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>)
|
582
|
+
<span class="ruby-keyword">end</span></pre>
|
583
|
+
</div>
|
584
|
+
</div>
|
585
|
+
|
586
|
+
|
587
|
+
</div>
|
588
|
+
|
589
|
+
<div id="method-i-change_column_vertical_alignment" class="method-detail ">
|
590
|
+
<div class="method-header">
|
591
|
+
<div class="method-heading">
|
592
|
+
<span class="method-name">change_column_vertical_alignment</span><span
|
593
|
+
class="method-args">(column_index, alignment = 'center')</span>
|
594
|
+
<span class="method-click-advice">click to toggle source</span>
|
595
|
+
</div>
|
596
|
+
</div>
|
597
|
+
|
598
|
+
<div class="method-description">
|
599
|
+
|
600
|
+
|
601
|
+
<div class="method-source-code" id="change_column_vertical_alignment-source">
|
602
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 631</span>
|
603
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_vertical_alignment</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">alignment</span> = <span class="ruby-string">'center'</span>)
|
604
|
+
<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> }
|
605
|
+
<span class="ruby-keyword">end</span></pre>
|
606
|
+
</div>
|
607
|
+
</div>
|
608
|
+
|
609
|
+
|
610
|
+
</div>
|
611
|
+
|
612
|
+
<div id="method-i-change_column_width" class="method-detail ">
|
613
|
+
<div class="method-header">
|
614
|
+
<div class="method-heading">
|
615
|
+
<span class="method-name">change_column_width</span><span
|
616
|
+
class="method-args">(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)</span>
|
617
|
+
<span class="method-click-advice">click to toggle source</span>
|
618
|
+
</div>
|
619
|
+
</div>
|
620
|
+
|
621
|
+
<div class="method-description">
|
622
|
+
<p>Get column width measured in number of digits, as per <a 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>
|
623
|
+
|
624
|
+
<div class="method-source-code" id="change_column_width-source">
|
625
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 384</span>
|
626
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
627
|
+
<span class="ruby-identifier">change_column_width_raw</span>(<span class="ruby-identifier">column_index</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-identifier">chars2raw</span>(<span class="ruby-identifier">width_in_chars</span>))
|
628
|
+
<span class="ruby-keyword">end</span></pre>
|
629
|
+
</div>
|
630
|
+
</div>
|
631
|
+
|
632
|
+
|
633
|
+
</div>
|
634
|
+
|
635
|
+
<div id="method-i-change_column_width_raw" class="method-detail ">
|
636
|
+
<div class="method-header">
|
637
|
+
<div class="method-heading">
|
638
|
+
<span class="method-name">change_column_width_raw</span><span
|
639
|
+
class="method-args">(column_index, width)</span>
|
640
|
+
<span class="method-click-advice">click to toggle source</span>
|
641
|
+
</div>
|
642
|
+
</div>
|
643
|
+
|
644
|
+
<div class="method-description">
|
645
|
+
<p>Set raw column width value</p>
|
646
|
+
|
647
|
+
<div class="method-source-code" id="change_column_width_raw-source">
|
648
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 374</span>
|
649
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_column_width_raw</span>(<span class="ruby-identifier">column_index</span>, <span class="ruby-identifier">width</span>)
|
650
|
+
<span class="ruby-identifier">validate_workbook</span>
|
651
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
652
|
+
<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>)
|
653
|
+
<span class="ruby-identifier">range</span>.<span class="ruby-identifier">width</span> = <span class="ruby-identifier">width</span>
|
654
|
+
<span class="ruby-identifier">range</span>.<span class="ruby-identifier">custom_width</span> = <span class="ruby-keyword">true</span>
|
655
|
+
<span class="ruby-keyword">end</span></pre>
|
656
|
+
</div>
|
657
|
+
</div>
|
658
|
+
|
659
|
+
|
660
|
+
</div>
|
661
|
+
|
662
|
+
<div id="method-i-change_row_alignment" class="method-detail ">
|
663
|
+
<div class="method-header">
|
664
|
+
<div class="method-heading">
|
665
|
+
<span class="method-name">change_row_alignment</span><span
|
666
|
+
class="method-args">(row, &block)</span>
|
667
|
+
<span class="method-click-advice">click to toggle source</span>
|
668
|
+
</div>
|
669
|
+
</div>
|
670
|
+
|
671
|
+
<div class="method-description">
|
672
|
+
|
673
|
+
|
674
|
+
<div class="method-source-code" id="change_row_alignment-source">
|
675
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 662</span>
|
676
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_row_alignment</span>(<span class="ruby-identifier">row</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
677
|
+
<span class="ruby-identifier">validate_workbook</span>
|
678
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
679
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
680
|
+
|
681
|
+
<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>)
|
682
|
+
|
683
|
+
<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>
|
684
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span>
|
685
|
+
<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>)
|
686
|
+
}
|
687
|
+
<span class="ruby-keyword">end</span></pre>
|
688
|
+
</div>
|
689
|
+
</div>
|
690
|
+
|
691
|
+
|
692
|
+
</div>
|
693
|
+
|
694
|
+
<div id="method-i-change_row_bold" class="method-detail ">
|
695
|
+
<div class="method-header">
|
696
|
+
<div class="method-heading">
|
697
|
+
<span class="method-name">change_row_bold</span><span
|
698
|
+
class="method-args">(row = 0, bolded = false)</span>
|
699
|
+
<span class="method-click-advice">click to toggle source</span>
|
700
|
+
</div>
|
701
|
+
</div>
|
702
|
+
|
703
|
+
<div class="method-description">
|
704
|
+
|
705
|
+
|
706
|
+
<div class="method-source-code" id="change_row_bold-source">
|
707
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 531</span>
|
708
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
709
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
710
|
+
<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>
|
711
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_bold</span>(<span class="ruby-identifier">bolded</span>)
|
712
|
+
<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>)
|
713
|
+
<span class="ruby-keyword">end</span></pre>
|
714
|
+
</div>
|
715
|
+
</div>
|
716
|
+
|
717
|
+
|
718
|
+
</div>
|
719
|
+
|
720
|
+
<div id="method-i-change_row_border" class="method-detail ">
|
721
|
+
<div class="method-header">
|
722
|
+
<div class="method-heading">
|
723
|
+
<span class="method-name">change_row_border</span><span
|
724
|
+
class="method-args">(row, direction, weight)</span>
|
725
|
+
<span class="method-click-advice">click to toggle source</span>
|
726
|
+
</div>
|
727
|
+
</div>
|
728
|
+
|
729
|
+
<div class="method-description">
|
730
|
+
|
731
|
+
|
732
|
+
<div class="method-source-code" id="change_row_border-source">
|
733
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 457</span>
|
734
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">change_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">direction</span>, <span class="ruby-identifier">weight</span>)
|
735
|
+
<span class="ruby-identifier">validate_workbook</span>
|
736
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
737
|
+
|
738
|
+
<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>)
|
739
|
+
|
740
|
+
<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>
|
741
|
+
<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>
|
742
|
+
}
|
743
|
+
<span class="ruby-keyword">end</span></pre>
|
744
|
+
</div>
|
745
|
+
</div>
|
746
|
+
|
747
|
+
|
748
|
+
</div>
|
749
|
+
|
750
|
+
<div id="method-i-change_row_border_color" class="method-detail ">
|
751
|
+
<div class="method-header">
|
752
|
+
<div class="method-heading">
|
753
|
+
<span class="method-name">change_row_border_color</span><span
|
754
|
+
class="method-args">(row, direction, color = '000000')</span>
|
755
|
+
<span class="method-click-advice">click to toggle source</span>
|
756
|
+
</div>
|
757
|
+
</div>
|
758
|
+
|
759
|
+
<div class="method-description">
|
760
|
+
|
761
|
+
|
762
|
+
<div class="method-source-code" id="change_row_border_color-source">
|
763
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 468</span>
|
764
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
765
|
+
<span class="ruby-identifier">validate_workbook</span>
|
766
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
767
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">color</span>)
|
768
|
+
|
769
|
+
<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>)
|
770
|
+
|
771
|
+
<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>
|
772
|
+
<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>
|
773
|
+
}
|
774
|
+
<span class="ruby-keyword">end</span></pre>
|
775
|
+
</div>
|
776
|
+
</div>
|
777
|
+
|
778
|
+
|
779
|
+
</div>
|
780
|
+
|
781
|
+
<div id="method-i-change_row_fill" class="method-detail ">
|
782
|
+
<div class="method-header">
|
783
|
+
<div class="method-heading">
|
784
|
+
<span class="method-name">change_row_fill</span><span
|
785
|
+
class="method-args">(row_index = 0, rgb = 'ffffff')</span>
|
786
|
+
<span class="method-click-advice">click to toggle source</span>
|
787
|
+
</div>
|
788
|
+
</div>
|
789
|
+
|
790
|
+
<div class="method-description">
|
791
|
+
|
792
|
+
|
793
|
+
<div class="method-source-code" id="change_row_fill-source">
|
794
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 480</span>
|
795
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
796
|
+
<span class="ruby-identifier">validate_workbook</span>
|
797
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
798
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">rgb</span>)
|
799
|
+
|
800
|
+
<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>)
|
801
|
+
<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> }
|
802
|
+
<span class="ruby-keyword">end</span></pre>
|
803
|
+
</div>
|
804
|
+
</div>
|
805
|
+
|
806
|
+
|
807
|
+
</div>
|
808
|
+
|
809
|
+
<div id="method-i-change_row_font" class="method-detail ">
|
810
|
+
<div class="method-header">
|
811
|
+
<div class="method-heading">
|
812
|
+
<span class="method-name">change_row_font</span><span
|
813
|
+
class="method-args">(row_index, change_type, arg, font)</span>
|
814
|
+
<span class="method-click-advice">click to toggle source</span>
|
815
|
+
</div>
|
816
|
+
</div>
|
817
|
+
|
818
|
+
<div class="method-description">
|
819
|
+
<p>Helper method to update the row styles array change_type - <a href="WorksheetConvenienceMethods.html#NAME"><code>NAME</code></a> or <a href="WorksheetConvenienceMethods.html#SIZE"><code>SIZE</code></a> or <a href="WorksheetConvenienceMethods.html#COLOR"><code>COLOR</code></a> etc main method to change font, called from each separate font mutator method</p>
|
820
|
+
|
821
|
+
<div class="method-source-code" id="change_row_font-source">
|
822
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 492</span>
|
823
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
824
|
+
<span class="ruby-identifier">validate_workbook</span>
|
825
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
826
|
+
|
827
|
+
<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>))
|
828
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row_index</span>]
|
829
|
+
<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>)
|
830
|
+
<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> }
|
831
|
+
<span class="ruby-keyword">end</span></pre>
|
832
|
+
</div>
|
833
|
+
</div>
|
834
|
+
|
835
|
+
|
836
|
+
</div>
|
837
|
+
|
838
|
+
<div id="method-i-change_row_font_color" class="method-detail ">
|
839
|
+
<div class="method-header">
|
840
|
+
<div class="method-heading">
|
841
|
+
<span class="method-name">change_row_font_color</span><span
|
842
|
+
class="method-args">(row = 0, font_color = '000000')</span>
|
843
|
+
<span class="method-click-advice">click to toggle source</span>
|
844
|
+
</div>
|
845
|
+
</div>
|
846
|
+
|
847
|
+
<div class="method-description">
|
848
|
+
|
849
|
+
|
850
|
+
<div class="method-source-code" id="change_row_font_color-source">
|
851
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 516</span>
|
852
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
853
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
854
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">font_color</span>)
|
855
|
+
<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>
|
856
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_rgb_color</span>(<span class="ruby-identifier">font_color</span>)
|
857
|
+
<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>)
|
858
|
+
<span class="ruby-keyword">end</span></pre>
|
859
|
+
</div>
|
860
|
+
</div>
|
861
|
+
|
862
|
+
|
863
|
+
</div>
|
864
|
+
|
865
|
+
<div id="method-i-change_row_font_name" class="method-detail ">
|
866
|
+
<div class="method-header">
|
867
|
+
<div class="method-heading">
|
868
|
+
<span class="method-name">change_row_font_name</span><span
|
869
|
+
class="method-args">(row = 0, font_name = 'Verdana')</span>
|
870
|
+
<span class="method-click-advice">click to toggle source</span>
|
871
|
+
</div>
|
872
|
+
</div>
|
873
|
+
|
874
|
+
<div class="method-description">
|
875
|
+
|
876
|
+
|
877
|
+
<div class="method-source-code" id="change_row_font_name-source">
|
878
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 502</span>
|
879
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
880
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
881
|
+
<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>
|
882
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_name</span>(<span class="ruby-identifier">font_name</span>)
|
883
|
+
<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>)
|
884
|
+
<span class="ruby-keyword">end</span></pre>
|
885
|
+
</div>
|
886
|
+
</div>
|
887
|
+
|
888
|
+
|
889
|
+
</div>
|
890
|
+
|
891
|
+
<div id="method-i-change_row_font_size" class="method-detail ">
|
892
|
+
<div class="method-header">
|
893
|
+
<div class="method-heading">
|
894
|
+
<span class="method-name">change_row_font_size</span><span
|
895
|
+
class="method-args">(row = 0, font_size=10)</span>
|
896
|
+
<span class="method-click-advice">click to toggle source</span>
|
897
|
+
</div>
|
898
|
+
</div>
|
899
|
+
|
900
|
+
<div class="method-description">
|
901
|
+
|
902
|
+
|
903
|
+
<div class="method-source-code" id="change_row_font_size-source">
|
904
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 509</span>
|
905
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
906
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
907
|
+
<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>
|
908
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_size</span>(<span class="ruby-identifier">font_size</span>)
|
909
|
+
<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>)
|
910
|
+
<span class="ruby-keyword">end</span></pre>
|
911
|
+
</div>
|
912
|
+
</div>
|
913
|
+
|
914
|
+
|
915
|
+
</div>
|
916
|
+
|
917
|
+
<div id="method-i-change_row_height" class="method-detail ">
|
918
|
+
<div class="method-header">
|
919
|
+
<div class="method-heading">
|
920
|
+
<span class="method-name">change_row_height</span><span
|
921
|
+
class="method-args">(row = 0, height = 10)</span>
|
922
|
+
<span class="method-click-advice">click to toggle source</span>
|
923
|
+
</div>
|
924
|
+
</div>
|
925
|
+
|
926
|
+
<div class="method-description">
|
927
|
+
|
928
|
+
|
929
|
+
<div class="method-source-code" id="change_row_height-source">
|
930
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 552</span>
|
931
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
932
|
+
<span class="ruby-identifier">validate_workbook</span>
|
933
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
934
|
+
|
935
|
+
<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>]
|
936
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">ht</span> = <span class="ruby-identifier">height</span>
|
937
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">custom_height</span> = <span class="ruby-keyword">true</span>
|
938
|
+
<span class="ruby-keyword">end</span></pre>
|
939
|
+
</div>
|
940
|
+
</div>
|
941
|
+
|
942
|
+
|
943
|
+
</div>
|
944
|
+
|
945
|
+
<div id="method-i-change_row_horizontal_alignment" class="method-detail ">
|
946
|
+
<div class="method-header">
|
947
|
+
<div class="method-heading">
|
948
|
+
<span class="method-name">change_row_horizontal_alignment</span><span
|
949
|
+
class="method-args">(row = 0, alignment = 'center')</span>
|
950
|
+
<span class="method-click-advice">click to toggle source</span>
|
951
|
+
</div>
|
952
|
+
</div>
|
953
|
+
|
954
|
+
<div class="method-description">
|
955
|
+
|
956
|
+
|
957
|
+
<div class="method-source-code" id="change_row_horizontal_alignment-source">
|
958
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 445</span>
|
959
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
960
|
+
<span class="ruby-identifier">validate_workbook</span>
|
961
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
962
|
+
<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> }
|
963
|
+
<span class="ruby-keyword">end</span></pre>
|
964
|
+
</div>
|
965
|
+
</div>
|
966
|
+
|
967
|
+
|
968
|
+
</div>
|
969
|
+
|
970
|
+
<div id="method-i-change_row_italics" class="method-detail ">
|
971
|
+
<div class="method-header">
|
972
|
+
<div class="method-heading">
|
973
|
+
<span class="method-name">change_row_italics</span><span
|
974
|
+
class="method-args">(row = 0, italicized = false)</span>
|
975
|
+
<span class="method-click-advice">click to toggle source</span>
|
976
|
+
</div>
|
977
|
+
</div>
|
978
|
+
|
979
|
+
<div class="method-description">
|
980
|
+
|
981
|
+
|
982
|
+
<div class="method-source-code" id="change_row_italics-source">
|
983
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 524</span>
|
984
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
985
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
986
|
+
<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>
|
987
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_italic</span>(<span class="ruby-identifier">italicized</span>)
|
988
|
+
<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>)
|
989
|
+
<span class="ruby-keyword">end</span></pre>
|
990
|
+
</div>
|
991
|
+
</div>
|
992
|
+
|
993
|
+
|
994
|
+
</div>
|
995
|
+
|
996
|
+
<div id="method-i-change_row_strikethrough" class="method-detail ">
|
997
|
+
<div class="method-header">
|
998
|
+
<div class="method-heading">
|
999
|
+
<span class="method-name">change_row_strikethrough</span><span
|
1000
|
+
class="method-args">(row = 0, struckthrough=false)</span>
|
1001
|
+
<span class="method-click-advice">click to toggle source</span>
|
1002
|
+
</div>
|
1003
|
+
</div>
|
1004
|
+
|
1005
|
+
<div class="method-description">
|
1006
|
+
|
1007
|
+
|
1008
|
+
<div class="method-source-code" id="change_row_strikethrough-source">
|
1009
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 545</span>
|
1010
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
1011
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
1012
|
+
<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>
|
1013
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_strikethrough</span>(<span class="ruby-identifier">struckthrough</span>)
|
1014
|
+
<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>)
|
1015
|
+
<span class="ruby-keyword">end</span></pre>
|
1016
|
+
</div>
|
1017
|
+
</div>
|
1018
|
+
|
1019
|
+
|
1020
|
+
</div>
|
1021
|
+
|
1022
|
+
<div id="method-i-change_row_underline" class="method-detail ">
|
1023
|
+
<div class="method-header">
|
1024
|
+
<div class="method-heading">
|
1025
|
+
<span class="method-name">change_row_underline</span><span
|
1026
|
+
class="method-args">(row = 0, underlined=false)</span>
|
1027
|
+
<span class="method-click-advice">click to toggle source</span>
|
1028
|
+
</div>
|
1029
|
+
</div>
|
1030
|
+
|
1031
|
+
<div class="method-description">
|
1032
|
+
|
1033
|
+
|
1034
|
+
<div class="method-source-code" id="change_row_underline-source">
|
1035
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 538</span>
|
1036
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
1037
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
1038
|
+
<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>
|
1039
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_underline</span>(<span class="ruby-identifier">underlined</span>)
|
1040
|
+
<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>)
|
1041
|
+
<span class="ruby-keyword">end</span></pre>
|
1042
|
+
</div>
|
1043
|
+
</div>
|
1044
|
+
|
1045
|
+
|
1046
|
+
</div>
|
1047
|
+
|
1048
|
+
<div id="method-i-change_row_vertical_alignment" class="method-detail ">
|
1049
|
+
<div class="method-header">
|
1050
|
+
<div class="method-heading">
|
1051
|
+
<span class="method-name">change_row_vertical_alignment</span><span
|
1052
|
+
class="method-args">(row = 0, alignment = 'center')</span>
|
1053
|
+
<span class="method-click-advice">click to toggle source</span>
|
1054
|
+
</div>
|
1055
|
+
</div>
|
1056
|
+
|
1057
|
+
<div class="method-description">
|
1058
|
+
|
1059
|
+
|
1060
|
+
<div class="method-source-code" id="change_row_vertical_alignment-source">
|
1061
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 451</span>
|
1062
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
1063
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1064
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
1065
|
+
<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> }
|
1066
|
+
<span class="ruby-keyword">end</span></pre>
|
1067
|
+
</div>
|
1068
|
+
</div>
|
1069
|
+
|
1070
|
+
|
1071
|
+
</div>
|
1072
|
+
|
1073
|
+
<div id="method-i-column_font" class="method-detail ">
|
1074
|
+
<div class="method-header">
|
1075
|
+
<div class="method-heading">
|
1076
|
+
<span class="method-name">column_font</span><span
|
1077
|
+
class="method-args">(col)</span>
|
1078
|
+
<span class="method-click-advice">click to toggle source</span>
|
1079
|
+
</div>
|
1080
|
+
</div>
|
1081
|
+
|
1082
|
+
<div class="method-description">
|
1083
|
+
|
1084
|
+
|
1085
|
+
<div class="method-source-code" id="column_font-source">
|
1086
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 432</span>
|
1087
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">column_font</span>(<span class="ruby-identifier">col</span>)
|
1088
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1089
|
+
|
1090
|
+
<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>]
|
1091
|
+
<span class="ruby-keyword">end</span></pre>
|
1092
|
+
</div>
|
1093
|
+
</div>
|
1094
|
+
|
1095
|
+
|
1096
|
+
</div>
|
1097
|
+
|
1098
|
+
<div id="method-i-delete_cell" class="method-detail ">
|
1099
|
+
<div class="method-header">
|
1100
|
+
<div class="method-heading">
|
1101
|
+
<span class="method-name">delete_cell</span><span
|
1102
|
+
class="method-args">(row_index = 0, column_index=0, shift=nil)</span>
|
1103
|
+
<span class="method-click-advice">click to toggle source</span>
|
1104
|
+
</div>
|
1105
|
+
</div>
|
1106
|
+
|
1107
|
+
<div class="method-description">
|
1108
|
+
<p>by default, only sets cell to nil if :left is specified, method will shift row contents to the right of the deleted cell to the left if :up is specified, method will shift column contents below the deleted cell upward</p>
|
1109
|
+
|
1110
|
+
<div class="method-source-code" id="delete_cell-source">
|
1111
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 40</span>
|
1112
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
1113
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1114
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row_index</span>)
|
1115
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
1116
|
+
|
1117
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row_index</span>]
|
1118
|
+
<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>]
|
1119
|
+
|
1120
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">shift</span>
|
1121
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">then</span>
|
1122
|
+
<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>
|
1123
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:left</span> <span class="ruby-keyword">then</span>
|
1124
|
+
<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>
|
1125
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:up</span> <span class="ruby-keyword">then</span>
|
1126
|
+
(<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>
|
1127
|
+
<span class="ruby-identifier">old_row</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>]
|
1128
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">old_row</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">then</span>
|
1129
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-keyword">nil</span>
|
1130
|
+
<span class="ruby-keyword">else</span>
|
1131
|
+
<span class="ruby-identifier">new_row</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-identifier">add_row</span>(<span class="ruby-identifier">index</span>)
|
1132
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">new_row</span>.<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column_index</span>] = <span class="ruby-identifier">old_row</span>.<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column_index</span>]
|
1133
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">row</span> = (<span class="ruby-identifier">index</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>)
|
1134
|
+
<span class="ruby-keyword">end</span>
|
1135
|
+
}
|
1136
|
+
<span class="ruby-keyword">else</span>
|
1137
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'invalid shift option'</span>
|
1138
|
+
<span class="ruby-keyword">end</span>
|
1139
|
+
|
1140
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">old_cell</span>
|
1141
|
+
<span class="ruby-keyword">end</span></pre>
|
1142
|
+
</div>
|
1143
|
+
</div>
|
1144
|
+
|
1145
|
+
|
1146
|
+
</div>
|
1147
|
+
|
1148
|
+
<div id="method-i-delete_column" class="method-detail ">
|
1149
|
+
<div class="method-header">
|
1150
|
+
<div class="method-heading">
|
1151
|
+
<span class="method-name">delete_column</span><span
|
1152
|
+
class="method-args">(column_index = 0)</span>
|
1153
|
+
<span class="method-click-advice">click to toggle source</span>
|
1154
|
+
</div>
|
1155
|
+
</div>
|
1156
|
+
|
1157
|
+
<div class="method-description">
|
1158
|
+
|
1159
|
+
|
1160
|
+
<div class="method-source-code" id="delete_column-source">
|
1161
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 204</span>
|
1162
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_column</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
1163
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1164
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
1165
|
+
|
1166
|
+
<span class="ruby-comment"># Delete column</span>
|
1167
|
+
<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>) }
|
1168
|
+
|
1169
|
+
<span class="ruby-comment"># Update column numbers for cells to the right of the deleted column</span>
|
1170
|
+
<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>
|
1171
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">nil?</span>
|
1172
|
+
<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>
|
1173
|
+
<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>)
|
1174
|
+
}
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
<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>) }
|
1178
|
+
|
1179
|
+
<span class="ruby-comment"># Update row number of merged cells</span>
|
1180
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">merged_cells</span>
|
1181
|
+
|
1182
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">column_index</span><span class="ruby-operator">..</span><span class="ruby-identifier">column_index</span>) }
|
1183
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span>
|
1184
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">column_index</span>
|
1185
|
+
|
1186
|
+
<span class="ruby-identifier">in_merged_cell</span> = <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">column_index</span>
|
1187
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(
|
1188
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">first</span>,
|
1189
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">last</span>,
|
1190
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">in_merged_cell</span> <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>),
|
1191
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>,
|
1192
|
+
)
|
1193
|
+
}
|
1194
|
+
|
1195
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">single_cell?</span> }
|
1196
|
+
<span class="ruby-keyword">end</span></pre>
|
1197
|
+
</div>
|
1198
|
+
</div>
|
1199
|
+
|
1200
|
+
|
1201
|
+
</div>
|
1202
|
+
|
1203
|
+
<div id="method-i-delete_row" class="method-detail ">
|
1204
|
+
<div class="method-header">
|
1205
|
+
<div class="method-heading">
|
1206
|
+
<span class="method-name">delete_row</span><span
|
1207
|
+
class="method-args">(row_index=0)</span>
|
1208
|
+
<span class="method-click-advice">click to toggle source</span>
|
1209
|
+
</div>
|
1210
|
+
</div>
|
1211
|
+
|
1212
|
+
<div class="method-description">
|
1213
|
+
|
1214
|
+
|
1215
|
+
<div class="method-source-code" id="delete_row-source">
|
1216
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 126</span>
|
1217
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_row</span>(<span class="ruby-identifier">row_index</span>=<span class="ruby-value">0</span>)
|
1218
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1219
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row_index</span>)
|
1220
|
+
|
1221
|
+
<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>)
|
1222
|
+
|
1223
|
+
<span class="ruby-comment"># Update row number of each cell</span>
|
1224
|
+
<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>
|
1225
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">index</span>]
|
1226
|
+
<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> }
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
<span class="ruby-comment"># Update row number of merged cells</span>
|
1230
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">merged_cells</span> <span class="ruby-keyword">then</span>
|
1231
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">row_index</span><span class="ruby-operator">..</span><span class="ruby-identifier">row_index</span>) }
|
1232
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span>
|
1233
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">row_index</span>
|
1234
|
+
|
1235
|
+
<span class="ruby-identifier">in_merged_cell</span> = <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator"><=</span> <span class="ruby-identifier">row_index</span>
|
1236
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(
|
1237
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">in_merged_cell</span> <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>),
|
1238
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>,
|
1239
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">first</span>,
|
1240
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">last</span>,
|
1241
|
+
)
|
1242
|
+
}
|
1243
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">single_cell?</span> }
|
1244
|
+
<span class="ruby-keyword">end</span>
|
1245
|
+
|
1246
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">deleted</span>
|
1247
|
+
<span class="ruby-keyword">end</span></pre>
|
1248
|
+
</div>
|
1249
|
+
</div>
|
1250
|
+
|
1251
|
+
|
1252
|
+
</div>
|
1253
|
+
|
1254
|
+
<div id="method-i-get_col_style" class="method-detail ">
|
1255
|
+
<div class="method-header">
|
1256
|
+
<div class="method-heading">
|
1257
|
+
<span class="method-name">get_col_style</span><span
|
1258
|
+
class="method-args">(column_index)</span>
|
1259
|
+
<span class="method-click-advice">click to toggle source</span>
|
1260
|
+
</div>
|
1261
|
+
</div>
|
1262
|
+
|
1263
|
+
<div class="method-description">
|
1264
|
+
<p>Helper method to get the style index for a column</p>
|
1265
|
+
|
1266
|
+
<div class="method-source-code" id="get_col_style-source">
|
1267
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 389</span>
|
1268
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_col_style</span>(<span class="ruby-identifier">column_index</span>)
|
1269
|
+
<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>)
|
1270
|
+
(<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>
|
1271
|
+
<span class="ruby-keyword">end</span></pre>
|
1272
|
+
</div>
|
1273
|
+
</div>
|
1274
|
+
|
1275
|
+
|
1276
|
+
</div>
|
1277
|
+
|
1278
|
+
<div id="method-i-get_cols_style_index" class="method-detail ">
|
1279
|
+
<div class="method-header">
|
1280
|
+
<div class="method-heading">
|
1281
|
+
<span class="method-name">get_cols_style_index</span><span
|
1282
|
+
class="method-args">(column_index)</span>
|
1283
|
+
<span class="method-click-advice">click to toggle source</span>
|
1284
|
+
</div>
|
1285
|
+
</div>
|
1286
|
+
|
1287
|
+
<div class="method-description">
|
1288
|
+
|
1289
|
+
|
1290
|
+
<div class="method-source-code" id="get_cols_style_index-source">
|
1291
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 315</span>
|
1292
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_cols_style_index</span>(<span class="ruby-identifier">column_index</span>)
|
1293
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
1294
|
+
<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>)
|
1295
|
+
(<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>
|
1296
|
+
<span class="ruby-keyword">end</span></pre>
|
1297
|
+
</div>
|
1298
|
+
</div>
|
1299
|
+
|
1300
|
+
|
1301
|
+
</div>
|
1302
|
+
|
1303
|
+
<div id="method-i-get_column_alignment" class="method-detail ">
|
1304
|
+
<div class="method-header">
|
1305
|
+
<div class="method-heading">
|
1306
|
+
<span class="method-name">get_column_alignment</span><span
|
1307
|
+
class="method-args">(col, type)</span>
|
1308
|
+
<span class="method-click-advice">click to toggle source</span>
|
1309
|
+
</div>
|
1310
|
+
</div>
|
1311
|
+
|
1312
|
+
<div class="method-description">
|
1313
|
+
|
1314
|
+
|
1315
|
+
<div class="method-source-code" id="get_column_alignment-source">
|
1316
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 438</span>
|
1317
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_alignment</span>(<span class="ruby-identifier">col</span>, <span class="ruby-identifier">type</span>)
|
1318
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1319
|
+
|
1320
|
+
<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>)]
|
1321
|
+
<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>)
|
1322
|
+
<span class="ruby-keyword">end</span></pre>
|
1323
|
+
</div>
|
1324
|
+
</div>
|
1325
|
+
|
1326
|
+
|
1327
|
+
</div>
|
1328
|
+
|
1329
|
+
<div id="method-i-get_column_border" class="method-detail ">
|
1330
|
+
<div class="method-header">
|
1331
|
+
<div class="method-heading">
|
1332
|
+
<span class="method-name">get_column_border</span><span
|
1333
|
+
class="method-args">(col, border_direction)</span>
|
1334
|
+
<span class="method-click-advice">click to toggle source</span>
|
1335
|
+
</div>
|
1336
|
+
</div>
|
1337
|
+
|
1338
|
+
<div class="method-description">
|
1339
|
+
|
1340
|
+
|
1341
|
+
<div class="method-source-code" id="get_column_border-source">
|
1342
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 416</span>
|
1343
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-identifier">border_direction</span>)
|
1344
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1345
|
+
|
1346
|
+
<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>)]
|
1347
|
+
<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>]
|
1348
|
+
<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>)
|
1349
|
+
<span class="ruby-keyword">end</span></pre>
|
1350
|
+
</div>
|
1351
|
+
</div>
|
1352
|
+
|
1353
|
+
|
1354
|
+
</div>
|
1355
|
+
|
1356
|
+
<div id="method-i-get_column_border_color" class="method-detail ">
|
1357
|
+
<div class="method-header">
|
1358
|
+
<div class="method-heading">
|
1359
|
+
<span class="method-name">get_column_border_color</span><span
|
1360
|
+
class="method-args">(col, border_direction)</span>
|
1361
|
+
<span class="method-click-advice">click to toggle source</span>
|
1362
|
+
</div>
|
1363
|
+
</div>
|
1364
|
+
|
1365
|
+
<div class="method-description">
|
1366
|
+
|
1367
|
+
|
1368
|
+
<div class="method-source-code" id="get_column_border_color-source">
|
1369
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 424</span>
|
1370
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_border_color</span>(<span class="ruby-identifier">col</span>, <span class="ruby-identifier">border_direction</span>)
|
1371
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1372
|
+
|
1373
|
+
<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>)]
|
1374
|
+
<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>]
|
1375
|
+
<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>)
|
1376
|
+
<span class="ruby-keyword">end</span></pre>
|
1377
|
+
</div>
|
1378
|
+
</div>
|
1379
|
+
|
1380
|
+
|
1381
|
+
</div>
|
1382
|
+
|
1383
|
+
<div id="method-i-get_column_fill" class="method-detail ">
|
1384
|
+
<div class="method-header">
|
1385
|
+
<div class="method-heading">
|
1386
|
+
<span class="method-name">get_column_fill</span><span
|
1387
|
+
class="method-args">(col=0)</span>
|
1388
|
+
<span class="method-click-advice">click to toggle source</span>
|
1389
|
+
</div>
|
1390
|
+
</div>
|
1391
|
+
|
1392
|
+
<div class="method-description">
|
1393
|
+
|
1394
|
+
|
1395
|
+
<div class="method-source-code" id="get_column_fill-source">
|
1396
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 394</span>
|
1397
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_fill</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
1398
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1399
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">col</span>)
|
1400
|
+
|
1401
|
+
<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>))
|
1402
|
+
<span class="ruby-keyword">end</span></pre>
|
1403
|
+
</div>
|
1404
|
+
</div>
|
1405
|
+
|
1406
|
+
|
1407
|
+
</div>
|
1408
|
+
|
1409
|
+
<div id="method-i-get_column_font_color" class="method-detail ">
|
1410
|
+
<div class="method-header">
|
1411
|
+
<div class="method-heading">
|
1412
|
+
<span class="method-name">get_column_font_color</span><span
|
1413
|
+
class="method-args">(col = 0)</span>
|
1414
|
+
<span class="method-click-advice">click to toggle source</span>
|
1415
|
+
</div>
|
1416
|
+
</div>
|
1417
|
+
|
1418
|
+
<div class="method-description">
|
1419
|
+
|
1420
|
+
|
1421
|
+
<div class="method-source-code" id="get_column_font_color-source">
|
1422
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 331</span>
|
1423
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_font_color</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
1424
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
1425
|
+
<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>)
|
1426
|
+
<span class="ruby-keyword">end</span></pre>
|
1427
|
+
</div>
|
1428
|
+
</div>
|
1429
|
+
|
1430
|
+
|
1431
|
+
</div>
|
1432
|
+
|
1433
|
+
<div id="method-i-get_column_font_name" class="method-detail ">
|
1434
|
+
<div class="method-header">
|
1435
|
+
<div class="method-heading">
|
1436
|
+
<span class="method-name">get_column_font_name</span><span
|
1437
|
+
class="method-args">(col = 0)</span>
|
1438
|
+
<span class="method-click-advice">click to toggle source</span>
|
1439
|
+
</div>
|
1440
|
+
</div>
|
1441
|
+
|
1442
|
+
<div class="method-description">
|
1443
|
+
|
1444
|
+
|
1445
|
+
<div class="method-source-code" id="get_column_font_name-source">
|
1446
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 321</span>
|
1447
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_font_name</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
1448
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
1449
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_name</span>
|
1450
|
+
<span class="ruby-keyword">end</span></pre>
|
1451
|
+
</div>
|
1452
|
+
</div>
|
1453
|
+
|
1454
|
+
|
1455
|
+
</div>
|
1456
|
+
|
1457
|
+
<div id="method-i-get_column_font_size" class="method-detail ">
|
1458
|
+
<div class="method-header">
|
1459
|
+
<div class="method-heading">
|
1460
|
+
<span class="method-name">get_column_font_size</span><span
|
1461
|
+
class="method-args">(col = 0)</span>
|
1462
|
+
<span class="method-click-advice">click to toggle source</span>
|
1463
|
+
</div>
|
1464
|
+
</div>
|
1465
|
+
|
1466
|
+
<div class="method-description">
|
1467
|
+
|
1468
|
+
|
1469
|
+
<div class="method-source-code" id="get_column_font_size-source">
|
1470
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 326</span>
|
1471
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_font_size</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
1472
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
1473
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_size</span>
|
1474
|
+
<span class="ruby-keyword">end</span></pre>
|
1475
|
+
</div>
|
1476
|
+
</div>
|
1477
|
+
|
1478
|
+
|
1479
|
+
</div>
|
1480
|
+
|
1481
|
+
<div id="method-i-get_column_width" class="method-detail ">
|
1482
|
+
<div class="method-header">
|
1483
|
+
<div class="method-heading">
|
1484
|
+
<span class="method-name">get_column_width</span><span
|
1485
|
+
class="method-args">(column_index = 0)</span>
|
1486
|
+
<span class="method-click-advice">click to toggle source</span>
|
1487
|
+
</div>
|
1488
|
+
</div>
|
1489
|
+
|
1490
|
+
<div class="method-description">
|
1491
|
+
<p>Get column width measured in number of digits, as per <a 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>
|
1492
|
+
|
1493
|
+
<div class="method-source-code" id="get_column_width-source">
|
1494
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 367</span>
|
1495
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_width</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
1496
|
+
<span class="ruby-identifier">width</span> = <span class="ruby-identifier">get_column_width_raw</span>(<span class="ruby-identifier">column_index</span>)
|
1497
|
+
<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>
|
1498
|
+
(<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>
|
1499
|
+
<span class="ruby-keyword">end</span></pre>
|
1500
|
+
</div>
|
1501
|
+
</div>
|
1502
|
+
|
1503
|
+
|
1504
|
+
</div>
|
1505
|
+
|
1506
|
+
<div id="method-i-get_column_width_raw" class="method-detail ">
|
1507
|
+
<div class="method-header">
|
1508
|
+
<div class="method-heading">
|
1509
|
+
<span class="method-name">get_column_width_raw</span><span
|
1510
|
+
class="method-args">(column_index = 0)</span>
|
1511
|
+
<span class="method-click-advice">click to toggle source</span>
|
1512
|
+
</div>
|
1513
|
+
</div>
|
1514
|
+
|
1515
|
+
<div class="method-description">
|
1516
|
+
<p>Get raw column width value as stored in the file</p>
|
1517
|
+
|
1518
|
+
<div class="method-source-code" id="get_column_width_raw-source">
|
1519
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 357</span>
|
1520
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_column_width_raw</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
1521
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1522
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
1523
|
+
|
1524
|
+
<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>)
|
1525
|
+
<span class="ruby-identifier">range</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">width</span>
|
1526
|
+
<span class="ruby-keyword">end</span></pre>
|
1527
|
+
</div>
|
1528
|
+
</div>
|
1529
|
+
|
1530
|
+
|
1531
|
+
</div>
|
1532
|
+
|
1533
|
+
<div id="method-i-get_row_alignment" class="method-detail ">
|
1534
|
+
<div class="method-header">
|
1535
|
+
<div class="method-heading">
|
1536
|
+
<span class="method-name">get_row_alignment</span><span
|
1537
|
+
class="method-args">(row, is_horizontal)</span>
|
1538
|
+
<span class="method-click-advice">click to toggle source</span>
|
1539
|
+
</div>
|
1540
|
+
</div>
|
1541
|
+
|
1542
|
+
<div class="method-description">
|
1543
|
+
|
1544
|
+
|
1545
|
+
<div class="method-source-code" id="get_row_alignment-source">
|
1546
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 304</span>
|
1547
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_alignment</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">is_horizontal</span>)
|
1548
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1549
|
+
|
1550
|
+
<span class="ruby-identifier">xf_obj</span> = <span class="ruby-identifier">get_row_xf</span>(<span class="ruby-identifier">row</span>)
|
1551
|
+
<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>
|
1552
|
+
|
1553
|
+
<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>
|
1554
|
+
<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>
|
1555
|
+
<span class="ruby-keyword">end</span>
|
1556
|
+
<span class="ruby-keyword">end</span></pre>
|
1557
|
+
</div>
|
1558
|
+
</div>
|
1559
|
+
|
1560
|
+
|
1561
|
+
</div>
|
1562
|
+
|
1563
|
+
<div id="method-i-get_row_border" class="method-detail ">
|
1564
|
+
<div class="method-header">
|
1565
|
+
<div class="method-heading">
|
1566
|
+
<span class="method-name">get_row_border</span><span
|
1567
|
+
class="method-args">(row, border_direction)</span>
|
1568
|
+
<span class="method-click-advice">click to toggle source</span>
|
1569
|
+
</div>
|
1570
|
+
</div>
|
1571
|
+
|
1572
|
+
<div class="method-description">
|
1573
|
+
|
1574
|
+
|
1575
|
+
<div class="method-source-code" id="get_row_border-source">
|
1576
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 286</span>
|
1577
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">border_direction</span>)
|
1578
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1579
|
+
|
1580
|
+
<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>]
|
1581
|
+
<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>)
|
1582
|
+
<span class="ruby-keyword">end</span></pre>
|
1583
|
+
</div>
|
1584
|
+
</div>
|
1585
|
+
|
1586
|
+
|
1587
|
+
</div>
|
1588
|
+
|
1589
|
+
<div id="method-i-get_row_border_color" class="method-detail ">
|
1590
|
+
<div class="method-header">
|
1591
|
+
<div class="method-heading">
|
1592
|
+
<span class="method-name">get_row_border_color</span><span
|
1593
|
+
class="method-args">(row, border_direction)</span>
|
1594
|
+
<span class="method-click-advice">click to toggle source</span>
|
1595
|
+
</div>
|
1596
|
+
</div>
|
1597
|
+
|
1598
|
+
<div class="method-description">
|
1599
|
+
|
1600
|
+
|
1601
|
+
<div class="method-source-code" id="get_row_border_color-source">
|
1602
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 293</span>
|
1603
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_border_color</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">border_direction</span>)
|
1604
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1605
|
+
|
1606
|
+
<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>]
|
1607
|
+
<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>)
|
1608
|
+
<span class="ruby-keyword">end</span></pre>
|
1609
|
+
</div>
|
1610
|
+
</div>
|
1611
|
+
|
1612
|
+
|
1613
|
+
</div>
|
1614
|
+
|
1615
|
+
<div id="method-i-get_row_fill" class="method-detail ">
|
1616
|
+
<div class="method-header">
|
1617
|
+
<div class="method-heading">
|
1618
|
+
<span class="method-name">get_row_fill</span><span
|
1619
|
+
class="method-args">(row = 0)</span>
|
1620
|
+
<span class="method-click-advice">click to toggle source</span>
|
1621
|
+
</div>
|
1622
|
+
</div>
|
1623
|
+
|
1624
|
+
<div class="method-description">
|
1625
|
+
|
1626
|
+
|
1627
|
+
<div class="method-source-code" id="get_row_fill-source">
|
1628
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 245</span>
|
1629
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_fill</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
1630
|
+
(<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>
|
1631
|
+
<span class="ruby-keyword">end</span></pre>
|
1632
|
+
</div>
|
1633
|
+
</div>
|
1634
|
+
|
1635
|
+
|
1636
|
+
</div>
|
1637
|
+
|
1638
|
+
<div id="method-i-get_row_font_color" class="method-detail ">
|
1639
|
+
<div class="method-header">
|
1640
|
+
<div class="method-heading">
|
1641
|
+
<span class="method-name">get_row_font_color</span><span
|
1642
|
+
class="method-args">(row = 0)</span>
|
1643
|
+
<span class="method-click-advice">click to toggle source</span>
|
1644
|
+
</div>
|
1645
|
+
</div>
|
1646
|
+
|
1647
|
+
<div class="method-description">
|
1648
|
+
|
1649
|
+
|
1650
|
+
<div class="method-source-code" id="get_row_font_color-source">
|
1651
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 257</span>
|
1652
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_font_color</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
1653
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)
|
1654
|
+
<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>
|
1655
|
+
<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>)
|
1656
|
+
<span class="ruby-keyword">end</span></pre>
|
1657
|
+
</div>
|
1658
|
+
</div>
|
1659
|
+
|
1660
|
+
|
1661
|
+
</div>
|
1662
|
+
|
1663
|
+
<div id="method-i-get_row_font_name" class="method-detail ">
|
1664
|
+
<div class="method-header">
|
1665
|
+
<div class="method-heading">
|
1666
|
+
<span class="method-name">get_row_font_name</span><span
|
1667
|
+
class="method-args">(row = 0)</span>
|
1668
|
+
<span class="method-click-advice">click to toggle source</span>
|
1669
|
+
</div>
|
1670
|
+
</div>
|
1671
|
+
|
1672
|
+
<div class="method-description">
|
1673
|
+
|
1674
|
+
|
1675
|
+
<div class="method-source-code" id="get_row_font_name-source">
|
1676
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 249</span>
|
1677
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_font_name</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
1678
|
+
(<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>
|
1679
|
+
<span class="ruby-keyword">end</span></pre>
|
1680
|
+
</div>
|
1681
|
+
</div>
|
1682
|
+
|
1683
|
+
|
1684
|
+
</div>
|
1685
|
+
|
1686
|
+
<div id="method-i-get_row_font_size" class="method-detail ">
|
1687
|
+
<div class="method-header">
|
1688
|
+
<div class="method-heading">
|
1689
|
+
<span class="method-name">get_row_font_size</span><span
|
1690
|
+
class="method-args">(row = 0)</span>
|
1691
|
+
<span class="method-click-advice">click to toggle source</span>
|
1692
|
+
</div>
|
1693
|
+
</div>
|
1694
|
+
|
1695
|
+
<div class="method-description">
|
1696
|
+
|
1697
|
+
|
1698
|
+
<div class="method-source-code" id="get_row_font_size-source">
|
1699
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 253</span>
|
1700
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_font_size</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
1701
|
+
(<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>
|
1702
|
+
<span class="ruby-keyword">end</span></pre>
|
1703
|
+
</div>
|
1704
|
+
</div>
|
1705
|
+
|
1706
|
+
|
1707
|
+
</div>
|
1708
|
+
|
1709
|
+
<div id="method-i-get_row_height" class="method-detail ">
|
1710
|
+
<div class="method-header">
|
1711
|
+
<div class="method-heading">
|
1712
|
+
<span class="method-name">get_row_height</span><span
|
1713
|
+
class="method-args">(row = 0)</span>
|
1714
|
+
<span class="method-click-advice">click to toggle source</span>
|
1715
|
+
</div>
|
1716
|
+
</div>
|
1717
|
+
|
1718
|
+
<div class="method-description">
|
1719
|
+
|
1720
|
+
|
1721
|
+
<div class="method-source-code" id="get_row_height-source">
|
1722
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 279</span>
|
1723
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_height</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
1724
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1725
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
1726
|
+
<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>]
|
1727
|
+
(<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>
|
1728
|
+
<span class="ruby-keyword">end</span></pre>
|
1729
|
+
</div>
|
1730
|
+
</div>
|
1731
|
+
|
1732
|
+
|
1733
|
+
</div>
|
1734
|
+
|
1735
|
+
<div id="method-i-get_row_style" class="method-detail ">
|
1736
|
+
<div class="method-header">
|
1737
|
+
<div class="method-heading">
|
1738
|
+
<span class="method-name">get_row_style</span><span
|
1739
|
+
class="method-args">(row_index)</span>
|
1740
|
+
<span class="method-click-advice">click to toggle source</span>
|
1741
|
+
</div>
|
1742
|
+
</div>
|
1743
|
+
|
1744
|
+
<div class="method-description">
|
1745
|
+
|
1746
|
+
|
1747
|
+
<div class="method-source-code" id="get_row_style-source">
|
1748
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 240</span>
|
1749
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_row_style</span>(<span class="ruby-identifier">row_index</span>)
|
1750
|
+
<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>]
|
1751
|
+
(<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>
|
1752
|
+
<span class="ruby-keyword">end</span></pre>
|
1753
|
+
</div>
|
1754
|
+
</div>
|
1755
|
+
|
1756
|
+
|
1757
|
+
</div>
|
1758
|
+
|
1759
|
+
<div id="method-i-insert_cell" class="method-detail ">
|
1760
|
+
<div class="method-header">
|
1761
|
+
<div class="method-heading">
|
1762
|
+
<span class="method-name">insert_cell</span><span
|
1763
|
+
class="method-args">(row = 0, col = 0, data = nil, formula = nil, shift = nil)</span>
|
1764
|
+
<span class="method-click-advice">click to toggle source</span>
|
1765
|
+
</div>
|
1766
|
+
</div>
|
1767
|
+
|
1768
|
+
<div class="method-description">
|
1769
|
+
|
1770
|
+
|
1771
|
+
<div class="method-source-code" id="insert_cell-source">
|
1772
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 11</span>
|
1773
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">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>)
|
1774
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1775
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">col</span>)
|
1776
|
+
|
1777
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">shift</span>
|
1778
|
+
<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>
|
1779
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:right</span> <span class="ruby-keyword">then</span>
|
1780
|
+
<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>)
|
1781
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:down</span> <span class="ruby-keyword">then</span>
|
1782
|
+
<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>))
|
1783
|
+
(<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>
|
1784
|
+
<span class="ruby-identifier">old_row</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>]
|
1785
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">old_row</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">then</span>
|
1786
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span>] = <span class="ruby-keyword">nil</span>
|
1787
|
+
<span class="ruby-keyword">else</span>
|
1788
|
+
<span class="ruby-identifier">new_row</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-identifier">add_row</span>(<span class="ruby-identifier">index</span>)
|
1789
|
+
<span class="ruby-identifier">new_row</span>.<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>] = <span class="ruby-identifier">old_row</span>.<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>]
|
1790
|
+
<span class="ruby-keyword">end</span>
|
1791
|
+
}
|
1792
|
+
<span class="ruby-keyword">else</span>
|
1793
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'invalid shift option'</span>
|
1794
|
+
<span class="ruby-keyword">end</span>
|
1795
|
+
|
1796
|
+
<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>)
|
1797
|
+
<span class="ruby-keyword">end</span></pre>
|
1798
|
+
</div>
|
1799
|
+
</div>
|
1800
|
+
|
1801
|
+
|
1802
|
+
</div>
|
1803
|
+
|
1804
|
+
<div id="method-i-insert_column" class="method-detail ">
|
1805
|
+
<div class="method-header">
|
1806
|
+
<div class="method-heading">
|
1807
|
+
<span class="method-name">insert_column</span><span
|
1808
|
+
class="method-args">(column_index = 0)</span>
|
1809
|
+
<span class="method-click-advice">click to toggle source</span>
|
1810
|
+
</div>
|
1811
|
+
</div>
|
1812
|
+
|
1813
|
+
<div class="method-description">
|
1814
|
+
<p>Inserts column at <code>column_index</code>, pushes everything right, takes styles from column to left NOTE: use of this method will break formulas which reference cells which are being “pushed right”</p>
|
1815
|
+
|
1816
|
+
<div class="method-source-code" id="insert_column-source">
|
1817
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 160</span>
|
1818
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_column</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>)
|
1819
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1820
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
1821
|
+
|
1822
|
+
<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>)
|
1823
|
+
|
1824
|
+
<span class="ruby-comment"># Go through each cell in column</span>
|
1825
|
+
<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>
|
1826
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-comment"># Do not process blank rows</span>
|
1827
|
+
|
1828
|
+
<span class="ruby-identifier">old_cell</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
1829
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-keyword">nil</span>
|
1830
|
+
|
1831
|
+
<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>
|
1832
|
+
<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>
|
1833
|
+
|
1834
|
+
<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>,
|
1835
|
+
<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>,
|
1836
|
+
<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>)
|
1837
|
+
<span class="ruby-keyword">end</span>
|
1838
|
+
|
1839
|
+
<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>)
|
1840
|
+
}
|
1841
|
+
|
1842
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">insert_column</span>(<span class="ruby-identifier">column_index</span>)
|
1843
|
+
|
1844
|
+
<span class="ruby-comment"># Update merged cells for all rows below</span>
|
1845
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">merged_cells</span> <span class="ruby-keyword">then</span>
|
1846
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span>
|
1847
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">column_index</span>
|
1848
|
+
|
1849
|
+
<span class="ruby-identifier">in_merged_cell</span> = <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">column_index</span>
|
1850
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(
|
1851
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">first</span>,
|
1852
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">last</span>,
|
1853
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">in_merged_cell</span> <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>),
|
1854
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>,
|
1855
|
+
)
|
1856
|
+
}
|
1857
|
+
<span class="ruby-keyword">end</span>
|
1858
|
+
|
1859
|
+
<span class="ruby-comment"># TODO: update column numbers</span>
|
1860
|
+
<span class="ruby-keyword">end</span></pre>
|
1861
|
+
</div>
|
1862
|
+
</div>
|
1863
|
+
|
1864
|
+
|
1865
|
+
</div>
|
1866
|
+
|
1867
|
+
<div id="method-i-insert_row" class="method-detail ">
|
1868
|
+
<div class="method-header">
|
1869
|
+
<div class="method-heading">
|
1870
|
+
<span class="method-name">insert_row</span><span
|
1871
|
+
class="method-args">(row_index = 0)</span>
|
1872
|
+
<span class="method-click-advice">click to toggle source</span>
|
1873
|
+
</div>
|
1874
|
+
</div>
|
1875
|
+
|
1876
|
+
<div class="method-description">
|
1877
|
+
<p>Inserts row at row_index, pushes down, copies style from the row above (that’s what Excel 2013 does!) NOTE: use of this method will break formulas which reference cells which are being “pushed down”</p>
|
1878
|
+
|
1879
|
+
<div class="method-source-code" id="insert_row-source">
|
1880
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 73</span>
|
1881
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">insert_row</span>(<span class="ruby-identifier">row_index</span> = <span class="ruby-value">0</span>)
|
1882
|
+
<span class="ruby-identifier">validate_workbook</span>
|
1883
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
1884
|
+
|
1885
|
+
<span class="ruby-identifier">old_row</span> = <span class="ruby-identifier">new_cells</span> = <span class="ruby-keyword">nil</span>
|
1886
|
+
|
1887
|
+
<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>
|
1888
|
+
<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>]
|
1889
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">old_row</span> <span class="ruby-keyword">then</span>
|
1890
|
+
<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>
|
1891
|
+
<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>
|
1892
|
+
<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>)
|
1893
|
+
<span class="ruby-identifier">nc</span>.<span class="ruby-identifier">worksheet</span> = <span class="ruby-keyword">self</span>
|
1894
|
+
<span class="ruby-identifier">nc</span>
|
1895
|
+
<span class="ruby-keyword">end</span>
|
1896
|
+
}
|
1897
|
+
<span class="ruby-keyword">end</span>
|
1898
|
+
<span class="ruby-keyword">end</span>
|
1899
|
+
|
1900
|
+
<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>]
|
1901
|
+
<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>)
|
1902
|
+
|
1903
|
+
<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>)
|
1904
|
+
<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>)
|
1905
|
+
|
1906
|
+
<span class="ruby-comment"># Update row values for all rows below</span>
|
1907
|
+
<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>
|
1908
|
+
<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>]
|
1909
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">nil?</span>
|
1910
|
+
<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>
|
1911
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">nil?</span>
|
1912
|
+
<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>)
|
1913
|
+
}
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
<span class="ruby-comment"># Update merged cells for all rows below</span>
|
1917
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">merged_cells</span> <span class="ruby-keyword">then</span>
|
1918
|
+
<span class="ruby-identifier">merged_cells</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mc</span><span class="ruby-operator">|</span>
|
1919
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">row_index</span>
|
1920
|
+
|
1921
|
+
<span class="ruby-identifier">in_merged_cell</span> = <span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">row_index</span>
|
1922
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(
|
1923
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">in_merged_cell</span> <span class="ruby-operator">?</span> <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>),
|
1924
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>,
|
1925
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">first</span>,
|
1926
|
+
<span class="ruby-identifier">mc</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">last</span>,
|
1927
|
+
)
|
1928
|
+
}
|
1929
|
+
<span class="ruby-keyword">end</span>
|
1930
|
+
|
1931
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">new_row</span>
|
1932
|
+
<span class="ruby-keyword">end</span></pre>
|
1933
|
+
</div>
|
1934
|
+
</div>
|
1935
|
+
|
1936
|
+
|
1937
|
+
</div>
|
1938
|
+
|
1939
|
+
<div id="method-i-is_column_bolded" class="method-detail ">
|
1940
|
+
<div class="method-header">
|
1941
|
+
<div class="method-heading">
|
1942
|
+
<span class="method-name">is_column_bolded</span><span
|
1943
|
+
class="method-args">(col = 0)</span>
|
1944
|
+
<span class="method-click-advice">click to toggle source</span>
|
1945
|
+
</div>
|
1946
|
+
</div>
|
1947
|
+
|
1948
|
+
<div class="method-description">
|
1949
|
+
|
1950
|
+
|
1951
|
+
<div class="method-source-code" id="is_column_bolded-source">
|
1952
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 341</span>
|
1953
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_column_bolded</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
1954
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
1955
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_bold</span>
|
1956
|
+
<span class="ruby-keyword">end</span></pre>
|
1957
|
+
</div>
|
1958
|
+
</div>
|
1959
|
+
|
1960
|
+
|
1961
|
+
</div>
|
1962
|
+
|
1963
|
+
<div id="method-i-is_column_italicized" class="method-detail ">
|
1964
|
+
<div class="method-header">
|
1965
|
+
<div class="method-heading">
|
1966
|
+
<span class="method-name">is_column_italicized</span><span
|
1967
|
+
class="method-args">(col = 0)</span>
|
1968
|
+
<span class="method-click-advice">click to toggle source</span>
|
1969
|
+
</div>
|
1970
|
+
</div>
|
1971
|
+
|
1972
|
+
<div class="method-description">
|
1973
|
+
|
1974
|
+
|
1975
|
+
<div class="method-source-code" id="is_column_italicized-source">
|
1976
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 336</span>
|
1977
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_column_italicized</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
1978
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
1979
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_italic</span>
|
1980
|
+
<span class="ruby-keyword">end</span></pre>
|
1981
|
+
</div>
|
1982
|
+
</div>
|
1983
|
+
|
1984
|
+
|
1985
|
+
</div>
|
1986
|
+
|
1987
|
+
<div id="method-i-is_column_struckthrough" class="method-detail ">
|
1988
|
+
<div class="method-header">
|
1989
|
+
<div class="method-heading">
|
1990
|
+
<span class="method-name">is_column_struckthrough</span><span
|
1991
|
+
class="method-args">(col = 0)</span>
|
1992
|
+
<span class="method-click-advice">click to toggle source</span>
|
1993
|
+
</div>
|
1994
|
+
</div>
|
1995
|
+
|
1996
|
+
<div class="method-description">
|
1997
|
+
|
1998
|
+
|
1999
|
+
<div class="method-source-code" id="is_column_struckthrough-source">
|
2000
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 351</span>
|
2001
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_column_struckthrough</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
2002
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
2003
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_strikethrough</span>
|
2004
|
+
<span class="ruby-keyword">end</span></pre>
|
2005
|
+
</div>
|
2006
|
+
</div>
|
2007
|
+
|
2008
|
+
|
2009
|
+
</div>
|
2010
|
+
|
2011
|
+
<div id="method-i-is_column_underlined" class="method-detail ">
|
2012
|
+
<div class="method-header">
|
2013
|
+
<div class="method-heading">
|
2014
|
+
<span class="method-name">is_column_underlined</span><span
|
2015
|
+
class="method-args">(col = 0)</span>
|
2016
|
+
<span class="method-click-advice">click to toggle source</span>
|
2017
|
+
</div>
|
2018
|
+
</div>
|
2019
|
+
|
2020
|
+
<div class="method-description">
|
2021
|
+
|
2022
|
+
|
2023
|
+
<div class="method-source-code" id="is_column_underlined-source">
|
2024
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 346</span>
|
2025
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_column_underlined</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
|
2026
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
2027
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_underlined</span>
|
2028
|
+
<span class="ruby-keyword">end</span></pre>
|
2029
|
+
</div>
|
2030
|
+
</div>
|
2031
|
+
|
2032
|
+
|
2033
|
+
</div>
|
2034
|
+
|
2035
|
+
<div id="method-i-is_row_bolded" class="method-detail ">
|
2036
|
+
<div class="method-header">
|
2037
|
+
<div class="method-heading">
|
2038
|
+
<span class="method-name">is_row_bolded</span><span
|
2039
|
+
class="method-args">(row = 0)</span>
|
2040
|
+
<span class="method-click-advice">click to toggle source</span>
|
2041
|
+
</div>
|
2042
|
+
</div>
|
2043
|
+
|
2044
|
+
<div class="method-description">
|
2045
|
+
|
2046
|
+
|
2047
|
+
<div class="method-source-code" id="is_row_bolded-source">
|
2048
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 267</span>
|
2049
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_row_bolded</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
2050
|
+
(<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>
|
2051
|
+
<span class="ruby-keyword">end</span></pre>
|
2052
|
+
</div>
|
2053
|
+
</div>
|
2054
|
+
|
2055
|
+
|
2056
|
+
</div>
|
2057
|
+
|
2058
|
+
<div id="method-i-is_row_italicized" class="method-detail ">
|
2059
|
+
<div class="method-header">
|
2060
|
+
<div class="method-heading">
|
2061
|
+
<span class="method-name">is_row_italicized</span><span
|
2062
|
+
class="method-args">(row = 0)</span>
|
2063
|
+
<span class="method-click-advice">click to toggle source</span>
|
2064
|
+
</div>
|
2065
|
+
</div>
|
2066
|
+
|
2067
|
+
<div class="method-description">
|
2068
|
+
|
2069
|
+
|
2070
|
+
<div class="method-source-code" id="is_row_italicized-source">
|
2071
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 263</span>
|
2072
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_row_italicized</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
2073
|
+
(<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>
|
2074
|
+
<span class="ruby-keyword">end</span></pre>
|
2075
|
+
</div>
|
2076
|
+
</div>
|
2077
|
+
|
2078
|
+
|
2079
|
+
</div>
|
2080
|
+
|
2081
|
+
<div id="method-i-is_row_struckthrough" class="method-detail ">
|
2082
|
+
<div class="method-header">
|
2083
|
+
<div class="method-heading">
|
2084
|
+
<span class="method-name">is_row_struckthrough</span><span
|
2085
|
+
class="method-args">(row = 0)</span>
|
2086
|
+
<span class="method-click-advice">click to toggle source</span>
|
2087
|
+
</div>
|
2088
|
+
</div>
|
2089
|
+
|
2090
|
+
<div class="method-description">
|
2091
|
+
|
2092
|
+
|
2093
|
+
<div class="method-source-code" id="is_row_struckthrough-source">
|
2094
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 275</span>
|
2095
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_row_struckthrough</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
2096
|
+
(<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>
|
2097
|
+
<span class="ruby-keyword">end</span></pre>
|
2098
|
+
</div>
|
2099
|
+
</div>
|
2100
|
+
|
2101
|
+
|
2102
|
+
</div>
|
2103
|
+
|
2104
|
+
<div id="method-i-is_row_underlined" class="method-detail ">
|
2105
|
+
<div class="method-header">
|
2106
|
+
<div class="method-heading">
|
2107
|
+
<span class="method-name">is_row_underlined</span><span
|
2108
|
+
class="method-args">(row = 0)</span>
|
2109
|
+
<span class="method-click-advice">click to toggle source</span>
|
2110
|
+
</div>
|
2111
|
+
</div>
|
2112
|
+
|
2113
|
+
<div class="method-description">
|
2114
|
+
|
2115
|
+
|
2116
|
+
<div class="method-source-code" id="is_row_underlined-source">
|
2117
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 271</span>
|
2118
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_row_underlined</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
2119
|
+
(<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>
|
2120
|
+
<span class="ruby-keyword">end</span></pre>
|
2121
|
+
</div>
|
2122
|
+
</div>
|
2123
|
+
|
2124
|
+
|
2125
|
+
</div>
|
2126
|
+
|
2127
|
+
<div id="method-i-merge_cells" class="method-detail ">
|
2128
|
+
<div class="method-header">
|
2129
|
+
<div class="method-heading">
|
2130
|
+
<span class="method-name">merge_cells</span><span
|
2131
|
+
class="method-args">(*params)</span>
|
2132
|
+
<span class="method-click-advice">click to toggle source</span>
|
2133
|
+
</div>
|
2134
|
+
</div>
|
2135
|
+
|
2136
|
+
<div class="method-description">
|
2137
|
+
<p>Merges cells within a rectangular area <a href="WorksheetConvenienceMethods.html#method-i-merge_cells"><code>merge_cells(row_from, col_from, row_to, col_to)</code></a> <a href="WorksheetConvenienceMethods.html#method-i-merge_cells"><code>merge_cells(reference_string)</code></a> <a href="WorksheetConvenienceMethods.html#method-i-merge_cells"><code>merge_cells</code></a>(row_from:, row_to:, col_from:, col_to:)</p>
|
2138
|
+
|
2139
|
+
<div class="method-source-code" id="merge_cells-source">
|
2140
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 695</span>
|
2141
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">merge_cells</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">params</span>)
|
2142
|
+
<span class="ruby-identifier">validate_workbook</span>
|
2143
|
+
|
2144
|
+
<span class="ruby-identifier">row_from</span> = <span class="ruby-identifier">col_from</span> = <span class="ruby-identifier">row_to</span> = <span class="ruby-identifier">col_to</span> = <span class="ruby-keyword">nil</span>
|
2145
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">size</span>
|
2146
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">4</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">col_from</span>, <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-identifier">params</span>
|
2147
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">1</span> <span class="ruby-keyword">then</span>
|
2148
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">first</span>
|
2149
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span> <span class="ruby-keyword">then</span>
|
2150
|
+
<span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_from</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">fetch_values</span>(<span class="ruby-value">:row_from</span>, <span class="ruby-value">:row_to</span>, <span class="ruby-value">:col_from</span>, <span class="ruby-value">:col_to</span>)
|
2151
|
+
<span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span>
|
2152
|
+
<span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">':'</span>)
|
2153
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"reference for merging cells must be a range"</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">to</span>.<span class="ruby-identifier">nil?</span>
|
2154
|
+
<span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">col_from</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-identifier">from</span>)
|
2155
|
+
<span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-identifier">to</span>)
|
2156
|
+
<span class="ruby-keyword">else</span>
|
2157
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"invalid value for #{self.class}: #{params[0].inspect}"</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
|
2158
|
+
<span class="ruby-keyword">end</span>
|
2159
|
+
<span class="ruby-keyword">end</span>
|
2160
|
+
|
2161
|
+
<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>
|
2162
|
+
<span class="ruby-comment"># TODO: add validation to make sure ranges are not intersecting with existing ones</span>
|
2163
|
+
<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">row_from</span>, <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_from</span>, <span class="ruby-identifier">col_to</span>))
|
2164
|
+
<span class="ruby-keyword">end</span></pre>
|
2165
|
+
</div>
|
2166
|
+
</div>
|
2167
|
+
|
2168
|
+
|
2169
|
+
</div>
|
2170
|
+
|
2171
|
+
<div id="method-i-row_font" class="method-detail ">
|
2172
|
+
<div class="method-header">
|
2173
|
+
<div class="method-heading">
|
2174
|
+
<span class="method-name">row_font</span><span
|
2175
|
+
class="method-args">(row)</span>
|
2176
|
+
<span class="method-click-advice">click to toggle source</span>
|
2177
|
+
</div>
|
2178
|
+
</div>
|
2179
|
+
|
2180
|
+
<div class="method-description">
|
2181
|
+
|
2182
|
+
|
2183
|
+
<div class="method-source-code" id="row_font-source">
|
2184
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/convenience_methods/worksheet.rb, line 300</span>
|
2185
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">row_font</span>(<span class="ruby-identifier">row</span>)
|
2186
|
+
(<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>
|
2187
|
+
<span class="ruby-keyword">end</span></pre>
|
2188
|
+
</div>
|
2189
|
+
</div>
|
2190
|
+
|
2191
|
+
|
2192
|
+
</div>
|
2193
|
+
|
2194
|
+
</section>
|
2195
|
+
|
2196
|
+
</section>
|
2197
|
+
</main>
|
2198
|
+
|
2199
|
+
|
2200
|
+
<footer id="validator-badges" role="contentinfo">
|
2201
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
2202
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.3.1.
|
2203
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
2204
|
+
</footer>
|
2205
|
+
|