| Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Spreadsheet/ParseExcel/Worksheet.pm |
| Statements | Executed 21 statements in 773µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 9µs | 11µs | Spreadsheet::ParseExcel::Worksheet::BEGIN@19 |
| 1 | 1 | 1 | 7µs | 8µs | Spreadsheet::ParseExcel::Worksheet::new |
| 1 | 1 | 1 | 6µs | 18µs | Spreadsheet::ParseExcel::Worksheet::BEGIN@625 |
| 1 | 1 | 1 | 4µs | 19µs | Spreadsheet::ParseExcel::Worksheet::BEGIN@21 |
| 1 | 1 | 1 | 3µs | 18µs | Spreadsheet::ParseExcel::Worksheet::BEGIN@20 |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::_get_col_properties |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::_get_row_properties |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::col_range |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_cell |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_col_widths |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_default_col_width |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_default_row_height |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_fit_to_pages |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_footer |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_h_pagebreaks |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_header |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_margin_bottom |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_margin_footer |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_margin_header |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_margin_left |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_margin_right |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_margin_top |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_merged_areas |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_name |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_paper |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_print_order |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_print_scale |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_row_heights |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_start_page |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_tab_color |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::get_v_pagebreaks |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_centered_horizontally |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_centered_vertically |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_col_hidden |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_portrait |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_print_black_and_white |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_print_comments |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_print_draft |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_print_gridlines |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_print_row_col_headers |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_row_hidden |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::is_sheet_hidden |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::row_range |
| 0 | 0 | 0 | 0s | 0s | Spreadsheet::ParseExcel::Worksheet::sheet_num |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Spreadsheet::ParseExcel::Worksheet; | ||||
| 2 | |||||
| 3 | ############################################################################### | ||||
| 4 | # | ||||
| 5 | # Spreadsheet::ParseExcel::Worksheet - A class for Worksheets. | ||||
| 6 | # | ||||
| 7 | # Used in conjunction with Spreadsheet::ParseExcel. | ||||
| 8 | # | ||||
| 9 | # Copyright (c) 2014 Douglas Wilson | ||||
| 10 | # Copyright (c) 2009-2013 John McNamara | ||||
| 11 | # Copyright (c) 2006-2008 Gabor Szabo | ||||
| 12 | # Copyright (c) 2000-2006 Kawai Takanori | ||||
| 13 | # | ||||
| 14 | # perltidy with standard settings. | ||||
| 15 | # | ||||
| 16 | # Documentation after __END__ | ||||
| 17 | # | ||||
| 18 | |||||
| 19 | 2 | 17µs | 2 | 12µs | # spent 11µs (9+1) within Spreadsheet::ParseExcel::Worksheet::BEGIN@19 which was called:
# once (9µs+1µs) by Spreadsheet::ParseExcel::BEGIN@32 at line 19 # spent 11µs making 1 call to Spreadsheet::ParseExcel::Worksheet::BEGIN@19
# spent 2µs making 1 call to strict::import |
| 20 | 2 | 15µs | 2 | 32µs | # spent 18µs (3+15) within Spreadsheet::ParseExcel::Worksheet::BEGIN@20 which was called:
# once (3µs+15µs) by Spreadsheet::ParseExcel::BEGIN@32 at line 20 # spent 18µs making 1 call to Spreadsheet::ParseExcel::Worksheet::BEGIN@20
# spent 15µs making 1 call to warnings::import |
| 21 | 2 | 697µs | 2 | 34µs | # spent 19µs (4+15) within Spreadsheet::ParseExcel::Worksheet::BEGIN@21 which was called:
# once (4µs+15µs) by Spreadsheet::ParseExcel::BEGIN@32 at line 21 # spent 19µs making 1 call to Spreadsheet::ParseExcel::Worksheet::BEGIN@21
# spent 15µs making 1 call to Exporter::import |
| 22 | |||||
| 23 | 1 | 300ns | our $VERSION = '0.66'; | ||
| 24 | |||||
| 25 | ############################################################################### | ||||
| 26 | # | ||||
| 27 | # new() | ||||
| 28 | # | ||||
| 29 | # spent 8µs (7+700ns) within Spreadsheet::ParseExcel::Worksheet::new which was called:
# once (7µs+700ns) by Spreadsheet::ParseXLSX::_parse_workbook at line 179 of /home/micha/Projekt/spreadsheet-parsexlsx/lib/Spreadsheet/ParseXLSX.pm | ||||
| 30 | |||||
| 31 | 1 | 2µs | my ( $class, %properties ) = @_; | ||
| 32 | |||||
| 33 | 1 | 400ns | my $self = \%properties; | ||
| 34 | |||||
| 35 | 1 | 3µs | 1 | 700ns | weaken $self->{_Book}; # spent 700ns making 1 call to Scalar::Util::weaken |
| 36 | |||||
| 37 | 1 | 600ns | $self->{Cells} = undef; | ||
| 38 | 1 | 700ns | $self->{DefColWidth} = 8.43; | ||
| 39 | |||||
| 40 | 1 | 2µs | return bless $self, $class; | ||
| 41 | } | ||||
| 42 | |||||
| 43 | ############################################################################### | ||||
| 44 | # | ||||
| 45 | # get_cell( $row, $col ) | ||||
| 46 | # | ||||
| 47 | # Returns the Cell object at row $row and column $col, if defined. | ||||
| 48 | # | ||||
| 49 | sub get_cell { | ||||
| 50 | |||||
| 51 | my ( $self, $row, $col ) = @_; | ||||
| 52 | |||||
| 53 | if ( !defined $row | ||||
| 54 | || !defined $col | ||||
| 55 | || !defined $self->{MaxRow} | ||||
| 56 | || !defined $self->{MaxCol} ) | ||||
| 57 | { | ||||
| 58 | |||||
| 59 | # Return undef if no arguments are given or if no cells are defined. | ||||
| 60 | return undef; | ||||
| 61 | } | ||||
| 62 | elsif ($row < $self->{MinRow} | ||||
| 63 | || $row > $self->{MaxRow} | ||||
| 64 | || $col < $self->{MinCol} | ||||
| 65 | || $col > $self->{MaxCol} ) | ||||
| 66 | { | ||||
| 67 | |||||
| 68 | # Return undef if outside allowable row/col range. | ||||
| 69 | return undef; | ||||
| 70 | } | ||||
| 71 | else { | ||||
| 72 | |||||
| 73 | # Return the Cell object. | ||||
| 74 | return $self->{Cells}->[$row]->[$col]; | ||||
| 75 | } | ||||
| 76 | } | ||||
| 77 | |||||
| 78 | ############################################################################### | ||||
| 79 | # | ||||
| 80 | # row_range() | ||||
| 81 | # | ||||
| 82 | # Returns a two-element list ($min, $max) containing the minimum and maximum | ||||
| 83 | # defined rows in the worksheet. | ||||
| 84 | # | ||||
| 85 | # If there is no row defined $max is smaller than $min. | ||||
| 86 | # | ||||
| 87 | sub row_range { | ||||
| 88 | |||||
| 89 | my $self = shift; | ||||
| 90 | |||||
| 91 | my $min = $self->{MinRow} || 0; | ||||
| 92 | my $max = defined( $self->{MaxRow} ) ? $self->{MaxRow} : ( $min - 1 ); | ||||
| 93 | |||||
| 94 | return ( $min, $max ); | ||||
| 95 | } | ||||
| 96 | |||||
| 97 | ############################################################################### | ||||
| 98 | # | ||||
| 99 | # col_range() | ||||
| 100 | # | ||||
| 101 | # Returns a two-element list ($min, $max) containing the minimum and maximum | ||||
| 102 | # defined cols in the worksheet. | ||||
| 103 | # | ||||
| 104 | # If there is no column defined $max is smaller than $min. | ||||
| 105 | # | ||||
| 106 | sub col_range { | ||||
| 107 | |||||
| 108 | my $self = shift; | ||||
| 109 | |||||
| 110 | my $min = $self->{MinCol} || 0; | ||||
| 111 | my $max = defined( $self->{MaxCol} ) ? $self->{MaxCol} : ( $min - 1 ); | ||||
| 112 | |||||
| 113 | return ( $min, $max ); | ||||
| 114 | } | ||||
| 115 | |||||
| 116 | ############################################################################### | ||||
| 117 | # | ||||
| 118 | # get_name() | ||||
| 119 | # | ||||
| 120 | # Returns the name of the worksheet. | ||||
| 121 | # | ||||
| 122 | sub get_name { | ||||
| 123 | |||||
| 124 | my $self = shift; | ||||
| 125 | |||||
| 126 | return $self->{Name}; | ||||
| 127 | } | ||||
| 128 | |||||
| 129 | ############################################################################### | ||||
| 130 | # | ||||
| 131 | # sheet_num() | ||||
| 132 | # | ||||
| 133 | sub sheet_num { | ||||
| 134 | |||||
| 135 | my $self = shift; | ||||
| 136 | |||||
| 137 | return $self->{_SheetNo}; | ||||
| 138 | } | ||||
| 139 | |||||
| 140 | ############################################################################### | ||||
| 141 | # | ||||
| 142 | # get_h_pagebreaks() | ||||
| 143 | # | ||||
| 144 | # Returns an array ref of row numbers where a horizontal page break occurs. | ||||
| 145 | # | ||||
| 146 | sub get_h_pagebreaks { | ||||
| 147 | |||||
| 148 | my $self = shift; | ||||
| 149 | |||||
| 150 | return $self->{HPageBreak}; | ||||
| 151 | } | ||||
| 152 | |||||
| 153 | ############################################################################### | ||||
| 154 | # | ||||
| 155 | # get_v_pagebreaks() | ||||
| 156 | # | ||||
| 157 | # Returns an array ref of column numbers where a vertical page break occurs. | ||||
| 158 | # | ||||
| 159 | sub get_v_pagebreaks { | ||||
| 160 | |||||
| 161 | my $self = shift; | ||||
| 162 | |||||
| 163 | return $self->{VPageBreak}; | ||||
| 164 | } | ||||
| 165 | |||||
| 166 | ############################################################################### | ||||
| 167 | # | ||||
| 168 | # get_merged_areas() | ||||
| 169 | # | ||||
| 170 | # Returns an array ref of cells that are merged. | ||||
| 171 | # | ||||
| 172 | sub get_merged_areas { | ||||
| 173 | |||||
| 174 | my $self = shift; | ||||
| 175 | |||||
| 176 | return $self->{MergedArea}; | ||||
| 177 | } | ||||
| 178 | |||||
| 179 | ############################################################################### | ||||
| 180 | # | ||||
| 181 | # get_row_heights() | ||||
| 182 | # | ||||
| 183 | # Returns an array of row heights. | ||||
| 184 | # | ||||
| 185 | sub get_row_heights { | ||||
| 186 | |||||
| 187 | my $self = shift; | ||||
| 188 | |||||
| 189 | if ( wantarray() ) { | ||||
| 190 | return unless $self->{RowHeight}; | ||||
| 191 | return @{ $self->{RowHeight} }; | ||||
| 192 | } | ||||
| 193 | return $self->{RowHeight}; | ||||
| 194 | } | ||||
| 195 | |||||
| 196 | ############################################################################### | ||||
| 197 | # | ||||
| 198 | # get_col_widths() | ||||
| 199 | # | ||||
| 200 | # Returns an array of column widths. | ||||
| 201 | # | ||||
| 202 | sub get_col_widths { | ||||
| 203 | |||||
| 204 | my $self = shift; | ||||
| 205 | |||||
| 206 | if ( wantarray() ) { | ||||
| 207 | return unless $self->{ColWidth}; | ||||
| 208 | return @{ $self->{ColWidth} }; | ||||
| 209 | } | ||||
| 210 | return $self->{ColWidth}; | ||||
| 211 | } | ||||
| 212 | |||||
| 213 | ############################################################################### | ||||
| 214 | # | ||||
| 215 | # get_default_row_height() | ||||
| 216 | # | ||||
| 217 | # Returns the default row height for the worksheet. Generally 12.75. | ||||
| 218 | # | ||||
| 219 | sub get_default_row_height { | ||||
| 220 | |||||
| 221 | my $self = shift; | ||||
| 222 | |||||
| 223 | return $self->{DefRowHeight}; | ||||
| 224 | } | ||||
| 225 | |||||
| 226 | ############################################################################### | ||||
| 227 | # | ||||
| 228 | # get_default_col_width() | ||||
| 229 | # | ||||
| 230 | # Returns the default column width for the worksheet. Generally 8.43. | ||||
| 231 | # | ||||
| 232 | sub get_default_col_width { | ||||
| 233 | |||||
| 234 | my $self = shift; | ||||
| 235 | |||||
| 236 | return $self->{DefColWidth}; | ||||
| 237 | } | ||||
| 238 | |||||
| 239 | ############################################################################### | ||||
| 240 | # | ||||
| 241 | # _get_row_properties() | ||||
| 242 | # | ||||
| 243 | # Returns an array_ref of row properties. | ||||
| 244 | # TODO. This is a placeholder for a future method. | ||||
| 245 | # | ||||
| 246 | sub _get_row_properties { | ||||
| 247 | |||||
| 248 | my $self = shift; | ||||
| 249 | |||||
| 250 | return $self->{RowProperties}; | ||||
| 251 | } | ||||
| 252 | |||||
| 253 | ############################################################################### | ||||
| 254 | # | ||||
| 255 | # _get_col_properties() | ||||
| 256 | # | ||||
| 257 | # Returns an array_ref of column properties. | ||||
| 258 | # TODO. This is a placeholder for a future method. | ||||
| 259 | # | ||||
| 260 | sub _get_col_properties { | ||||
| 261 | |||||
| 262 | my $self = shift; | ||||
| 263 | |||||
| 264 | return $self->{ColProperties}; | ||||
| 265 | } | ||||
| 266 | |||||
| 267 | ############################################################################### | ||||
| 268 | # | ||||
| 269 | # get_header() | ||||
| 270 | # | ||||
| 271 | # Returns the worksheet header string. | ||||
| 272 | # | ||||
| 273 | sub get_header { | ||||
| 274 | |||||
| 275 | my $self = shift; | ||||
| 276 | |||||
| 277 | return $self->{Header}; | ||||
| 278 | } | ||||
| 279 | |||||
| 280 | ############################################################################### | ||||
| 281 | # | ||||
| 282 | # get_footer() | ||||
| 283 | # | ||||
| 284 | # Returns the worksheet footer string. | ||||
| 285 | # | ||||
| 286 | sub get_footer { | ||||
| 287 | |||||
| 288 | my $self = shift; | ||||
| 289 | |||||
| 290 | return $self->{Footer}; | ||||
| 291 | } | ||||
| 292 | |||||
| 293 | ############################################################################### | ||||
| 294 | # | ||||
| 295 | # get_margin_left() | ||||
| 296 | # | ||||
| 297 | # Returns the left margin of the worksheet in inches. | ||||
| 298 | # | ||||
| 299 | sub get_margin_left { | ||||
| 300 | |||||
| 301 | my $self = shift; | ||||
| 302 | |||||
| 303 | return $self->{LeftMargin}; | ||||
| 304 | } | ||||
| 305 | |||||
| 306 | ############################################################################### | ||||
| 307 | # | ||||
| 308 | # get_margin_right() | ||||
| 309 | # | ||||
| 310 | # Returns the right margin of the worksheet in inches. | ||||
| 311 | # | ||||
| 312 | sub get_margin_right { | ||||
| 313 | |||||
| 314 | my $self = shift; | ||||
| 315 | |||||
| 316 | return $self->{RightMargin}; | ||||
| 317 | } | ||||
| 318 | |||||
| 319 | ############################################################################### | ||||
| 320 | # | ||||
| 321 | # get_margin_top() | ||||
| 322 | # | ||||
| 323 | # Returns the top margin of the worksheet in inches. | ||||
| 324 | # | ||||
| 325 | sub get_margin_top { | ||||
| 326 | |||||
| 327 | my $self = shift; | ||||
| 328 | |||||
| 329 | return $self->{TopMargin}; | ||||
| 330 | } | ||||
| 331 | |||||
| 332 | ############################################################################### | ||||
| 333 | # | ||||
| 334 | # get_margin_bottom() | ||||
| 335 | # | ||||
| 336 | # Returns the bottom margin of the worksheet in inches. | ||||
| 337 | # | ||||
| 338 | sub get_margin_bottom { | ||||
| 339 | |||||
| 340 | my $self = shift; | ||||
| 341 | |||||
| 342 | return $self->{BottomMargin}; | ||||
| 343 | } | ||||
| 344 | |||||
| 345 | ############################################################################### | ||||
| 346 | # | ||||
| 347 | # get_margin_header() | ||||
| 348 | # | ||||
| 349 | # Returns the header margin of the worksheet in inches. | ||||
| 350 | # | ||||
| 351 | sub get_margin_header { | ||||
| 352 | |||||
| 353 | my $self = shift; | ||||
| 354 | |||||
| 355 | return $self->{HeaderMargin}; | ||||
| 356 | } | ||||
| 357 | |||||
| 358 | ############################################################################### | ||||
| 359 | # | ||||
| 360 | # get_margin_footer() | ||||
| 361 | # | ||||
| 362 | # Returns the footer margin of the worksheet in inches. | ||||
| 363 | # | ||||
| 364 | sub get_margin_footer { | ||||
| 365 | |||||
| 366 | my $self = shift; | ||||
| 367 | |||||
| 368 | return $self->{FooterMargin}; | ||||
| 369 | } | ||||
| 370 | |||||
| 371 | ############################################################################### | ||||
| 372 | # | ||||
| 373 | # get_paper() | ||||
| 374 | # | ||||
| 375 | # Returns the printer paper size. | ||||
| 376 | # | ||||
| 377 | sub get_paper { | ||||
| 378 | |||||
| 379 | my $self = shift; | ||||
| 380 | |||||
| 381 | return $self->{PaperSize}; | ||||
| 382 | } | ||||
| 383 | |||||
| 384 | ############################################################################### | ||||
| 385 | # | ||||
| 386 | # get_start_page() | ||||
| 387 | # | ||||
| 388 | # Returns the page number that printing will start from. | ||||
| 389 | # | ||||
| 390 | sub get_start_page { | ||||
| 391 | |||||
| 392 | my $self = shift; | ||||
| 393 | |||||
| 394 | # Only return the page number if the "First page number" option is set. | ||||
| 395 | if ( $self->{UsePage} ) { | ||||
| 396 | return $self->{PageStart}; | ||||
| 397 | } | ||||
| 398 | else { | ||||
| 399 | return 0; | ||||
| 400 | } | ||||
| 401 | } | ||||
| 402 | |||||
| 403 | ############################################################################### | ||||
| 404 | # | ||||
| 405 | # get_print_order() | ||||
| 406 | # | ||||
| 407 | # Returns the Worksheet page printing order. | ||||
| 408 | # | ||||
| 409 | sub get_print_order { | ||||
| 410 | |||||
| 411 | my $self = shift; | ||||
| 412 | |||||
| 413 | return $self->{LeftToRight}; | ||||
| 414 | } | ||||
| 415 | |||||
| 416 | ############################################################################### | ||||
| 417 | # | ||||
| 418 | # get_print_scale() | ||||
| 419 | # | ||||
| 420 | # Returns the workbook scale for printing. | ||||
| 421 | # | ||||
| 422 | sub get_print_scale { | ||||
| 423 | |||||
| 424 | my $self = shift; | ||||
| 425 | |||||
| 426 | return $self->{Scale}; | ||||
| 427 | } | ||||
| 428 | |||||
| 429 | ############################################################################### | ||||
| 430 | # | ||||
| 431 | # get_fit_to_pages() | ||||
| 432 | # | ||||
| 433 | # Returns the number of pages wide and high that the printed worksheet page | ||||
| 434 | # will fit to. | ||||
| 435 | # | ||||
| 436 | sub get_fit_to_pages { | ||||
| 437 | |||||
| 438 | my $self = shift; | ||||
| 439 | |||||
| 440 | if ( !$self->{PageFit} ) { | ||||
| 441 | return ( 0, 0 ); | ||||
| 442 | } | ||||
| 443 | else { | ||||
| 444 | return ( $self->{FitWidth}, $self->{FitHeight} ); | ||||
| 445 | } | ||||
| 446 | } | ||||
| 447 | |||||
| 448 | ############################################################################### | ||||
| 449 | # | ||||
| 450 | # is_portrait() | ||||
| 451 | # | ||||
| 452 | # Returns true if the worksheet has been set for printing in portrait mode. | ||||
| 453 | # | ||||
| 454 | sub is_portrait { | ||||
| 455 | |||||
| 456 | my $self = shift; | ||||
| 457 | |||||
| 458 | return $self->{Landscape}; | ||||
| 459 | } | ||||
| 460 | |||||
| 461 | ############################################################################### | ||||
| 462 | # | ||||
| 463 | # is_centered_horizontally() | ||||
| 464 | # | ||||
| 465 | # Returns true if the worksheet has been centered horizontally for printing. | ||||
| 466 | # | ||||
| 467 | sub is_centered_horizontally { | ||||
| 468 | |||||
| 469 | my $self = shift; | ||||
| 470 | |||||
| 471 | return $self->{HCenter}; | ||||
| 472 | } | ||||
| 473 | |||||
| 474 | ############################################################################### | ||||
| 475 | # | ||||
| 476 | # is_centered_vertically() | ||||
| 477 | # | ||||
| 478 | # Returns true if the worksheet has been centered vertically for printing. | ||||
| 479 | # | ||||
| 480 | sub is_centered_vertically { | ||||
| 481 | |||||
| 482 | my $self = shift; | ||||
| 483 | |||||
| 484 | return $self->{HCenter}; | ||||
| 485 | } | ||||
| 486 | |||||
| 487 | ############################################################################### | ||||
| 488 | # | ||||
| 489 | # is_print_gridlines() | ||||
| 490 | # | ||||
| 491 | # Returns true if the worksheet print "gridlines" option is turned on. | ||||
| 492 | # | ||||
| 493 | sub is_print_gridlines { | ||||
| 494 | |||||
| 495 | my $self = shift; | ||||
| 496 | |||||
| 497 | return $self->{PrintGrid}; | ||||
| 498 | } | ||||
| 499 | |||||
| 500 | ############################################################################### | ||||
| 501 | # | ||||
| 502 | # is_print_row_col_headers() | ||||
| 503 | # | ||||
| 504 | # Returns true if the worksheet print "row and column headings" option is on. | ||||
| 505 | # | ||||
| 506 | sub is_print_row_col_headers { | ||||
| 507 | |||||
| 508 | my $self = shift; | ||||
| 509 | |||||
| 510 | return $self->{PrintHeaders}; | ||||
| 511 | } | ||||
| 512 | |||||
| 513 | ############################################################################### | ||||
| 514 | # | ||||
| 515 | # is_print_black_and_white() | ||||
| 516 | # | ||||
| 517 | # Returns true if the worksheet print "black and white" option is turned on. | ||||
| 518 | # | ||||
| 519 | sub is_print_black_and_white { | ||||
| 520 | |||||
| 521 | my $self = shift; | ||||
| 522 | |||||
| 523 | return $self->{NoColor}; | ||||
| 524 | } | ||||
| 525 | |||||
| 526 | ############################################################################### | ||||
| 527 | # | ||||
| 528 | # is_print_draft() | ||||
| 529 | # | ||||
| 530 | # Returns true if the worksheet print "draft" option is turned on. | ||||
| 531 | # | ||||
| 532 | sub is_print_draft { | ||||
| 533 | |||||
| 534 | my $self = shift; | ||||
| 535 | |||||
| 536 | return $self->{Draft}; | ||||
| 537 | } | ||||
| 538 | |||||
| 539 | ############################################################################### | ||||
| 540 | # | ||||
| 541 | # is_print_comments() | ||||
| 542 | # | ||||
| 543 | # Returns true if the worksheet print "comments" option is turned on. | ||||
| 544 | # | ||||
| 545 | sub is_print_comments { | ||||
| 546 | |||||
| 547 | my $self = shift; | ||||
| 548 | |||||
| 549 | return $self->{Notes}; | ||||
| 550 | } | ||||
| 551 | |||||
| 552 | =head2 get_tab_color() | ||||
| 553 | |||||
| 554 | Return color index of tab, or undef if not set. | ||||
| 555 | |||||
| 556 | =cut | ||||
| 557 | |||||
| 558 | sub get_tab_color { | ||||
| 559 | my $worksheet = shift; | ||||
| 560 | |||||
| 561 | return $worksheet->{TabColor}; | ||||
| 562 | } | ||||
| 563 | |||||
| 564 | =head2 is_sheet_hidden() | ||||
| 565 | |||||
| 566 | Return true if sheet is hidden | ||||
| 567 | |||||
| 568 | =cut | ||||
| 569 | |||||
| 570 | sub is_sheet_hidden { | ||||
| 571 | my $worksheet = shift; | ||||
| 572 | |||||
| 573 | return $worksheet->{SheetHidden}; | ||||
| 574 | } | ||||
| 575 | |||||
| 576 | =head2 is_row_hidden($row) | ||||
| 577 | |||||
| 578 | In scalar context, return true if $row is hidden | ||||
| 579 | In array context, return an array whose elements are true | ||||
| 580 | if the corresponding row is hidden. | ||||
| 581 | |||||
| 582 | =cut | ||||
| 583 | |||||
| 584 | sub is_row_hidden { | ||||
| 585 | my $worksheet = shift; | ||||
| 586 | |||||
| 587 | my ($row) = @_; | ||||
| 588 | |||||
| 589 | unless ( $worksheet->{RowHidden} ) { | ||||
| 590 | return () if (wantarray); | ||||
| 591 | return 0; | ||||
| 592 | } | ||||
| 593 | |||||
| 594 | return @{ $worksheet->{RowHidden} } if (wantarray); | ||||
| 595 | return $worksheet->{RowHidden}[$row]; | ||||
| 596 | } | ||||
| 597 | |||||
| 598 | =head2 is_col_hidden($col) | ||||
| 599 | |||||
| 600 | In scalar context, return true if $col is hidden | ||||
| 601 | In array context, return an array whose elements are true | ||||
| 602 | if the corresponding column is hidden. | ||||
| 603 | |||||
| 604 | =cut | ||||
| 605 | |||||
| 606 | sub is_col_hidden { | ||||
| 607 | my $worksheet = shift; | ||||
| 608 | |||||
| 609 | my ($col) = @_; | ||||
| 610 | |||||
| 611 | unless ( $worksheet->{ColHidden} ) { | ||||
| 612 | return () if (wantarray); | ||||
| 613 | return 0; | ||||
| 614 | } | ||||
| 615 | |||||
| 616 | return @{ $worksheet->{ColHidden} } if (wantarray); | ||||
| 617 | return $worksheet->{ColHidden}[$col]; | ||||
| 618 | } | ||||
| 619 | |||||
| 620 | ############################################################################### | ||||
| 621 | # | ||||
| 622 | # Mapping between legacy method names and new names. | ||||
| 623 | # | ||||
| 624 | { | ||||
| 625 | 3 | 32µs | 2 | 31µs | # spent 18µs (6+13) within Spreadsheet::ParseExcel::Worksheet::BEGIN@625 which was called:
# once (6µs+13µs) by Spreadsheet::ParseExcel::BEGIN@32 at line 625 # spent 18µs making 1 call to Spreadsheet::ParseExcel::Worksheet::BEGIN@625
# spent 13µs making 1 call to warnings::unimport |
| 626 | 1 | 800ns | *sheetNo = *sheet_num; | ||
| 627 | 1 | 100ns | *Cell = *get_cell; | ||
| 628 | 1 | 200ns | *RowRange = *row_range; | ||
| 629 | 1 | 200ns | *ColRange = *col_range; | ||
| 630 | } | ||||
| 631 | |||||
| 632 | 1 | 3µs | 1; | ||
| 633 | |||||
| 634 | __END__ |