You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2017/05/05 21:45:03 UTC

[Bug 60184] Saved file that uses a XSSFFont without a specifically set FontFamily won't open in Excel

https://bz.apache.org/bugzilla/show_bug.cgi?id=60184

Greg Woolsey <gw...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gwoolsey@apache.org

--- Comment #8 from Greg Woolsey <gw...@apache.org> ---
I just now found this issue, wish I'd seen it earlier.  I see the problem now.

XSSFFont can be created without a family.  This is what happens when calling
XSSFWorkbook.createFont().  This is fine per the OOXML XSD.

However, XSSFFont.getFamily() creates an empty family element if none exist. 
This is invalid, as the family element is required to have a val attribute.

Further, it's really bad practice for things that are defined as property
getters to have side effects like this.

Since the API's been out there a while, we should maintain backward
compatibility, but I don't like it too much.

I think in the missing element case it should just return 0, the index for
NOT_APPLICABLE, which appears to coincide with "auto" in the spec, but NOT
create a family element.

Better would be a method that returns an instance of the enum or null if not
defined, or NOT_APPLICABLE if null is undesirable.  For now though, I'll just
update to not create the empty element if missing.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org