LibreOffice Module sc (master) 1
Public Member Functions | Private Attributes | Friends | List of all members
ScMarkArray Class Reference

This is a rather odd datastructure. More...

#include <markarr.hxx>

Collaboration diagram for ScMarkArray:
[legend]

Public Member Functions

 ScMarkArray (const ScSheetLimits &rLimits)
 
 ScMarkArray (ScMarkArray &&rArray) noexcept
 
 ScMarkArray (const ScMarkArray &rArray)
 
void Reset (bool bMarked=false, SCSIZE nNeeded=1)
 
bool GetMark (SCROW nRow) const
 
void SetMarkArea (SCROW nStartRow, SCROW nEndRow, bool bMarked)
 
void Set (std::vector< ScMarkEntry > &&)
 optimised init-from-range-list. More...
 
bool IsAllMarked (SCROW nStartRow, SCROW nEndRow) const
 
bool HasOneMark (SCROW &rStartRow, SCROW &rEndRow) const
 
bool HasMarks () const
 
ScMarkArrayoperator= (ScMarkArray const &rSource)
 
ScMarkArrayoperator= (ScMarkArray &&rSource) noexcept
 
bool operator== (ScMarkArray const &rOther) const
 
bool Search (SCROW nRow, SCSIZE &nIndex) const
 
SCROW GetNextMarked (SCROW nRow, bool bUp) const
 Including current row, may return -1 if bUp and not found. More...
 
SCROW GetMarkEnd (SCROW nRow, bool bUp) const
 
void Shift (SCROW nStartRow, tools::Long nOffset)
 
void Intersect (const ScMarkArray &rOther)
 

Private Attributes

const ScSheetLimitsmrSheetLimits
 
std::vector< ScMarkEntrymvData
 

Friends

class ScMarkArrayIter
 
class ScDocument
 

Detailed Description

This is a rather odd datastructure.

We store alternating marked/not-marked entries, and for each entry the range is defined as : [previousEntry.nRow+1, currentEntry.nRow]

Definition at line 43 of file markarr.hxx.

Constructor & Destructor Documentation

◆ ScMarkArray() [1/3]

ScMarkArray::ScMarkArray ( const ScSheetLimits rLimits)

Definition at line 25 of file markarr.cxx.

References Reset().

◆ ScMarkArray() [2/3]

ScMarkArray::ScMarkArray ( ScMarkArray &&  rArray)
noexcept

Definition at line 32 of file markarr.cxx.

◆ ScMarkArray() [3/3]

ScMarkArray::ScMarkArray ( const ScMarkArray rArray)

Definition at line 39 of file markarr.cxx.

References operator=().

Member Function Documentation

◆ GetMark()

bool ScMarkArray::GetMark ( SCROW  nRow) const

◆ GetMarkEnd()

SCROW ScMarkArray::GetMarkEnd ( SCROW  nRow,
bool  bUp 
) const

◆ GetNextMarked()

SCROW ScMarkArray::GetNextMarked ( SCROW  nRow,
bool  bUp 
) const

Including current row, may return -1 if bUp and not found.

Definition at line 286 of file markarr.cxx.

References mrSheetLimits, mvData, nIndex, Search(), and ScSheetLimits::ValidRow().

Referenced by ScMultiSel::GetNextMarked(), ScTable::GetNextMarkedCell(), ScAttrArray::SearchStyle(), and ScMultiSel::SetMarkArea().

◆ HasMarks()

bool ScMarkArray::HasMarks ( ) const
inline

◆ HasOneMark()

bool ScMarkArray::HasOneMark ( SCROW rStartRow,
SCROW rEndRow 
) const

Definition at line 231 of file markarr.cxx.

References ScSheetLimits::mnMaxRow, mrSheetLimits, and mvData.

Referenced by ScMultiSel::HasOneMark().

◆ Intersect()

void ScMarkArray::Intersect ( const ScMarkArray rOther)

Definition at line 351 of file markarr.cxx.

References i, and mvData.

◆ IsAllMarked()

bool ScMarkArray::IsAllMarked ( SCROW  nStartRow,
SCROW  nEndRow 
) const

Definition at line 217 of file markarr.cxx.

References mvData, and Search().

Referenced by ScMultiSel::IsAllMarked().

◆ operator=() [1/2]

ScMarkArray & ScMarkArray::operator= ( ScMarkArray &&  rSource)
noexcept

Definition at line 280 of file markarr.cxx.

References mvData.

◆ operator=() [2/2]

ScMarkArray & ScMarkArray::operator= ( ScMarkArray const &  rSource)

Definition at line 274 of file markarr.cxx.

References mvData.

Referenced by ScMarkArray().

◆ operator==()

bool ScMarkArray::operator== ( ScMarkArray const &  rOther) const

Definition at line 269 of file markarr.cxx.

References mvData.

◆ Reset()

void ScMarkArray::Reset ( bool  bMarked = false,
SCSIZE  nNeeded = 1 
)

Definition at line 45 of file markarr.cxx.

References ScSheetLimits::mnMaxRow, mrSheetLimits, and mvData.

Referenced by ScMultiSel::Clear(), ScMarkArray(), and SetMarkArea().

◆ Search()

bool ScMarkArray::Search ( SCROW  nRow,
SCSIZE nIndex 
) const

Definition at line 58 of file markarr.cxx.

References i, mvData, and nIndex.

Referenced by ScDocument::FillInfo(), GetMark(), GetMarkEnd(), GetNextMarked(), IsAllMarked(), and SetMarkArea().

◆ Set()

void ScMarkArray::Set ( std::vector< ScMarkEntry > &&  rMarkEntries)

optimised init-from-range-list.

Specifically this is optimised for cases where we have very large data columns with lots and lots of ranges.

Definition at line 212 of file markarr.cxx.

References mvData.

◆ SetMarkArea()

void ScMarkArray::SetMarkArea ( SCROW  nStartRow,
SCROW  nEndRow,
bool  bMarked 
)

◆ Shift()

void ScMarkArray::Shift ( SCROW  nStartRow,
tools::Long  nOffset 
)

Definition at line 328 of file markarr.cxx.

References i, ScSheetLimits::mnMaxRow, mrSheetLimits, and mvData.

Referenced by ScMultiSel::ShiftRows().

Friends And Related Function Documentation

◆ ScDocument

friend class ScDocument
friend

Definition at line 49 of file markarr.hxx.

◆ ScMarkArrayIter

friend class ScMarkArrayIter
friend

Definition at line 48 of file markarr.hxx.

Member Data Documentation

◆ mrSheetLimits

const ScSheetLimits& ScMarkArray::mrSheetLimits
private

Definition at line 45 of file markarr.hxx.

Referenced by GetNextMarked(), HasOneMark(), Reset(), SetMarkArea(), and Shift().

◆ mvData

std::vector<ScMarkEntry> ScMarkArray::mvData
private

The documentation for this class was generated from the following files: