rubyXL 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/rubyXL.rb +1 -0
- data/lib/rubyXL/objects/border.rb +3 -4
- data/lib/rubyXL/objects/calculation_chain.rb +1 -1
- data/lib/rubyXL/objects/cell_style.rb +3 -4
- data/lib/rubyXL/objects/chartsheet.rb +78 -0
- data/lib/rubyXL/objects/container_nodes.rb +2 -3
- data/lib/rubyXL/objects/data_validation.rb +5 -10
- data/lib/rubyXL/objects/document_properties.rb +1 -1
- data/lib/rubyXL/objects/fill.rb +3 -6
- data/lib/rubyXL/objects/filters.rb +120 -0
- data/lib/rubyXL/objects/formula.rb +2 -2
- data/lib/rubyXL/objects/ooxml_object.rb +116 -56
- data/lib/rubyXL/objects/relationships.rb +5 -1
- data/lib/rubyXL/objects/shared_strings.rb +1 -1
- data/lib/rubyXL/objects/sheet_common.rb +50 -0
- data/lib/rubyXL/objects/sheet_data.rb +6 -1
- data/lib/rubyXL/objects/simple_types.rb +78 -0
- data/lib/rubyXL/objects/stylesheet.rb +15 -3
- data/lib/rubyXL/objects/text.rb +4 -5
- data/lib/rubyXL/objects/workbook.rb +151 -26
- data/lib/rubyXL/objects/worksheet.rb +329 -107
- data/lib/rubyXL/parser.rb +12 -11
- data/lib/rubyXL/workbook.rb +3 -2
- data/rdoc/README_rdoc.html +404 -0
- data/rdoc/RubyXL.html +337 -0
- data/rdoc/RubyXL/AExtensionStorageArea.html +105 -0
- data/rdoc/RubyXL/Alignment.html +108 -0
- data/rdoc/RubyXL/AlternateContent.html +105 -0
- data/rdoc/RubyXL/AutoFilter.html +105 -0
- data/rdoc/RubyXL/AutoFilterColumn.html +105 -0
- data/rdoc/RubyXL/BooleanNode.html +105 -0
- data/rdoc/RubyXL/BooleanValue.html +105 -0
- data/rdoc/RubyXL/Border.html +105 -0
- data/rdoc/RubyXL/BorderContainer.html +105 -0
- data/rdoc/RubyXL/BorderEdge.html +156 -0
- data/rdoc/RubyXL/Break.html +105 -0
- data/rdoc/RubyXL/BreakList.html +105 -0
- data/rdoc/RubyXL/CalculationChain.html +159 -0
- data/rdoc/RubyXL/CalculationChainCell.html +108 -0
- data/rdoc/RubyXL/CalculationProperties.html +105 -0
- data/rdoc/RubyXL/Cell.html +428 -0
- data/rdoc/RubyXL/CellSmartTag.html +105 -0
- data/rdoc/RubyXL/CellSmartTagContainer.html +105 -0
- data/rdoc/RubyXL/CellSmartTagProperty.html +105 -0
- data/rdoc/RubyXL/CellStyle.html +108 -0
- data/rdoc/RubyXL/CellStyleContainer.html +105 -0
- data/rdoc/RubyXL/CellStyleXFContainer.html +105 -0
- data/rdoc/RubyXL/CellValue.html +108 -0
- data/rdoc/RubyXL/CellWatch.html +105 -0
- data/rdoc/RubyXL/CellWatchContainer.html +105 -0
- data/rdoc/RubyXL/CellXFContainer.html +105 -0
- data/rdoc/RubyXL/Chartsheet.html +105 -0
- data/rdoc/RubyXL/ChartsheetPageSetup.html +105 -0
- data/rdoc/RubyXL/ChartsheetProperties.html +108 -0
- data/rdoc/RubyXL/ChartsheetProtection.html +108 -0
- data/rdoc/RubyXL/ChartsheetView.html +105 -0
- data/rdoc/RubyXL/ChartsheetViewContainer.html +105 -0
- data/rdoc/RubyXL/Color.html +163 -0
- data/rdoc/RubyXL/ColorFilter.html +105 -0
- data/rdoc/RubyXL/ColorScale.html +105 -0
- data/rdoc/RubyXL/ColorScheme.html +105 -0
- data/rdoc/RubyXL/ColorSet.html +105 -0
- data/rdoc/RubyXL/Colors.html +105 -0
- data/rdoc/RubyXL/ColumnRange.html +233 -0
- data/rdoc/RubyXL/ColumnRanges.html +275 -0
- data/rdoc/RubyXL/ConditionalFormatValue.html +105 -0
- data/rdoc/RubyXL/ConditionalFormatting.html +105 -0
- data/rdoc/RubyXL/ConditionalFormattingRule.html +105 -0
- data/rdoc/RubyXL/CustomFilter.html +105 -0
- data/rdoc/RubyXL/CustomFilterContainer.html +105 -0
- data/rdoc/RubyXL/CustomProperty.html +105 -0
- data/rdoc/RubyXL/CustomPropertyContainer.html +105 -0
- data/rdoc/RubyXL/CustomSheetView.html +105 -0
- data/rdoc/RubyXL/CustomSheetViews.html +105 -0
- data/rdoc/RubyXL/CustomWorkbookView.html +105 -0
- data/rdoc/RubyXL/CustomWorkbookViewContainer.html +105 -0
- data/rdoc/RubyXL/DXF.html +105 -0
- data/rdoc/RubyXL/DXFs.html +105 -0
- data/rdoc/RubyXL/DataBar.html +105 -0
- data/rdoc/RubyXL/DataConsolidate.html +105 -0
- data/rdoc/RubyXL/DataConsolidationReference.html +105 -0
- data/rdoc/RubyXL/DataConsolidationReferences.html +105 -0
- data/rdoc/RubyXL/DataValidation.html +108 -0
- data/rdoc/RubyXL/DataValidations.html +105 -0
- data/rdoc/RubyXL/DateGroupItem.html +108 -0
- data/rdoc/RubyXL/DefinedName.html +105 -0
- data/rdoc/RubyXL/DefinedNames.html +105 -0
- data/rdoc/RubyXL/DocumentProperties.html +271 -0
- data/rdoc/RubyXL/DynamicFilter.html +105 -0
- data/rdoc/RubyXL/EmbeddedControl.html +105 -0
- data/rdoc/RubyXL/EmbeddedControlContainer.html +105 -0
- data/rdoc/RubyXL/Extension.html +228 -0
- data/rdoc/RubyXL/ExtensionStorageArea.html +108 -0
- data/rdoc/RubyXL/ExternalReference.html +105 -0
- data/rdoc/RubyXL/ExternalReferences.html +105 -0
- data/rdoc/RubyXL/FieldItem.html +105 -0
- data/rdoc/RubyXL/FileRecoveryProperties.html +105 -0
- data/rdoc/RubyXL/FileSharing.html +108 -0
- data/rdoc/RubyXL/FileVersion.html +108 -0
- data/rdoc/RubyXL/Fill.html +105 -0
- data/rdoc/RubyXL/FillContainer.html +105 -0
- data/rdoc/RubyXL/FilterContainer.html +105 -0
- data/rdoc/RubyXL/FloatNode.html +105 -0
- data/rdoc/RubyXL/FloatValue.html +105 -0
- data/rdoc/RubyXL/Font.html +655 -0
- data/rdoc/RubyXL/FontContainer.html +105 -0
- data/rdoc/RubyXL/FontScheme.html +105 -0
- data/rdoc/RubyXL/FormatScheme.html +105 -0
- data/rdoc/RubyXL/Formula.html +108 -0
- data/rdoc/RubyXL/FunctionGroup.html +105 -0
- data/rdoc/RubyXL/FunctionGroupContainer.html +105 -0
- data/rdoc/RubyXL/GenericStorage.html +344 -0
- data/rdoc/RubyXL/GradientFill.html +105 -0
- data/rdoc/RubyXL/HeaderFooterSettings.html +105 -0
- data/rdoc/RubyXL/Hyperlink.html +105 -0
- data/rdoc/RubyXL/HyperlinkContainer.html +105 -0
- data/rdoc/RubyXL/IconFilter.html +105 -0
- data/rdoc/RubyXL/IconSet.html +105 -0
- data/rdoc/RubyXL/IgnoredError.html +105 -0
- data/rdoc/RubyXL/IgnoredErrorContainer.html +105 -0
- data/rdoc/RubyXL/IndexedColorContainer.html +105 -0
- data/rdoc/RubyXL/InputCells.html +105 -0
- data/rdoc/RubyXL/IntegerNode.html +105 -0
- data/rdoc/RubyXL/IntegerValue.html +105 -0
- data/rdoc/RubyXL/LegacyCell.html +1498 -0
- data/rdoc/RubyXL/LegacyWorkbook.html +1283 -0
- data/rdoc/RubyXL/LegacyWorksheet.html +3291 -0
- data/rdoc/RubyXL/MRUColorContainer.html +105 -0
- data/rdoc/RubyXL/MergedCell.html +105 -0
- data/rdoc/RubyXL/MergedCells.html +105 -0
- data/rdoc/RubyXL/NumFmt.html +105 -0
- data/rdoc/RubyXL/NumberFormat.html +160 -0
- data/rdoc/RubyXL/NumberFormatContainer.html +173 -0
- data/rdoc/RubyXL/OLEObject.html +105 -0
- data/rdoc/RubyXL/OLEObjects.html +105 -0
- data/rdoc/RubyXL/OLESize.html +105 -0
- data/rdoc/RubyXL/OOXMLObject.html +862 -0
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +105 -0
- data/rdoc/RubyXL/OutlineProperties.html +108 -0
- data/rdoc/RubyXL/PageMargins.html +105 -0
- data/rdoc/RubyXL/PageSetup.html +105 -0
- data/rdoc/RubyXL/PageSetupProperties.html +108 -0
- data/rdoc/RubyXL/Pane.html +105 -0
- data/rdoc/RubyXL/Parser.html +348 -0
- data/rdoc/RubyXL/PatternFill.html +105 -0
- data/rdoc/RubyXL/PhoneticProperties.html +105 -0
- data/rdoc/RubyXL/PhoneticRun.html +105 -0
- data/rdoc/RubyXL/PivotArea.html +105 -0
- data/rdoc/RubyXL/PivotCache.html +105 -0
- data/rdoc/RubyXL/PivotCaches.html +105 -0
- data/rdoc/RubyXL/PivotReference.html +105 -0
- data/rdoc/RubyXL/PivotReferenceContainer.html +105 -0
- data/rdoc/RubyXL/PivotTableSelection.html +105 -0
- data/rdoc/RubyXL/PrintOptions.html +105 -0
- data/rdoc/RubyXL/ProtectedRange.html +105 -0
- data/rdoc/RubyXL/ProtectedRanges.html +105 -0
- data/rdoc/RubyXL/Protection.html +105 -0
- data/rdoc/RubyXL/RID.html +105 -0
- data/rdoc/RubyXL/RawOOXML.html +225 -0
- data/rdoc/RubyXL/Reference.html +642 -0
- data/rdoc/RubyXL/Relationship.html +105 -0
- data/rdoc/RubyXL/RichText.html +105 -0
- data/rdoc/RubyXL/RichTextRun.html +105 -0
- data/rdoc/RubyXL/Row.html +105 -0
- data/rdoc/RubyXL/RunProperties.html +108 -0
- data/rdoc/RubyXL/Scenario.html +105 -0
- data/rdoc/RubyXL/ScenarioContainer.html +105 -0
- data/rdoc/RubyXL/Selection.html +105 -0
- data/rdoc/RubyXL/SharedStringsTable.html +397 -0
- data/rdoc/RubyXL/Sheet.html +105 -0
- data/rdoc/RubyXL/SheetCalculationProperties.html +105 -0
- data/rdoc/RubyXL/SheetData.html +105 -0
- data/rdoc/RubyXL/Sheets.html +105 -0
- data/rdoc/RubyXL/SmartTagContainer.html +105 -0
- data/rdoc/RubyXL/SmartTagProperties.html +105 -0
- data/rdoc/RubyXL/SmartTagType.html +105 -0
- data/rdoc/RubyXL/SmartTagTypeContainer.html +105 -0
- data/rdoc/RubyXL/SortCondition.html +105 -0
- data/rdoc/RubyXL/SortState.html +105 -0
- data/rdoc/RubyXL/Sqref.html +199 -0
- data/rdoc/RubyXL/Stop.html +108 -0
- data/rdoc/RubyXL/StringNode.html +105 -0
- data/rdoc/RubyXL/StringValue.html +105 -0
- data/rdoc/RubyXL/Stylesheet.html +105 -0
- data/rdoc/RubyXL/TableParts.html +105 -0
- data/rdoc/RubyXL/TableStyle.html +105 -0
- data/rdoc/RubyXL/TableStyles.html +105 -0
- data/rdoc/RubyXL/Text.html +195 -0
- data/rdoc/RubyXL/Theme.html +105 -0
- data/rdoc/RubyXL/ThemeElements.html +105 -0
- data/rdoc/RubyXL/Top10.html +105 -0
- data/rdoc/RubyXL/Variant.html +108 -0
- data/rdoc/RubyXL/Vector.html +105 -0
- data/rdoc/RubyXL/VectorValue.html +105 -0
- data/rdoc/RubyXL/WebPublishObject.html +105 -0
- data/rdoc/RubyXL/WebPublishObjectContainer.html +105 -0
- data/rdoc/RubyXL/WebPublishingItem.html +108 -0
- data/rdoc/RubyXL/WebPublishingItemContainer.html +105 -0
- data/rdoc/RubyXL/WebPublishingProperties.html +105 -0
- data/rdoc/RubyXL/Workbook.html +105 -0
- data/rdoc/RubyXL/WorkbookProperties.html +108 -0
- data/rdoc/RubyXL/WorkbookProtection.html +105 -0
- data/rdoc/RubyXL/WorkbookRelationships.html +316 -0
- data/rdoc/RubyXL/WorkbookView.html +105 -0
- data/rdoc/RubyXL/WorkbookViews.html +105 -0
- data/rdoc/RubyXL/Worksheet.html +105 -0
- data/rdoc/RubyXL/WorksheetDimensions.html +105 -0
- data/rdoc/RubyXL/WorksheetFormatProperties.html +105 -0
- data/rdoc/RubyXL/WorksheetProperties.html +108 -0
- data/rdoc/RubyXL/WorksheetProtection.html +105 -0
- data/rdoc/RubyXL/WorksheetView.html +105 -0
- data/rdoc/RubyXL/WorksheetViews.html +105 -0
- data/rdoc/RubyXL/Writer.html +98 -0
- data/rdoc/RubyXL/Writer/ContentTypesWriter.html +289 -0
- data/rdoc/RubyXL/Writer/CoreWriter.html +210 -0
- data/rdoc/RubyXL/Writer/GenericWriter.html +348 -0
- data/rdoc/RubyXL/Writer/RootRelsWriter.html +193 -0
- data/rdoc/RubyXL/Writer/StylesWriter.html +191 -0
- data/rdoc/RubyXL/Writer/ThemeWriter.html +511 -0
- data/rdoc/RubyXL/Writer/WorkbookWriter.html +249 -0
- data/rdoc/RubyXL/Writer/WorksheetWriter.html +236 -0
- data/rdoc/RubyXL/XF.html +105 -0
- data/rdoc/created.rid +24 -21
- data/rdoc/index.html +216 -0
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/table_of_contents.html +1496 -0
- data/rubyXL.gemspec +211 -4
- data/spec/lib/parser_spec.rb +18 -6
- data/test/input/.gitkeep +0 -0
- data/test/output/.gitkeep +0 -0
- data/test/test_parse_write.rb +15 -0
- metadata +211 -4
- data/lib/rubyXL/objects/sheet_view.rb +0 -71
|
@@ -0,0 +1,3291 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>module RubyXL::LegacyWorksheet - rubyXL 2.1.3</title>
|
|
8
|
+
|
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
|
11
|
+
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
var rdoc_rel_prefix = "../";
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<script src="../js/jquery.js"></script>
|
|
17
|
+
<script src="../js/navigation.js"></script>
|
|
18
|
+
<script src="../js/search_index.js"></script>
|
|
19
|
+
<script src="../js/search.js"></script>
|
|
20
|
+
<script src="../js/searcher.js"></script>
|
|
21
|
+
<script src="../js/darkfish.js"></script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<body id="top" role="document" class="module">
|
|
25
|
+
<nav role="navigation">
|
|
26
|
+
<div id="project-navigation">
|
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
+
<h2>
|
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
|
30
|
+
</h2>
|
|
31
|
+
|
|
32
|
+
<div id="table-of-contents-navigation">
|
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
41
|
+
<div id="search-field-wrapper">
|
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
<div id="class-metadata">
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
<div id="includes-section" class="nav-section">
|
|
62
|
+
<h3>Included Modules</h3>
|
|
63
|
+
|
|
64
|
+
<ul class="link-list">
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<li><span class="include">Enumerable</span>
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
<!-- Method Quickref -->
|
|
75
|
+
<div id="method-list-section" class="nav-section">
|
|
76
|
+
<h3>Methods</h3>
|
|
77
|
+
|
|
78
|
+
<ul class="link-list" role="directory">
|
|
79
|
+
|
|
80
|
+
<li class="calls-super" ><a href="#method-c-new">::new</a>
|
|
81
|
+
|
|
82
|
+
<li ><a href="#method-i-5B-5D">#[]</a>
|
|
83
|
+
|
|
84
|
+
<li ><a href="#method-i-add_cell">#add_cell</a>
|
|
85
|
+
|
|
86
|
+
<li ><a href="#method-i-add_row">#add_row</a>
|
|
87
|
+
|
|
88
|
+
<li ><a href="#method-i-change_column_bold">#change_column_bold</a>
|
|
89
|
+
|
|
90
|
+
<li ><a href="#method-i-change_column_border_bottom">#change_column_border_bottom</a>
|
|
91
|
+
|
|
92
|
+
<li ><a href="#method-i-change_column_border_diagonal">#change_column_border_diagonal</a>
|
|
93
|
+
|
|
94
|
+
<li ><a href="#method-i-change_column_border_left">#change_column_border_left</a>
|
|
95
|
+
|
|
96
|
+
<li ><a href="#method-i-change_column_border_right">#change_column_border_right</a>
|
|
97
|
+
|
|
98
|
+
<li ><a href="#method-i-change_column_border_top">#change_column_border_top</a>
|
|
99
|
+
|
|
100
|
+
<li ><a href="#method-i-change_column_fill">#change_column_fill</a>
|
|
101
|
+
|
|
102
|
+
<li ><a href="#method-i-change_column_font_color">#change_column_font_color</a>
|
|
103
|
+
|
|
104
|
+
<li ><a href="#method-i-change_column_font_name">#change_column_font_name</a>
|
|
105
|
+
|
|
106
|
+
<li ><a href="#method-i-change_column_font_size">#change_column_font_size</a>
|
|
107
|
+
|
|
108
|
+
<li ><a href="#method-i-change_column_horizontal_alignment">#change_column_horizontal_alignment</a>
|
|
109
|
+
|
|
110
|
+
<li ><a href="#method-i-change_column_italics">#change_column_italics</a>
|
|
111
|
+
|
|
112
|
+
<li ><a href="#method-i-change_column_strikethrough">#change_column_strikethrough</a>
|
|
113
|
+
|
|
114
|
+
<li ><a href="#method-i-change_column_underline">#change_column_underline</a>
|
|
115
|
+
|
|
116
|
+
<li ><a href="#method-i-change_column_vertical_alignment">#change_column_vertical_alignment</a>
|
|
117
|
+
|
|
118
|
+
<li ><a href="#method-i-change_column_width">#change_column_width</a>
|
|
119
|
+
|
|
120
|
+
<li ><a href="#method-i-change_row_bold">#change_row_bold</a>
|
|
121
|
+
|
|
122
|
+
<li ><a href="#method-i-change_row_border_bottom">#change_row_border_bottom</a>
|
|
123
|
+
|
|
124
|
+
<li ><a href="#method-i-change_row_border_diagonal">#change_row_border_diagonal</a>
|
|
125
|
+
|
|
126
|
+
<li ><a href="#method-i-change_row_border_left">#change_row_border_left</a>
|
|
127
|
+
|
|
128
|
+
<li ><a href="#method-i-change_row_border_right">#change_row_border_right</a>
|
|
129
|
+
|
|
130
|
+
<li ><a href="#method-i-change_row_border_top">#change_row_border_top</a>
|
|
131
|
+
|
|
132
|
+
<li ><a href="#method-i-change_row_fill">#change_row_fill</a>
|
|
133
|
+
|
|
134
|
+
<li ><a href="#method-i-change_row_font_color">#change_row_font_color</a>
|
|
135
|
+
|
|
136
|
+
<li ><a href="#method-i-change_row_font_name">#change_row_font_name</a>
|
|
137
|
+
|
|
138
|
+
<li ><a href="#method-i-change_row_font_size">#change_row_font_size</a>
|
|
139
|
+
|
|
140
|
+
<li ><a href="#method-i-change_row_height">#change_row_height</a>
|
|
141
|
+
|
|
142
|
+
<li ><a href="#method-i-change_row_horizontal_alignment">#change_row_horizontal_alignment</a>
|
|
143
|
+
|
|
144
|
+
<li ><a href="#method-i-change_row_italics">#change_row_italics</a>
|
|
145
|
+
|
|
146
|
+
<li ><a href="#method-i-change_row_strikethrough">#change_row_strikethrough</a>
|
|
147
|
+
|
|
148
|
+
<li ><a href="#method-i-change_row_underline">#change_row_underline</a>
|
|
149
|
+
|
|
150
|
+
<li ><a href="#method-i-change_row_vertical_alignment">#change_row_vertical_alignment</a>
|
|
151
|
+
|
|
152
|
+
<li ><a href="#method-i-delete_cell">#delete_cell</a>
|
|
153
|
+
|
|
154
|
+
<li ><a href="#method-i-delete_column">#delete_column</a>
|
|
155
|
+
|
|
156
|
+
<li ><a href="#method-i-delete_row">#delete_row</a>
|
|
157
|
+
|
|
158
|
+
<li ><a href="#method-i-each">#each</a>
|
|
159
|
+
|
|
160
|
+
<li ><a href="#method-i-extract_data">#extract_data</a>
|
|
161
|
+
|
|
162
|
+
<li ><a href="#method-i-get_column_border_bottom">#get_column_border_bottom</a>
|
|
163
|
+
|
|
164
|
+
<li ><a href="#method-i-get_column_border_diagonal">#get_column_border_diagonal</a>
|
|
165
|
+
|
|
166
|
+
<li ><a href="#method-i-get_column_border_left">#get_column_border_left</a>
|
|
167
|
+
|
|
168
|
+
<li ><a href="#method-i-get_column_border_right">#get_column_border_right</a>
|
|
169
|
+
|
|
170
|
+
<li ><a href="#method-i-get_column_border_top">#get_column_border_top</a>
|
|
171
|
+
|
|
172
|
+
<li ><a href="#method-i-get_column_fill">#get_column_fill</a>
|
|
173
|
+
|
|
174
|
+
<li ><a href="#method-i-get_column_font_color">#get_column_font_color</a>
|
|
175
|
+
|
|
176
|
+
<li ><a href="#method-i-get_column_font_name">#get_column_font_name</a>
|
|
177
|
+
|
|
178
|
+
<li ><a href="#method-i-get_column_font_size">#get_column_font_size</a>
|
|
179
|
+
|
|
180
|
+
<li ><a href="#method-i-get_column_horizontal_alignment">#get_column_horizontal_alignment</a>
|
|
181
|
+
|
|
182
|
+
<li ><a href="#method-i-get_column_vertical_alignment">#get_column_vertical_alignment</a>
|
|
183
|
+
|
|
184
|
+
<li ><a href="#method-i-get_column_width">#get_column_width</a>
|
|
185
|
+
|
|
186
|
+
<li ><a href="#method-i-get_row_border_bottom">#get_row_border_bottom</a>
|
|
187
|
+
|
|
188
|
+
<li ><a href="#method-i-get_row_border_diagonal">#get_row_border_diagonal</a>
|
|
189
|
+
|
|
190
|
+
<li ><a href="#method-i-get_row_border_left">#get_row_border_left</a>
|
|
191
|
+
|
|
192
|
+
<li ><a href="#method-i-get_row_border_right">#get_row_border_right</a>
|
|
193
|
+
|
|
194
|
+
<li ><a href="#method-i-get_row_border_top">#get_row_border_top</a>
|
|
195
|
+
|
|
196
|
+
<li ><a href="#method-i-get_row_fill">#get_row_fill</a>
|
|
197
|
+
|
|
198
|
+
<li ><a href="#method-i-get_row_font_color">#get_row_font_color</a>
|
|
199
|
+
|
|
200
|
+
<li ><a href="#method-i-get_row_font_name">#get_row_font_name</a>
|
|
201
|
+
|
|
202
|
+
<li ><a href="#method-i-get_row_font_size">#get_row_font_size</a>
|
|
203
|
+
|
|
204
|
+
<li ><a href="#method-i-get_row_height">#get_row_height</a>
|
|
205
|
+
|
|
206
|
+
<li ><a href="#method-i-get_row_horizontal_alignment">#get_row_horizontal_alignment</a>
|
|
207
|
+
|
|
208
|
+
<li ><a href="#method-i-get_row_vertical_alignment">#get_row_vertical_alignment</a>
|
|
209
|
+
|
|
210
|
+
<li ><a href="#method-i-get_table">#get_table</a>
|
|
211
|
+
|
|
212
|
+
<li ><a href="#method-i-insert_cell">#insert_cell</a>
|
|
213
|
+
|
|
214
|
+
<li ><a href="#method-i-insert_column">#insert_column</a>
|
|
215
|
+
|
|
216
|
+
<li ><a href="#method-i-insert_row">#insert_row</a>
|
|
217
|
+
|
|
218
|
+
<li ><a href="#method-i-is_column_bolded">#is_column_bolded</a>
|
|
219
|
+
|
|
220
|
+
<li ><a href="#method-i-is_column_italicized">#is_column_italicized</a>
|
|
221
|
+
|
|
222
|
+
<li ><a href="#method-i-is_column_struckthrough">#is_column_struckthrough</a>
|
|
223
|
+
|
|
224
|
+
<li ><a href="#method-i-is_column_underlined">#is_column_underlined</a>
|
|
225
|
+
|
|
226
|
+
<li ><a href="#method-i-is_row_bolded">#is_row_bolded</a>
|
|
227
|
+
|
|
228
|
+
<li ><a href="#method-i-is_row_italicized">#is_row_italicized</a>
|
|
229
|
+
|
|
230
|
+
<li ><a href="#method-i-is_row_struckthrough">#is_row_struckthrough</a>
|
|
231
|
+
|
|
232
|
+
<li ><a href="#method-i-is_row_underlined">#is_row_underlined</a>
|
|
233
|
+
|
|
234
|
+
<li ><a href="#method-i-merge_cells">#merge_cells</a>
|
|
235
|
+
|
|
236
|
+
</ul>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
</div>
|
|
240
|
+
</nav>
|
|
241
|
+
|
|
242
|
+
<main role="main" aria-labelledby="module-RubyXL::LegacyWorksheet">
|
|
243
|
+
<h1 id="module-RubyXL::LegacyWorksheet" class="module">
|
|
244
|
+
module RubyXL::LegacyWorksheet
|
|
245
|
+
</h1>
|
|
246
|
+
|
|
247
|
+
<section class="description">
|
|
248
|
+
|
|
249
|
+
</section>
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
<section class="constants-list">
|
|
261
|
+
<header>
|
|
262
|
+
<h3>Constants</h3>
|
|
263
|
+
</header>
|
|
264
|
+
<dl>
|
|
265
|
+
|
|
266
|
+
<dt id="BOLD">BOLD
|
|
267
|
+
|
|
268
|
+
<dd>
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
<dt id="COLOR">COLOR
|
|
272
|
+
|
|
273
|
+
<dd>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
<dt id="ITALICS">ITALICS
|
|
277
|
+
|
|
278
|
+
<dd>
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<dt id="NAME">NAME
|
|
282
|
+
|
|
283
|
+
<dd>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
<dt id="SIZE">SIZE
|
|
287
|
+
|
|
288
|
+
<dd>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<dt id="STRIKETHROUGH">STRIKETHROUGH
|
|
292
|
+
|
|
293
|
+
<dd>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<dt id="UNDERLINE">UNDERLINE
|
|
297
|
+
|
|
298
|
+
<dd>
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
</dl>
|
|
302
|
+
</section>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
<section class="attribute-method-details" class="method-section">
|
|
307
|
+
<header>
|
|
308
|
+
<h3>Attributes</h3>
|
|
309
|
+
</header>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
<div id="attribute-i-extLst" class="method-detail">
|
|
313
|
+
<div class="method-heading attribute-method-heading">
|
|
314
|
+
<span class="method-name">extLst</span><span
|
|
315
|
+
class="attribute-access-type">[RW]</span>
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
<div class="method-description">
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
<div id="attribute-i-sheet_id" class="method-detail">
|
|
326
|
+
<div class="method-heading attribute-method-heading">
|
|
327
|
+
<span class="method-name">sheet_id</span><span
|
|
328
|
+
class="attribute-access-type">[RW]</span>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<div class="method-description">
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
<div id="attribute-i-sheet_name" class="method-detail">
|
|
339
|
+
<div class="method-heading attribute-method-heading">
|
|
340
|
+
<span class="method-name">sheet_name</span><span
|
|
341
|
+
class="attribute-access-type">[RW]</span>
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
<div class="method-description">
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<div id="attribute-i-validations" class="method-detail">
|
|
352
|
+
<div class="method-heading attribute-method-heading">
|
|
353
|
+
<span class="method-name">validations</span><span
|
|
354
|
+
class="attribute-access-type">[RW]</span>
|
|
355
|
+
</div>
|
|
356
|
+
|
|
357
|
+
<div class="method-description">
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
|
|
364
|
+
<div id="attribute-i-workbook" class="method-detail">
|
|
365
|
+
<div class="method-heading attribute-method-heading">
|
|
366
|
+
<span class="method-name">workbook</span><span
|
|
367
|
+
class="attribute-access-type">[RW]</span>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
<div class="method-description">
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
|
|
377
|
+
</section>
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
382
|
+
<header>
|
|
383
|
+
<h3>Public Class Methods</h3>
|
|
384
|
+
</header>
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
<div id="method-c-new" class="method-detail ">
|
|
388
|
+
|
|
389
|
+
<div class="method-heading">
|
|
390
|
+
<span class="method-name">new</span><span
|
|
391
|
+
class="method-args">(params = {})</span>
|
|
392
|
+
|
|
393
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
394
|
+
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
<div class="method-description">
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
<div class="method-calls-super">
|
|
404
|
+
Calls superclass method
|
|
405
|
+
|
|
406
|
+
</div>
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
<div class="method-source-code" id="new-source">
|
|
411
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 7</span>
|
|
412
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span> = {})
|
|
413
|
+
<span class="ruby-keyword">super</span>
|
|
414
|
+
<span class="ruby-ivar">@workbook</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:workbook</span>]
|
|
415
|
+
<span class="ruby-ivar">@sheet_name</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:sheet_name</span>]
|
|
416
|
+
<span class="ruby-ivar">@sheet_id</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:sheet_id</span>]
|
|
417
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">sheet_data</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">SheetData</span>.<span class="ruby-identifier">new</span>
|
|
418
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">cols</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">ColumnRanges</span>.<span class="ruby-identifier">new</span>
|
|
419
|
+
<span class="ruby-ivar">@extLst</span> = <span class="ruby-keyword">nil</span>
|
|
420
|
+
<span class="ruby-ivar">@validations</span> = []
|
|
421
|
+
<span class="ruby-keyword">end</span></pre>
|
|
422
|
+
</div>
|
|
423
|
+
|
|
424
|
+
</div>
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
</div>
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
</section>
|
|
433
|
+
|
|
434
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
435
|
+
<header>
|
|
436
|
+
<h3>Public Instance Methods</h3>
|
|
437
|
+
</header>
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
<div id="method-i-5B-5D" class="method-detail ">
|
|
441
|
+
|
|
442
|
+
<div class="method-heading">
|
|
443
|
+
<span class="method-name">[]</span><span
|
|
444
|
+
class="method-args">(row = 0)</span>
|
|
445
|
+
|
|
446
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
447
|
+
|
|
448
|
+
</div>
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
<div class="method-description">
|
|
452
|
+
|
|
453
|
+
<p>allows for easier access to sheet_data</p>
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
<div class="method-source-code" id="5B-5D-source">
|
|
459
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 19</span>
|
|
460
|
+
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
461
|
+
<span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row</span>]
|
|
462
|
+
<span class="ruby-keyword">end</span></pre>
|
|
463
|
+
</div>
|
|
464
|
+
|
|
465
|
+
</div>
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
</div>
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
<div id="method-i-add_cell" class="method-detail ">
|
|
474
|
+
|
|
475
|
+
<div class="method-heading">
|
|
476
|
+
<span class="method-name">add_cell</span><span
|
|
477
|
+
class="method-args">(row = 0, column = 0, data = '', formula = nil, overwrite = true)</span>
|
|
478
|
+
|
|
479
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
480
|
+
|
|
481
|
+
</div>
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
<div class="method-description">
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
<div class="method-source-code" id="add_cell-source">
|
|
492
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 329</span>
|
|
493
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_cell</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">column</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">data</span> = <span class="ruby-string">''</span>, <span class="ruby-identifier">formula</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">overwrite</span> = <span class="ruby-keyword">true</span>)
|
|
494
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
495
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">column</span>)
|
|
496
|
+
|
|
497
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">overwrite</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column</span>].<span class="ruby-identifier">nil?</span>
|
|
498
|
+
<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>
|
|
499
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">worksheet</span> = <span class="ruby-keyword">self</span>
|
|
500
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">row</span> = <span class="ruby-identifier">row</span>
|
|
501
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">column</span> = <span class="ruby-identifier">column</span>
|
|
502
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">raw_value</span> = <span class="ruby-identifier">data</span>
|
|
503
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">datatype</span> = (<span class="ruby-identifier">formula</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Numeric</span>)) <span class="ruby-operator">?</span> <span class="ruby-string">''</span> <span class="ruby-operator">:</span> <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Cell</span><span class="ruby-operator">::</span><span class="ruby-constant">RAW_STRING</span>
|
|
504
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">formula</span> = <span class="ruby-identifier">formula</span>
|
|
505
|
+
|
|
506
|
+
<span class="ruby-identifier">range</span> = <span class="ruby-identifier">cols</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">column</span>)
|
|
507
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">style_index</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">s</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">style_index</span>) <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
|
|
508
|
+
|
|
509
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column</span>] = <span class="ruby-identifier">c</span>
|
|
510
|
+
<span class="ruby-keyword">end</span>
|
|
511
|
+
|
|
512
|
+
<span class="ruby-identifier">add_cell_style</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">column</span>)
|
|
513
|
+
|
|
514
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">column</span>]
|
|
515
|
+
<span class="ruby-keyword">end</span></pre>
|
|
516
|
+
</div>
|
|
517
|
+
|
|
518
|
+
</div>
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
</div>
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
<div id="method-i-add_row" class="method-detail ">
|
|
527
|
+
|
|
528
|
+
<div class="method-heading">
|
|
529
|
+
<span class="method-name">add_row</span><span
|
|
530
|
+
class="method-args">(row = 0, params = {})</span>
|
|
531
|
+
|
|
532
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
533
|
+
|
|
534
|
+
</div>
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
<div class="method-description">
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
<div class="method-source-code" id="add_row-source">
|
|
545
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 323</span>
|
|
546
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_row</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">params</span> = {})
|
|
547
|
+
<span class="ruby-identifier">new_row</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Row</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>)
|
|
548
|
+
<span class="ruby-identifier">new_row</span>.<span class="ruby-identifier">worksheet</span> = <span class="ruby-keyword">self</span>
|
|
549
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>] = <span class="ruby-identifier">new_row</span>
|
|
550
|
+
<span class="ruby-keyword">end</span></pre>
|
|
551
|
+
</div>
|
|
552
|
+
|
|
553
|
+
</div>
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
</div>
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
<div id="method-i-change_column_bold" class="method-detail ">
|
|
562
|
+
|
|
563
|
+
<div class="method-heading">
|
|
564
|
+
<span class="method-name">change_column_bold</span><span
|
|
565
|
+
class="method-args">(col = 0, bolded = false)</span>
|
|
566
|
+
|
|
567
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
568
|
+
|
|
569
|
+
</div>
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
<div class="method-description">
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
<div class="method-source-code" id="change_column_bold-source">
|
|
580
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 244</span>
|
|
581
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_bold</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">bolded</span> = <span class="ruby-keyword">false</span>)
|
|
582
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>)
|
|
583
|
+
<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>
|
|
584
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_bold</span>(<span class="ruby-identifier">bolded</span>)
|
|
585
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">col</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>)
|
|
586
|
+
<span class="ruby-keyword">end</span></pre>
|
|
587
|
+
</div>
|
|
588
|
+
|
|
589
|
+
</div>
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
</div>
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
<div id="method-i-change_column_border_bottom" class="method-detail ">
|
|
598
|
+
|
|
599
|
+
<div class="method-heading">
|
|
600
|
+
<span class="method-name">change_column_border_bottom</span><span
|
|
601
|
+
class="method-args">(col=0,weight = 'thin')</span>
|
|
602
|
+
|
|
603
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
604
|
+
|
|
605
|
+
</div>
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
<div class="method-description">
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
<div class="method-source-code" id="change_column_border_bottom-source">
|
|
616
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 307</span>
|
|
617
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_border_bottom</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
618
|
+
<span class="ruby-identifier">change_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:bottom</span>, <span class="ruby-identifier">weight</span>)
|
|
619
|
+
<span class="ruby-keyword">end</span></pre>
|
|
620
|
+
</div>
|
|
621
|
+
|
|
622
|
+
</div>
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
</div>
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
<div id="method-i-change_column_border_diagonal" class="method-detail ">
|
|
631
|
+
|
|
632
|
+
<div class="method-heading">
|
|
633
|
+
<span class="method-name">change_column_border_diagonal</span><span
|
|
634
|
+
class="method-args">(col=0,weight = 'thin')</span>
|
|
635
|
+
|
|
636
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
637
|
+
|
|
638
|
+
</div>
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
<div class="method-description">
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
<div class="method-source-code" id="change_column_border_diagonal-source">
|
|
649
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 311</span>
|
|
650
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_border_diagonal</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
651
|
+
<span class="ruby-identifier">change_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:diagonal</span>, <span class="ruby-identifier">weight</span>)
|
|
652
|
+
<span class="ruby-keyword">end</span></pre>
|
|
653
|
+
</div>
|
|
654
|
+
|
|
655
|
+
</div>
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
</div>
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
<div id="method-i-change_column_border_left" class="method-detail ">
|
|
664
|
+
|
|
665
|
+
<div class="method-heading">
|
|
666
|
+
<span class="method-name">change_column_border_left</span><span
|
|
667
|
+
class="method-args">(col=0,weight = 'thin')</span>
|
|
668
|
+
|
|
669
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
670
|
+
|
|
671
|
+
</div>
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
<div class="method-description">
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
<div class="method-source-code" id="change_column_border_left-source">
|
|
682
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 299</span>
|
|
683
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_border_left</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
684
|
+
<span class="ruby-identifier">change_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:left</span>, <span class="ruby-identifier">weight</span>)
|
|
685
|
+
<span class="ruby-keyword">end</span></pre>
|
|
686
|
+
</div>
|
|
687
|
+
|
|
688
|
+
</div>
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
</div>
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
<div id="method-i-change_column_border_right" class="method-detail ">
|
|
697
|
+
|
|
698
|
+
<div class="method-heading">
|
|
699
|
+
<span class="method-name">change_column_border_right</span><span
|
|
700
|
+
class="method-args">(col=0,weight = 'thin')</span>
|
|
701
|
+
|
|
702
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
703
|
+
|
|
704
|
+
</div>
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
<div class="method-description">
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
<div class="method-source-code" id="change_column_border_right-source">
|
|
715
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 303</span>
|
|
716
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_border_right</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
717
|
+
<span class="ruby-identifier">change_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:right</span>, <span class="ruby-identifier">weight</span>)
|
|
718
|
+
<span class="ruby-keyword">end</span></pre>
|
|
719
|
+
</div>
|
|
720
|
+
|
|
721
|
+
</div>
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
</div>
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
<div id="method-i-change_column_border_top" class="method-detail ">
|
|
730
|
+
|
|
731
|
+
<div class="method-heading">
|
|
732
|
+
<span class="method-name">change_column_border_top</span><span
|
|
733
|
+
class="method-args">(col=0,weight = 'thin')</span>
|
|
734
|
+
|
|
735
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
736
|
+
|
|
737
|
+
</div>
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
<div class="method-description">
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
<div class="method-source-code" id="change_column_border_top-source">
|
|
748
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 295</span>
|
|
749
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_border_top</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
750
|
+
<span class="ruby-identifier">change_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:top</span>, <span class="ruby-identifier">weight</span>)
|
|
751
|
+
<span class="ruby-keyword">end</span></pre>
|
|
752
|
+
</div>
|
|
753
|
+
|
|
754
|
+
</div>
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
</div>
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
<div id="method-i-change_column_fill" class="method-detail ">
|
|
763
|
+
|
|
764
|
+
<div class="method-heading">
|
|
765
|
+
<span class="method-name">change_column_fill</span><span
|
|
766
|
+
class="method-args">(column_index = 0, color_index='ffffff')</span>
|
|
767
|
+
|
|
768
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
769
|
+
|
|
770
|
+
</div>
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
<div class="method-description">
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
<div class="method-source-code" id="change_column_fill-source">
|
|
781
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 274</span>
|
|
782
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_fill</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">color_index</span>=<span class="ruby-string">'ffffff'</span>)
|
|
783
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
784
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">color_index</span>)
|
|
785
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
786
|
+
|
|
787
|
+
<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</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_index</span>)
|
|
788
|
+
|
|
789
|
+
<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>
|
|
790
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
|
791
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">change_fill</span>(<span class="ruby-identifier">color_index</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>
|
|
792
|
+
}
|
|
793
|
+
<span class="ruby-keyword">end</span></pre>
|
|
794
|
+
</div>
|
|
795
|
+
|
|
796
|
+
</div>
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
</div>
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
<div id="method-i-change_column_font_color" class="method-detail ">
|
|
805
|
+
|
|
806
|
+
<div class="method-heading">
|
|
807
|
+
<span class="method-name">change_column_font_color</span><span
|
|
808
|
+
class="method-args">(col=0, font_color='000000')</span>
|
|
809
|
+
|
|
810
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
811
|
+
|
|
812
|
+
</div>
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
<div class="method-description">
|
|
816
|
+
|
|
817
|
+
<p>Changes font color of column</p>
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
<div class="method-source-code" id="change_column_font_color-source">
|
|
823
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 228</span>
|
|
824
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_font_color</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">font_color</span>=<span class="ruby-string">'000000'</span>)
|
|
825
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
826
|
+
|
|
827
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>)
|
|
828
|
+
<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>
|
|
829
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_rgb_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
830
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">col</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>)
|
|
831
|
+
<span class="ruby-keyword">end</span></pre>
|
|
832
|
+
</div>
|
|
833
|
+
|
|
834
|
+
</div>
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
</div>
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
<div id="method-i-change_column_font_name" class="method-detail ">
|
|
843
|
+
|
|
844
|
+
<div class="method-heading">
|
|
845
|
+
<span class="method-name">change_column_font_name</span><span
|
|
846
|
+
class="method-args">(col = 0, font_name = 'Verdana')</span>
|
|
847
|
+
|
|
848
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
849
|
+
|
|
850
|
+
</div>
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
<div class="method-description">
|
|
854
|
+
|
|
855
|
+
<p>Changes font name of column</p>
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
<div class="method-source-code" id="change_column_font_name-source">
|
|
861
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 212</span>
|
|
862
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_font_name</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">font_name</span> = <span class="ruby-string">'Verdana'</span>)
|
|
863
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>)
|
|
864
|
+
<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>
|
|
865
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_name</span>(<span class="ruby-identifier">font_name</span>)
|
|
866
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">col</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>)
|
|
867
|
+
<span class="ruby-keyword">end</span></pre>
|
|
868
|
+
</div>
|
|
869
|
+
|
|
870
|
+
</div>
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
</div>
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
<div id="method-i-change_column_font_size" class="method-detail ">
|
|
879
|
+
|
|
880
|
+
<div class="method-heading">
|
|
881
|
+
<span class="method-name">change_column_font_size</span><span
|
|
882
|
+
class="method-args">(col=0, font_size=10)</span>
|
|
883
|
+
|
|
884
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
885
|
+
|
|
886
|
+
</div>
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
<div class="method-description">
|
|
890
|
+
|
|
891
|
+
<p>Changes font size of column</p>
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
<div class="method-source-code" id="change_column_font_size-source">
|
|
897
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 220</span>
|
|
898
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_font_size</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">font_size</span>=<span class="ruby-value">10</span>)
|
|
899
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>)
|
|
900
|
+
<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>
|
|
901
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_size</span>(<span class="ruby-identifier">font_size</span>)
|
|
902
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">col</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>)
|
|
903
|
+
<span class="ruby-keyword">end</span></pre>
|
|
904
|
+
</div>
|
|
905
|
+
|
|
906
|
+
</div>
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
</div>
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
<div id="method-i-change_column_horizontal_alignment" class="method-detail ">
|
|
915
|
+
|
|
916
|
+
<div class="method-heading">
|
|
917
|
+
<span class="method-name">change_column_horizontal_alignment</span><span
|
|
918
|
+
class="method-args">(col=0,alignment='center')</span>
|
|
919
|
+
|
|
920
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
921
|
+
|
|
922
|
+
</div>
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
<div class="method-description">
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
<div class="method-source-code" id="change_column_horizontal_alignment-source">
|
|
933
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 287</span>
|
|
934
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_horizontal_alignment</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">alignment</span>=<span class="ruby-string">'center'</span>)
|
|
935
|
+
<span class="ruby-identifier">change_column_alignment</span>(<span class="ruby-identifier">col</span>,<span class="ruby-identifier">alignment</span>,<span class="ruby-keyword">true</span>)
|
|
936
|
+
<span class="ruby-keyword">end</span></pre>
|
|
937
|
+
</div>
|
|
938
|
+
|
|
939
|
+
</div>
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
</div>
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
<div id="method-i-change_column_italics" class="method-detail ">
|
|
948
|
+
|
|
949
|
+
<div class="method-heading">
|
|
950
|
+
<span class="method-name">change_column_italics</span><span
|
|
951
|
+
class="method-args">(col = 0, italicized = false)</span>
|
|
952
|
+
|
|
953
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
954
|
+
|
|
955
|
+
</div>
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
<div class="method-description">
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
<div class="method-source-code" id="change_column_italics-source">
|
|
966
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 237</span>
|
|
967
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_italics</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">italicized</span> = <span class="ruby-keyword">false</span>)
|
|
968
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>)
|
|
969
|
+
<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>
|
|
970
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_italic</span>(<span class="ruby-identifier">italicized</span>)
|
|
971
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">col</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>)
|
|
972
|
+
<span class="ruby-keyword">end</span></pre>
|
|
973
|
+
</div>
|
|
974
|
+
|
|
975
|
+
</div>
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
</div>
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
<div id="method-i-change_column_strikethrough" class="method-detail ">
|
|
984
|
+
|
|
985
|
+
<div class="method-heading">
|
|
986
|
+
<span class="method-name">change_column_strikethrough</span><span
|
|
987
|
+
class="method-args">(col=0, struckthrough=false)</span>
|
|
988
|
+
|
|
989
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
990
|
+
|
|
991
|
+
</div>
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
<div class="method-description">
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
<div class="method-source-code" id="change_column_strikethrough-source">
|
|
1002
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 258</span>
|
|
1003
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_strikethrough</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">struckthrough</span>=<span class="ruby-keyword">false</span>)
|
|
1004
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>)
|
|
1005
|
+
<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>
|
|
1006
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_strikethrough</span>(<span class="ruby-identifier">struckthrough</span>)
|
|
1007
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">col</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>)
|
|
1008
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1009
|
+
</div>
|
|
1010
|
+
|
|
1011
|
+
</div>
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
</div>
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
<div id="method-i-change_column_underline" class="method-detail ">
|
|
1020
|
+
|
|
1021
|
+
<div class="method-heading">
|
|
1022
|
+
<span class="method-name">change_column_underline</span><span
|
|
1023
|
+
class="method-args">(col = 0, underlined = false)</span>
|
|
1024
|
+
|
|
1025
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1026
|
+
|
|
1027
|
+
</div>
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
<div class="method-description">
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
<div class="method-source-code" id="change_column_underline-source">
|
|
1038
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 251</span>
|
|
1039
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_underline</span>(<span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">underlined</span> = <span class="ruby-keyword">false</span>)
|
|
1040
|
+
<span class="ruby-identifier">xf</span> = <span class="ruby-identifier">get_col_xf</span>(<span class="ruby-identifier">col</span>)
|
|
1041
|
+
<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>
|
|
1042
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_underline</span>(<span class="ruby-identifier">underlined</span>)
|
|
1043
|
+
<span class="ruby-identifier">change_column_font</span>(<span class="ruby-identifier">col</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>)
|
|
1044
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1045
|
+
</div>
|
|
1046
|
+
|
|
1047
|
+
</div>
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
</div>
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
<div id="method-i-change_column_vertical_alignment" class="method-detail ">
|
|
1056
|
+
|
|
1057
|
+
<div class="method-heading">
|
|
1058
|
+
<span class="method-name">change_column_vertical_alignment</span><span
|
|
1059
|
+
class="method-args">(col=0,alignment='center')</span>
|
|
1060
|
+
|
|
1061
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1062
|
+
|
|
1063
|
+
</div>
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
<div class="method-description">
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
<div class="method-source-code" id="change_column_vertical_alignment-source">
|
|
1074
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 291</span>
|
|
1075
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_vertical_alignment</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>,<span class="ruby-identifier">alignment</span>=<span class="ruby-string">'center'</span>)
|
|
1076
|
+
<span class="ruby-identifier">change_column_alignment</span>(<span class="ruby-identifier">col</span>, <span class="ruby-identifier">alignment</span>, <span class="ruby-keyword">false</span>)
|
|
1077
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1078
|
+
</div>
|
|
1079
|
+
|
|
1080
|
+
</div>
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
</div>
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
<div id="method-i-change_column_width" class="method-detail ">
|
|
1089
|
+
|
|
1090
|
+
<div class="method-heading">
|
|
1091
|
+
<span class="method-name">change_column_width</span><span
|
|
1092
|
+
class="method-args">(column_index = 0, width = 13)</span>
|
|
1093
|
+
|
|
1094
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1095
|
+
|
|
1096
|
+
</div>
|
|
1097
|
+
|
|
1098
|
+
|
|
1099
|
+
<div class="method-description">
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
<div class="method-source-code" id="change_column_width-source">
|
|
1107
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 265</span>
|
|
1108
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_width</span>(<span class="ruby-identifier">column_index</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">width</span> = <span class="ruby-value">13</span>)
|
|
1109
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1110
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
1111
|
+
|
|
1112
|
+
<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>)
|
|
1113
|
+
<span class="ruby-identifier">range</span>.<span class="ruby-identifier">width</span> = <span class="ruby-identifier">width</span>
|
|
1114
|
+
<span class="ruby-identifier">range</span>.<span class="ruby-identifier">custom_width</span> = <span class="ruby-keyword">true</span>
|
|
1115
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1116
|
+
</div>
|
|
1117
|
+
|
|
1118
|
+
</div>
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
</div>
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
<div id="method-i-change_row_bold" class="method-detail ">
|
|
1127
|
+
|
|
1128
|
+
<div class="method-heading">
|
|
1129
|
+
<span class="method-name">change_row_bold</span><span
|
|
1130
|
+
class="method-args">(row = 0, bolded=false)</span>
|
|
1131
|
+
|
|
1132
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1133
|
+
|
|
1134
|
+
</div>
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
<div class="method-description">
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
|
|
1144
|
+
<div class="method-source-code" id="change_row_bold-source">
|
|
1145
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 142</span>
|
|
1146
|
+
<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>)
|
|
1147
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1148
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>).<span class="ruby-identifier">dup</span>
|
|
1149
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_bold</span>(<span class="ruby-identifier">bolded</span>)
|
|
1150
|
+
<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>)
|
|
1151
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1152
|
+
</div>
|
|
1153
|
+
|
|
1154
|
+
</div>
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
</div>
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
<div id="method-i-change_row_border_bottom" class="method-detail ">
|
|
1163
|
+
|
|
1164
|
+
<div class="method-heading">
|
|
1165
|
+
<span class="method-name">change_row_border_bottom</span><span
|
|
1166
|
+
class="method-args">(row = 0, weight = 'thin')</span>
|
|
1167
|
+
|
|
1168
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1169
|
+
|
|
1170
|
+
</div>
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
<div class="method-description">
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
<div class="method-source-code" id="change_row_border_bottom-source">
|
|
1181
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 203</span>
|
|
1182
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_border_bottom</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
1183
|
+
<span class="ruby-identifier">change_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:bottom</span>, <span class="ruby-identifier">weight</span>)
|
|
1184
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1185
|
+
</div>
|
|
1186
|
+
|
|
1187
|
+
</div>
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
</div>
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
<div id="method-i-change_row_border_diagonal" class="method-detail ">
|
|
1196
|
+
|
|
1197
|
+
<div class="method-heading">
|
|
1198
|
+
<span class="method-name">change_row_border_diagonal</span><span
|
|
1199
|
+
class="method-args">(row = 0, weight = 'thin')</span>
|
|
1200
|
+
|
|
1201
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1202
|
+
|
|
1203
|
+
</div>
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
<div class="method-description">
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
<div class="method-source-code" id="change_row_border_diagonal-source">
|
|
1214
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 207</span>
|
|
1215
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_border_diagonal</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
1216
|
+
<span class="ruby-identifier">change_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:diagonal</span>, <span class="ruby-identifier">weight</span>)
|
|
1217
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1218
|
+
</div>
|
|
1219
|
+
|
|
1220
|
+
</div>
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
</div>
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
<div id="method-i-change_row_border_left" class="method-detail ">
|
|
1229
|
+
|
|
1230
|
+
<div class="method-heading">
|
|
1231
|
+
<span class="method-name">change_row_border_left</span><span
|
|
1232
|
+
class="method-args">(row = 0, weight = 'thin')</span>
|
|
1233
|
+
|
|
1234
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1235
|
+
|
|
1236
|
+
</div>
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
<div class="method-description">
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
<div class="method-source-code" id="change_row_border_left-source">
|
|
1247
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 195</span>
|
|
1248
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_border_left</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
1249
|
+
<span class="ruby-identifier">change_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:left</span>, <span class="ruby-identifier">weight</span>)
|
|
1250
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1251
|
+
</div>
|
|
1252
|
+
|
|
1253
|
+
</div>
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
</div>
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
<div id="method-i-change_row_border_right" class="method-detail ">
|
|
1262
|
+
|
|
1263
|
+
<div class="method-heading">
|
|
1264
|
+
<span class="method-name">change_row_border_right</span><span
|
|
1265
|
+
class="method-args">(row = 0, weight = 'thin')</span>
|
|
1266
|
+
|
|
1267
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1268
|
+
|
|
1269
|
+
</div>
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
<div class="method-description">
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
<div class="method-source-code" id="change_row_border_right-source">
|
|
1280
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 199</span>
|
|
1281
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_border_right</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
1282
|
+
<span class="ruby-identifier">change_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:right</span>, <span class="ruby-identifier">weight</span>)
|
|
1283
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1284
|
+
</div>
|
|
1285
|
+
|
|
1286
|
+
</div>
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
</div>
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
<div id="method-i-change_row_border_top" class="method-detail ">
|
|
1295
|
+
|
|
1296
|
+
<div class="method-heading">
|
|
1297
|
+
<span class="method-name">change_row_border_top</span><span
|
|
1298
|
+
class="method-args">(row = 0, weight = 'thin')</span>
|
|
1299
|
+
|
|
1300
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1301
|
+
|
|
1302
|
+
</div>
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
<div class="method-description">
|
|
1306
|
+
|
|
1307
|
+
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
<div class="method-source-code" id="change_row_border_top-source">
|
|
1313
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 191</span>
|
|
1314
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_row_border_top</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">weight</span> = <span class="ruby-string">'thin'</span>)
|
|
1315
|
+
<span class="ruby-identifier">change_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:top</span>, <span class="ruby-identifier">weight</span>)
|
|
1316
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1317
|
+
</div>
|
|
1318
|
+
|
|
1319
|
+
</div>
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
</div>
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
<div id="method-i-change_row_fill" class="method-detail ">
|
|
1328
|
+
|
|
1329
|
+
<div class="method-heading">
|
|
1330
|
+
<span class="method-name">change_row_fill</span><span
|
|
1331
|
+
class="method-args">(row_index = 0, rgb = 'ffffff')</span>
|
|
1332
|
+
|
|
1333
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1334
|
+
|
|
1335
|
+
</div>
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
<div class="method-description">
|
|
1339
|
+
|
|
1340
|
+
<p>changes color of fill in (zer0 indexed) row</p>
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
<div class="method-source-code" id="change_row_fill-source">
|
|
1346
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 104</span>
|
|
1347
|
+
<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>)
|
|
1348
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1349
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
|
1350
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">rgb</span>)
|
|
1351
|
+
|
|
1352
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row_index</span>].<span class="ruby-identifier">s</span> = <span class="ruby-ivar">@workbook</span>.<span class="ruby-identifier">modify_fill</span>(<span class="ruby-identifier">get_row_style</span>(<span class="ruby-identifier">row_index</span>), <span class="ruby-identifier">rgb</span>)
|
|
1353
|
+
<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> }
|
|
1354
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1355
|
+
</div>
|
|
1356
|
+
|
|
1357
|
+
</div>
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
|
|
1362
|
+
</div>
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
<div id="method-i-change_row_font_color" class="method-detail ">
|
|
1366
|
+
|
|
1367
|
+
<div class="method-heading">
|
|
1368
|
+
<span class="method-name">change_row_font_color</span><span
|
|
1369
|
+
class="method-args">(row = 0, font_color='000000')</span>
|
|
1370
|
+
|
|
1371
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1372
|
+
|
|
1373
|
+
</div>
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
<div class="method-description">
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
<div class="method-source-code" id="change_row_font_color-source">
|
|
1384
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 127</span>
|
|
1385
|
+
<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>)
|
|
1386
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1387
|
+
<span class="ruby-constant">Color</span>.<span class="ruby-identifier">validate_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
1388
|
+
<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>
|
|
1389
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_rgb_color</span>(<span class="ruby-identifier">font_color</span>)
|
|
1390
|
+
<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>)
|
|
1391
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1392
|
+
</div>
|
|
1393
|
+
|
|
1394
|
+
</div>
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
|
|
1399
|
+
</div>
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
<div id="method-i-change_row_font_name" class="method-detail ">
|
|
1403
|
+
|
|
1404
|
+
<div class="method-heading">
|
|
1405
|
+
<span class="method-name">change_row_font_name</span><span
|
|
1406
|
+
class="method-args">(row = 0, font_name = 'Verdana')</span>
|
|
1407
|
+
|
|
1408
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1409
|
+
|
|
1410
|
+
</div>
|
|
1411
|
+
|
|
1412
|
+
|
|
1413
|
+
<div class="method-description">
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
<div class="method-source-code" id="change_row_font_name-source">
|
|
1421
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 113</span>
|
|
1422
|
+
<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>)
|
|
1423
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1424
|
+
<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>
|
|
1425
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_name</span>(<span class="ruby-identifier">font_name</span>)
|
|
1426
|
+
<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>)
|
|
1427
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1428
|
+
</div>
|
|
1429
|
+
|
|
1430
|
+
</div>
|
|
1431
|
+
|
|
1432
|
+
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
</div>
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
<div id="method-i-change_row_font_size" class="method-detail ">
|
|
1439
|
+
|
|
1440
|
+
<div class="method-heading">
|
|
1441
|
+
<span class="method-name">change_row_font_size</span><span
|
|
1442
|
+
class="method-args">(row = 0, font_size=10)</span>
|
|
1443
|
+
|
|
1444
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1445
|
+
|
|
1446
|
+
</div>
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
<div class="method-description">
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
<div class="method-source-code" id="change_row_font_size-source">
|
|
1457
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 120</span>
|
|
1458
|
+
<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>)
|
|
1459
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1460
|
+
<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>
|
|
1461
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_size</span>(<span class="ruby-identifier">font_size</span>)
|
|
1462
|
+
<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>)
|
|
1463
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1464
|
+
</div>
|
|
1465
|
+
|
|
1466
|
+
</div>
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
</div>
|
|
1472
|
+
|
|
1473
|
+
|
|
1474
|
+
<div id="method-i-change_row_height" class="method-detail ">
|
|
1475
|
+
|
|
1476
|
+
<div class="method-heading">
|
|
1477
|
+
<span class="method-name">change_row_height</span><span
|
|
1478
|
+
class="method-args">(row = 0, height=10)</span>
|
|
1479
|
+
|
|
1480
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1481
|
+
|
|
1482
|
+
</div>
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
<div class="method-description">
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
<div class="method-source-code" id="change_row_height-source">
|
|
1493
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 163</span>
|
|
1494
|
+
<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>)
|
|
1495
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1496
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1497
|
+
|
|
1498
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">height</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">height</span>.<span class="ruby-identifier">to_s</span>
|
|
1499
|
+
<span class="ruby-identifier">height</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">height</span>)
|
|
1500
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">height</span>.<span class="ruby-identifier">to_f</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">height</span>.<span class="ruby-identifier">to_s</span>
|
|
1501
|
+
<span class="ruby-identifier">height</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">height</span>)
|
|
1502
|
+
<span class="ruby-keyword">else</span>
|
|
1503
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'You must enter a number for the height'</span>
|
|
1504
|
+
<span class="ruby-keyword">end</span>
|
|
1505
|
+
|
|
1506
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">ht</span> = <span class="ruby-identifier">height</span>
|
|
1507
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">custom_height</span> = <span class="ruby-keyword">true</span>
|
|
1508
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1509
|
+
</div>
|
|
1510
|
+
|
|
1511
|
+
</div>
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
|
|
1516
|
+
</div>
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
<div id="method-i-change_row_horizontal_alignment" class="method-detail ">
|
|
1520
|
+
|
|
1521
|
+
<div class="method-heading">
|
|
1522
|
+
<span class="method-name">change_row_horizontal_alignment</span><span
|
|
1523
|
+
class="method-args">(row = 0,alignment='center')</span>
|
|
1524
|
+
|
|
1525
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1526
|
+
|
|
1527
|
+
</div>
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
<div class="method-description">
|
|
1531
|
+
|
|
1532
|
+
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
|
|
1537
|
+
<div class="method-source-code" id="change_row_horizontal_alignment-source">
|
|
1538
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 179</span>
|
|
1539
|
+
<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>)
|
|
1540
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1541
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
1542
|
+
<span class="ruby-identifier">change_row_alignment</span>(<span class="ruby-identifier">row</span>,<span class="ruby-identifier">alignment</span>,<span class="ruby-keyword">true</span>)
|
|
1543
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1544
|
+
</div>
|
|
1545
|
+
|
|
1546
|
+
</div>
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
|
|
1551
|
+
</div>
|
|
1552
|
+
|
|
1553
|
+
|
|
1554
|
+
<div id="method-i-change_row_italics" class="method-detail ">
|
|
1555
|
+
|
|
1556
|
+
<div class="method-heading">
|
|
1557
|
+
<span class="method-name">change_row_italics</span><span
|
|
1558
|
+
class="method-args">(row = 0, italicized=false)</span>
|
|
1559
|
+
|
|
1560
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1561
|
+
|
|
1562
|
+
</div>
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
<div class="method-description">
|
|
1566
|
+
|
|
1567
|
+
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
<div class="method-source-code" id="change_row_italics-source">
|
|
1573
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 135</span>
|
|
1574
|
+
<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>)
|
|
1575
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1576
|
+
<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>
|
|
1577
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_italic</span>(<span class="ruby-identifier">italicized</span>)
|
|
1578
|
+
<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>)
|
|
1579
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1580
|
+
</div>
|
|
1581
|
+
|
|
1582
|
+
</div>
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
</div>
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
<div id="method-i-change_row_strikethrough" class="method-detail ">
|
|
1591
|
+
|
|
1592
|
+
<div class="method-heading">
|
|
1593
|
+
<span class="method-name">change_row_strikethrough</span><span
|
|
1594
|
+
class="method-args">(row = 0, struckthrough=false)</span>
|
|
1595
|
+
|
|
1596
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1597
|
+
|
|
1598
|
+
</div>
|
|
1599
|
+
|
|
1600
|
+
|
|
1601
|
+
<div class="method-description">
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
<div class="method-source-code" id="change_row_strikethrough-source">
|
|
1609
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 156</span>
|
|
1610
|
+
<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>)
|
|
1611
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1612
|
+
<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>
|
|
1613
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_strikethrough</span>(<span class="ruby-identifier">struckthrough</span>)
|
|
1614
|
+
<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>)
|
|
1615
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1616
|
+
</div>
|
|
1617
|
+
|
|
1618
|
+
</div>
|
|
1619
|
+
|
|
1620
|
+
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
</div>
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
<div id="method-i-change_row_underline" class="method-detail ">
|
|
1627
|
+
|
|
1628
|
+
<div class="method-heading">
|
|
1629
|
+
<span class="method-name">change_row_underline</span><span
|
|
1630
|
+
class="method-args">(row = 0, underlined=false)</span>
|
|
1631
|
+
|
|
1632
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1633
|
+
|
|
1634
|
+
</div>
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
<div class="method-description">
|
|
1638
|
+
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
|
|
1643
|
+
|
|
1644
|
+
<div class="method-source-code" id="change_row_underline-source">
|
|
1645
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 149</span>
|
|
1646
|
+
<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>)
|
|
1647
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>)
|
|
1648
|
+
<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>
|
|
1649
|
+
<span class="ruby-identifier">font</span>.<span class="ruby-identifier">set_underline</span>(<span class="ruby-identifier">underlined</span>)
|
|
1650
|
+
<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>)
|
|
1651
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1652
|
+
</div>
|
|
1653
|
+
|
|
1654
|
+
</div>
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
|
|
1658
|
+
|
|
1659
|
+
</div>
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
<div id="method-i-change_row_vertical_alignment" class="method-detail ">
|
|
1663
|
+
|
|
1664
|
+
<div class="method-heading">
|
|
1665
|
+
<span class="method-name">change_row_vertical_alignment</span><span
|
|
1666
|
+
class="method-args">(row = 0,alignment='center')</span>
|
|
1667
|
+
|
|
1668
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1669
|
+
|
|
1670
|
+
</div>
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
<div class="method-description">
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
<div class="method-source-code" id="change_row_vertical_alignment-source">
|
|
1681
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 185</span>
|
|
1682
|
+
<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>)
|
|
1683
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1684
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
1685
|
+
<span class="ruby-identifier">change_row_alignment</span>(<span class="ruby-identifier">row</span>,<span class="ruby-identifier">alignment</span>,<span class="ruby-keyword">false</span>)
|
|
1686
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1687
|
+
</div>
|
|
1688
|
+
|
|
1689
|
+
</div>
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
</div>
|
|
1695
|
+
|
|
1696
|
+
|
|
1697
|
+
<div id="method-i-delete_cell" class="method-detail ">
|
|
1698
|
+
|
|
1699
|
+
<div class="method-heading">
|
|
1700
|
+
<span class="method-name">delete_cell</span><span
|
|
1701
|
+
class="method-args">(row = 0, col=0, shift=nil)</span>
|
|
1702
|
+
|
|
1703
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1704
|
+
|
|
1705
|
+
</div>
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
<div class="method-description">
|
|
1709
|
+
|
|
1710
|
+
<p>by default, only sets cell to nil if :left is specified, method will shift
|
|
1711
|
+
row contents to the right of the deleted cell to the left if :up is
|
|
1712
|
+
specified, method will shift column contents below the deleted cell upward</p>
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
<div class="method-source-code" id="delete_cell-source">
|
|
1718
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 472</span>
|
|
1719
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete_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">shift</span>=<span class="ruby-keyword">nil</span>)
|
|
1720
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1721
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
1722
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">col</span>)
|
|
1723
|
+
|
|
1724
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">row_exists</span>(<span class="ruby-identifier">row</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">column_exists</span>(<span class="ruby-identifier">col</span>)
|
|
1725
|
+
|
|
1726
|
+
<span class="ruby-identifier">cell</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row</span>][<span class="ruby-identifier">col</span>]
|
|
1727
|
+
|
|
1728
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">shift</span>
|
|
1729
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">then</span>
|
|
1730
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>] = <span class="ruby-keyword">nil</span>
|
|
1731
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:left</span> <span class="ruby-keyword">then</span>
|
|
1732
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row</span>].<span class="ruby-identifier">delete_cell_shift_left</span>(<span class="ruby-identifier">col</span>)
|
|
1733
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:up</span> <span class="ruby-keyword">then</span>
|
|
1734
|
+
(<span class="ruby-identifier">row</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>
|
|
1735
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>] = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>]
|
|
1736
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">row</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Cell</span>)
|
|
1737
|
+
}
|
|
1738
|
+
<span class="ruby-keyword">else</span>
|
|
1739
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'invalid shift option'</span>
|
|
1740
|
+
<span class="ruby-keyword">end</span>
|
|
1741
|
+
|
|
1742
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">cell</span>
|
|
1743
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1744
|
+
</div>
|
|
1745
|
+
|
|
1746
|
+
</div>
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
</div>
|
|
1752
|
+
|
|
1753
|
+
|
|
1754
|
+
<div id="method-i-delete_column" class="method-detail ">
|
|
1755
|
+
|
|
1756
|
+
<div class="method-heading">
|
|
1757
|
+
<span class="method-name">delete_column</span><span
|
|
1758
|
+
class="method-args">(column_index = 0)</span>
|
|
1759
|
+
|
|
1760
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1761
|
+
|
|
1762
|
+
</div>
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
<div class="method-description">
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
<div class="method-source-code" id="delete_column-source">
|
|
1773
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 398</span>
|
|
1774
|
+
<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>)
|
|
1775
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1776
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
|
1777
|
+
|
|
1778
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">column_exists</span>(<span class="ruby-identifier">column_index</span>)
|
|
1779
|
+
|
|
1780
|
+
<span class="ruby-comment">#delete column</span>
|
|
1781
|
+
<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>) }
|
|
1782
|
+
|
|
1783
|
+
<span class="ruby-comment">#change column numbers for cells to right of deleted column</span>
|
|
1784
|
+
<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>
|
|
1785
|
+
<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">column_index</span><span class="ruby-operator">|</span>
|
|
1786
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">column</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>)
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">column_ranges</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>) }
|
|
1791
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1792
|
+
</div>
|
|
1793
|
+
|
|
1794
|
+
</div>
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
|
|
1799
|
+
</div>
|
|
1800
|
+
|
|
1801
|
+
|
|
1802
|
+
<div id="method-i-delete_row" class="method-detail ">
|
|
1803
|
+
|
|
1804
|
+
<div class="method-heading">
|
|
1805
|
+
<span class="method-name">delete_row</span><span
|
|
1806
|
+
class="method-args">(row_index=0)</span>
|
|
1807
|
+
|
|
1808
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1809
|
+
|
|
1810
|
+
</div>
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
<div class="method-description">
|
|
1814
|
+
|
|
1815
|
+
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
|
|
1819
|
+
|
|
1820
|
+
<div class="method-source-code" id="delete_row-source">
|
|
1821
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 353</span>
|
|
1822
|
+
<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>)
|
|
1823
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
1824
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row_index</span>)
|
|
1825
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">row_exists</span>(<span class="ruby-identifier">row_index</span>)
|
|
1826
|
+
|
|
1827
|
+
<span class="ruby-identifier">deleted</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">row_index</span>)
|
|
1828
|
+
<span class="ruby-identifier">row_num</span> = <span class="ruby-identifier">row_index</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>
|
|
1829
|
+
|
|
1830
|
+
<span class="ruby-comment"># Change cell row numbers</span>
|
|
1831
|
+
<span class="ruby-identifier">row_index</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
|
1832
|
+
<span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">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">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> }
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">deleted</span>
|
|
1836
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1837
|
+
</div>
|
|
1838
|
+
|
|
1839
|
+
</div>
|
|
1840
|
+
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
</div>
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
<div id="method-i-each" class="method-detail ">
|
|
1848
|
+
|
|
1849
|
+
<div class="method-heading">
|
|
1850
|
+
<span class="method-name">each</span><span
|
|
1851
|
+
class="method-args">() { |row| ... }</span>
|
|
1852
|
+
|
|
1853
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1854
|
+
|
|
1855
|
+
</div>
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
<div class="method-description">
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
|
|
1864
|
+
|
|
1865
|
+
<div class="method-source-code" id="each-source">
|
|
1866
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 23</span>
|
|
1867
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">each</span>
|
|
1868
|
+
<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-keyword">yield</span>(<span class="ruby-identifier">row</span>) }
|
|
1869
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1870
|
+
</div>
|
|
1871
|
+
|
|
1872
|
+
</div>
|
|
1873
|
+
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
</div>
|
|
1878
|
+
|
|
1879
|
+
|
|
1880
|
+
<div id="method-i-extract_data" class="method-detail ">
|
|
1881
|
+
|
|
1882
|
+
<div class="method-heading">
|
|
1883
|
+
<span class="method-name">extract_data</span><span
|
|
1884
|
+
class="method-args">(args = {})</span>
|
|
1885
|
+
|
|
1886
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1887
|
+
|
|
1888
|
+
</div>
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
<div class="method-description">
|
|
1892
|
+
|
|
1893
|
+
<p>returns 2d array of just the cell values (without style or formula
|
|
1894
|
+
information)</p>
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
<div class="method-source-code" id="extract_data-source">
|
|
1900
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 28</span>
|
|
1901
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">extract_data</span>(<span class="ruby-identifier">args</span> = {})
|
|
1902
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
|
|
1903
|
+
<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">map</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-operator">&&</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">value</span>(<span class="ruby-identifier">args</span>) }
|
|
1904
|
+
}
|
|
1905
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1906
|
+
</div>
|
|
1907
|
+
|
|
1908
|
+
</div>
|
|
1909
|
+
|
|
1910
|
+
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
</div>
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
<div id="method-i-get_column_border_bottom" class="method-detail ">
|
|
1917
|
+
|
|
1918
|
+
<div class="method-heading">
|
|
1919
|
+
<span class="method-name">get_column_border_bottom</span><span
|
|
1920
|
+
class="method-args">(col=0)</span>
|
|
1921
|
+
|
|
1922
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1923
|
+
|
|
1924
|
+
</div>
|
|
1925
|
+
|
|
1926
|
+
|
|
1927
|
+
<div class="method-description">
|
|
1928
|
+
|
|
1929
|
+
|
|
1930
|
+
|
|
1931
|
+
|
|
1932
|
+
|
|
1933
|
+
|
|
1934
|
+
<div class="method-source-code" id="get_column_border_bottom-source">
|
|
1935
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 640</span>
|
|
1936
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_border_bottom</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
1937
|
+
<span class="ruby-identifier">get_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:bottom</span>)
|
|
1938
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1939
|
+
</div>
|
|
1940
|
+
|
|
1941
|
+
</div>
|
|
1942
|
+
|
|
1943
|
+
|
|
1944
|
+
|
|
1945
|
+
|
|
1946
|
+
</div>
|
|
1947
|
+
|
|
1948
|
+
|
|
1949
|
+
<div id="method-i-get_column_border_diagonal" class="method-detail ">
|
|
1950
|
+
|
|
1951
|
+
<div class="method-heading">
|
|
1952
|
+
<span class="method-name">get_column_border_diagonal</span><span
|
|
1953
|
+
class="method-args">(col=0)</span>
|
|
1954
|
+
|
|
1955
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1956
|
+
|
|
1957
|
+
</div>
|
|
1958
|
+
|
|
1959
|
+
|
|
1960
|
+
<div class="method-description">
|
|
1961
|
+
|
|
1962
|
+
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
<div class="method-source-code" id="get_column_border_diagonal-source">
|
|
1968
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 644</span>
|
|
1969
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_border_diagonal</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
1970
|
+
<span class="ruby-identifier">get_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:diagonal</span>)
|
|
1971
|
+
<span class="ruby-keyword">end</span></pre>
|
|
1972
|
+
</div>
|
|
1973
|
+
|
|
1974
|
+
</div>
|
|
1975
|
+
|
|
1976
|
+
|
|
1977
|
+
|
|
1978
|
+
|
|
1979
|
+
</div>
|
|
1980
|
+
|
|
1981
|
+
|
|
1982
|
+
<div id="method-i-get_column_border_left" class="method-detail ">
|
|
1983
|
+
|
|
1984
|
+
<div class="method-heading">
|
|
1985
|
+
<span class="method-name">get_column_border_left</span><span
|
|
1986
|
+
class="method-args">(col=0)</span>
|
|
1987
|
+
|
|
1988
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
1989
|
+
|
|
1990
|
+
</div>
|
|
1991
|
+
|
|
1992
|
+
|
|
1993
|
+
<div class="method-description">
|
|
1994
|
+
|
|
1995
|
+
|
|
1996
|
+
|
|
1997
|
+
|
|
1998
|
+
|
|
1999
|
+
|
|
2000
|
+
<div class="method-source-code" id="get_column_border_left-source">
|
|
2001
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 632</span>
|
|
2002
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_border_left</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
2003
|
+
<span class="ruby-identifier">get_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:left</span>)
|
|
2004
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2005
|
+
</div>
|
|
2006
|
+
|
|
2007
|
+
</div>
|
|
2008
|
+
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
</div>
|
|
2013
|
+
|
|
2014
|
+
|
|
2015
|
+
<div id="method-i-get_column_border_right" class="method-detail ">
|
|
2016
|
+
|
|
2017
|
+
<div class="method-heading">
|
|
2018
|
+
<span class="method-name">get_column_border_right</span><span
|
|
2019
|
+
class="method-args">(col=0)</span>
|
|
2020
|
+
|
|
2021
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2022
|
+
|
|
2023
|
+
</div>
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
<div class="method-description">
|
|
2027
|
+
|
|
2028
|
+
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
<div class="method-source-code" id="get_column_border_right-source">
|
|
2034
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 636</span>
|
|
2035
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_border_right</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
2036
|
+
<span class="ruby-identifier">get_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:right</span>)
|
|
2037
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2038
|
+
</div>
|
|
2039
|
+
|
|
2040
|
+
</div>
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
|
|
2044
|
+
|
|
2045
|
+
</div>
|
|
2046
|
+
|
|
2047
|
+
|
|
2048
|
+
<div id="method-i-get_column_border_top" class="method-detail ">
|
|
2049
|
+
|
|
2050
|
+
<div class="method-heading">
|
|
2051
|
+
<span class="method-name">get_column_border_top</span><span
|
|
2052
|
+
class="method-args">(col=0)</span>
|
|
2053
|
+
|
|
2054
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2055
|
+
|
|
2056
|
+
</div>
|
|
2057
|
+
|
|
2058
|
+
|
|
2059
|
+
<div class="method-description">
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
|
|
2063
|
+
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
<div class="method-source-code" id="get_column_border_top-source">
|
|
2067
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 628</span>
|
|
2068
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_border_top</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
2069
|
+
<span class="ruby-identifier">get_column_border</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:top</span>)
|
|
2070
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2071
|
+
</div>
|
|
2072
|
+
|
|
2073
|
+
</div>
|
|
2074
|
+
|
|
2075
|
+
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
</div>
|
|
2079
|
+
|
|
2080
|
+
|
|
2081
|
+
<div id="method-i-get_column_fill" class="method-detail ">
|
|
2082
|
+
|
|
2083
|
+
<div class="method-heading">
|
|
2084
|
+
<span class="method-name">get_column_fill</span><span
|
|
2085
|
+
class="method-args">(col=0)</span>
|
|
2086
|
+
|
|
2087
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2088
|
+
|
|
2089
|
+
</div>
|
|
2090
|
+
|
|
2091
|
+
|
|
2092
|
+
<div class="method-description">
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
|
|
2097
|
+
|
|
2098
|
+
|
|
2099
|
+
<div class="method-source-code" id="get_column_fill-source">
|
|
2100
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 612</span>
|
|
2101
|
+
<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>)
|
|
2102
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2103
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">col</span>)
|
|
2104
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">column_exists</span>(<span class="ruby-identifier">col</span>)
|
|
2105
|
+
|
|
2106
|
+
<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>))
|
|
2107
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2108
|
+
</div>
|
|
2109
|
+
|
|
2110
|
+
</div>
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
|
|
2114
|
+
|
|
2115
|
+
</div>
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
<div id="method-i-get_column_font_color" class="method-detail ">
|
|
2119
|
+
|
|
2120
|
+
<div class="method-heading">
|
|
2121
|
+
<span class="method-name">get_column_font_color</span><span
|
|
2122
|
+
class="method-args">(col = 0)</span>
|
|
2123
|
+
|
|
2124
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2125
|
+
|
|
2126
|
+
</div>
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
<div class="method-description">
|
|
2130
|
+
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
<div class="method-source-code" id="get_column_font_color-source">
|
|
2137
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 578</span>
|
|
2138
|
+
<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>)
|
|
2139
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2140
|
+
<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>)
|
|
2141
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2142
|
+
</div>
|
|
2143
|
+
|
|
2144
|
+
</div>
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
</div>
|
|
2150
|
+
|
|
2151
|
+
|
|
2152
|
+
<div id="method-i-get_column_font_name" class="method-detail ">
|
|
2153
|
+
|
|
2154
|
+
<div class="method-heading">
|
|
2155
|
+
<span class="method-name">get_column_font_name</span><span
|
|
2156
|
+
class="method-args">(col = 0)</span>
|
|
2157
|
+
|
|
2158
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2159
|
+
|
|
2160
|
+
</div>
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
<div class="method-description">
|
|
2164
|
+
|
|
2165
|
+
|
|
2166
|
+
|
|
2167
|
+
|
|
2168
|
+
|
|
2169
|
+
|
|
2170
|
+
<div class="method-source-code" id="get_column_font_name-source">
|
|
2171
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 568</span>
|
|
2172
|
+
<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>)
|
|
2173
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2174
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_name</span>
|
|
2175
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2176
|
+
</div>
|
|
2177
|
+
|
|
2178
|
+
</div>
|
|
2179
|
+
|
|
2180
|
+
|
|
2181
|
+
|
|
2182
|
+
|
|
2183
|
+
</div>
|
|
2184
|
+
|
|
2185
|
+
|
|
2186
|
+
<div id="method-i-get_column_font_size" class="method-detail ">
|
|
2187
|
+
|
|
2188
|
+
<div class="method-heading">
|
|
2189
|
+
<span class="method-name">get_column_font_size</span><span
|
|
2190
|
+
class="method-args">(col = 0)</span>
|
|
2191
|
+
|
|
2192
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2193
|
+
|
|
2194
|
+
</div>
|
|
2195
|
+
|
|
2196
|
+
|
|
2197
|
+
<div class="method-description">
|
|
2198
|
+
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
|
|
2202
|
+
|
|
2203
|
+
|
|
2204
|
+
<div class="method-source-code" id="get_column_font_size-source">
|
|
2205
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 573</span>
|
|
2206
|
+
<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>)
|
|
2207
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2208
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">get_size</span>
|
|
2209
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2210
|
+
</div>
|
|
2211
|
+
|
|
2212
|
+
</div>
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
</div>
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
<div id="method-i-get_column_horizontal_alignment" class="method-detail ">
|
|
2221
|
+
|
|
2222
|
+
<div class="method-heading">
|
|
2223
|
+
<span class="method-name">get_column_horizontal_alignment</span><span
|
|
2224
|
+
class="method-args">(col=0)</span>
|
|
2225
|
+
|
|
2226
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2227
|
+
|
|
2228
|
+
</div>
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
<div class="method-description">
|
|
2232
|
+
|
|
2233
|
+
|
|
2234
|
+
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
<div class="method-source-code" id="get_column_horizontal_alignment-source">
|
|
2239
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 620</span>
|
|
2240
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_horizontal_alignment</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
2241
|
+
<span class="ruby-identifier">get_column_alignment</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:horizontal</span>)
|
|
2242
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2243
|
+
</div>
|
|
2244
|
+
|
|
2245
|
+
</div>
|
|
2246
|
+
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
|
|
2250
|
+
</div>
|
|
2251
|
+
|
|
2252
|
+
|
|
2253
|
+
<div id="method-i-get_column_vertical_alignment" class="method-detail ">
|
|
2254
|
+
|
|
2255
|
+
<div class="method-heading">
|
|
2256
|
+
<span class="method-name">get_column_vertical_alignment</span><span
|
|
2257
|
+
class="method-args">(col=0)</span>
|
|
2258
|
+
|
|
2259
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2260
|
+
|
|
2261
|
+
</div>
|
|
2262
|
+
|
|
2263
|
+
|
|
2264
|
+
<div class="method-description">
|
|
2265
|
+
|
|
2266
|
+
|
|
2267
|
+
|
|
2268
|
+
|
|
2269
|
+
|
|
2270
|
+
|
|
2271
|
+
<div class="method-source-code" id="get_column_vertical_alignment-source">
|
|
2272
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 624</span>
|
|
2273
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_column_vertical_alignment</span>(<span class="ruby-identifier">col</span>=<span class="ruby-value">0</span>)
|
|
2274
|
+
<span class="ruby-identifier">get_column_alignment</span>(<span class="ruby-identifier">col</span>, <span class="ruby-value">:vertical</span>)
|
|
2275
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2276
|
+
</div>
|
|
2277
|
+
|
|
2278
|
+
</div>
|
|
2279
|
+
|
|
2280
|
+
|
|
2281
|
+
|
|
2282
|
+
|
|
2283
|
+
</div>
|
|
2284
|
+
|
|
2285
|
+
|
|
2286
|
+
<div id="method-i-get_column_width" class="method-detail ">
|
|
2287
|
+
|
|
2288
|
+
<div class="method-heading">
|
|
2289
|
+
<span class="method-name">get_column_width</span><span
|
|
2290
|
+
class="method-args">(column_index = 0)</span>
|
|
2291
|
+
|
|
2292
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2293
|
+
|
|
2294
|
+
</div>
|
|
2295
|
+
|
|
2296
|
+
|
|
2297
|
+
<div class="method-description">
|
|
2298
|
+
|
|
2299
|
+
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
<div class="method-source-code" id="get_column_width-source">
|
|
2305
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 603</span>
|
|
2306
|
+
<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>)
|
|
2307
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2308
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">column_index</span>)
|
|
2309
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">column_exists</span>(<span class="ruby-identifier">column_index</span>)
|
|
2310
|
+
|
|
2311
|
+
<span class="ruby-identifier">range</span> = <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">column_index</span>)
|
|
2312
|
+
(<span class="ruby-identifier">range</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">range</span>.<span class="ruby-identifier">width</span>) <span class="ruby-operator">||</span> <span class="ruby-value">10</span>
|
|
2313
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2314
|
+
</div>
|
|
2315
|
+
|
|
2316
|
+
</div>
|
|
2317
|
+
|
|
2318
|
+
|
|
2319
|
+
|
|
2320
|
+
|
|
2321
|
+
</div>
|
|
2322
|
+
|
|
2323
|
+
|
|
2324
|
+
<div id="method-i-get_row_border_bottom" class="method-detail ">
|
|
2325
|
+
|
|
2326
|
+
<div class="method-heading">
|
|
2327
|
+
<span class="method-name">get_row_border_bottom</span><span
|
|
2328
|
+
class="method-args">(row = 0)</span>
|
|
2329
|
+
|
|
2330
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2331
|
+
|
|
2332
|
+
</div>
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
<div class="method-description">
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
|
|
2340
|
+
|
|
2341
|
+
|
|
2342
|
+
<div class="method-source-code" id="get_row_border_bottom-source">
|
|
2343
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 560</span>
|
|
2344
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_border_bottom</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2345
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">get_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:bottom</span>)
|
|
2346
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2347
|
+
</div>
|
|
2348
|
+
|
|
2349
|
+
</div>
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
|
|
2353
|
+
|
|
2354
|
+
</div>
|
|
2355
|
+
|
|
2356
|
+
|
|
2357
|
+
<div id="method-i-get_row_border_diagonal" class="method-detail ">
|
|
2358
|
+
|
|
2359
|
+
<div class="method-heading">
|
|
2360
|
+
<span class="method-name">get_row_border_diagonal</span><span
|
|
2361
|
+
class="method-args">(row = 0)</span>
|
|
2362
|
+
|
|
2363
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2364
|
+
|
|
2365
|
+
</div>
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
<div class="method-description">
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
|
|
2372
|
+
|
|
2373
|
+
|
|
2374
|
+
|
|
2375
|
+
<div class="method-source-code" id="get_row_border_diagonal-source">
|
|
2376
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 564</span>
|
|
2377
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_border_diagonal</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2378
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">get_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:diagonal</span>)
|
|
2379
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2380
|
+
</div>
|
|
2381
|
+
|
|
2382
|
+
</div>
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
|
|
2387
|
+
</div>
|
|
2388
|
+
|
|
2389
|
+
|
|
2390
|
+
<div id="method-i-get_row_border_left" class="method-detail ">
|
|
2391
|
+
|
|
2392
|
+
<div class="method-heading">
|
|
2393
|
+
<span class="method-name">get_row_border_left</span><span
|
|
2394
|
+
class="method-args">(row = 0)</span>
|
|
2395
|
+
|
|
2396
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2397
|
+
|
|
2398
|
+
</div>
|
|
2399
|
+
|
|
2400
|
+
|
|
2401
|
+
<div class="method-description">
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
<div class="method-source-code" id="get_row_border_left-source">
|
|
2409
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 552</span>
|
|
2410
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_border_left</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2411
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">get_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:left</span>)
|
|
2412
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2413
|
+
</div>
|
|
2414
|
+
|
|
2415
|
+
</div>
|
|
2416
|
+
|
|
2417
|
+
|
|
2418
|
+
|
|
2419
|
+
|
|
2420
|
+
</div>
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
<div id="method-i-get_row_border_right" class="method-detail ">
|
|
2424
|
+
|
|
2425
|
+
<div class="method-heading">
|
|
2426
|
+
<span class="method-name">get_row_border_right</span><span
|
|
2427
|
+
class="method-args">(row = 0)</span>
|
|
2428
|
+
|
|
2429
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2430
|
+
|
|
2431
|
+
</div>
|
|
2432
|
+
|
|
2433
|
+
|
|
2434
|
+
<div class="method-description">
|
|
2435
|
+
|
|
2436
|
+
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
|
|
2440
|
+
|
|
2441
|
+
<div class="method-source-code" id="get_row_border_right-source">
|
|
2442
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 556</span>
|
|
2443
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_border_right</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2444
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">get_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:right</span>)
|
|
2445
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2446
|
+
</div>
|
|
2447
|
+
|
|
2448
|
+
</div>
|
|
2449
|
+
|
|
2450
|
+
|
|
2451
|
+
|
|
2452
|
+
|
|
2453
|
+
</div>
|
|
2454
|
+
|
|
2455
|
+
|
|
2456
|
+
<div id="method-i-get_row_border_top" class="method-detail ">
|
|
2457
|
+
|
|
2458
|
+
<div class="method-heading">
|
|
2459
|
+
<span class="method-name">get_row_border_top</span><span
|
|
2460
|
+
class="method-args">(row = 0)</span>
|
|
2461
|
+
|
|
2462
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2463
|
+
|
|
2464
|
+
</div>
|
|
2465
|
+
|
|
2466
|
+
|
|
2467
|
+
<div class="method-description">
|
|
2468
|
+
|
|
2469
|
+
|
|
2470
|
+
|
|
2471
|
+
|
|
2472
|
+
|
|
2473
|
+
|
|
2474
|
+
<div class="method-source-code" id="get_row_border_top-source">
|
|
2475
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 548</span>
|
|
2476
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_border_top</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2477
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">get_row_border</span>(<span class="ruby-identifier">row</span>, <span class="ruby-value">:top</span>)
|
|
2478
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2479
|
+
</div>
|
|
2480
|
+
|
|
2481
|
+
</div>
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
</div>
|
|
2487
|
+
|
|
2488
|
+
|
|
2489
|
+
<div id="method-i-get_row_fill" class="method-detail ">
|
|
2490
|
+
|
|
2491
|
+
<div class="method-heading">
|
|
2492
|
+
<span class="method-name">get_row_fill</span><span
|
|
2493
|
+
class="method-args">(row = 0)</span>
|
|
2494
|
+
|
|
2495
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2496
|
+
|
|
2497
|
+
</div>
|
|
2498
|
+
|
|
2499
|
+
|
|
2500
|
+
<div class="method-description">
|
|
2501
|
+
|
|
2502
|
+
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
|
|
2506
|
+
|
|
2507
|
+
<div class="method-source-code" id="get_row_fill-source">
|
|
2508
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 498</span>
|
|
2509
|
+
<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>)
|
|
2510
|
+
(<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>
|
|
2511
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2512
|
+
</div>
|
|
2513
|
+
|
|
2514
|
+
</div>
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
</div>
|
|
2520
|
+
|
|
2521
|
+
|
|
2522
|
+
<div id="method-i-get_row_font_color" class="method-detail ">
|
|
2523
|
+
|
|
2524
|
+
<div class="method-heading">
|
|
2525
|
+
<span class="method-name">get_row_font_color</span><span
|
|
2526
|
+
class="method-args">(row = 0)</span>
|
|
2527
|
+
|
|
2528
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2529
|
+
|
|
2530
|
+
</div>
|
|
2531
|
+
|
|
2532
|
+
|
|
2533
|
+
<div class="method-description">
|
|
2534
|
+
|
|
2535
|
+
|
|
2536
|
+
|
|
2537
|
+
|
|
2538
|
+
|
|
2539
|
+
|
|
2540
|
+
<div class="method-source-code" id="get_row_font_color-source">
|
|
2541
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 510</span>
|
|
2542
|
+
<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>)
|
|
2543
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">row_font</span>(<span class="ruby-identifier">row</span>)
|
|
2544
|
+
<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>
|
|
2545
|
+
<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>)
|
|
2546
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2547
|
+
</div>
|
|
2548
|
+
|
|
2549
|
+
</div>
|
|
2550
|
+
|
|
2551
|
+
|
|
2552
|
+
|
|
2553
|
+
|
|
2554
|
+
</div>
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
<div id="method-i-get_row_font_name" class="method-detail ">
|
|
2558
|
+
|
|
2559
|
+
<div class="method-heading">
|
|
2560
|
+
<span class="method-name">get_row_font_name</span><span
|
|
2561
|
+
class="method-args">(row = 0)</span>
|
|
2562
|
+
|
|
2563
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2564
|
+
|
|
2565
|
+
</div>
|
|
2566
|
+
|
|
2567
|
+
|
|
2568
|
+
<div class="method-description">
|
|
2569
|
+
|
|
2570
|
+
|
|
2571
|
+
|
|
2572
|
+
|
|
2573
|
+
|
|
2574
|
+
|
|
2575
|
+
<div class="method-source-code" id="get_row_font_name-source">
|
|
2576
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 502</span>
|
|
2577
|
+
<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>)
|
|
2578
|
+
(<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>
|
|
2579
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2580
|
+
</div>
|
|
2581
|
+
|
|
2582
|
+
</div>
|
|
2583
|
+
|
|
2584
|
+
|
|
2585
|
+
|
|
2586
|
+
|
|
2587
|
+
</div>
|
|
2588
|
+
|
|
2589
|
+
|
|
2590
|
+
<div id="method-i-get_row_font_size" class="method-detail ">
|
|
2591
|
+
|
|
2592
|
+
<div class="method-heading">
|
|
2593
|
+
<span class="method-name">get_row_font_size</span><span
|
|
2594
|
+
class="method-args">(row = 0)</span>
|
|
2595
|
+
|
|
2596
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2597
|
+
|
|
2598
|
+
</div>
|
|
2599
|
+
|
|
2600
|
+
|
|
2601
|
+
<div class="method-description">
|
|
2602
|
+
|
|
2603
|
+
|
|
2604
|
+
|
|
2605
|
+
|
|
2606
|
+
|
|
2607
|
+
|
|
2608
|
+
<div class="method-source-code" id="get_row_font_size-source">
|
|
2609
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 506</span>
|
|
2610
|
+
<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>)
|
|
2611
|
+
(<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>
|
|
2612
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2613
|
+
</div>
|
|
2614
|
+
|
|
2615
|
+
</div>
|
|
2616
|
+
|
|
2617
|
+
|
|
2618
|
+
|
|
2619
|
+
|
|
2620
|
+
</div>
|
|
2621
|
+
|
|
2622
|
+
|
|
2623
|
+
<div id="method-i-get_row_height" class="method-detail ">
|
|
2624
|
+
|
|
2625
|
+
<div class="method-heading">
|
|
2626
|
+
<span class="method-name">get_row_height</span><span
|
|
2627
|
+
class="method-args">(row = 0)</span>
|
|
2628
|
+
|
|
2629
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2630
|
+
|
|
2631
|
+
</div>
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
<div class="method-description">
|
|
2635
|
+
|
|
2636
|
+
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
|
|
2640
|
+
|
|
2641
|
+
<div class="method-source-code" id="get_row_height-source">
|
|
2642
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 532</span>
|
|
2643
|
+
<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>)
|
|
2644
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2645
|
+
<span class="ruby-identifier">validate_nonnegative</span>(<span class="ruby-identifier">row</span>)
|
|
2646
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">row_exists</span>(<span class="ruby-identifier">row</span>)
|
|
2647
|
+
<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>]
|
|
2648
|
+
<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-value">13</span>
|
|
2649
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2650
|
+
</div>
|
|
2651
|
+
|
|
2652
|
+
</div>
|
|
2653
|
+
|
|
2654
|
+
|
|
2655
|
+
|
|
2656
|
+
|
|
2657
|
+
</div>
|
|
2658
|
+
|
|
2659
|
+
|
|
2660
|
+
<div id="method-i-get_row_horizontal_alignment" class="method-detail ">
|
|
2661
|
+
|
|
2662
|
+
<div class="method-heading">
|
|
2663
|
+
<span class="method-name">get_row_horizontal_alignment</span><span
|
|
2664
|
+
class="method-args">(row = 0)</span>
|
|
2665
|
+
|
|
2666
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2667
|
+
|
|
2668
|
+
</div>
|
|
2669
|
+
|
|
2670
|
+
|
|
2671
|
+
<div class="method-description">
|
|
2672
|
+
|
|
2673
|
+
|
|
2674
|
+
|
|
2675
|
+
|
|
2676
|
+
|
|
2677
|
+
|
|
2678
|
+
<div class="method-source-code" id="get_row_horizontal_alignment-source">
|
|
2679
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 540</span>
|
|
2680
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_horizontal_alignment</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2681
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">get_row_alignment</span>(<span class="ruby-identifier">row</span>, <span class="ruby-keyword">true</span>)
|
|
2682
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2683
|
+
</div>
|
|
2684
|
+
|
|
2685
|
+
</div>
|
|
2686
|
+
|
|
2687
|
+
|
|
2688
|
+
|
|
2689
|
+
|
|
2690
|
+
</div>
|
|
2691
|
+
|
|
2692
|
+
|
|
2693
|
+
<div id="method-i-get_row_vertical_alignment" class="method-detail ">
|
|
2694
|
+
|
|
2695
|
+
<div class="method-heading">
|
|
2696
|
+
<span class="method-name">get_row_vertical_alignment</span><span
|
|
2697
|
+
class="method-args">(row = 0)</span>
|
|
2698
|
+
|
|
2699
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2700
|
+
|
|
2701
|
+
</div>
|
|
2702
|
+
|
|
2703
|
+
|
|
2704
|
+
<div class="method-description">
|
|
2705
|
+
|
|
2706
|
+
|
|
2707
|
+
|
|
2708
|
+
|
|
2709
|
+
|
|
2710
|
+
|
|
2711
|
+
<div class="method-source-code" id="get_row_vertical_alignment-source">
|
|
2712
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 544</span>
|
|
2713
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_row_vertical_alignment</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>)
|
|
2714
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">get_row_alignment</span>(<span class="ruby-identifier">row</span>, <span class="ruby-keyword">false</span>)
|
|
2715
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2716
|
+
</div>
|
|
2717
|
+
|
|
2718
|
+
</div>
|
|
2719
|
+
|
|
2720
|
+
|
|
2721
|
+
|
|
2722
|
+
|
|
2723
|
+
</div>
|
|
2724
|
+
|
|
2725
|
+
|
|
2726
|
+
<div id="method-i-get_table" class="method-detail ">
|
|
2727
|
+
|
|
2728
|
+
<div class="method-heading">
|
|
2729
|
+
<span class="method-name">get_table</span><span
|
|
2730
|
+
class="method-args">(headers = [], opts = {})</span>
|
|
2731
|
+
|
|
2732
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2733
|
+
|
|
2734
|
+
</div>
|
|
2735
|
+
|
|
2736
|
+
|
|
2737
|
+
<div class="method-description">
|
|
2738
|
+
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
|
|
2742
|
+
|
|
2743
|
+
|
|
2744
|
+
<div class="method-source-code" id="get_table-source">
|
|
2745
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 34</span>
|
|
2746
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_table</span>(<span class="ruby-identifier">headers</span> = [], <span class="ruby-identifier">opts</span> = {})
|
|
2747
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2748
|
+
|
|
2749
|
+
<span class="ruby-identifier">headers</span> = [<span class="ruby-identifier">headers</span>] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">headers</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
|
2750
|
+
<span class="ruby-identifier">row_num</span> = <span class="ruby-identifier">find_first_row_with_content</span>(<span class="ruby-identifier">headers</span>)
|
|
2751
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">row_num</span>.<span class="ruby-identifier">nil?</span>
|
|
2752
|
+
|
|
2753
|
+
<span class="ruby-identifier">table_hash</span> = {}
|
|
2754
|
+
<span class="ruby-identifier">table_hash</span>[<span class="ruby-value">:table</span>] = []
|
|
2755
|
+
|
|
2756
|
+
<span class="ruby-identifier">header_row</span> = <span class="ruby-identifier">sheet_data</span>[<span class="ruby-identifier">row_num</span>]
|
|
2757
|
+
<span class="ruby-identifier">header_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">header_cell</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
|
|
2758
|
+
<span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">index</span><span class="ruby-operator">></span><span class="ruby-value">0</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">opts</span>[<span class="ruby-value">:last_header</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">header_row</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">header_row</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>].<span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">header_row</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>].<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span><span class="ruby-operator">==</span><span class="ruby-identifier">opts</span>[<span class="ruby-value">:last_header</span>]
|
|
2759
|
+
<span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">header_cell</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">header_cell</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
|
|
2760
|
+
<span class="ruby-identifier">header</span> = <span class="ruby-identifier">header_cell</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
|
|
2761
|
+
<span class="ruby-identifier">table_hash</span>[<span class="ruby-value">:sorted_headers</span>]<span class="ruby-operator">||=</span>[]
|
|
2762
|
+
<span class="ruby-identifier">table_hash</span>[<span class="ruby-value">:sorted_headers</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">header</span>
|
|
2763
|
+
<span class="ruby-identifier">table_hash</span>[<span class="ruby-identifier">header</span>] = []
|
|
2764
|
+
|
|
2765
|
+
<span class="ruby-identifier">original_row</span> = <span class="ruby-identifier">row_num</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
2766
|
+
<span class="ruby-identifier">current_row</span> = <span class="ruby-identifier">original_row</span>
|
|
2767
|
+
|
|
2768
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">current_row</span>]
|
|
2769
|
+
<span class="ruby-identifier">cell</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">index</span>]
|
|
2770
|
+
|
|
2771
|
+
<span class="ruby-comment"># makes array of hashes in table_hash[:table]</span>
|
|
2772
|
+
<span class="ruby-comment"># as well as hash of arrays in table_hash[header]</span>
|
|
2773
|
+
<span class="ruby-identifier">table_index</span> = <span class="ruby-identifier">current_row</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">original_row</span>
|
|
2774
|
+
<span class="ruby-identifier">cell_test</span> = (<span class="ruby-operator">!</span><span class="ruby-identifier">cell</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cell</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>)
|
|
2775
|
+
|
|
2776
|
+
<span class="ruby-keyword">while</span> <span class="ruby-identifier">cell_test</span> <span class="ruby-operator">||</span> (<span class="ruby-identifier">table_hash</span>[<span class="ruby-value">:table</span>][<span class="ruby-identifier">table_index</span>] <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">table_hash</span>[<span class="ruby-value">:table</span>][<span class="ruby-identifier">table_index</span>].<span class="ruby-identifier">empty?</span>)
|
|
2777
|
+
<span class="ruby-identifier">table_hash</span>[<span class="ruby-identifier">header</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">value</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">cell_test</span>
|
|
2778
|
+
<span class="ruby-identifier">table_index</span> = <span class="ruby-identifier">current_row</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">original_row</span>
|
|
2779
|
+
|
|
2780
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cell_test</span> <span class="ruby-keyword">then</span>
|
|
2781
|
+
<span class="ruby-identifier">table_hash</span>[<span class="ruby-value">:table</span>][<span class="ruby-identifier">table_index</span>] <span class="ruby-operator">||=</span> {}
|
|
2782
|
+
<span class="ruby-identifier">table_hash</span>[<span class="ruby-value">:table</span>][<span class="ruby-identifier">table_index</span>][<span class="ruby-identifier">header</span>] = <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">value</span>
|
|
2783
|
+
<span class="ruby-keyword">end</span>
|
|
2784
|
+
|
|
2785
|
+
<span class="ruby-identifier">current_row</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
2786
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">current_row</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">then</span>
|
|
2787
|
+
<span class="ruby-identifier">cell</span> = <span class="ruby-keyword">nil</span>
|
|
2788
|
+
<span class="ruby-keyword">else</span>
|
|
2789
|
+
<span class="ruby-identifier">cell</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">current_row</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">index</span>]
|
|
2790
|
+
<span class="ruby-keyword">end</span>
|
|
2791
|
+
<span class="ruby-identifier">cell_test</span> = (<span class="ruby-operator">!</span><span class="ruby-identifier">cell</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cell</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>)
|
|
2792
|
+
<span class="ruby-keyword">end</span>
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">table_hash</span>
|
|
2796
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2797
|
+
</div>
|
|
2798
|
+
|
|
2799
|
+
</div>
|
|
2800
|
+
|
|
2801
|
+
|
|
2802
|
+
|
|
2803
|
+
|
|
2804
|
+
</div>
|
|
2805
|
+
|
|
2806
|
+
|
|
2807
|
+
<div id="method-i-insert_cell" class="method-detail ">
|
|
2808
|
+
|
|
2809
|
+
<div class="method-heading">
|
|
2810
|
+
<span class="method-name">insert_cell</span><span
|
|
2811
|
+
class="method-args">(row = 0, col = 0, data = nil, formula = nil, shift = nil)</span>
|
|
2812
|
+
|
|
2813
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2814
|
+
|
|
2815
|
+
</div>
|
|
2816
|
+
|
|
2817
|
+
|
|
2818
|
+
<div class="method-description">
|
|
2819
|
+
|
|
2820
|
+
|
|
2821
|
+
|
|
2822
|
+
|
|
2823
|
+
|
|
2824
|
+
|
|
2825
|
+
<div class="method-source-code" id="insert_cell-source">
|
|
2826
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 449</span>
|
|
2827
|
+
<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>)
|
|
2828
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2829
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row</span>, <span class="ruby-identifier">col</span>)
|
|
2830
|
+
|
|
2831
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">shift</span>
|
|
2832
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">then</span> <span class="ruby-comment"># No shifting at all</span>
|
|
2833
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:right</span> <span class="ruby-keyword">then</span>
|
|
2834
|
+
<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>)
|
|
2835
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:down</span> <span class="ruby-keyword">then</span>
|
|
2836
|
+
<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>))
|
|
2837
|
+
(<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>
|
|
2838
|
+
<span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>] = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">index</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>].<span class="ruby-identifier">cells</span>[<span class="ruby-identifier">col</span>]
|
|
2839
|
+
}
|
|
2840
|
+
<span class="ruby-keyword">else</span>
|
|
2841
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">'invalid shift option'</span>
|
|
2842
|
+
<span class="ruby-keyword">end</span>
|
|
2843
|
+
|
|
2844
|
+
<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>)
|
|
2845
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2846
|
+
</div>
|
|
2847
|
+
|
|
2848
|
+
</div>
|
|
2849
|
+
|
|
2850
|
+
|
|
2851
|
+
|
|
2852
|
+
|
|
2853
|
+
</div>
|
|
2854
|
+
|
|
2855
|
+
|
|
2856
|
+
<div id="method-i-insert_column" class="method-detail ">
|
|
2857
|
+
|
|
2858
|
+
<div class="method-heading">
|
|
2859
|
+
<span class="method-name">insert_column</span><span
|
|
2860
|
+
class="method-args">(column_index = 0)</span>
|
|
2861
|
+
|
|
2862
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2863
|
+
|
|
2864
|
+
</div>
|
|
2865
|
+
|
|
2866
|
+
|
|
2867
|
+
<div class="method-description">
|
|
2868
|
+
|
|
2869
|
+
<p>inserts column at <code>column_index</code>, pushes everything right, takes
|
|
2870
|
+
styles from column to left USE OF THIS METHOD will break formulas which
|
|
2871
|
+
reference cells which are being “pushed down”</p>
|
|
2872
|
+
|
|
2873
|
+
|
|
2874
|
+
|
|
2875
|
+
|
|
2876
|
+
<div class="method-source-code" id="insert_column-source">
|
|
2877
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 419</span>
|
|
2878
|
+
<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>)
|
|
2879
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2880
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">column_index</span>)
|
|
2881
|
+
|
|
2882
|
+
<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>)
|
|
2883
|
+
|
|
2884
|
+
<span class="ruby-comment">#go through each cell in column</span>
|
|
2885
|
+
<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>
|
|
2886
|
+
<span class="ruby-identifier">old_cell</span> = <span class="ruby-identifier">row</span>[<span class="ruby-identifier">column_index</span>]
|
|
2887
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-keyword">nil</span>
|
|
2888
|
+
|
|
2889
|
+
<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>
|
|
2890
|
+
<span class="ruby-identifier">old_range</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">old_range</span>.<span class="ruby-identifier">style</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>
|
|
2891
|
+
|
|
2892
|
+
<span class="ruby-identifier">c</span> = <span class="ruby-constant">Cell</span>.<span class="ruby-identifier">new</span>
|
|
2893
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">worksheet</span> = <span class="ruby-keyword">self</span>
|
|
2894
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">row</span> = <span class="ruby-identifier">row_index</span>
|
|
2895
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">column</span> = <span class="ruby-identifier">column_index</span>
|
|
2896
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">datatype</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Cell</span><span class="ruby-operator">::</span><span class="ruby-constant">SHARED_STRING</span>
|
|
2897
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">style_index</span> = <span class="ruby-identifier">old_cell</span>.<span class="ruby-identifier">style_index</span>
|
|
2898
|
+
<span class="ruby-keyword">end</span>
|
|
2899
|
+
|
|
2900
|
+
<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>)
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">insert_column</span>(<span class="ruby-identifier">column_index</span>)
|
|
2904
|
+
|
|
2905
|
+
<span class="ruby-comment"># TODO: update column numbers</span>
|
|
2906
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2907
|
+
</div>
|
|
2908
|
+
|
|
2909
|
+
</div>
|
|
2910
|
+
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
|
|
2914
|
+
</div>
|
|
2915
|
+
|
|
2916
|
+
|
|
2917
|
+
<div id="method-i-insert_row" class="method-detail ">
|
|
2918
|
+
|
|
2919
|
+
<div class="method-heading">
|
|
2920
|
+
<span class="method-name">insert_row</span><span
|
|
2921
|
+
class="method-args">(row_index = 0)</span>
|
|
2922
|
+
|
|
2923
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2924
|
+
|
|
2925
|
+
</div>
|
|
2926
|
+
|
|
2927
|
+
|
|
2928
|
+
<div class="method-description">
|
|
2929
|
+
|
|
2930
|
+
<pre>Inserts row at row_index, pushes down, copies style from the row above (that's what Excel 2013 does!)</pre>
|
|
2931
|
+
|
|
2932
|
+
<p>USE OF THIS METHOD will break formulas which reference cells which are
|
|
2933
|
+
being “pushed down”</p>
|
|
2934
|
+
|
|
2935
|
+
|
|
2936
|
+
|
|
2937
|
+
|
|
2938
|
+
<div class="method-source-code" id="insert_row-source">
|
|
2939
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 371</span>
|
|
2940
|
+
<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>)
|
|
2941
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
2942
|
+
<span class="ruby-identifier">ensure_cell_exists</span>(<span class="ruby-identifier">row_index</span>)
|
|
2943
|
+
|
|
2944
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">row_index</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword">then</span>
|
|
2945
|
+
<span class="ruby-identifier">old_row</span> = <span class="ruby-keyword">nil</span>
|
|
2946
|
+
<span class="ruby-identifier">new_cells</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-value">0</span>].<span class="ruby-identifier">cells</span>.<span class="ruby-identifier">size</span>)
|
|
2947
|
+
<span class="ruby-keyword">else</span>
|
|
2948
|
+
<span class="ruby-identifier">old_row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">row_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
|
|
2949
|
+
<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>
|
|
2950
|
+
<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>
|
|
2951
|
+
<span class="ruby-keyword">else</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>)
|
|
2952
|
+
<span class="ruby-keyword">end</span> }
|
|
2953
|
+
<span class="ruby-keyword">end</span>
|
|
2954
|
+
|
|
2955
|
+
<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>)
|
|
2956
|
+
<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">:s</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">s</span>)
|
|
2957
|
+
|
|
2958
|
+
<span class="ruby-comment">#update row value for all rows below</span>
|
|
2959
|
+
<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">i</span><span class="ruby-operator">|</span>
|
|
2960
|
+
<span class="ruby-identifier">row</span> = <span class="ruby-identifier">sheet_data</span>.<span class="ruby-identifier">rows</span>[<span class="ruby-identifier">i</span>]
|
|
2961
|
+
<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-identifier">i</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">nil?</span> }
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">new_row</span>
|
|
2965
|
+
<span class="ruby-keyword">end</span></pre>
|
|
2966
|
+
</div>
|
|
2967
|
+
|
|
2968
|
+
</div>
|
|
2969
|
+
|
|
2970
|
+
|
|
2971
|
+
|
|
2972
|
+
|
|
2973
|
+
</div>
|
|
2974
|
+
|
|
2975
|
+
|
|
2976
|
+
<div id="method-i-is_column_bolded" class="method-detail ">
|
|
2977
|
+
|
|
2978
|
+
<div class="method-heading">
|
|
2979
|
+
<span class="method-name">is_column_bolded</span><span
|
|
2980
|
+
class="method-args">(col = 0)</span>
|
|
2981
|
+
|
|
2982
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
2983
|
+
|
|
2984
|
+
</div>
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
<div class="method-description">
|
|
2988
|
+
|
|
2989
|
+
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
|
|
2993
|
+
|
|
2994
|
+
<div class="method-source-code" id="is_column_bolded-source">
|
|
2995
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 588</span>
|
|
2996
|
+
<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>)
|
|
2997
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
2998
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_bold</span>
|
|
2999
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3000
|
+
</div>
|
|
3001
|
+
|
|
3002
|
+
</div>
|
|
3003
|
+
|
|
3004
|
+
|
|
3005
|
+
|
|
3006
|
+
|
|
3007
|
+
</div>
|
|
3008
|
+
|
|
3009
|
+
|
|
3010
|
+
<div id="method-i-is_column_italicized" class="method-detail ">
|
|
3011
|
+
|
|
3012
|
+
<div class="method-heading">
|
|
3013
|
+
<span class="method-name">is_column_italicized</span><span
|
|
3014
|
+
class="method-args">(col = 0)</span>
|
|
3015
|
+
|
|
3016
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3017
|
+
|
|
3018
|
+
</div>
|
|
3019
|
+
|
|
3020
|
+
|
|
3021
|
+
<div class="method-description">
|
|
3022
|
+
|
|
3023
|
+
|
|
3024
|
+
|
|
3025
|
+
|
|
3026
|
+
|
|
3027
|
+
|
|
3028
|
+
<div class="method-source-code" id="is_column_italicized-source">
|
|
3029
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 583</span>
|
|
3030
|
+
<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>)
|
|
3031
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
3032
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_italic</span>
|
|
3033
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3034
|
+
</div>
|
|
3035
|
+
|
|
3036
|
+
</div>
|
|
3037
|
+
|
|
3038
|
+
|
|
3039
|
+
|
|
3040
|
+
|
|
3041
|
+
</div>
|
|
3042
|
+
|
|
3043
|
+
|
|
3044
|
+
<div id="method-i-is_column_struckthrough" class="method-detail ">
|
|
3045
|
+
|
|
3046
|
+
<div class="method-heading">
|
|
3047
|
+
<span class="method-name">is_column_struckthrough</span><span
|
|
3048
|
+
class="method-args">(col = 0)</span>
|
|
3049
|
+
|
|
3050
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3051
|
+
|
|
3052
|
+
</div>
|
|
3053
|
+
|
|
3054
|
+
|
|
3055
|
+
<div class="method-description">
|
|
3056
|
+
|
|
3057
|
+
|
|
3058
|
+
|
|
3059
|
+
|
|
3060
|
+
|
|
3061
|
+
|
|
3062
|
+
<div class="method-source-code" id="is_column_struckthrough-source">
|
|
3063
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 598</span>
|
|
3064
|
+
<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>)
|
|
3065
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
3066
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_strikethrough</span>
|
|
3067
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3068
|
+
</div>
|
|
3069
|
+
|
|
3070
|
+
</div>
|
|
3071
|
+
|
|
3072
|
+
|
|
3073
|
+
|
|
3074
|
+
|
|
3075
|
+
</div>
|
|
3076
|
+
|
|
3077
|
+
|
|
3078
|
+
<div id="method-i-is_column_underlined" class="method-detail ">
|
|
3079
|
+
|
|
3080
|
+
<div class="method-heading">
|
|
3081
|
+
<span class="method-name">is_column_underlined</span><span
|
|
3082
|
+
class="method-args">(col = 0)</span>
|
|
3083
|
+
|
|
3084
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3085
|
+
|
|
3086
|
+
</div>
|
|
3087
|
+
|
|
3088
|
+
|
|
3089
|
+
<div class="method-description">
|
|
3090
|
+
|
|
3091
|
+
|
|
3092
|
+
|
|
3093
|
+
|
|
3094
|
+
|
|
3095
|
+
|
|
3096
|
+
<div class="method-source-code" id="is_column_underlined-source">
|
|
3097
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 593</span>
|
|
3098
|
+
<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>)
|
|
3099
|
+
<span class="ruby-identifier">font</span> = <span class="ruby-identifier">column_font</span>(<span class="ruby-identifier">col</span>)
|
|
3100
|
+
<span class="ruby-identifier">font</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">font</span>.<span class="ruby-identifier">is_underlined</span>
|
|
3101
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3102
|
+
</div>
|
|
3103
|
+
|
|
3104
|
+
</div>
|
|
3105
|
+
|
|
3106
|
+
|
|
3107
|
+
|
|
3108
|
+
|
|
3109
|
+
</div>
|
|
3110
|
+
|
|
3111
|
+
|
|
3112
|
+
<div id="method-i-is_row_bolded" class="method-detail ">
|
|
3113
|
+
|
|
3114
|
+
<div class="method-heading">
|
|
3115
|
+
<span class="method-name">is_row_bolded</span><span
|
|
3116
|
+
class="method-args">(row = 0)</span>
|
|
3117
|
+
|
|
3118
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3119
|
+
|
|
3120
|
+
</div>
|
|
3121
|
+
|
|
3122
|
+
|
|
3123
|
+
<div class="method-description">
|
|
3124
|
+
|
|
3125
|
+
|
|
3126
|
+
|
|
3127
|
+
|
|
3128
|
+
|
|
3129
|
+
|
|
3130
|
+
<div class="method-source-code" id="is_row_bolded-source">
|
|
3131
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 520</span>
|
|
3132
|
+
<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>)
|
|
3133
|
+
(<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>
|
|
3134
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3135
|
+
</div>
|
|
3136
|
+
|
|
3137
|
+
</div>
|
|
3138
|
+
|
|
3139
|
+
|
|
3140
|
+
|
|
3141
|
+
|
|
3142
|
+
</div>
|
|
3143
|
+
|
|
3144
|
+
|
|
3145
|
+
<div id="method-i-is_row_italicized" class="method-detail ">
|
|
3146
|
+
|
|
3147
|
+
<div class="method-heading">
|
|
3148
|
+
<span class="method-name">is_row_italicized</span><span
|
|
3149
|
+
class="method-args">(row = 0)</span>
|
|
3150
|
+
|
|
3151
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3152
|
+
|
|
3153
|
+
</div>
|
|
3154
|
+
|
|
3155
|
+
|
|
3156
|
+
<div class="method-description">
|
|
3157
|
+
|
|
3158
|
+
|
|
3159
|
+
|
|
3160
|
+
|
|
3161
|
+
|
|
3162
|
+
|
|
3163
|
+
<div class="method-source-code" id="is_row_italicized-source">
|
|
3164
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 516</span>
|
|
3165
|
+
<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>)
|
|
3166
|
+
(<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>
|
|
3167
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3168
|
+
</div>
|
|
3169
|
+
|
|
3170
|
+
</div>
|
|
3171
|
+
|
|
3172
|
+
|
|
3173
|
+
|
|
3174
|
+
|
|
3175
|
+
</div>
|
|
3176
|
+
|
|
3177
|
+
|
|
3178
|
+
<div id="method-i-is_row_struckthrough" class="method-detail ">
|
|
3179
|
+
|
|
3180
|
+
<div class="method-heading">
|
|
3181
|
+
<span class="method-name">is_row_struckthrough</span><span
|
|
3182
|
+
class="method-args">(row = 0)</span>
|
|
3183
|
+
|
|
3184
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3185
|
+
|
|
3186
|
+
</div>
|
|
3187
|
+
|
|
3188
|
+
|
|
3189
|
+
<div class="method-description">
|
|
3190
|
+
|
|
3191
|
+
|
|
3192
|
+
|
|
3193
|
+
|
|
3194
|
+
|
|
3195
|
+
|
|
3196
|
+
<div class="method-source-code" id="is_row_struckthrough-source">
|
|
3197
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 528</span>
|
|
3198
|
+
<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>)
|
|
3199
|
+
(<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>
|
|
3200
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3201
|
+
</div>
|
|
3202
|
+
|
|
3203
|
+
</div>
|
|
3204
|
+
|
|
3205
|
+
|
|
3206
|
+
|
|
3207
|
+
|
|
3208
|
+
</div>
|
|
3209
|
+
|
|
3210
|
+
|
|
3211
|
+
<div id="method-i-is_row_underlined" class="method-detail ">
|
|
3212
|
+
|
|
3213
|
+
<div class="method-heading">
|
|
3214
|
+
<span class="method-name">is_row_underlined</span><span
|
|
3215
|
+
class="method-args">(row = 0)</span>
|
|
3216
|
+
|
|
3217
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3218
|
+
|
|
3219
|
+
</div>
|
|
3220
|
+
|
|
3221
|
+
|
|
3222
|
+
<div class="method-description">
|
|
3223
|
+
|
|
3224
|
+
|
|
3225
|
+
|
|
3226
|
+
|
|
3227
|
+
|
|
3228
|
+
|
|
3229
|
+
<div class="method-source-code" id="is_row_underlined-source">
|
|
3230
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 524</span>
|
|
3231
|
+
<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>)
|
|
3232
|
+
(<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>
|
|
3233
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3234
|
+
</div>
|
|
3235
|
+
|
|
3236
|
+
</div>
|
|
3237
|
+
|
|
3238
|
+
|
|
3239
|
+
|
|
3240
|
+
|
|
3241
|
+
</div>
|
|
3242
|
+
|
|
3243
|
+
|
|
3244
|
+
<div id="method-i-merge_cells" class="method-detail ">
|
|
3245
|
+
|
|
3246
|
+
<div class="method-heading">
|
|
3247
|
+
<span class="method-name">merge_cells</span><span
|
|
3248
|
+
class="method-args">(row1 = 0, col1 = 0, row2 = 0, col2 = 0)</span>
|
|
3249
|
+
|
|
3250
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
3251
|
+
|
|
3252
|
+
</div>
|
|
3253
|
+
|
|
3254
|
+
|
|
3255
|
+
<div class="method-description">
|
|
3256
|
+
|
|
3257
|
+
<p>merges cells within a rectangular range</p>
|
|
3258
|
+
|
|
3259
|
+
|
|
3260
|
+
|
|
3261
|
+
|
|
3262
|
+
<div class="method-source-code" id="merge_cells-source">
|
|
3263
|
+
<pre><span class="ruby-comment"># File lib/rubyXL/worksheet.rb, line 316</span>
|
|
3264
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">merge_cells</span>(<span class="ruby-identifier">row1</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">col1</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">row2</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">col2</span> = <span class="ruby-value">0</span>)
|
|
3265
|
+
<span class="ruby-identifier">validate_workbook</span>
|
|
3266
|
+
|
|
3267
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">merged_cells_list</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>
|
|
3268
|
+
<span class="ruby-identifier">merged_cells_list</span>.<span class="ruby-identifier">merge_cell</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">row1</span>, <span class="ruby-identifier">row2</span>, <span class="ruby-identifier">col1</span>, <span class="ruby-identifier">col2</span>))
|
|
3269
|
+
<span class="ruby-keyword">end</span></pre>
|
|
3270
|
+
</div>
|
|
3271
|
+
|
|
3272
|
+
</div>
|
|
3273
|
+
|
|
3274
|
+
|
|
3275
|
+
|
|
3276
|
+
|
|
3277
|
+
</div>
|
|
3278
|
+
|
|
3279
|
+
|
|
3280
|
+
</section>
|
|
3281
|
+
|
|
3282
|
+
</section>
|
|
3283
|
+
</main>
|
|
3284
|
+
|
|
3285
|
+
|
|
3286
|
+
<footer id="validator-badges" role="contentinfo">
|
|
3287
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
3288
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
|
3289
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
3290
|
+
</footer>
|
|
3291
|
+
|