From 76bb151bbb79a0a5db6759e27d06d229505236ba Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 13 Mar 2014 12:16:32 -0500 Subject: [PATCH] Fix issue #308 Changed returning parameter of method PIXEL2EMU from INT4 to STRING --- ZA2X/CLAS/ZCL_EXCEL_DRAWING.slnk | 191 +++++-------------------------- 1 file changed, 28 insertions(+), 163 deletions(-) diff --git a/ZA2X/CLAS/ZCL_EXCEL_DRAWING.slnk b/ZA2X/CLAS/ZCL_EXCEL_DRAWING.slnk index 8fa8482..6ba5d31 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_DRAWING.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_DRAWING.slnk @@ -1,140 +1,5 @@ - - class ZCL_EXCEL_DRAWING definition - public - final - create public . - -public section. -*"* public components of class ZCL_EXCEL_DRAWING -*"* do not include other source files here!!! - type-pools ABAP . - - constants C_GRAPH_PIE type ZEXCEL_GRAPH_TYPE value '1'. "#EC NOTEXT - constants C_GRAPH_LINE type ZEXCEL_GRAPH_TYPE value '2'. "#EC NOTEXT - constants C_GRAPH_BARS type ZEXCEL_GRAPH_TYPE value '0'. "#EC NOTEXT - data GRAPH_TYPE type ZEXCEL_GRAPH_TYPE . - data TITLE type STRING value 'image1.jpg'. "#EC NOTEXT . - data X_REFERENCES type CHAR1 . - data Y_REFERENCES type CHAR1 . - constants TYPE_IMAGE type ZEXCEL_DRAWING_TYPE value 'image'. "#EC NOTEXT - constants TYPE_CHART type ZEXCEL_DRAWING_TYPE value 'chart'. "#EC NOTEXT - constants ANCHOR_ABSOLUTE type ZEXCEL_DRAWING_ANCHOR value 'ABS'. "#EC NOTEXT - constants ANCHOR_ONE_CELL type ZEXCEL_DRAWING_ANCHOR value 'ONE'. "#EC NOTEXT - constants ANCHOR_TWO_CELL type ZEXCEL_DRAWING_ANCHOR value 'TWO'. "#EC NOTEXT - data GRAPH type ref to ZCL_EXCEL_GRAPH . - constants C_MEDIA_TYPE_BMP type STRING value 'bmp'. "#EC NOTEXT - constants C_MEDIA_TYPE_XML type STRING value 'xml'. "#EC NOTEXT - constants C_MEDIA_TYPE_JPG type STRING value 'jpg'. "#EC NOTEXT - - methods CONSTRUCTOR - importing - !IP_TYPE type ZEXCEL_DRAWING_TYPE default ZCL_EXCEL_DRAWING=>TYPE_IMAGE - !IP_TITLE type ZEXCEL_SHEET_TITLE optional . - methods CREATE_MEDIA_NAME - importing - !IP_INDEX type I . - methods GET_FROM_COL - returning - value(R_FROM_COL) type ZEXCEL_CELL_COLUMN . - methods GET_FROM_ROW - returning - value(R_FROM_ROW) type ZEXCEL_CELL_ROW . - methods GET_GUID - returning - value(EP_GUID) type GUID_16 . - methods GET_HEIGHT_EMU_STR - returning - value(R_HEIGHT) type STRING . - methods GET_MEDIA - returning - value(R_MEDIA) type XSTRING . - methods GET_MEDIA_NAME - returning - value(R_NAME) type STRING . - methods GET_MEDIA_TYPE - returning - value(R_TYPE) type STRING . - methods GET_NAME - returning - value(R_NAME) type STRING . - methods GET_TO_COL - returning - value(R_TO_COL) type ZEXCEL_CELL_COLUMN . - methods GET_TO_ROW - returning - value(R_TO_ROW) type ZEXCEL_CELL_ROW . - methods GET_WIDTH_EMU_STR - returning - value(R_WIDTH) type STRING . - class-methods PIXEL2EMU - importing - !IP_PIXEL type INT4 - !IP_DPI type INT2 optional - returning - value(R_EMU) type INT4 . - methods SET_MEDIA - importing - !IP_MEDIA type XSTRING optional - !IP_MEDIA_TYPE type STRING - !IP_WIDTH type INT4 default 0 - !IP_HEIGHT type INT4 default 0 . - methods SET_MEDIA_MIME - importing - !IP_IO type SKWF_IO - !IP_WIDTH type INT4 - !IP_HEIGHT type INT4 . - methods SET_MEDIA_WWW - importing - !IP_KEY type WWWDATATAB - !IP_WIDTH type INT4 - !IP_HEIGHT type INT4 . - methods SET_POSITION - importing - !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 . - methods SET_POSITION2 - importing - !IP_FROM type ZEXCEL_DRAWING_LOCATION - !IP_TO type ZEXCEL_DRAWING_LOCATION - !IP_ANCHOR type ZEXCEL_DRAWING_ANCHOR optional . - methods GET_POSITION - returning - value(RP_POSITION) type ZEXCEL_DRAWING_POSITION . - methods GET_TYPE - returning - value(RP_TYPE) type ZEXCEL_DRAWING_TYPE . - methods GET_INDEX - returning - value(RP_INDEX) type STRING . - methods LOAD_CHART_ATTRIBUTES - importing - value(IP_CHART) type ref to IF_IXML_DOCUMENT . - *"* protected components of class ZCL_EXCEL_DRAWING -*"* do not include other source files here!!! -protected section. - private section. -*"* private components of class ZCL_EXCEL_DRAWING -*"* do not include other source files here!!! - - data TYPE type ZEXCEL_DRAWING_TYPE value TYPE_IMAGE. "#EC NOTEXT . - data INDEX type STRING . - data ANCHOR type ZEXCEL_DRAWING_ANCHOR value ANCHOR_ONE_CELL. "#EC NOTEXT . - constants C_MEDIA_SOURCE_WWW type CHAR1 value 1. "#EC NOTEXT - constants C_MEDIA_SOURCE_XSTRING type CHAR1 value 0. "#EC NOTEXT - constants C_MEDIA_SOURCE_MIME type CHAR1 value 2. "#EC NOTEXT - data GUID type GUID_16 . - data MEDIA type XSTRING . - data MEDIA_KEY_WWW type WWWDATATAB . - data MEDIA_NAME type STRING . - data MEDIA_SOURCE type CHAR1 . - data MEDIA_TYPE type STRING . - data IO type SKWF_IO . - data FROM_LOC type ZEXCEL_DRAWING_LOCATION . - data TO_LOC type ZEXCEL_DRAWING_LOCATION . - data SIZE type ZEXCEL_DRAWING_SIZE . + *"* local class implementation for public class *"* use this source file for the implementation part of *"* local helper classes @@ -198,7 +63,7 @@ protected section. anchor = anchor_one_cell. from_loc-col = 1. from_loc-row = 1. -endmethod. + endmethod. @@ -210,19 +75,19 @@ endmethod. index = ip_index. CONCATENATE me->type index INTO media_name. CONDENSE media_name NO-GAPS. -endmethod. + endmethod. method GET_FROM_COL. r_from_col = me->from_loc-col. -endmethod. + endmethod. method GET_FROM_ROW. r_from_row = me->from_loc-row. -endmethod. + endmethod. @@ -230,20 +95,20 @@ endmethod. ep_guid = me->guid. -endmethod. + endmethod. method GET_HEIGHT_EMU_STR. r_height = pixel2emu( size-height ). CONDENSE r_height NO-GAPS. -endmethod. + endmethod. method GET_INDEX. rp_index = me->index. -endmethod. + endmethod. @@ -304,25 +169,25 @@ endmethod. failed = 1 OTHERS = 2. ENDCASE. -endmethod. + endmethod. method GET_MEDIA_NAME. CONCATENATE media_name `.` media_type INTO r_name. -endmethod. + endmethod. method GET_MEDIA_TYPE. r_type = media_type. -endmethod. + endmethod. method GET_NAME. r_name = title. -endmethod. + endmethod. @@ -331,36 +196,36 @@ endmethod. rp_position-from = from_loc. rp_position-to = to_loc. rp_position-size = size. -endmethod. + endmethod. method GET_TO_COL. r_to_col = me->to_loc-col. -endmethod. + endmethod. method GET_TO_ROW. r_to_row = me->to_loc-row. -endmethod. + endmethod. method GET_TYPE. rp_type = me->type. -endmethod. + endmethod. method GET_WIDTH_EMU_STR. r_width = pixel2emu( size-width ). CONDENSE r_width NO-GAPS. -endmethod. + endmethod. - METHOD load_chart_attributes. + method LOAD_CHART_ATTRIBUTES. DATA: node TYPE REF TO if_ixml_element. DATA: node2 TYPE REF TO if_ixml_element. DATA: node3 TYPE REF TO if_ixml_element. @@ -1042,12 +907,12 @@ endmethod. me->graph->pagemargins = ls_pagemargins. -ENDMETHOD. + endmethod. - + method PIXEL2EMU. * suppose 96 DPI IF ip_dpi IS SUPPLIED. @@ -1056,14 +921,14 @@ ENDMETHOD. * suppose 96 DPI r_emu = ip_pixel * 914400 / 96. ENDIF. -endmethod. + endmethod. - METHOD set_media. + method SET_MEDIA. IF ip_media IS SUPPLIED. media = ip_media. ENDIF. @@ -1075,7 +940,7 @@ endmethod. IF ip_height IS SUPPLIED. size-height = ip_height. ENDIF. -ENDMETHOD. + endmethod. @@ -1100,7 +965,7 @@ ENDMETHOD. -endmethod. + endmethod. @@ -1124,14 +989,14 @@ endmethod. size-width = ip_width. size-height = ip_height. -endmethod. + endmethod. - METHOD set_position. + method SET_POSITION. from_loc-col = zcl_excel_common=>convert_column2int( ip_from_col ) - 1. IF ip_coloff IS SUPPLIED. from_loc-col_offset = ip_coloff. @@ -1141,7 +1006,7 @@ endmethod. from_loc-row_offset = ip_rowoff. ENDIF. anchor = anchor_one_cell. -ENDMETHOD. + endmethod. @@ -1171,6 +1036,6 @@ ENDMETHOD. me->to_loc = ip_to. me->anchor = lv_anchor. -endmethod. + endmethod.