… | |
… | |
317 | return ss->normal; |
317 | return ss->normal; |
318 | else |
318 | else |
319 | return psiconv_list_get(ss->styles,0xff - nr); |
319 | return psiconv_list_get(ss->styles,0xff - nr); |
320 | } |
320 | } |
321 | |
321 | |
|
|
322 | psiconv_formula psiconv_get_formula (psiconv_formula_list ss, int nr) |
|
|
323 | { |
|
|
324 | return psiconv_list_get(ss,psiconv_list_length(ss)-nr-1); |
|
|
325 | } |
|
|
326 | |
|
|
327 | /* TODO: What if a cell is both in a default row and a default column?!? */ |
|
|
328 | psiconv_sheet_cell_layout psiconv_get_default_layout |
|
|
329 | (psiconv_sheet_line_list row_defaults, |
|
|
330 | psiconv_sheet_line_list col_defaults, |
|
|
331 | psiconv_sheet_cell_layout cell_default, |
|
|
332 | int row,int col) |
|
|
333 | { |
|
|
334 | int i; |
|
|
335 | psiconv_sheet_line line; |
|
|
336 | for (i = 0;i < psiconv_list_length(row_defaults);i++) { |
|
|
337 | line = psiconv_list_get(row_defaults,i); |
|
|
338 | if (line->position == row) |
|
|
339 | return line->layout; |
|
|
340 | } |
|
|
341 | for (i = 0;i < psiconv_list_length(col_defaults);i++) { |
|
|
342 | line = psiconv_list_get(col_defaults,i); |
|
|
343 | if (line->position == col) |
|
|
344 | return line->layout; |
|
|
345 | } |
|
|
346 | return cell_default; |
|
|
347 | } |
|
|
348 | |
|
|
349 | |
322 | void psiconv_free_color (psiconv_color color) |
350 | void psiconv_free_color (psiconv_color color) |
323 | { |
351 | { |
324 | if (color) |
352 | if (color) |
325 | free(color); |
353 | free(color); |
326 | } |
354 | } |
… | |
… | |
585 | { |
613 | { |
586 | if (list) |
614 | if (list) |
587 | psiconv_list_free_el(list,psiconv_free_sheet_cell_aux); |
615 | psiconv_list_free_el(list,psiconv_free_sheet_cell_aux); |
588 | } |
616 | } |
589 | |
617 | |
|
|
618 | void psiconv_free_sheet_line_aux(void *line) |
|
|
619 | { |
|
|
620 | psiconv_sheet_line data = line; |
|
|
621 | |
|
|
622 | psiconv_free_sheet_cell_layout(data->layout); |
|
|
623 | } |
|
|
624 | |
|
|
625 | void psiconv_free_sheet_line(psiconv_sheet_line line) |
|
|
626 | { |
|
|
627 | if (line) { |
|
|
628 | psiconv_free_sheet_line_aux(line); |
|
|
629 | free(line); |
|
|
630 | } |
|
|
631 | } |
|
|
632 | |
|
|
633 | void psiconv_free_sheet_line_list(psiconv_sheet_line_list list) |
|
|
634 | { |
|
|
635 | if (list) |
|
|
636 | psiconv_list_free_el(list,psiconv_free_sheet_line_aux); |
|
|
637 | } |
|
|
638 | |
590 | void psiconv_free_sheet_worksheet_aux (void *data) |
639 | void psiconv_free_sheet_worksheet_aux (void *data) |
591 | { |
640 | { |
592 | psiconv_sheet_worksheet section = data; |
641 | psiconv_sheet_worksheet section = data; |
593 | psiconv_free_sheet_cell_layout(section->default_layout); |
642 | psiconv_free_sheet_cell_layout(section->default_layout); |
594 | psiconv_free_sheet_cell_list(section->cells); |
643 | psiconv_free_sheet_cell_list(section->cells); |
|
|
644 | psiconv_free_sheet_line_list(section->row_default_layouts); |
|
|
645 | psiconv_free_sheet_line_list(section->col_default_layouts); |
595 | } |
646 | } |
596 | |
647 | |
597 | void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet) |
648 | void psiconv_free_sheet_worksheet(psiconv_sheet_worksheet sheet) |
598 | { |
649 | { |
599 | if (sheet) { |
650 | if (sheet) { |