From 70e0a556db02355447f280ee32bdccb1e7f6ade8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schm=C3=B6cker?= Date: Sun, 28 Oct 2012 10:26:17 +0000 Subject: [PATCH] Fix issue #222 - Reader was disfunctional if path .\xl\worksheets\_rels\ isn't existing. git-svn-id: https://subversion.assembla.com/svn/abap2xlsx/trunk@347 b7d68dce-7c3c-4a99-8ce0-9ea847f5d049 --- ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk b/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk index 66014a9..2947410 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_READER_2007.slnk @@ -1313,7 +1313,7 @@ endmethod. differentoddeven TYPE string, END OF t_headerfooter. - types: BEGIN OF lty_tabcolor, + TYPES: BEGIN OF lty_tabcolor, rgb TYPE string, theme TYPE string, END OF lty_tabcolor. @@ -1384,8 +1384,8 @@ endmethod. outline_level TYPE int4, lr_tabcolor TYPE REF TO if_ixml_element, - ls_tabcolor type lty_tabcolor, - ls_excel_s_tabcolor type zexcel_s_tabcolor, + ls_tabcolor TYPE lty_tabcolor, + ls_excel_s_tabcolor TYPE zexcel_s_tabcolor, rows TYPE REF TO if_ixml_node_collection, row TYPE t_row, @@ -1412,8 +1412,12 @@ endmethod. file_path = dirname. CONCATENATE dirname '_rels/' stripped_name '.rels' INTO rels_worksheet_path. - rels_worksheet = me->get_ixml_from_zip_archive( rels_worksheet_path ). - node ?= rels_worksheet->find_from_name( 'Relationship' ). + TRY. " +#222 _rels/xxx.rels might not be present. If not found there can be no drawings --> just ignore this section + rels_worksheet = me->get_ixml_from_zip_archive( rels_worksheet_path ). + node ?= rels_worksheet->find_from_name( 'Relationship' ). + CATCH zcx_excel. " +#222 + " +#222 No errorhandling necessary - node will be unbound if error occurs + ENDTRY. " +#222 WHILE node IS BOUND. fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = relationship ). CONCATENATE dirname relationship-target INTO path. @@ -1444,10 +1448,10 @@ endmethod. IF lr_tabcolor IS BOUND. fill_struct_from_attributes( EXPORTING ip_element = lr_tabcolor CHANGING cp_structure = ls_tabcolor ). * Theme not supported yet - if ls_tabcolor-rgb is not INITIAL. + IF ls_tabcolor-rgb IS NOT INITIAL. ls_excel_s_tabcolor-rgb = ls_tabcolor-rgb. io_worksheet->set_tabcolor( ls_excel_s_tabcolor ). - endif. + ENDIF. ENDIF. rows = worksheet->get_elements_by_tag_name( name = 'row' ).