better import xlsx heights

don't call UpdateAllRowHeights when IsAdjustHeightEnabled property is set and additionally set manual heights for *all* imported row heights ( same afaics xls import does ) - certainly this improves import ( also see documents attached in i#94028, i#93609 )

Change-Id: Id8aff727587ed4fa19fd0897aaf25b2202737084
This commit is contained in:
Noel Power
2012-06-04 18:00:36 +01:00
parent d59a707f6e
commit 764752f5d8
3 changed files with 1 additions and 23 deletions

View File

@@ -793,8 +793,6 @@ void SheetDataBuffer::applyCellMerging( const CellRangeAddress& rRange )
{
if( const EditTextObject* pEditObj = static_cast< const ScEditCell* >( rDoc.GetCell( rStart ) )->GetData() )
bTextWrap = pEditObj->GetParagraphCount() > 1;
if( bTextWrap )
setManualRowHeight( rStart.Row() );
}
}
}

View File

@@ -342,8 +342,6 @@ public:
@descr Row default formatting is converted directly, other settings
are cached and converted in the finalizeImport() call. */
void setRowModel( const RowModel& rModel );
/** Specifies that the passed row needs to set its height manually. */
void setManualRowHeight( sal_Int32 nRow );
/** Initial conversion before importing the worksheet. */
void initializeWorksheetImport();
@@ -401,7 +399,6 @@ private:
RowModelRangeMap maRowModels; /// Ranges of rows sorted by first row index.
HyperlinkModelList maHyperlinks; /// Cell ranges containing hyperlinks.
ValidationModelList maValidations; /// Cell ranges containing data validation settings.
ValueRangeSet maManualRowHeights; /// Rows that need manual height independent from own settings.
SheetDataBuffer maSheetData; /// Buffer for cell contents and cell formatting.
CondFormatBuffer maCondFormats; /// Buffer for conditional formatting.
CommentsBuffer maComments; /// Buffer for all cell comments in this sheet.
@@ -938,11 +935,6 @@ void WorksheetGlobals::setRowModel( const RowModel& rModel )
lclUpdateProgressBar( mxRowProgress, maUsedArea, nRow );
}
void WorksheetGlobals::setManualRowHeight( sal_Int32 nRow )
{
maManualRowHeights.insert( nRow );
}
void WorksheetGlobals::initializeWorksheetImport()
{
// set default cell style for unused cells
@@ -1236,10 +1228,7 @@ void WorksheetGlobals::convertRows( OutlineLevelVec& orRowLevels,
custom height, otherwise get all rows specified in the class member
maManualRowHeights that are inside the passed row model. */
ValueRangeVector aManualRows;
if( rModel.mbCustomHeight )
aManualRows.push_back( rRowRange );
else
aManualRows = maManualRowHeights.getIntersection( rRowRange );
aManualRows.push_back( rRowRange );
for( ValueRangeVector::const_iterator aIt = aManualRows.begin(), aEnd = aManualRows.end(); aIt != aEnd; ++aIt )
{
PropertySet aPropSet( getRows( *aIt ) );
@@ -1551,11 +1540,6 @@ void WorksheetHelper::setRowModel( const RowModel& rModel )
mrSheetGlob.setRowModel( rModel );
}
void WorksheetHelper::setManualRowHeight( sal_Int32 nRow )
{
mrSheetGlob.setManualRowHeight( nRow );
}
void WorksheetHelper::putValue( const CellAddress& rAddress, double fValue ) const
{
ScAddress aAddress;

View File

@@ -1683,11 +1683,7 @@ void SAL_CALL ScModelObj::setPropertyValue(
bool bOldAdjustHeightEnabled = pDoc->IsAdjustHeightEnabled();
bool bAdjustHeightEnabled = ScUnoHelpFunctions::GetBoolFromAny( aValue );
if( bOldAdjustHeightEnabled != bAdjustHeightEnabled )
{
pDoc->EnableAdjustHeight( bAdjustHeightEnabled );
if( bAdjustHeightEnabled )
pDocShell->UpdateAllRowHeights();
}
}
else if ( aString.EqualsAscii( SC_UNO_ISEXECUTELINKENABLED ) )
{