Kaydet (Commit) 947177a5 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#74555: Avoid excessive calls to GetPreviewCellStyle().

GetOptimalHeight() gets called *all the time* and is very performance
sensitive.  Let's not do an expensive operation such as GetPreviewCellStyle()
which slows down pretty much everything else after the non-default font is
applied.

Change-Id: I5d5b2e706dd5dd98173044642b98ccaedd9536f0
üst 2ecc1964
......@@ -767,15 +767,6 @@ void ScColumn::GetOptimalHeight(
::boost::ptr_vector<ScPatternAttr> aAltPatterns;
while ( pPattern )
{
// GetOptimalHeight called for preview style needs to
// use really use the style
if ( ScStyleSheet* pStyle = pDocument->GetPreviewCellStyle( nCol, nStartRow, nTab ) )
{
aAltPatterns.push_back( new ScPatternAttr( *pPattern ) );
ScPatternAttr* pModifiedPatt = &aAltPatterns.back();
pModifiedPatt->SetStyleSheet( pStyle );
pPattern = pModifiedPatt;
}
const ScMergeAttr* pMerge = (const ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE);
const ScMergeFlagAttr* pFlag = (const ScMergeFlagAttr*)&pPattern->GetItem(ATTR_MERGE_FLAG);
if ( pMerge->GetRowMerge() > 1 || pFlag->IsOverlapped() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment