poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55385] New: XSSFFont.setBoldweight(short) to 300 but getBoldweight return 400
Date Thu, 08 Aug 2013 01:06:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55385

            Bug ID: 55385
           Summary: XSSFFont.setBoldweight(short) to 300 but getBoldweight
                    return 400
           Product: POI
           Version: 3.10-dev
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: fujian1115@gmail.com

execute the code:

      Workbook workbook = new XSSFWorkbook();
        Sheet createSheet = workbook.createSheet();
        Row row = createSheet.createRow(0);
        Cell cell = row.createCell(0);
        CellStyle cellStyle = workbook.createCellStyle();


        Font createFont = workbook.createFont();
         createFont.setBoldweight((short)300);

        cellStyle.setFont(createFont);
        cell.setCellStyle(cellStyle);

        short fontIndex = cell.getCellStyle().getFontIndex();
        Font fontAt = workbook.getFontAt(fontIndex);
        System.out.println(fontAt.getBoldweight());

the boldweight can't be set to 300. due to :

    public short getBoldweight()
    {
        return getBold() ? BOLDWEIGHT_BOLD : BOLDWEIGHT_NORMAL;
    }




org.apache.poi.xssf.usermodel.XSSFFont.getBoldweight()
is 400 or 700 only. if so, why provide the setBoldweight() to set any short
value?

-- 
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


Mime
View raw message