Skip to content

Commit

Permalink
Fix bug: The last page display incorrectly when preivew xtab as PDF(T…
Browse files Browse the repository at this point in the history
…34932)
  • Loading branch information
Gang Liu committed Dec 8, 2010
1 parent 6d839fd commit e282bc7
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 137 deletions.
Expand Up @@ -38,11 +38,6 @@ public class CellArea extends BlockContainerArea implements IContainerArea
protected int columnID = 0;
protected int rowID = 0;

/**
* the row span has been consumed, not including header and footer rows if
* repeat header is true.
*/
private int usedRowSpan = 0;

protected DiagonalInfo diagonalInfo;

Expand Down Expand Up @@ -129,15 +124,6 @@ public void setRowSpan( int rowSpan )
this.rowSpan = rowSpan;
}

public int getUsedRowSpan( )
{
return usedRowSpan;
}

public void setUsedRowSpan( int usedRowSpan )
{
this.usedRowSpan = usedRowSpan;
}

public void close( ) throws BirtException
{
Expand Down
Expand Up @@ -74,7 +74,6 @@ public void setDelta( int delta )
public CellArea cloneArea( )
{
CellArea cloneCell = cell.cloneArea( );
cell.setRowSpan( cell.getRowSpan( ) - cell.getUsedRowSpan( ) + 1 );
return cloneCell;
}

Expand Down
Expand Up @@ -236,6 +236,7 @@ protected void addCaption( String caption ) throws BirtException
captionCell.setMaxAvaWidth( width );
captionCell.initialize( );
captionCell.isDummy = true;
captionCell.setRowSpan( 1 );
captionRow.children.add( captionCell );
BlockTextArea captionText = new BlockTextArea( captionCell, context,
captionLabel );
Expand Down Expand Up @@ -294,7 +295,7 @@ public SplitResult split( int height, boolean force ) throws BirtException
tableResult.setHeight( tableResult.getHeight( ) + h );
}
tableResult.resolveBottomBorder( );
layout.setUnresolvedRow( unresolvedRow );
//layout.setUnresolvedRow( unresolvedRow );
if ( context.isFixedLayout( ) )
{
FixedLayoutPageHintGenerator pageHintGenerator = context
Expand Down Expand Up @@ -455,16 +456,27 @@ protected String getNextRowId( RowArea row )
}


protected boolean setUnresolvedRow = false;

protected void setUnresolvedRow( )
{
if ( !setUnresolvedRow )
{
layout.setUnresolvedRow( unresolvedRow );
setUnresolvedRow = true;
}
}
public void relayoutChildren( ) throws BirtException
{
String nextRowId = null;
if ( layout.unresolvedRow != null )
if ( unresolvedRow != null )
{
nextRowId = this.getNextRowId( layout.unresolvedRow );
nextRowId = this.getNextRowId( unresolvedRow );
}
layout.clear( );
setUnresolvedRow = false;
addRows( this, layout, nextRowId );
layout.mergeUnresolvedRowHint( );
setUnresolvedRow( );
}

protected void addRows( ContainerArea container, TableLayout layout, String rowId)
Expand All @@ -477,7 +489,7 @@ protected void addRows( ContainerArea container, TableLayout layout, String rowI
if ( rowId != null && id != null
&& rowId.equals( id.toUniqueString( ) ) )
{
layout.mergeUnresolvedRowHint( );
setUnresolvedRow( );
}

if ( row.needResolveBorder )
Expand Down

0 comments on commit e282bc7

Please sign in to comment.