Exemplo n.º 1
0
void
Sheet::handleDimensions( const BOF & bof,
	Record & record )
{
	if( bof.version() == BOF::BIFF8 )
	{
		int firstRow = 0;
		int lastRow = 0;
		short firstColumn = 0;
		short lastColumn = 0;

		record.dataStream().read( firstRow, 4 );
		record.dataStream().read( lastRow, 4 );
		record.dataStream().read( firstColumn, 2 );
		record.dataStream().read( lastColumn, 2 );

		initCells( lastRow - 1, lastColumn - 1 );
	}
	else
	{
		short firstRow = 0;
		short lastRow = 0;
		short firstColumn = 0;
		short lastColumn = 0;

		record.dataStream().read( firstRow, 2 );
		record.dataStream().read( lastRow, 2 );
		record.dataStream().read( firstColumn, 2 );
		record.dataStream().read( lastColumn, 2 );

		initCells( lastRow - 1, lastColumn - 1 );
	}
}
Exemplo n.º 2
0
void
Sheet::handleLabelSST( Record & record )
{
	short row = 0;
	short column = 0;
	short xfIndex = 0;
	int sstIndex = 0;

	record.dataStream().read( row, 2 );
	record.dataStream().read( column, 2 );
	record.dataStream().read( xfIndex, 2 );
	record.dataStream().read( sstIndex, 4 );

	initCell( row, column );

	m_cells[ row ][ column ].setData( m_sst[ sstIndex ] );
}
Exemplo n.º 3
0
std::vector< std::wstring >
SharedStringTable::parse( Record & record )
{
	int totalStrings = 0;
	int uniqueStrings = 0;

	record.dataStream().read( totalStrings, 4 );
	record.dataStream().read( uniqueStrings, 4 );

	std::vector< std::wstring > sst( uniqueStrings );

	if(MAX_SST_SIZE)
		uniqueStrings = min(MAX_SST_SIZE, uniqueStrings) ;
	for( int i = 0; i < uniqueStrings; ++i )
		sst[ i ] = loadString( record.dataStream(), record.borders() );

	return sst;
}