-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some bugs to fix #1193
base: main
Are you sure you want to change the base?
Some bugs to fix #1193
Conversation
CornerRB should not look like fromCenter
Thank you. It's very difficult to distinguish the changes if you do one PR for everything. Also, fixing minor things like typos or comments should not be all mixed, you can do a separate PR for this. The key principle is to check the diff, it should be straight to the point. EDIT: I would like to create one issue per issue you mention, with reproducible code, and one PR per issue. Could you do it? |
Hello, sorry, did not see your update from 14 April. Starting with the issue gradient_fill, one PR for the 4 points is ok ? Or each point a PR ? |
I think each bug should have one issue to reproduce the problem (don't explain the problem of the code), and one PR per fix (if needed, you can explain code in the PR). I'll review each issue separately. Thank you! |
Hello,
I found some bugs to fix:
The structure ZEXCEL_S_CSTYLE_FILL contains the wrong component type for GRADTYPE. It is the X-structure instead of
the data structure. But field names are the same. So the coding of zcl_excel_worksheet->change_cell_style works but
truncates any gradient data to one char. So every try to change gradient values with this method fails so far.
ZDEMO_EXCEL2:
CornerRB (Right bottom) should not look like fromCenter. So i fixed the code in zcl_excel_style_fill=>build_gradient( ).
Before fixing it i recognized that caused by this bug the same gradient data (initiated by filltypes cornerRB and fromCenter
in method zcl_excel_style_fill=>build_gradient) are not compressed to one fill and in this case even one cellXfs style in xl/styles.xml.
The only difference is the filltype itself, but in case of gradient data filltype doesn't matter for XML Output.
Therefore zcl_excel_writer_2007->create_xl_styles now sets filltype to NONE then.
Because of the fix above the example below to test static settings of gradient data also offers another possibility to test this.
Further details there.
I removed the quick and dirty 'gradtype' code in method zcl_excel_common->recursive_struct_to_class.
To do this the field flag_class now is set depending on the current class in e_target and used only for it and not anything in field-symbol attribute.
So now the optionally created border object is moved to e_target and not to field-symbol attribute.
And the changed e_target is returned to above level's field-symbol attribute, so this should work properly.
This also offers the possibility to avoid the Try ASSIGNs in every loop (in one level e_target is always structure or always class).
Changed zcl_excel_common->recursive_class_to_struct accordingly.
Insert this at the end of ZDEMO_EXCEL2 for testing:
ZDEMO_EXCEL27:
Change the last reference of lv_style_1_guid to lv_style_2_guid in the following line near the end of the program:
Then lv_style_1_guid and lv_style_2_guid are each referenced twice in the programm. The result should be red color for the
texfunctions (Row 6) but it is green as before. The wrong field is used in method add_conditional_formatting in local class
lcl_create_xl_sheet (currently line 1174). Instead of cell style (GUID) from texfunction's data cell style from last cellis' data
is used. That is green.
I enhanced the reader to be able to read the complete Output of ZDEMO_EXCEL27.
The textfunction part was not implemented so far.
To avoid the need of reusing the literal "notContainsText" (line 932 of the above mentioned method) for the reader
i decided to change the zcl_excel_style_cond constant c_textfunction_notcontains from "notContains" to "notContainsText".
This is the correct cfRule type for conditionalFormatting used by excel. Literal "notContains" is only left for writing the
cfRule's operator in the above mentioned method.
There i am using now the corresponding anyway existing zcl_excel_style_cond constant c_operator_notcontains,
which contains this literal.
Some changes in zcl_excel_writer_2007->create_dxf_style:
Example ZDEMO_EXCEL27: There should be two entries (one for each style lv_style_1_guid and lv_style_2_guid),
but there are entries for every zcl_excel_style_cond instance.
In my opinion it makes the code very difficult to read. Why not reading styles_cond_mapping with key style = 0 and reading
it_cellxfs with corresponding index 1 if for example the requested style is 0 ? Futher advantage: A style number in
styles_mapping and styles_cond_mapping with the same value is related to the same style. What of course should be the case
but was not before. However in this usage it did not cause anything wrong.
Change in zcl_excel_reader_2007->get_dxf_style_guid:
I got a REGEX_TOO_COMPLEX exception from method resolve_path reading a very long external hyper link. Currently
the call of this method only makes sense for drawings and comments. So i moved the two corresponding coding lines in load_worksheet to the drawings and comments parts of the CASE.
reading showgridlines corrected (ok, not a problem but comparing a one char field (TYPE zexcel_show_gridlines)
with literal 'true' ?)
and reading showrowcolheaders added.
Bernd