summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-22 16:29:14 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-23 21:08:24 -0400
commitd053d40e86381cc4e7c7249e66530f5f4323b514 (patch)
treeb10a25ab30db27d5bb294350ee214e9e1efec2bf /sc/source/ui/docshell
parent832bee9aae88c30d2eea4c8fd0765e4a193cbe7b (diff)
Skip adjustment of row height when all rows have the same height.
Change-Id: I490ecade6b909bcf36b848c05e198d58adc90e0a
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index de45b1a23372..deaf24481a34 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -490,13 +490,19 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
WaitObject aWait( rDocShell.GetActiveDialogParent() );
+ SCROW nStartRow = aLocalParam.nRow1 + (aLocalParam.bHasHeader ? 1 : 0);
+
// 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);
+ ScAddress(aLocalParam.nCol1,nStartRow,nTab),
+ aLocalParam.nCol2-aLocalParam.nCol1+1,
+ aLocalParam.nRow2-nStartRow+1);
+
+ // No point adjusting row heights after the sort when all rows have the same height.
+ bool bUniformRowHeight =
+ pDoc->HasUniformRowHeight(nTab, nStartRow, aLocalParam.nRow2);
bool bRepeatQuery = false; // bestehenden Filter wiederholen?
ScQueryParam aQueryParam;
@@ -632,8 +638,9 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
}
}
- ScRange aDirtyRange( aLocalParam.nCol1, aLocalParam.nRow1, nTab,
- aLocalParam.nCol2, aLocalParam.nRow2, nTab );
+ ScRange aDirtyRange(
+ aLocalParam.nCol1, nStartRow, nTab,
+ aLocalParam.nCol2, aLocalParam.nRow2, nTab);
pDoc->SetDirty( aDirtyRange );
if (bPaint)
@@ -659,7 +666,8 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
rDocShell.PostPaint(ScRange(nStartX, nStartY, nTab, nEndX, nEndY, nTab), nPaint);
}
- rDocShell.AdjustRowHeight( aLocalParam.nRow1, aLocalParam.nRow2, nTab );
+ if (!bUniformRowHeight)
+ rDocShell.AdjustRowHeight(nStartRow, aLocalParam.nRow2, nTab);
// #i59745# set collected drawing undo actions at sorting undo action
if( pUndoAction && pDrawLayer )