@@ -247,7 +247,7 @@ public LayoutResult layout(LayoutContext layoutContext) {
247
247
// Cells' up moves occured while split processing
248
248
// key is column number (there can be only one move during one split)
249
249
// value is the previous row number of the cell
250
- Map <Integer , Integer > rowMoves = new HashMap <Integer , Integer >();
250
+ Map <Integer , Integer > rowMoves = new HashMap <>();
251
251
252
252
MarginsCollapseHandler marginsCollapseHandler = null ;
253
253
boolean marginsCollapsingEnabled = Boolean .TRUE .equals (getPropertyAsBoolean (Property .COLLAPSING_MARGINS ));
@@ -687,7 +687,6 @@ public LayoutResult layout(LayoutContext layoutContext) {
687
687
while (0 != cellProcessingQueue .size ()) {
688
688
CellRendererInfo cellInfo = cellProcessingQueue .pop ();
689
689
col = cellInfo .column ;
690
- int rowN = cellInfo .finishRowInd ;
691
690
CellRenderer cell = cellInfo .cellRenderer ;
692
691
float collapsedWithNextRowBorderWidth = null == cell .getBorders ()[2 ] ? 0 : cell .getBorders ()[2 ].getWidth ();
693
692
cell .deleteOwnProperty (Property .BORDER_BOTTOM );
@@ -939,8 +938,8 @@ public LayoutResult layout(LayoutContext layoutContext) {
939
938
logger .warn (LogMessageConstant .CLIP_ELEMENT );
940
939
// Process borders
941
940
if (status == LayoutResult .NOTHING ) {
942
- ArrayList <Border > topBorders = new ArrayList <Border >();
943
- ArrayList <Border > bottomBorders = new ArrayList <Border >();
941
+ ArrayList <Border > topBorders = new ArrayList <>();
942
+ ArrayList <Border > bottomBorders = new ArrayList <>();
944
943
for (int i = 0 ; i < numberOfColumns ; i ++) {
945
944
topBorders .add (borders [0 ]);
946
945
bottomBorders .add (borders [2 ]);
@@ -1015,13 +1014,13 @@ public LayoutResult layout(LayoutContext layoutContext) {
1015
1014
1016
1015
// if table is empty we still need to process table borders
1017
1016
if (0 == childRenderers .size () && null == headerRenderer && null == footerRenderer ) {
1018
- List <Border > topHorizontalBorders = new ArrayList <Border >();
1019
- List <Border > bottomHorizontalBorders = new ArrayList <Border >();
1017
+ List <Border > topHorizontalBorders = new ArrayList <>();
1018
+ List <Border > bottomHorizontalBorders = new ArrayList <>();
1020
1019
for (int i = 0 ; i < numberOfColumns ; i ++) {
1021
1020
bottomHorizontalBorders .add (Border .NO_BORDER );
1022
1021
}
1023
- List <Border > leftVerticalBorders = new ArrayList <Border >();
1024
- List <Border > rightVerticalBorders = new ArrayList <Border >();
1022
+ List <Border > leftVerticalBorders = new ArrayList <>();
1023
+ List <Border > rightVerticalBorders = new ArrayList <>();
1025
1024
1026
1025
// process bottom border of the last added row
1027
1026
if (tableModel .isComplete () && 0 != lastFlushedRowBottomBorder .size ()) {
@@ -1290,41 +1289,12 @@ public void move(float dxRight, float dyUp) {
1290
1289
}
1291
1290
}
1292
1291
1293
- protected float [] calculateScaledColumnWidths (Table tableModel , float tableWidth , float leftBorderWidth , float rightBorderWidth ) {
1294
- float [] scaledWidths = new float [tableModel .getNumberOfColumns ()];
1295
- float widthSum = 0 ;
1296
- float totalPointWidth = 0 ;
1297
- int col ;
1298
- for (col = 0 ; col < tableModel .getNumberOfColumns (); col ++) {
1299
- UnitValue columnUnitWidth = tableModel .getColumnWidth (col );
1300
- float columnWidth ;
1301
- if (columnUnitWidth .isPercentValue ()) {
1302
- columnWidth = tableWidth * columnUnitWidth .getValue () / 100 ;
1303
- scaledWidths [col ] = columnWidth ;
1304
- widthSum += columnWidth ;
1305
- } else {
1306
- totalPointWidth += columnUnitWidth .getValue ();
1307
- }
1308
- }
1309
- float freeTableSpaceWidth = tableWidth - widthSum ;
1310
-
1311
- if (totalPointWidth > 0 ) {
1312
- for (col = 0 ; col < tableModel .getNumberOfColumns (); col ++) {
1313
- float columnWidth ;
1314
- UnitValue columnUnitWidth = tableModel .getColumnWidth (col );
1315
- if (columnUnitWidth .isPointValue ()) {
1316
- columnWidth = (freeTableSpaceWidth / totalPointWidth ) * columnUnitWidth .getValue ();
1317
- scaledWidths [col ] = columnWidth ;
1318
- widthSum += columnWidth ;
1319
- }
1320
- }
1321
- }
1322
-
1323
- for (col = 0 ; col < tableModel .getNumberOfColumns (); col ++) {
1324
- scaledWidths [col ] *= (tableWidth - leftBorderWidth / 2 - rightBorderWidth / 2 ) / widthSum ;
1325
- }
1326
-
1327
- return scaledWidths ;
1292
+ /**
1293
+ * @deprecated Method will be removed in 7.1.
1294
+ */
1295
+ @ Deprecated
1296
+ protected float [] calculateScaledColumnWidths (Table tableModel , float tableWidth ) {
1297
+ return countedColumnWidth ;
1328
1298
}
1329
1299
1330
1300
protected TableRenderer [] split (int row ) {
@@ -1803,7 +1773,7 @@ private void updateFirstRowBorders(int colN) {
1803
1773
1804
1774
// collapse with table border or header bottom borders
1805
1775
private void correctFirstRowTopBorders (Border tableBorder , int colN ) {
1806
- int col = 0 ;
1776
+ int col ;
1807
1777
int row = 0 ;
1808
1778
List <Border > topBorders = horizontalBorders .get (0 );
1809
1779
List <Border > bordersToBeCollapsedWith = null != headerRenderer
0 commit comments