spout icon indicating copy to clipboard operation
spout copied to clipboard

Add setCellVerticalAlignment() & allow setShouldWrapText() to be explicitly set as false

Open jonnott opened this issue 2 years ago • 6 comments

Fixes issues: https://github.com/box/spout/issues/829 https://github.com/box/spout/issues/737

  • add Common\Entity\Style\CellVerticalAlignment
  • duplicate get/set/hasSet/shouldApply methods for CellAlignment in Common\Entity\Style\Style for CellVerticalAlignment instead, plus corresponding properties
  • add setCellVerticalAlignment method to Common\Creator\Style\StyleBuilder
  • add vertical alignment to StyleMerger:: mergeCellProperties()
  • adjust wrapText logic in mergeCellProperties() to fix issue https://github.com/box/spout/issues/829
  • apply vertical cell styling for both XLSX and ODS, via corresponding StyleManager classes
  • transform vertical alignment ‘center’ to ‘middle’ for ODS
  • fix logic around wrapText such that the choice whether to include wrapping styles depends on hasSetWrapText() being true, and then use shouldWrapText() thereafter to either set wrapping or no wrapping (for XLSX, wrapText=“1” or wrapText=“0”, for ODS, wrap-option=wrap or wrap-option=no-wrap). previously there was no way to set wrapping to be OFF, only to set it to be ON.
  • add new tests to ensure shouldWrapText(false) results in the correct negated wrapText (XLSX) / wrap-option (ODS) styles
  • add new tests to StyleBuilderTest for vertical alignment
  • add vertical alignment to documentation.md

jonnott avatar Feb 10 '22 20:02 jonnott

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 10 '22 20:02 CLAassistant

@adrilo @PeteAUK @fwwarr

jonnott avatar Feb 10 '22 20:02 jonnott

Thanks @jonnott for your contribution! It looks good overall. I just left 2 minor comments that should be addressed before I can merge.

Hi @adrilo, I've force-pushed an amended version of my commit to this PR with the changes as discussed above. Please let me know your thoughts..

jonnott avatar Feb 12 '22 19:02 jonnott

@adrilo Do you see any outstanding issues with this still preventing a merge?

jonnott avatar Feb 28 '22 17:02 jonnott

Anyone know if there's any likelihood that this will get merged any time soon? Or do I need to submit this PR to openspout/openspout and look to use that in my project instead?

@adrilo

jonnott avatar Mar 25 '22 17:03 jonnott

Merged in https://github.com/openspout/openspout/pull/63 tnx

Slamdunk avatar Mar 28 '22 14:03 Slamdunk