https://bz.apache.org/bugzilla/show_bug.cgi?id=55385
--- Comment #2 from Javen O'Neal <[email protected]> --- Looking at XSSFFont.setBoldweight(short boldweight), it looks like getBoldweight and setBoldweight were never intended to be used with literals--only the Font.BOLDWEIGHT_NORMAL and Font.BOLDWEIGHT_BOLD constants. [1] Your example can be simplified to: Workbook wb = new XSSFWorkbook(); Font font = wb.createFont(); short weight = 314; assumeTrue(weight != Font.BOLDWEIGHT_NORMAL); assumeTrue(weight != Font.BOLDWEIGHT_BOLD); font.setBoldweight(weight); assertEquals(weight, font.getBoldweight); The XSSFFont never stores the requested boldweight. If the OOXML format allows specifying a numeric weight in addition to a boolean bold/not-bold value, then this is a bug in POI. >From what I can make out in the 2006 OOXML schema, custom font weights are not part of the standard. sml-styles.xsd: <xsd:complexType name="CT_Font"> <xsd:choice maxOccurs="unbounded"> ... <xsd:element name="b" type="CT_BooleanProperty" minOccurs="0" maxOccurs="1"> <xsd:annotation> <xsd:documentation>Bold</xsd:documentation> </xsd:annotation> </xsd:element> ... </xsd:choice> </xsd:complexType> A note should be added to XSSFFont.get/setBoldweight javadocs that only the named constants will work. [1] https://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFont.java?revision=1701134&view=markup#l300 -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
