Fix issue 673 trailing spaces of cell values lost (#805)

* indicate preserve attribute in Excel writer

fix #673

* Update src/zcl_excel_writer_2007.clas.abap

Not sure to understand why it's needed, but no problem to do that

Co-authored-by: Lars Hvam <larshp@hotmail.com>

Co-authored-by: sandra <sandra.rossi@gmail.com>
Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
sandraros 2021-09-26 10:17:32 +02:00 committed by GitHub
parent 88d75bfe8a
commit 868c90ffdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3593,8 +3593,8 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
parent = lo_document ).
lo_sub_element = lo_document->create_simple_element( name = lc_xml_node_t
parent = lo_document ).
* if <fs_sheet_string>-string_type EQ 's_leading_blanks'.
IF <fs_sheet_string>-string_value IS NOT INITIAL AND <fs_sheet_string>-string_value(1) EQ ` `.
IF contains( val = <fs_sheet_string>-string_value start = ` ` ) = abap_true
OR contains( val = <fs_sheet_string>-string_value end = ` ` ) = abap_true.
lo_sub_element->set_attribute( name = 'space' namespace = 'xml' value = 'preserve' ).
ENDIF.
lo_sub_element->set_value( value = <fs_sheet_string>-string_value ).