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

Add support for mergeCells, shrink to fit #21

Merged
merged 5 commits into from
Mar 10, 2022

Conversation

Slamdunk
Copy link
Contributor

@Slamdunk Slamdunk commented Mar 10, 2022

See box/spout#738

  • Set cell width or set column autofit xlsx. box/spout#729 - fix shrink to fit + add test shrinkToFit was not handled in StyleMerger so it was overwritten by the default cell style StyleManager didn't add the property to the xml if shrinkToFit was used without alignment or text wrap. Unit test
  • Propose of the way of cell merging in Writer box/spout#529 - tests for column width, row height and cell merge + minor refact Tests Added 'addOption' to OptionsManagerInterface Moved 'setColumnWidths' and 'mergeCells' methods to Xlsx Writer implementation since the actual feature only works for Xlsx at the moment

quamis and others added 5 commits March 10, 2022 08:45
Added support for
    mergeCells:
        // mergeCells (B2:G2), you may use CellHelper::getColumnLettersFromColumnIndex() to convert from "B2" to "[1,2]"
	    $writer->mergeCells([1,2], [6, 2]);

    cell height:
        $row->setHeight(30);

    shouldShrinkToFit:
        $style->setShouldShrinkToFit();

These changes are implemented for XLSX as that's what I need and test spout on.
shrinkToFit was not handled in StyleMerger so it was overwritten by the default cell style
StyleManager didn't add the property to the xml if shrinkToFit was used without alignment or text wrap.
Unit test
Tests
Added 'addOption' to OptionsManagerInterface
Moved 'setColumnWidths' and 'mergeCells' methods to Xlsx Writer implementation since the actual feature only works for Xlsx at the moment
@Slamdunk Slamdunk added the enhancement New feature or request label Mar 10, 2022
@Slamdunk Slamdunk merged commit 55eb55e into openspout:main Mar 10, 2022
@Slamdunk Slamdunk deleted the merge_cells branch March 10, 2022 08:11
@Slamdunk
Copy link
Contributor Author

Thank you @quamis and @ignaczistvan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants