summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-09-12 20:15:01 +0200
committerEike Rathke <erack@redhat.com>2021-09-13 00:39:14 +0200
commit0a9b68c9f9880655576e3220d8b70064b367dbee (patch)
tree3d8eb79df26eaf51db68dfa73ab1abd2e0c061df /sc/source/ui/unoobj
parentdaa1469e3e7bfe840efb6f3fad1bac63a2577e3f (diff)
Resolves: tdf#144135 Rework Sort with area extras
Since commit 774a61afa9fc281290e7bfad4e28c05978b82d73 CommitDate: Wed Apr 14 08:46:03 2021 +0200 tdf#126678 - Consider "Include formats" option during sort a sheet formatted with visible attributes like cell background colour up to the end if for Sort all columns and/or rows are selected lead to an excessive memory allocation and slow execution time if it didn't get killed by the operating system before due to memory exhaustion. The same could had happened already before if graphics or comments were to be included that could had resulted in a similar large range. However, cell formats across sheets are more likely. This changes the strategy how the to be sorted data range is determined (range only with data) and additional area extras ranges without data that are only to be rearranged. Those are then processed in chunks (limited to ~512MB per chunk). Cell formats that are identical within one column's rows range do not even need to be covered as they are not rearranged, in the best case leading to all trailing formats' ranges being excluded from the sort. Additionally optimize the cell gathering of formats, graphics and comments such that for the area extras they are only collected if actually requested. The overall performance gain is in an order of magnitudes even if some extras are to be collected. Change-Id: If3abbaeaa615aaff7d88a82a5b3fc7ac633d770d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122013 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/datauno.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 5a1d8b355d12..fcc2ba5814e6 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -307,7 +307,7 @@ void ScSortDescriptor::FillProperties( uno::Sequence<beans::PropertyValue>& rSeq
pArray[3].Value <<= aFields;
pArray[4].Name = SC_UNONAME_BINDFMT;
- pArray[4].Value <<= rParam.bIncludePattern;
+ pArray[4].Value <<= rParam.aDataAreaExtras.mbCellFormats;
pArray[5].Name = SC_UNONAME_COPYOUT;
pArray[5].Value <<= !rParam.bInplace;
@@ -409,7 +409,7 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
rParam.bCaseSens = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
}
else if (aPropName == SC_UNONAME_BINDFMT)
- rParam.bIncludePattern = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
+ rParam.aDataAreaExtras.mbCellFormats = ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
else if (aPropName == SC_UNONAME_COPYOUT)
rParam.bInplace = !ScUnoHelpFunctions::GetBoolFromAny( rProp.Value );
else if (aPropName == SC_UNONAME_OUTPOS)