26 mrSheetLimits(rLimits)
33 : mrSheetLimits(rOther.mrSheetLimits)
35 operator=(std::move(rOther));
40 : mrSheetLimits(rOther.mrSheetLimits)
54 mvData[0].bMarked = bMarked;
73 else if ((
i > 0) && (
mvData[
i - 1].nRow >= nRow))
114 bool bCombined =
false;
124 if (
mvData[ni].bMarked != bMarked )
126 if ( ni == 0 || (
mvData[ni-1].nRow < nStartRow - 1) )
129 if (
mvData[ni].nRow > nEndRow )
134 else if ( ni > 0 &&
mvData[ni-1].nRow == nStartRow - 1 )
137 if ( ni > 0 &&
mvData[ni-1].bMarked == bMarked )
139 mvData[ni-1].nRow = nEndRow;
151 while ( nj <
mvData.size() &&
mvData[nj].nRow <= nEndRow )
155 if ( nj <
mvData.size() &&
mvData[nj].bMarked == bMarked )
159 if (
mvData[ni-1].bMarked == bMarked )
164 else if ( ni == nInsert )
165 mvData[ni-1].nRow = nStartRow - 1;
170 else if ( ni > 0 && ni == nInsert )
171 mvData[ni-1].nRow = nStartRow - 1;
177 mvData[ni].nRow = nEndRow;
178 mvData[ni].bMarked = bMarked;
190 if ( nInsert <=
mvData.size() )
193 mvData.insert(
mvData.begin() + nInsert, { nEndRow, bMarked });
196 mvData.insert(
mvData.begin() + nInsert, 2, { nEndRow, bMarked });
203 mvData[nInsert-1].nRow = nStartRow - 1;
214 mvData = std::move(rMarkEntries);
222 if (
Search( nStartRow, nStartIndex ))
223 if (
mvData[nStartIndex].bMarked)
224 if (
Search( nEndRow, nEndIndex ))
225 if (nEndIndex==nStartIndex)
243 else if (
mvData.size() == 2 )
252 rStartRow =
mvData[0].nRow + 1;
257 else if (
mvData.size() == 3 )
261 rStartRow =
mvData[0].nRow + 1;
282 mvData = std::move(rOther.mvData);
314 assert(
mvData[
nIndex].bMarked &&
"GetMarkEnd without bMarked" );
337 if (rEntry.nRow < nStartRow)
339 rEntry.nRow += nOffset;
356 std::vector<ScMarkEntry> aEntryArray;
357 aEntryArray.reserve(std::max(
mvData.size(), rOther.
mvData.size()));
361 const auto& rEntry =
mvData[
i];
362 const auto& rOtherEntry = rOther.
mvData[j];
364 if (rEntry.bMarked != rOtherEntry.bMarked)
366 if (!rOtherEntry.bMarked)
368 aEntryArray.push_back(rOther.
mvData[j++]);
374 aEntryArray.push_back(
mvData[
i++]);
375 while (j < rOther.
mvData.size() && rOther.
mvData[j].nRow <= rEntry.nRow)
383 if (rEntry.nRow <= rOtherEntry.nRow)
385 aEntryArray.push_back(
mvData[
i++]);
386 if (rEntry.nRow == rOtherEntry.nRow)
391 aEntryArray.push_back(rOther.
mvData[j++]);
396 if (rEntry.nRow <= rOtherEntry.nRow)
398 aEntryArray.push_back(rOther.
mvData[j++]);
404 aEntryArray.push_back(
mvData[
i++]);
405 while (j < rOther.
mvData.size() && rOther.
mvData[j].nRow <= rEntry.nRow)
412 assert((
i ==
mvData.size() || j == rOther.
mvData.size()) &&
"Unexpected case.");
416 aEntryArray.insert(aEntryArray.end(), rOther.
mvData.begin() + j, rOther.
mvData.end());
420 aEntryArray.insert(aEntryArray.end(),
mvData.begin() +
i,
mvData.end());
423 mvData = std::move(aEntryArray);
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
bool Next(SCROW &rTop, SCROW &rBottom)
ScMarkArrayIter(const ScMarkArray *pNewArray)
void reset(const ScMarkArray *pNewArray)
const ScMarkArray * pArray
This is a rather odd datastructure.
SCROW GetNextMarked(SCROW nRow, bool bUp) const
Including current row, may return -1 if bUp and not found.
bool IsAllMarked(SCROW nStartRow, SCROW nEndRow) const
void Shift(SCROW nStartRow, tools::Long nOffset)
ScMarkArray(const ScSheetLimits &rLimits)
SCROW GetMarkEnd(SCROW nRow, bool bUp) const
const ScSheetLimits & mrSheetLimits
void Intersect(const ScMarkArray &rOther)
void Reset(bool bMarked=false, SCSIZE nNeeded=1)
ScMarkArray & operator=(ScMarkArray const &rSource)
void SetMarkArea(SCROW nStartRow, SCROW nEndRow, bool bMarked)
bool GetMark(SCROW nRow) const
bool HasOneMark(SCROW &rStartRow, SCROW &rEndRow) const
bool operator==(ScMarkArray const &rOther) const
std::vector< ScMarkEntry > mvData
bool Search(SCROW nRow, SCSIZE &nIndex) const
void Set(std::vector< ScMarkEntry > &&)
optimised init-from-range-list.
std::vector< std::unique_ptr< SvLinkSource_Entry_Impl > > mvData
SCROW GetMaxRowCount() const
bool ValidRow(SCROW nRow) const
const SCROW mnMaxRow
Maximum addressable column.