Module: Writexlsx::Worksheet::Initialization

Included in:
Writexlsx::Worksheet
Defined in:
lib/write_xlsx/worksheet/initialization.rb

Instance Method Summary collapse

Instance Method Details

#apply_excel2003_compatibilityObject



128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/write_xlsx/worksheet/initialization.rb', line 128

def apply_excel2003_compatibility
  @original_row_height = 12.75
  @default_row_height = 12.75
  @default_row_pixels = 17

  self.margins_left_right = 0.75
  self.margins_top_bottom = 1

  @page_setup.margin_header = 0.5
  @page_setup.margin_footer = 0.5
  @page_setup.header_footer_aligns = false
end

#setup_cell_featuresObject



112
113
114
115
116
117
118
119
120
121
# File 'lib/write_xlsx/worksheet/initialization.rb', line 112

def setup_cell_features
  @merge = []

  @validations = []
  @cond_formats = {}
  @data_bars_2010 = []
  @dxf_priority = 1

  @ignore_errors = nil
end

#setup_dependenciesObject



29
30
31
32
33
# File 'lib/write_xlsx/worksheet/initialization.rb', line 29

def setup_dependencies
  @page_setup = Writexlsx::PageSetup.new
  @comments   = Package::Comments.new(self)
  @assets     = AssetManager.new
end

#setup_drawing_and_mediaObject



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/write_xlsx/worksheet/initialization.rb', line 83

def setup_drawing_and_media
  @last_shape_id = 1
  @rel_count = 0

  @external_hyper_links = []
  @external_drawing_links = []
  @external_comment_links = []
  @external_vml_links = []
  @external_background_links = []
  @external_table_links = []

  @drawing_links = []
  @vml_drawing_links = []

  @shape_hash = {}
  @drawing_rels = {}
  @drawing_rels_id = 0
  @vml_drawing_rels = {}
  @vml_drawing_rels_id = 0

  @has_dynamic_functions = false
  @has_embedded_images = false
  @use_future_functions = false
  @has_vml = false

  @buttons_array = []
  @header_images_array = []
end

#setup_filter_and_selection_stateObject



71
72
73
74
75
76
77
78
79
80
81
# File 'lib/write_xlsx/worksheet/initialization.rb', line 71

def setup_filter_and_selection_state
  @selections = []
  @panes = []

  @autofilter_area = nil
  @filter_on = false
  @filter_range = []
  @filter_cols = {}
  @filter_cells = {}
  @filter_type = {}
end

#setup_identity(workbook, index, name) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/write_xlsx/worksheet/initialization.rb', line 7

def setup_identity(workbook, index, name)
  @workbook = workbook
  @index = index
  @name = name

  @excel_version = 2007
  @palette = workbook.palette
  @default_url_format = workbook.default_url_format
  @max_url_length = workbook.max_url_length
end

#setup_limitsObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/write_xlsx/worksheet/initialization.rb', line 18

def setup_limits
  @xls_rowmax = 1_048_576
  @xls_colmax = 16_384
  @xls_strmax = 32_767

  @dim_rowmin = nil
  @dim_rowmax = nil
  @dim_colmin = nil
  @dim_colmax = nil
end

#setup_protectionObject



123
124
125
126
# File 'lib/write_xlsx/worksheet/initialization.rb', line 123

def setup_protection
  @protected_ranges = []
  @num_protected_ranges = 0
end

#setup_row_and_column_stateObject



60
61
62
63
64
65
66
67
68
69
# File 'lib/write_xlsx/worksheet/initialization.rb', line 60

def setup_row_and_column_state
  @col_info = {}
  @cell_data_store = CellDataStore.new

  @set_cols = {}
  @set_rows = {}
  @row_sizes = {}

  @col_size_changed = false
end

#setup_sheet_geometryObject



49
50
51
52
53
54
55
56
57
58
# File 'lib/write_xlsx/worksheet/initialization.rb', line 49

def setup_sheet_geometry
  @outline_row_level = 0
  @outline_col_level = 0

  @original_row_height = 15
  @default_row_height = 15
  @default_row_pixels = 20
  @default_col_width = 8.43
  @default_date_pixels = 68
end

#setup_view_optionsObject



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/write_xlsx/worksheet/initialization.rb', line 35

def setup_view_options
  @screen_gridlines = true
  @show_zeros = true
  @hide_row_col_headers = 0
  @top_left_cell = ''

  @tab_color = 0

  @zoom = 100
  @zoom_scale_normal = true
  @right_to_left = false
  @leading_zeros = false
end

#setup_workbook_dependent_stateObject



141
142
143
# File 'lib/write_xlsx/worksheet/initialization.rb', line 141

def setup_workbook_dependent_state
  @embedded_image_indexes = @workbook.embedded_image_indexes
end