@@ -667,19 +667,20 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
667667 if ( 1 == minRowspan ) {
668668 // Here we use the same cell, but create a new renderer which doesn't have any children,
669669 // therefore it won't have any content.
670- Cell overflowCell = ( ( Cell ) currentRow [ col ] . GetModelElement ( ) ) . Clone ( true ) ;
670+ CellRenderer overflowCell = ( CellRenderer ) ( ( Cell ) currentRow [ col ] . GetModelElement ( ) ) . Clone ( true ) . GetRenderer
671+ ( ) ;
671672 // we will change properties
672- CellRenderer originalCellRenderer = currentRow [ col ] ;
673+ overflowCell . SetParent ( this ) ;
674+ overflowCell . DeleteProperty ( Property . HEIGHT ) ;
675+ overflowCell . DeleteProperty ( Property . MIN_HEIGHT ) ;
676+ overflowCell . DeleteProperty ( Property . MAX_HEIGHT ) ;
677+ overflowRows . SetCell ( 0 , col , null ) ;
678+ overflowRows . SetCell ( targetOverflowRowIndex [ col ] - row , col , overflowCell ) ;
673679 currentRow [ col ] . isLastRendererForModelElement = false ;
674680 childRenderers . Add ( currentRow [ col ] ) ;
681+ CellRenderer originalCell = currentRow [ col ] ;
675682 currentRow [ col ] = null ;
676- rows [ targetOverflowRowIndex [ col ] ] [ col ] = originalCellRenderer ;
677- overflowRows . SetCell ( 0 , col , null ) ;
678- overflowRows . SetCell ( targetOverflowRowIndex [ col ] - row , col , ( CellRenderer ) overflowCell . GetRenderer ( ) . SetParent
679- ( this ) ) ;
680- overflowRows . GetCell ( targetOverflowRowIndex [ col ] - row , col ) . DeleteProperty ( Property . HEIGHT ) ;
681- overflowRows . GetCell ( targetOverflowRowIndex [ col ] - row , col ) . DeleteProperty ( Property . MIN_HEIGHT ) ;
682- overflowRows . GetCell ( targetOverflowRowIndex [ col ] - row , col ) . DeleteProperty ( Property . MAX_HEIGHT ) ;
683+ rows [ targetOverflowRowIndex [ col ] ] [ col ] = originalCell ;
683684 }
684685 else {
685686 childRenderers . Add ( currentRow [ col ] ) ;
@@ -688,15 +689,20 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
688689 for ( ; i < row + minRowspan && i + 1 < rows . Count && splitResult [ 1 ] . rows [ i + 1 - row ] [ col ] != null ; i ++ ) {
689690 overflowRows . SetCell ( i - row , col , splitResult [ 1 ] . rows [ i + 1 - row ] [ col ] ) ;
690691 overflowRows . SetCell ( i + 1 - row , col , null ) ;
692+ rows [ i ] [ col ] = rows [ i + 1 ] [ col ] ;
693+ rows [ i + 1 ] [ col ] = null ;
691694 }
692695 // the number of cells behind is less then minRowspan-1
693696 // so we should process the last cell in the column as in the case 1 == minRowspan
694697 if ( i != row + minRowspan - 1 && null != rows [ i ] [ col ] ) {
695- Cell overflowCell = ( ( Cell ) rows [ i ] [ col ] . GetModelElement ( ) ) ;
696- overflowRows . GetCell ( i - row , col ) . isLastRendererForModelElement = false ;
698+ CellRenderer overflowCell = ( CellRenderer ) ( ( Cell ) rows [ i ] [ col ] . GetModelElement ( ) ) . GetRenderer ( ) . SetParent ( this
699+ ) ;
700+ rows [ i ] [ col ] . isLastRendererForModelElement = false ;
697701 overflowRows . SetCell ( i - row , col , null ) ;
698- overflowRows . SetCell ( targetOverflowRowIndex [ col ] - row , col , ( CellRenderer ) overflowCell . GetRenderer ( ) . SetParent
699- ( this ) ) ;
702+ overflowRows . SetCell ( targetOverflowRowIndex [ col ] - row , col , overflowCell ) ;
703+ CellRenderer originalCell = rows [ i ] [ col ] ;
704+ rows [ i ] [ col ] = null ;
705+ rows [ targetOverflowRowIndex [ col ] ] [ col ] = originalCell ;
700706 }
701707 }
702708 overflowRows . GetCell ( targetOverflowRowIndex [ col ] - row , col ) . occupiedArea = cellOccupiedArea ;
0 commit comments