[Libreoffice-commits] core.git: sc/source
Supreme Aryal
supremearyal at gmail.com
Fri Dec 5 08:56:29 PST 2014
sc/source/core/data/table3.cxx | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit c50d8bf596f527bb53b86dd04da652ed72f2c549
Author: Supreme Aryal <supremearyal at gmail.com>
Date: Thu Dec 4 02:14:06 2014 -0500
Fix high memory usage when sorting cells in Calc. (fdo#81501)
Empty columns were being unnecessarily included in the sorting
range which caused extra allocation. This happens when you select
the entire sheet to sort. There was already code to skip empty
trailing cells in rows but not to skip empty columns.
Change-Id: Ieac22647bb13165cbf66cb1a93f567e5169fff6a
Reviewed-on: https://gerrit.libreoffice.org/13294
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 5ee2ada..1a2a518 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1542,6 +1542,8 @@ void ScTable::Sort(
if (rSortParam.bByRow)
{
+ while (aSortParam.nCol2 > aSortParam.nCol1 && aCol[aSortParam.nCol2].IsEmptyData())
+ --aSortParam.nCol2;
SCROW nLastRow = 0;
for (SCCOL nCol = aSortParam.nCol1; nCol <= aSortParam.nCol2; nCol++)
nLastRow = std::max(nLastRow, aCol[nCol].GetLastDataPos());
More information about the Libreoffice-commits
mailing list