diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-01-08 18:05:16 +0100 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2021-02-12 22:34:13 +0100 |
commit | 788c777c6cdf2254e8bba05321f4a9de309b15b5 (patch) | |
tree | d143e59a6a62d916972415106fd80f76e3b43e84 /sc | |
parent | 28555fc345ac2ccdda0e4e0f3c812c646befe68b (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>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/datauno.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 4b37477b5c30..c0b84d022274 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 7d7876601709..8e8e54536037 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -321,7 +321,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) { @@ -358,7 +358,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(); |