prevent row height zero (#950)

Fix #944

Co-authored-by: sandraros <sandra.rossi@gmail.com>
Co-authored-by: Abo <andrea@borgia.bo.it>
This commit is contained in:
sandraros 2022-01-06 10:32:24 +01:00 committed by GitHub
parent 6fcbc5c8a8
commit c5eb18acdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -2471,7 +2471,7 @@ CLASS zcl_excel_reader_2007 IMPLEMENTATION.
lo_row = io_worksheet->get_row( lv_cell_row ). lo_row = io_worksheet->get_row( lv_cell_row ).
IF ls_row-customheight = '1'. IF ls_row-customheight = '1'.
lo_row->set_row_height( ip_row_height = ls_row-ht ip_custom_height = abap_true ). lo_row->set_row_height( ip_row_height = ls_row-ht ip_custom_height = abap_true ).
ELSE. ELSEIF ls_row-ht > 0.
lo_row->set_row_height( ip_row_height = ls_row-ht ip_custom_height = abap_false ). lo_row->set_row_height( ip_row_height = ls_row-ht ip_custom_height = abap_false ).
ENDIF. ENDIF.

View File

@ -208,7 +208,12 @@ CLASS zcl_excel_row IMPLEMENTATION.
METHOD set_row_height. METHOD set_row_height.
DATA: height TYPE f.
TRY. TRY.
height = ip_row_height.
IF height <= 0.
zcx_excel=>raise_text( 'Please supply a positive number as row-height' ).
ENDIF.
me->row_height = ip_row_height. me->row_height = ip_row_height.
CATCH cx_sy_conversion_no_number. CATCH cx_sy_conversion_no_number.
zcx_excel=>raise_text( 'Unable to interpret ip_row_height as number' ). zcx_excel=>raise_text( 'Unable to interpret ip_row_height as number' ).

View File

@ -3774,9 +3774,6 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
* if a fix size is supplied use this * if a fix size is supplied use this
TRY. TRY.
height = ip_height_fix. height = ip_height_fix.
IF height <= 0.
zcx_excel=>raise_text( 'Please supply a positive number as row-height' ).
ENDIF.
lo_row->set_row_height( height ). lo_row->set_row_height( height ).
RETURN. RETURN.
CATCH cx_sy_conversion_no_number. CATCH cx_sy_conversion_no_number.

View File

@ -6107,7 +6107,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
IF lo_row->get_custom_height( ) = abap_true. IF lo_row->get_custom_height( ) = abap_true.
lo_element_2->set_attribute_ns( name = 'customHeight' value = '1' ). lo_element_2->set_attribute_ns( name = 'customHeight' value = '1' ).
ENDIF. ENDIF.
IF lo_row->get_row_height( ) >= 0. IF lo_row->get_row_height( ) > 0.
lv_value = lo_row->get_row_height( ). lv_value = lo_row->get_row_height( ).
lo_element_2->set_attribute_ns( name = 'ht' value = lv_value ). lo_element_2->set_attribute_ns( name = 'ht' value = lv_value ).
ENDIF. ENDIF.