-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix freeze pane for xlsx files #261
Fix freeze pane for xlsx files #261
Conversation
Thank you for the contribution. Would it be possible to cover that with unit tests without adding an excel file to the repository ? Maybe by writing a file from scratch and then reading it ? |
After looking a bit about making a unit test I realized that I had to change Xlsx writer too. I think the main problem is that we don't make any difference between xsplit/ysplit and topLeftCell. I took a look at Apache POI and for freeze pane they have: /**
* Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
* @param colSplit Horizontal position of split.
* @param rowSplit Vertical position of split.
*/
@Override
public void createFreezePane(int colSplit, int rowSplit) {
createFreezePane( colSplit, rowSplit, colSplit, rowSplit );
} /**
* Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
*
* <p>
* If both colSplit and rowSplit are zero then the existing freeze pane is removed
* </p>
*
* @param colSplit Horizontal position of split.
* @param rowSplit Vertical position of split.
* @param leftmostColumn Left column visible in right pane.
* @param topRow Top row visible in bottom pane
*/
@Override
public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow) { Where leftmostColumn and topRow represent topLeftCell. I'm not sure why they splitted it like that as in all Excel documentation it's always topLeftCell but anyway I think this way is more clear and will fix the bug I found. Should I continue on this PR or close this one and open a new one ? |
You can keep pushing new commits to this PR, or squash and force push. Up to you. |
…-use-xsplit-ysplit
I see a BC break in the method public function freezePane($splitCell, $topLeftCell = null) At first glance, it seems easier to use, give it a cell coordinate, instead of two integers. Also |
Ok for renaming the function but if we keep Well it's not the current position of the freeze pane, this one doesn't move. If when I load a file I have this :
|
Thanks for your contribution. I reworked it a bit, to avoid breaking API, and merged it. |
This is:
Checklist:
What does it change?
Fix #260
Always use xsplit and ysplit to define the freeze pane