Better performance on Excel doc import.

Don't set cached range on every single cell import when loading
Excel document with external ref cache.  This would become a major
performance bottleneck with a document with large cache.
This commit is contained in:
Kohei Yoshida 2010-10-05 21:09:34 -04:00
parent 296baa2fb6
commit d804b40cdf

View file

@ -404,28 +404,28 @@ void XclImpSupbookTab::LoadCachedValues(ScExternalRefCache::TableTypeRef pCacheT
{
bool b = p->GetBool();
ScExternalRefCache::TokenRef pToken(new formula::FormulaDoubleToken(b ? 1.0 : 0.0));
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
case EXC_CACHEDVAL_DOUBLE:
{
double f = p->GetValue();
ScExternalRefCache::TokenRef pToken(new formula::FormulaDoubleToken(f));
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
case EXC_CACHEDVAL_ERROR:
{
double fError = XclTools::ErrorToDouble( p->GetXclError() );
ScExternalRefCache::TokenRef pToken(new formula::FormulaDoubleToken(fError));
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
case EXC_CACHEDVAL_STRING:
{
const String& rStr = p->GetString();
ScExternalRefCache::TokenRef pToken(new formula::FormulaStringToken(rStr));
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken);
pCacheTable->setCell(rAddr.mnCol, rAddr.mnRow, pToken, 0, false);
}
break;
default: