26 #include <osl/diagnose.h>
36 nCol1(r.nCol1),nRow1(r.nRow1),nCol2(r.nCol2),nRow2(r.nRow2),nUserIndex(r.nUserIndex),
37 bHasHeader(r.bHasHeader),bByRow(r.bByRow),bCaseSens(r.bCaseSens),
38 bNaturalSort(r.bNaturalSort),bIncludeComments(r.bIncludeComments),
39 bIncludeGraphicObjects(r.bIncludeGraphicObjects),bUserDef(r.bUserDef),
40 bIncludePattern(r.bIncludePattern),bInplace(r.bInplace),
41 nDestTab(r.nDestTab),nDestCol(r.nDestCol),nDestRow(r.nDestRow),
42 maKeyState( r.maKeyState ),
43 aCollatorLocale( r.aCollatorLocale ), aCollatorAlgorithm( r.aCollatorAlgorithm ),
44 nCompatHeader( r.nCompatHeader )
105 sal_uInt16 nLast = 0;
106 sal_uInt16 nOtherLast = 0;
111 while (
maKeyState[nLast++].bDoSort && nLast < nSortSize ) ;
117 while ( rOther.
maKeyState[nOtherLast++].bDoSort && nOtherLast < nSortSize ) ;
121 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),nUserIndex(rSub.nUserIndex),
159 bHasHeader(true),bByRow(true),bCaseSens(rSub.bCaseSens),bNaturalSort(rOld.bNaturalSort),
160 bIncludeComments(rOld.bIncludeComments),bIncludeGraphicObjects(rOld.bIncludeGraphicObjects),
161 bUserDef(rSub.bUserDef),bIncludePattern(rSub.bIncludePattern),
163 nDestTab(0),nDestCol(0),nDestRow(0),
164 aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( rOld.aCollatorAlgorithm ),
165 nCompatHeader( rOld.nCompatHeader )
186 bool bDouble =
false;
202 nCol1(nCol),nRow1(rParam.nRow1),nCol2(nCol),nRow2(rParam.nRow2),nUserIndex(0),
203 bHasHeader(rParam.bHasHeader),bByRow(true),bCaseSens(rParam.bCaseSens),
204 bNaturalSort(false),bIncludeComments(false),bIncludeGraphicObjects(true),
206 bUserDef(false),bIncludePattern(false),
208 nDestTab(0),nDestCol(0),nDestRow(0), nCompatHeader(2)
232 nCol1 = sal::static_int_cast<
SCCOL>( nCol1 + nDifX );
233 nRow1 = sal::static_int_cast<
SCROW>( nRow1 + nDifY );
234 nCol2 = sal::static_int_cast<
SCCOL>( nCol2 + nDifX );
235 nRow2 = sal::static_int_cast<
SCROW>( nRow2 + nDifY );
246 OSL_FAIL(
"MoveToDest, bInplace == TRUE");
258 bool operator() (
const ReorderIndex& r1,
const ReorderIndex& r2 )
const
260 return r1.mnPos2 < r2.mnPos2;
267 ReorderIndex(
SCCOLROW nPos1,
SCCOLROW nPos2 ) : mnPos1(nPos1), mnPos2(nPos2) {}
281 std::vector<ReorderIndex> aBucket;
283 for (
size_t i = 0;
i < n; ++
i)
287 aBucket.emplace_back(nPos1, nPos2);
290 std::sort(aBucket.begin(), aBucket.end(), ReorderIndex::LessByPos2());
291 std::vector<SCCOLROW> aNew;
293 for (
size_t i = 0;
i < n; ++
i)
294 aNew.push_back(aBucket[
i].mnPos1);
::std::vector< ScSortKeyState > maKeyState
bool bGroupActive[MAXSUBTOTAL]
active groups
SCCOL nField[MAXSUBTOTAL]
associated field
css::lang::Locale aCollatorLocale
ScSortParam & operator=(const ScSortParam &r)
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
bool bIncludeGraphicObjects
bool operator==(const ScSortParam &rOther) const
std::vector< SCCOLROW > maOrderIndices
List of original column / row positions after reordering.
void reverse()
Reorder the position indices such that it can be used to undo the original reordering.
sal_uInt16 GetSortKeyCount() const
OUString aCollatorAlgorithm
bool bAscending
sort ascending