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