Skip to content
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

Fixed #1455 issue of border #1473

Closed
wants to merge 2 commits into from
Closed

Conversation

dhaval247
Copy link
Contributor

@dhaval247 dhaval247 commented May 13, 2020

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

This commit has been made to fix the #1455 issue of the border.
I have added range before applying the inline style instead of single cell to resolve border related issue #1455 .

@MarkBaker
Copy link
Member

Thank you for your submission.
Is it possible to provide a unit test case to verify this change?

$cellStyle = $sheet->getStyle($column . $row);
if (isset($attributeArray['rowspan'], $attributeArray['colspan'])) {
$columnTo = $column;
for ($i = 0; $i < (int) $attributeArray['colspan'] - 1; ++$i) {
Copy link
Member

@MarkBaker MarkBaker May 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the loop necessary? Or can the adjustment of the $columnTo value be done with simple mathematics, with conversion between character and numeric column addresses?
Might it be cleaner moving this calculation into a separate method, as it's duplicated for two cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Because it is incrementing the column which is A-Z and this is also used in the processDomElement on line number 504 so that is why i have used this. @MarkBaker. we can create separate method now as it is used total 4 times in the whole file.

$cellStyle = $sheet->getStyle($range);
} elseif (isset($attributeArray['colspan'])) {
$columnTo = $column;
for ($i = 0; $i < (int) $attributeArray['colspan'] - 1; ++$i) {
Copy link
Member

@MarkBaker MarkBaker May 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the loop necessary? Or can the adjustment of the $columnTo value be done with simple mathematics, with conversion between character and numeric column addresses?
Which is the more efficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Because it is incrementing the column which is A-Z and this is also used in the processDomElement on line number 504 so that is why i have used this. @MarkBaker.

Copy link
Member

@PowerKiKi PowerKiKi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments by Mark should be addressed and tests added before merging.

@PowerKiKi PowerKiKi closed this in 7e12575 Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants