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() {
598598 float [ ] minWidths = new float [ numberOfColumns ] ;
599599 float [ ] maxWidths = new float [ numberOfColumns ] ;
600600 foreach ( TableWidths . CellInfo cell in cells ) {
601- // Why we need it? Header/Footer?
602- cell . GetCell ( ) . SetParent ( tableRenderer ) ;
601+ cell . SetParent ( tableRenderer ) ;
603602 MinMaxWidth minMax = cell . GetCell ( ) . GetMinMaxWidth ( MinMaxWidthUtils . GetMax ( ) ) ;
604603 float [ ] indents = GetCellBorderIndents ( cell ) ;
605604 minMax . SetAdditionalWidth ( minMax . GetAdditionalWidth ( ) + indents [ 1 ] / 2 + indents [ 3 ] / 2 ) ;
@@ -883,6 +882,20 @@ public override String ToString() {
883882 }
884883 return str ;
885884 }
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+ }
886899 }
887900 //endregion
888901 }
You can’t perform that action at this time.
0 commit comments