Drawing reference 2

This commit is contained in:
KonstantinKhrushchev 2023-05-08 07:40:27 +03:00 committed by GitHub
parent 91757fcc94
commit 7c5f35e790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -533,6 +533,9 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
WHILE lo_iterator->has_next( ) EQ abap_true. WHILE lo_iterator->has_next( ) EQ abap_true.
lo_drawing ?= lo_iterator->get_next( ). lo_drawing ?= lo_iterator->get_next( ).
"do not add media from drawing with reference
CHECK lo_drawing->get_reference_guid( ) IS INITIAL.
lv_content = lo_drawing->get_media( ). lv_content = lo_drawing->get_media( ).
lv_value = lo_drawing->get_media_name( ). lv_value = lo_drawing->get_media_name( ).
CONCATENATE 'xl/media/' lv_value INTO lv_value. CONCATENATE 'xl/media/' lv_value INTO lv_value.
@ -2604,7 +2607,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
lo_drawing TYPE REF TO zcl_excel_drawing. lo_drawing TYPE REF TO zcl_excel_drawing.
DATA: lv_value TYPE string, DATA: lv_value TYPE string,
lv_counter TYPE i. lv_guid TYPE guid_32.
********************************************************************** **********************************************************************
* STEP 1: Create [Content_Types].xml into the root of the ZIP * STEP 1: Create [Content_Types].xml into the root of the ZIP
@ -2626,11 +2629,12 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
lo_iterator = lo_drawings->get_iterator( ). lo_iterator = lo_drawings->get_iterator( ).
WHILE lo_iterator->has_next( ) EQ abap_true. WHILE lo_iterator->has_next( ) EQ abap_true.
lo_drawing ?= lo_iterator->get_next( ). lo_drawing ?= lo_iterator->get_next( ).
ADD 1 TO lv_counter.
lv_value = lv_counter. CHECK lo_drawing->get_reference_guid( ) IS INITIAL.
CONDENSE lv_value.
CONCATENATE 'rId' lv_value INTO lv_value. lv_guid = lo_drawing->get_guid( ).
CONCATENATE 'rId' lv_guid INTO lv_value.
lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship
parent = lo_document ). parent = lo_document ).
@ -2828,7 +2832,8 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
lv_row TYPE string, " zexcel_cell_row. lv_row TYPE string, " zexcel_cell_row.
lv_col_offset TYPE string, lv_col_offset TYPE string,
lv_row_offset TYPE string, lv_row_offset TYPE string,
lv_value TYPE string. lv_value TYPE string,
lv_guid TYPE guid_32.
ls_position = io_drawing->get_position( ). ls_position = io_drawing->get_position( ).
@ -2960,8 +2965,12 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
lo_element_pic->append_child( new_child = lo_element ). lo_element_pic->append_child( new_child = lo_element ).
* blipFill * blipFill
lv_value = ip_index. "reference drawing
CONDENSE lv_value. IF io_drawing->get_reference_guid IS INITIAL.
lv_guid = io_drawing->get_guid( ).
ELSE.
lv_guid = io_drawing->get_reference_guid( ).
ENDIF.
CONCATENATE 'rId' lv_value INTO lv_value. CONCATENATE 'rId' lv_value INTO lv_value.
lo_element = io_document->create_simple_element( name = lc_xml_node_blipfill lo_element = io_document->create_simple_element( name = lc_xml_node_blipfill