29 : aRowSel(rSheetLimits), mrSheetLimits(rSheetLimits)
47 aRowSel = std::move(rOther.aRowSel);
76 SCROW nRow1 = -1, nRow2 = -1, nRow3 = -1, nRow4 = -1;
81 if ( aResult1 || aResult2 )
83 if ( aResult1 && aResult2 )
85 if ( ( nRow2 + 1 ) < nRow3 )
87 if ( ( nRow4 + 1 ) < nRow1 )
90 auto aRows = std::minmax( { nRow1, nRow2, nRow3, nRow4 } );
91 rStartRow = aRows.first;
92 rEndRow = aRows.second;
122 if ( !bHasMarks1 && !bHasMarks2 )
125 if ( bHasMarks1 && bHasMarks2 )
132 bool bRet = aMultiIter.
GetRangeData( nStartRow, aRowRange );
133 return bRet && aRowRange.
mbValue && aRowRange.
mnRow2 >= nEndRow;
146 if ( bCol1Exists || bCol2Exists )
148 if ( bCol1Exists && bCol2Exists )
150 else if ( bCol1Exists )
167 if ( nRow1 == nRow2 )
175 return ( bUp ? nRow2 : nRow1 );
196 if ( aIter.HasMarks() )
197 aIter.SetMarkArea( nStartRow, nEndRow,
false );
206 SCROW nBeg, nLast = nEndRow;
239 for (
SCCOL nColIter = nEndCol; nColIter >= nStartCol; --nColIter )
250 if (rList.
size() == 0)
254 auto aNewList = rList;
255 std::sort(aNewList.begin(), aNewList.end(),
258 return lhs.
aStart.
Row() < rhs.aStart.Row();
265 for (
const ScRange& rRange : aNewList)
267 SCCOL nStartCol = rRange.aStart.Col();
268 SCROW nStartRow = rRange.aStart.Row();
269 SCCOL nEndCol = rRange.aEnd.Col();
270 SCROW nEndRow = rRange.aEnd.Row();
271 assert( nEndRow >= nStartRow &&
"this method assumes the input data has ranges with endrow>=startrow");
272 assert( nEndCol >= nStartCol &&
"this method assumes the input data has ranges with endcol>=startcol");
277 for (
SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol )
279 auto & rMarkEntries = aMarkEntriesPerCol[nCol];
280 int nEntries = rMarkEntries.size();
281 if (nEntries > 1 && nStartRow >= rMarkEntries[nEntries-2].nRow+1
282 && nStartRow <= rMarkEntries[nEntries-1].nRow+1)
285 rMarkEntries.back().nRow = std::max(nEndRow, rMarkEntries.back().nRow);
291 rMarkEntries.emplace_back(
ScMarkEntry{nStartRow-1,
false});
292 rMarkEntries.emplace_back(
ScMarkEntry{nEndRow,
true});
295 nMaxCol = std::max(nMaxCol, nEndCol);
301 for (
SCCOL nCol = 0; nCol<=nMaxCol; ++nCol)
302 if (!aMarkEntriesPerCol[nCol].empty())
305 aMarkEntriesPerCol[nCol].clear();
319 return ( nLast >= nEndRow );
327 while( aMultiIter.
Next( nTop, nBottom ) )
337 if ( aPair.HasMarks() )
354 for (
SCCOL nSearchPos = nStartCol; nSearchPos < nEndPos; ++nSearchPos)
361 SCCOL nDestCol = nCol;
362 if (nDestCol >= nStartCol)
364 nDestCol += nColOffset;
377 if (!(nColOffset > 0 && nStartCol > 0 && nStartCol < static_cast<SCCOL>(aNewMultiSel.
aMultiSelContainer.size())))
386 rNewCol.Intersect(rPrevPos);
387 if (nStartCol + nColOffset >= static_cast<SCCOL>(aNewMultiSel.
aMultiSelContainer.size()))
396 aPair.Shift(nStartRow, nRowOffset);
413 aMarkArrayIter(nullptr),
420 if (bHasMarks1 && bHasMarks2)
427 while ( aMarkIter.
Next( nTop, nBottom ) )
434 while ( aMarkIter.
Next( nTop, nBottom ) )
458 if ( bRet && !aRowRange.
mbValue )
466 rBottom = aRowRange.
mnRow2;
478 return pRowSegs->getRangeData( nRow, rRowRange);
void SetMarkArea(SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow, bool bMark)
bool HasOneMark(SCROW &rStartRow, SCROW &rEndRow) const
bool HasOneMark(SCCOL nCol, SCROW &rStartRow, SCROW &rEndRow) const
void ShiftRows(SCROW nStartRow, sal_Int32 nRowOffset)
bool IsAllMarked(SCROW nStartRow, SCROW nEndRow) const
MapType aMultiSelContainer
const ScMarkArray * GetMultiSelArray(SCCOL nCol) const
SCROW GetMaxRowCount() const
void SetMarkArea(SCROW nStartRow, SCROW nEndRow, bool bMarked)
ScMarkArrayIter aMarkArrayIter
bool GetRangeData(SCROW nRow, ScFlatBoolRowSegments::RangeData &rRowRange) const
Only to be used by ScMultiSel::IsAllMarked() or otherwise sure that a segment tree is actually used...
bool Next(SCROW &rTop, SCROW &rBottom)
bool Next(SCROW &rTop, SCROW &rBottom)
bool HasMarks(SCCOL nCol) const
ScMultiSelIter(const ScMultiSel &rMultiSel, SCCOL nCol)
ScMultiSel(ScSheetLimits const &)
void Shift(SCROW nStartRow, tools::Long nOffset)
bool GetMark(SCCOL nCol, SCROW nRow) const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
This is a rather odd datastructure.
void ShiftCols(SCCOL nStartCol, sal_Int32 nColOffset)
bool IsRowMarked(SCROW nRow) const
void PutInOrder(T &nStart, T &nEnd)
void Reset(bool bMarked=false, SCSIZE nNeeded=1)
SCCOL GetMultiSelectionCount() const
const SCROW mnMaxRow
Maximum addressable column.
SCROW GetNextMarked(SCCOL nCol, SCROW nRow, bool bUp) const
SCROW GetMarkEnd(SCROW nRow, bool bUp) const
std::unique_ptr< ScFlatBoolRowSegments > pRowSegs
bool HasEqualRowsMarked(SCCOL nCol1, SCCOL nCol2) const
const ScMarkArray & GetRowSelArray() const
ScMultiSel & operator=(const ScMultiSel &rMultiSel)
void MarkAllCols(SCROW nStartRow, SCROW nEndRow)
ScMarkArray GetMarkArray(SCCOL nCol) const
bool IsRowRangeMarked(SCROW nStartRow, SCROW nEndRow) const
bool IsAllMarked(SCCOL nCol, SCROW nStartRow, SCROW nEndRow) const
void reset(const ScMarkArray *pNewArray)
bool GetMark(SCROW nRow) const
void Set(ScRangeList const &)
optimised init-from-range-list.
const ScSheetLimits & mrSheetLimits
SCROW GetNextMarked(SCROW nRow, bool bUp) const
Including current row, may return -1 if bUp and not found.