Hi, All:
I was importing kind of a CALC document and I wanted to set the
"Height" of a row and the "Width" of a column, The "Width" property
worked fine but the "Height" property didn't work, Could anyone help
me? Thank you very much.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
OUString widthName = CREATE_OUSTRING( "Width" );
Reference< XCellRange > xColumn;
try
{
Reference< XColumnRowRange > xColRowRange(
_xSheet, UNO_QUERY_THROW );
Reference< XTableColumns > xColumns =
xColRowRange->getColumns();
if( xColumns.is() )
xColumn.set( xColumns->getByIndex(
_cellAddress.Column), UNO_QUERY );
Reference< XPropertySet > xPropSet(xColumn,
UNO_QUERY);
xPropSet->setPropertyValue( widthName,
Any(_nColumnWidth*50) );
}
catch( Exception& )
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
OUString heightName = CREATE_OUSTRING( "Height" );
try
{
Reference< XColumnRowRange > xColRowRange(
_xSheet, UNO_QUERY_THROW );
Reference< XTableRows >
xRows(xColRowRange->getRows());
Reference< XCellRange > xRow;
if(xRows.is())
{
xRows->getByIndex(5) >>= xRow;
}
Reference< XPropertySet > xPropSet(xRow,
uno::UNO_QUERY);
xPropSet->setPropertyValue( heightName,
Any(_fRowHeight*50) );
}
catch( Exception& )
{
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]