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