Merge pull request #561 from AtomKrieg/master

propragate exceptions
This commit is contained in:
Ivan 2018-09-16 17:29:50 -05:00 committed by GitHub
commit 6781323356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 59 additions and 18 deletions

View File

@ -51,10 +51,14 @@ public section.
ZCX_EXCEL .
methods DELETE_WORKSHEET_BY_INDEX
importing
!IV_INDEX type NUMERIC .
!IV_INDEX type NUMERIC
raising
ZCX_EXCEL .
methods DELETE_WORKSHEET_BY_NAME
importing
!IV_TITLE type CLIKE .
!IV_TITLE type CLIKE
raising
ZCX_EXCEL .
methods GET_ACTIVE_SHEET_INDEX
returning
value(R_ACTIVE_WORKSHEET) type ZEXCEL_ACTIVE_WORKSHEET .
@ -278,7 +282,12 @@ method CONSTRUCTOR.
me->zif_excel_book_protection~initialize( ).
me->zif_excel_book_properties~initialize( ).
me->add_new_worksheet( ).
try.
me->add_new_worksheet( ).
catch zcx_excel. " suppress syntax check error
assert 1 = 2. " some error processing anyway
endtry.
me->add_new_style( ). " Standard style
lo_style = me->add_new_style( ). " Standard style with fill gray125
lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_pattern_gray125.

View File

@ -36,10 +36,14 @@ public section.
value(RS_AREA) type ZEXCEL_S_AUTOFILTER_AREA .
methods GET_FILTER_RANGE
returning
value(R_RANGE) type ZEXCEL_CELL_VALUE .
value(R_RANGE) type ZEXCEL_CELL_VALUE
raising
ZCX_EXCEL.
methods GET_FILTER_REFERENCE
returning
value(R_REF) type ZEXCEL_RANGE_VALUE .
value(R_REF) type ZEXCEL_RANGE_VALUE
raising
ZCX_EXCEL .
methods GET_VALUES
returning
value(RT_FILTER) type ZEXCEL_T_AUTOFILTER_VALUES .
@ -95,7 +99,9 @@ private section.
data WORKSHEET type ref to ZCL_EXCEL_WORKSHEET .
data MT_FILTERS type TT_FILTERS .
methods VALIDATE_AREA .
methods VALIDATE_AREA
raising
ZCX_EXCEL .
ENDCLASS.

View File

@ -98,7 +98,9 @@ public section.
!IP_FROM_ROW type ZEXCEL_CELL_ROW
!IP_FROM_COL type ZEXCEL_CELL_COLUMN_ALPHA
!IP_ROWOFF type INT4 optional
!IP_COLOFF type INT4 optional .
!IP_COLOFF type INT4 optional
raising
ZCX_EXCEL .
methods SET_POSITION2
importing
!IP_FROM type ZEXCEL_DRAWING_LOCATION

View File

@ -24,7 +24,9 @@ public section.
methods SET_COLOR
importing
!IP_INDEX type I
!IP_COLOR type ZEXCEL_STYLE_COLOR_ARGB .
!IP_COLOR type ZEXCEL_STYLE_COLOR_ARGB
raising
ZCX_EXCEL .
protected section.
*"* protected components of class ZCL_EXCEL_LEGACY_PALETTE
*"* do not include other source files here!!!

View File

@ -270,7 +270,9 @@ private section.
importing
!I_FILENAME type CSEQUENCE
returning
value(R_EXCEL_DATA) type XSTRING .
value(R_EXCEL_DATA) type XSTRING
raising
ZCX_EXCEL.
methods READ_FROM_LOCAL_FILE
importing
!I_FILENAME type CSEQUENCE

View File

@ -201,12 +201,20 @@ endmethod.
method LOAD_WORKSHEET.
data: lo_reader type ref to if_sxml_reader.
data: lx_not_found type ref to lcx_not_found.
lo_reader = get_sxml_reader( ip_path ).
read_worksheet_data( io_reader = lo_reader
io_worksheet = io_worksheet ).
try.
read_worksheet_data( io_reader = lo_reader
io_worksheet = io_worksheet ).
catch lcx_not_found into lx_not_found.
raise exception type zcx_excel
exporting
error = lx_not_found->error.
endtry.
endmethod.

View File

@ -22,7 +22,9 @@ private section.
methods LOAD_VBAPROJECT
importing
!IP_PATH type STRING
!IP_EXCEL type ref to ZCL_EXCEL .
!IP_EXCEL type ref to ZCL_EXCEL
raising
ZCX_EXCEL .
ENDCLASS.

View File

@ -75,13 +75,17 @@ public section.
!IP_START_ROW type ZEXCEL_CELL_ROW
!IP_START_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA
!IP_STOP_ROW type ZEXCEL_CELL_ROW
!IP_STOP_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA .
!IP_STOP_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA
raising
ZCX_EXCEL .
methods ADD_RANGE
importing
!IP_START_ROW type ZEXCEL_CELL_ROW
!IP_START_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA
!IP_STOP_ROW type ZEXCEL_CELL_ROW
!IP_STOP_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA .
!IP_STOP_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA
raising
ZCX_EXCEL .
class-methods FACTORY_COND_STYLE_ICONSET
importing
!IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET

View File

@ -81,7 +81,9 @@ public section.
!IP_COLUMN type CLIKE
!IP_FUNCTION type ZEXCEL_TABLE_TOTALS_FUNCTION
returning
value(EP_FORMULA) type STRING .
value(EP_FORMULA) type STRING
raising
ZCX_EXCEL .
methods HAS_TOTALS
returning
value(EP_RESULT) type ABAP_BOOL .
@ -101,7 +103,9 @@ public section.
importing
!IP_INCLUDE_TOTALS_ROW type ABAP_BOOL default ABAP_TRUE
returning
value(OV_REFERENCE) type STRING .
value(OV_REFERENCE) type STRING
raising
ZCX_EXCEL .
methods GET_BOTTOM_ROW_INTEGER
returning
value(EV_ROW) type I .

View File

@ -224,7 +224,9 @@ class ZCL_EXCEL_WORKSHEET definition
methods DELETE_MERGE
importing
!IP_CELL_COLUMN type SIMPLE optional
!IP_CELL_ROW type ZEXCEL_CELL_ROW optional .
!IP_CELL_ROW type ZEXCEL_CELL_ROW optional
raising
ZCX_EXCEL .
methods DELETE_ROW_OUTLINE
importing
!IV_ROW_FROM type I