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)
 
 ~ScMarkArray ()
 
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 > const &)
 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 44 of file markarr.hxx.

Constructor & Destructor Documentation

ScMarkArray::ScMarkArray ( const ScSheetLimits rLimits)

Definition at line 25 of file markarr.cxx.

References Reset().

ScMarkArray::ScMarkArray ( ScMarkArray &&  rArray)
noexcept

Definition at line 32 of file markarr.cxx.

References operator=().

ScMarkArray::ScMarkArray ( const ScMarkArray rArray)

Definition at line 39 of file markarr.cxx.

References operator=().

ScMarkArray::~ScMarkArray ( )

Definition at line 45 of file markarr.cxx.

Member Function Documentation

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

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

Definition at line 290 of file markarr.cxx.

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

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

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

Definition at line 235 of file markarr.cxx.

References ScSheetLimits::mnMaxRow, mrSheetLimits, and mvData.

Referenced by ScMultiSel::HasOneMark().

void ScMarkArray::Intersect ( const ScMarkArray rOther)

Definition at line 355 of file markarr.cxx.

References assert(), i, and mvData.

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

Definition at line 221 of file markarr.cxx.

References mvData, and Search().

Referenced by ScMultiSel::IsAllMarked().

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

Referenced by ScMarkArray().

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

Definition at line 284 of file markarr.cxx.

References mvData.

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

Definition at line 273 of file markarr.cxx.

References mvData.

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

Definition at line 49 of file markarr.cxx.

References assert(), ScSheetLimits::mnMaxRow, mrSheetLimits, and mvData.

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

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

Definition at line 62 of file markarr.cxx.

References assert(), i, and mvData.

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

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

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 216 of file markarr.cxx.

References mvData.

void ScMarkArray::SetMarkArea ( SCROW  nStartRow,
SCROW  nEndRow,
bool  bMarked 
)
void ScMarkArray::Shift ( SCROW  nStartRow,
tools::Long  nOffset 
)

Definition at line 332 of file markarr.cxx.

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

Referenced by ScMultiSel::ShiftRows().

Friends And Related Function Documentation

friend class ScDocument
friend

Definition at line 50 of file markarr.hxx.

friend class ScMarkArrayIter
friend

Definition at line 49 of file markarr.hxx.

Member Data Documentation

const ScSheetLimits& ScMarkArray::mrSheetLimits
private

Definition at line 46 of file markarr.hxx.

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

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

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