Bug 197929 Fail to preview document from BIRT2.1.3 in BIRT2.2.1[0900]
Description: Fail to preview document from BIRT2.1.3 in BIRT2.2.1 in pdf format with frameset servlet Build number:2.2.1.v20070726 Steps to reproduce: 1. Preview attached document in web viewer. 2. Click Print As PDF button. Expected result: Display content in pdf. Actual result: damanged file. Error log:n/a
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/ir/EngineIRReader.java
}
		
		PageSetupDesign pageSetup = reportDesign.getPageSetup( );
		int masterPageCount = IOUtil.readInt( dis );
		for ( int i = 0; i < masterPageCount; i++ )
		{
			SimpleMasterPageDesign masterPage = (SimpleMasterPageDesign) readDesign( dis );
			pageSetup.addMasterPage( masterPage );
		}
		
		int count = IOUtil.readInt( dis );
		for ( int i = 0; i < count; i++ )
		{
			ReportItemDesign item = (ReportItemDesign) readDesign( dis );
			reportDesign.addContent( item );
		}
		return reportDesign;
	}
	public void link( Report report, ReportDesignHandle handle )
	{
		new ReportItemVisitor( handle, report ).link( );
	}
	protected Object readDesign( DataInputStream in ) throws IOException
	{
		
		short designType = IOUtil.readShort( in );
		byte[] buffer = IOUtil.readBytes( in );
		DataInputStream dis = new DataInputStream( new ByteArrayInputStream(
				buffer ) );
		switch ( designType )