File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
itext/itext.layout/itext/layout/renderer Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -598,8 +598,7 @@ private void CalculateMinMaxWidths() {
598
598
float [ ] minWidths = new float [ numberOfColumns ] ;
599
599
float [ ] maxWidths = new float [ numberOfColumns ] ;
600
600
foreach ( TableWidths . CellInfo cell in cells ) {
601
- // Why we need it? Header/Footer?
602
- cell . GetCell ( ) . SetParent ( tableRenderer ) ;
601
+ cell . SetParent ( tableRenderer ) ;
603
602
MinMaxWidth minMax = cell . GetCell ( ) . GetMinMaxWidth ( MinMaxWidthUtils . GetMax ( ) ) ;
604
603
float [ ] indents = GetCellBorderIndents ( cell ) ;
605
604
minMax . SetAdditionalWidth ( minMax . GetAdditionalWidth ( ) + indents [ 1 ] / 2 + indents [ 3 ] / 2 ) ;
@@ -883,6 +882,20 @@ public override String ToString() {
883
882
}
884
883
return str ;
885
884
}
885
+
886
+ public virtual void SetParent ( TableRenderer tableRenderer ) {
887
+ if ( region == HEADER ) {
888
+ cell . SetParent ( tableRenderer . headerRenderer ) ;
889
+ }
890
+ else {
891
+ if ( region == FOOTER ) {
892
+ cell . SetParent ( tableRenderer . footerRenderer ) ;
893
+ }
894
+ else {
895
+ cell . SetParent ( tableRenderer ) ;
896
+ }
897
+ }
898
+ }
886
899
}
887
900
//endregion
888
901
}
You can’t perform that action at this time.
0 commit comments