From c6e5ad6ee63429c4ee16ba796738c7ee46c9a3d0 Mon Sep 17 00:00:00 2001 From: Abo Date: Sat, 16 Jul 2022 19:38:46 +0200 Subject: [PATCH] adopt default style when setting format for date / time (#1025) * first draft must check cloning vs uuid assignment, it works but I'm not convinced this is correct * remove unused class attribute * fixed unrelated typo * fixed linter complaints and revised changes * Delete zexcel_t_sheet_style.ttyp.xml * Delete zexcel_s_sheet_style.tabl.xml Co-authored-by: Gregor Wolf --- src/zcl_excel_worksheet.clas.abap | 6 ++++-- src/zcl_excel_worksheet.clas.xml | 12 ------------ src/zexcel_s_sheet_style.tabl.xml | 22 ---------------------- src/zexcel_t_sheet_style.ttyp.xml | 18 ------------------ 4 files changed, 4 insertions(+), 54 deletions(-) delete mode 100644 src/zexcel_s_sheet_style.tabl.xml delete mode 100644 src/zexcel_t_sheet_style.ttyp.xml diff --git a/src/zcl_excel_worksheet.clas.abap b/src/zcl_excel_worksheet.clas.abap index db1837e..4a871a4 100644 --- a/src/zcl_excel_worksheet.clas.abap +++ b/src/zcl_excel_worksheet.clas.abap @@ -92,7 +92,6 @@ CLASS zcl_excel_worksheet DEFINITION DATA sheet_setup TYPE REF TO zcl_excel_sheet_setup . DATA show_gridlines TYPE zexcel_show_gridlines READ-ONLY VALUE abap_true ##NO_TEXT. DATA show_rowcolheaders TYPE zexcel_show_gridlines READ-ONLY VALUE abap_true ##NO_TEXT. - DATA styles TYPE zexcel_t_sheet_style . DATA tabcolor TYPE zexcel_s_tabcolor READ-ONLY . DATA column_formulas TYPE mty_th_column_formula READ-ONLY . CLASS-DATA: @@ -3144,7 +3143,7 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. rv_guid = ip_style_or_guid. ELSE. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'IP_GUID type must be either REF TO zcl_excel_tyle or zexcel_cell_style'. + RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'IP_GUID type must be either REF TO zcl_excel_style or zexcel_cell_style'. ENDIF. ENDMETHOD. @@ -3698,6 +3697,9 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. * If not, use default DATA: lo_format_code_datetime TYPE zexcel_number_format. DATA: stylemapping TYPE zexcel_s_stylemapping. + IF -cell_style IS INITIAL. + -cell_style = me->excel->get_default_style( ). + ENDIF. CASE lv_value_type. WHEN cl_abap_typedescr=>typekind_date. TRY. diff --git a/src/zcl_excel_worksheet.clas.xml b/src/zcl_excel_worksheet.clas.xml index f53acab..7b905e8 100644 --- a/src/zcl_excel_worksheet.clas.xml +++ b/src/zcl_excel_worksheet.clas.xml @@ -1101,18 +1101,6 @@ I Show Gridlines - - ZCL_EXCEL_WORKSHEET - STYLES - E - Sheet style table type - - - ZCL_EXCEL_WORKSHEET - STYLES - I - Sheet style table type - ZCL_EXCEL_WORKSHEET STYLES_COND diff --git a/src/zexcel_s_sheet_style.tabl.xml b/src/zexcel_s_sheet_style.tabl.xml deleted file mode 100644 index 9d2dd49..0000000 --- a/src/zexcel_s_sheet_style.tabl.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZEXCEL_S_SHEET_STYLE - E - INTTAB - Sheet style structure - 1 - - - - GUID - ZEXCEL_CELL_STYLE - 0 - E - - - - - diff --git a/src/zexcel_t_sheet_style.ttyp.xml b/src/zexcel_t_sheet_style.ttyp.xml deleted file mode 100644 index 68734a7..0000000 --- a/src/zexcel_t_sheet_style.ttyp.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - ZEXCEL_T_SHEET_STYLE - E - ZEXCEL_S_SHEET_STYLE - S - STRU - T - D - N - Sheet style table type - - - -