/** * <w:gridCol list should be filtered to ignore negative value. * <p> * Ex : <w:gridCol w:w="-54" /> should be ignored. See https://code.google.com/p/xdocreport/issues/detail?id=315 * </p> * * @param grid * @return */ private static List<CTTblGridCol> getGridColList( CTTblGrid grid ) { List<CTTblGridCol> newCols = new ArrayList<CTTblGridCol>(); List<CTTblGridCol> cols = grid.getGridColList(); for ( CTTblGridCol col : cols ) { if ( col.getW().floatValue() >= 0 ) { newCols.add( col ); } } return newCols; }
/** * <w:gridCol list should be filtered to ignore negative value. * <p> * Ex : <w:gridCol w:w="-54" /> should be ignored. See https://code.google.com/p/xdocreport/issues/detail?id=315 * </p> * * @param grid * @return */ private static List<CTTblGridCol> getGridColList( CTTblGrid grid ) { List<CTTblGridCol> newCols = new ArrayList<CTTblGridCol>(); List<CTTblGridCol> cols = grid.getGridColList(); for ( CTTblGridCol col : cols ) { if ( col.getW().floatValue() >= 0 ) { newCols.add( col ); } } return newCols; }
public static float[] computeColWidths( CTTbl table ) { CTTblGrid grid = table.getTblGrid(); List<CTTblGridCol> cols = getGridColList( grid ); int nbColumns = cols.size(); float[] colWidths = new float[nbColumns]; float colWidth = -1; int nbColumnsToIgnoreBefore = 0; for ( int i = nbColumnsToIgnoreBefore; i < colWidths.length; i++ ) { CTTblGridCol tblGridCol = cols.get( i ); colWidth = tblGridCol.getW().floatValue(); colWidths[i] = dxa2points( colWidth ); } return colWidths; }
public static float[] computeColWidths( CTTbl table ) { CTTblGrid grid = table.getTblGrid(); List<CTTblGridCol> cols = getGridColList( grid ); int nbColumns = cols.size(); float[] colWidths = new float[nbColumns]; float colWidth = -1; int nbColumnsToIgnoreBefore = 0; for ( int i = nbColumnsToIgnoreBefore; i < colWidths.length; i++ ) { CTTblGridCol tblGridCol = cols.get( i ); colWidth = tblGridCol.getW().floatValue(); colWidths[i] = dxa2points( colWidth ); } return colWidths; }
colWidth = tblGridCol.getW().floatValue(); colWidths[i] = dxa2points( colWidth );
colWidth = tblGridCol.getW().floatValue(); colWidths[i] = dxa2points( colWidth );
colWidth = tblGridCol.getW().floatValue(); colWidths[i] = dxa2points( colWidth );