26#include <osl/diagnose.h>
36 nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),
37 aDataAreaExtras(r.aDataAreaExtras),
38 nUserIndex(r.nUserIndex),
39 bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),
40 bNaturalSort(r.bNaturalSort),
43 nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow),
44 maKeyState( r.maKeyState ),
45 aCollatorLocale( r.aCollatorLocale ), aCollatorAlgorithm( r.aCollatorAlgorithm ),
46 nCompatHeader( r.nCompatHeader )
107 sal_uInt16 nLast = 0;
108 sal_uInt16 nOtherLast = 0;
113 while (
maKeyState[nLast++].bDoSort && nLast < nSortSize ) ;
119 while ( rOther.
maKeyState[nOtherLast++].bDoSort && nOtherLast < nSortSize ) ;
123 if ( (nLast == nOtherLast)
147 for ( sal_uInt16
i=0;
i<=nLast && bEqual;
i++ )
158 nCol1(rSub.nCol1),nRow1(rSub.nRow1),nCol2(rSub.nCol2),nRow2(rSub.nRow2),
159 aDataAreaExtras(rOld.aDataAreaExtras),
160 nUserIndex(rSub.nUserIndex),
161 bHasHeader(true),bByRow(true),bCaseSens(rSub.bCaseSens),bNaturalSort(rOld.bNaturalSort),
162 bUserDef(rSub.bUserDef),
164 nDestTab(0),nDestCol(0),nDestRow(0),
165 aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( rOld.aCollatorAlgorithm ),
166 nCompatHeader( rOld.nCompatHeader )
191 bool bDouble =
false;
208 nCol1(nCol),nRow1(rParam.nRow1),nCol2(nCol),nRow2(rParam.nRow2),nUserIndex(0),
209 bHasHeader(rParam.bHasHeader),bByRow(true),bCaseSens(rParam.bCaseSens),
214 nDestTab(0),nDestCol(0),nDestRow(0), nCompatHeader(2)
241 nCol1 = sal::static_int_cast<SCCOL>(
nCol1 + nDifX );
242 nRow1 = sal::static_int_cast<SCROW>(
nRow1 + nDifY );
243 nCol2 = sal::static_int_cast<SCCOL>(
nCol2 + nDifX );
244 nRow2 = sal::static_int_cast<SCROW>(
nRow2 + nDifY );
255 OSL_FAIL(
"MoveToDest, bInplace == TRUE");
267 bool operator() (
const ReorderIndex& r1,
const ReorderIndex& r2 )
const
269 return r1.mnPos2 < r2.mnPos2;
276 ReorderIndex(
SCCOLROW nPos1,
SCCOLROW nPos2 ) : mnPos1(nPos1), mnPos2(nPos2) {}
290 std::vector<ReorderIndex> aBucket;
292 for (
size_t i = 0;
i <
n; ++
i)
296 aBucket.emplace_back(nPos1, nPos2);
299 std::sort(aBucket.begin(), aBucket.end(), ReorderIndex::LessByPos2());
300 std::vector<SCCOLROW> aNew;
302 for (
size_t i = 0;
i <
n; ++
i)
303 aNew.push_back(aBucket[
i].mnPos1);
CAUTION! The following defines must be in the same namespace as the respective type.
ScColorSortMode aColorSortMode
::std::vector< ScSortKeyState > maKeyState
OUString aCollatorAlgorithm
ScSortParam & operator=(const ScSortParam &r)
ScDataAreaExtras aDataAreaExtras
css::lang::Locale aCollatorLocale
bool operator==(const ScSortParam &rOther) const
sal_uInt16 GetSortKeyCount() const
bool bAscending
sort ascending
bool bGroupActive[MAXSUBTOTAL]
active groups
SCCOL nField[MAXSUBTOTAL]
associated field
bool bIncludePattern
sort formats
void reverse()
Reorder the position indices such that it can be used to undo the original reordering.
std::vector< SCCOLROW > maOrderIndices
List of original column / row positions after reordering.
ScRange maSortRange
This sort range already takes into account the presence or absence of header row / column i....
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW