-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Refactoring and code cleanup for XSSFSheet, XSSFRowColShifter, RowShifter and ColumnHelper classes #1066
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert javadoc to csharp xml documentation. use 'var' istead of explicit types where possible.
Convert Javadoc to c# xml docs; Add omitted cutly brackets; clean duoble blank-lines; add readonly modificators where appropriate; use type matching where approptiate; add omitted accessibility modificators; remove unnecessary parenthesis where appropriate; use simpified types (bool, string instead of Boolean, String); Adjust code-line lengths to fit smaller editor windows
To be later able to add an overload that accepts IColumn as argument.
The methods copy to current object properties of objects passed as parameters.
The style is not set if it is zero.
Adjust code-line lengths to fit smaller editor windows in XSSFSheet Convert javadoc to xml documentation for XSSFSheet Remove redundant code from Write method of XSSFSheet Remove unused parameter from SetColumn method of XSSFSheet The method is private to XSSFSheet, not a breaking change Simplify names in XSSFSheet Add omitted cutly brackets; clean duoble blank-lines; add readonly modificators where appropriate; use type matching where approptiate; add omitted accessibility modificators; use null propagation where appropriate; omit 'this' notation; remove unnecessary parenthesis where appropriate; use coalesce espressions where appropriate; use simpified types (bool, string instead of Boolean, String);
No code changes, the code comparisson will show a mess of changes, but this literally ONLY moves methods and properties from a place to place.
Rename to XSSFSheet.ShiftedRowOrColumnNumber, rename parameters to not be tied to only rows. Refactor XSSFSheet.ShouldRemoveRow private method Rename to XSSFSheet.ShouldRemoveAtIndex, rename parapmeters to not be tied to rows. Rename XSSFSheet.RemoveOverwritten private method to XSSFSheet.RemoveOverwrittenRows Refactor XSSFSheet.HeadMapCount method to be more general. To be later able to use it fot columns.
It sorts cells in low level row object and in the _cells field of XSSFRow. Order of the cells is imortant, Excel will repair the document if cells are out of order.
…s style set to it. I accordance with excel's behavior
Use ISheet.CopyComment in SheetUtil
It could occur when hyperlinks are copied if policy dictates copying of hyperlinks, but the source cell is null.
Add CT_Col.SetNumber(uint) method. It sets min and max properties of CT_Col that are used by excel as a span of a column object. Add CT_Col.IsSetNumber method It indicates if min & max fields of CT_Col are more than 0. This means that CT_Col object has a place on the worksheet. Add null checks for CT_Col.colField Initialize it if it's null Add CT_Col.Set(CT_Col) method. Add UnsetWidth, UnsetCustomWidth and UnsetStyle to CT_Col
No changes to code itself, just remove clatter, add braces where appropriate, move members to regions,
artem-iron
changed the title
Ref cl
Refactoring and code cleanup for XSSFSheet, XSSFRowColShifter, RowShifter and ColumnHelper classes
Apr 19, 2023
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to mainly cleanup and make more consistent and readable the code of XSSFSheet class,
but touching some adjacent classes, such as XSSFRowColShifter, RowShifter and ColumnHelper.
The core reason for this change to exist is to be a platform to later build functionality to manage columns of the sheet
the same way rows are managed, with column shifting etc. Hopefully this improves maintainability and stability somewhat. It is easier to track changes of XSSFSheet, XSSFRowColShifter, RowShifter and ColumnHelper classes in the commit history, since there's a lot of moving stuff around and diffs don't do a good job representing the picture of what happened. Public API has no breaking changes, no new failed tests are generated.
Among the changes:
current object properties of objects passed as parameters.
_cells field of XSSFRow. Order of the cells is imortant, Excel will repair the document if cells are out of order.
excel as a span of a column object.
than 0. This means that CT_Col object has a place on the worksheet.
accepts IColumn as argument.
not a breaking change.
renames parameters to not be tied to only rows.
renames parapmeters to not be tied to rows.
accordance with excel's behavior.
copied if policy dictates copying of hyperlinks, but the source cell is null.