summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-01-08 18:05:16 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-02-16 11:58:20 +0100
commit1c89de1ffce80e228eafca327d4f90a5c5487e55 (patch)
tree93ae02ba89a9a9d8928f9d8cc5169d1f9f34939c /sc
parentf767b83d1c5493815708135f0f2aec03e47615ac (diff)
tdf#105301 - increase the size of the sorting keys
During the import of a document, increase the number of shown sorting keys to match the actual size accordingly. Change-Id: I24ab596f47fadf33d0358f162d26b12c24615fa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108987 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> (cherry picked from commit 788c777c6cdf2254e8bba05321f4a9de309b15b5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110916
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx3
-rw-r--r--sc/source/ui/unoobj/datauno.cxx5
2 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index f8c2a996bd22..b70b8b591a84 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -82,7 +82,8 @@ ScTabPageSortFields::ScTabPageSortFields(weld::Container* pPage, weld::DialogCon
rArgSet.Get( nWhichSort )).
GetSortData() ),
nFieldCount ( 0 ),
- nSortKeyCount ( DEFSORT ),
+ // show actual size of the sorting keys without limiting them to the default size
+ nSortKeyCount(std::max(aSortData.GetSortKeyCount(), static_cast<sal_uInt16>(DEFSORT))),
bHasHeader ( false ),
bSortByRows ( false )
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 2f2bdae144a4..68c1c2da8cd7 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -320,7 +320,7 @@ void ScSortDescriptor::FillProperties( uno::Sequence<beans::PropertyValue>& rSeq
void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<beans::PropertyValue>& rSeq )
{
- sal_Int16 nSortSize = rParam.GetSortKeyCount();
+ sal_Int32 nSortSize = static_cast<sal_Int32>(rParam.GetSortKeyCount());
for (const beans::PropertyValue& rProp : rSeq)
{
@@ -357,7 +357,8 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const uno::Sequence<b
sal_Int32 i;
if ( nCount > static_cast<sal_Int32>( rParam.GetSortKeyCount() ) )
{
- nCount = nSortSize;
+ // tdf#105301 - increase the size of the sorting keys
+ nSortSize = nCount;
rParam.maKeyState.resize(nCount);
}
const util::SortField* pFieldArray = aSeq.getConstArray();