summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-22 15:28:49 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-23 21:08:24 -0400
commit832bee9aae88c30d2eea4c8fd0765e4a193cbe7b (patch)
tree4010540aba866bbe39d1ce28b298fe68f6975278 /sc/source/ui/docshell
parent94cf534a89634290201141a08e19d156bb3b9a19 (diff)
Update script types of all cells in sort range ahead of time.
To ensure that there is no SC_SCRIPTTYPE_UNKNOWN in the sort range, the presence of which would slow down during AdjustRowHeight(). This only adds a tiny overhead (0.3 second) and cuts the duration of AdjustRowHeight() from 15 seconds to 5 seconds. Change-Id: I145e901225ef1136f53c6f682ffed3902099859c
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 605ba472d91c..de45b1a23372 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -490,6 +490,14 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
WaitObject aWait( rDocShell.GetActiveDialogParent() );
+ // Calculate the script types for all cells in the sort range beforehand.
+ // This will speed up the row height adjustment that takes place after the
+ // sort.
+ pDoc->UpdateScriptTypes(
+ ScAddress(rSortParam.nCol1,rSortParam.nRow1,nTab),
+ rSortParam.nCol2-rSortParam.nCol1+1,
+ rSortParam.nRow2-rSortParam.nRow1+1);
+
bool bRepeatQuery = false; // bestehenden Filter wiederholen?
ScQueryParam aQueryParam;
pDBData->GetQueryParam( aQueryParam );
@@ -651,7 +659,6 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
rDocShell.PostPaint(ScRange(nStartX, nStartY, nTab, nEndX, nEndY, nTab), nPaint);
}
- // AdjustRowHeight( aLocalParam.nRow1, aLocalParam.nRow2, bPaint );
rDocShell.AdjustRowHeight( aLocalParam.nRow1, aLocalParam.nRow2, nTab );
// #i59745# set collected drawing undo actions at sorting undo action