LibreOffice Module sc (master) 1
|
A vector of column splits that supports inserting, removing and moving splits. More...
#include <csvsplits.hxx>
Public Member Functions | |
bool | Insert (sal_Int32 nPos) |
The split container. More... | |
bool | Remove (sal_Int32 nPos) |
Removes a split by position. More... | |
void | RemoveRange (sal_Int32 nPosStart, sal_Int32 nPosEnd) |
Removes a range of splits in the given position range. More... | |
void | Clear () |
Removes all elements from the vector. More... | |
bool | HasSplit (sal_Int32 nPos) const |
Returns true if at position nPos is a split. More... | |
sal_uInt32 | GetIndex (sal_Int32 nPos) const |
Searches for a split at position nPos. More... | |
sal_uInt32 | LowerBound (sal_Int32 nPos) const |
Returns index of the first split greater than or equal to nPos. More... | |
sal_uInt32 | UpperBound (sal_Int32 nPos) const |
Returns index of the last split less than or equal to nPos. More... | |
sal_uInt32 | Count () const |
Returns the number of splits. More... | |
sal_Int32 | GetPos (sal_uInt32 nIndex) const |
Returns the position of the specified split. More... | |
sal_Int32 | operator[] (sal_uInt32 nIndex) const |
Returns the position of the specified split. More... | |
Private Types | |
typedef ::std::vector< sal_Int32 > | ScSplitVector |
typedef ScSplitVector::const_iterator | const_iterator |
Private Member Functions | |
sal_uInt32 | GetIterIndex (const_iterator const &aIter) const |
Returns the vector index of an iterator. More... | |
Private Attributes | |
ScSplitVector | maVec |
A vector of column splits that supports inserting, removing and moving splits.
Definition at line 32 of file csvsplits.hxx.
|
private |
Definition at line 36 of file csvsplits.hxx.
|
private |
Definition at line 35 of file csvsplits.hxx.
void ScCsvSplits::Clear | ( | ) |
Removes all elements from the vector.
Definition at line 61 of file csvsplits.cxx.
References maVec.
Referenced by ScCsvGrid::ImplClearSplits(), load_FixedWidthList(), and ScCsvRuler::RemoveAllSplits().
|
inline |
Returns the number of splits.
Definition at line 68 of file csvsplits.hxx.
References maVec.
Referenced by ScCsvGrid::ApplyLayout(), GetPos(), ScCsvRuler::GetSplitCount(), save_FixedWidthList(), ScCsvGrid::SetColumnStates(), ScCsvGrid::SetSplits(), and UpperBound().
sal_uInt32 ScCsvSplits::GetIndex | ( | sal_Int32 | nPos | ) | const |
Searches for a split at position nPos.
Definition at line 71 of file csvsplits.cxx.
References GetIterIndex(), maVec, and nPos.
Referenced by HasSplit(), and Remove().
|
private |
Returns the vector index of an iterator.
Definition at line 97 of file csvsplits.cxx.
References CSV_VEC_NOTFOUND, and maVec.
Referenced by GetIndex(), and LowerBound().
sal_Int32 ScCsvSplits::GetPos | ( | sal_uInt32 | nIndex | ) | const |
Returns the position of the specified split.
Definition at line 92 of file csvsplits.cxx.
References Count(), CSV_POS_INVALID, maVec, and nIndex.
Referenced by operator[](), and UpperBound().
bool ScCsvSplits::HasSplit | ( | sal_Int32 | nPos | ) | const |
Returns true if at position nPos is a split.
Definition at line 66 of file csvsplits.cxx.
References CSV_VEC_NOTFOUND, GetIndex(), and nPos.
Referenced by ScCsvRuler::EndMouseTracking(), ScCsvRuler::HasSplit(), and ScCsvRuler::MoveMouseTracking().
bool ScCsvSplits::Insert | ( | sal_Int32 | nPos | ) |
The split container.
Inserts a new split at position nPos into the vector.
Definition at line 26 of file csvsplits.cxx.
References maVec, nPos, SAL_MAX_UINT32, and SAL_WARN_IF.
Referenced by ScCsvGrid::ApplyLayout(), ScCsvGrid::ImplClearSplits(), ScCsvGrid::ImplInsertSplit(), ScCsvGrid::ImplSetTextLineSep(), ScCsvRuler::InsertSplit(), load_FixedWidthList(), ScCsvGrid::MoveSplit(), ScCsvRuler::MoveSplit(), and ScCsvGrid::SetSplits().
sal_uInt32 ScCsvSplits::LowerBound | ( | sal_Int32 | nPos | ) | const |
Returns index of the first split greater than or equal to nPos.
Definition at line 77 of file csvsplits.cxx.
References GetIterIndex(), maVec, and nPos.
Referenced by ScCsvRuler::ImplDrawRulerDev(), ScCsvRuler::MoveCursorToSplit(), RemoveRange(), and UpperBound().
|
inline |
Returns the position of the specified split.
Definition at line 73 of file csvsplits.hxx.
bool ScCsvSplits::Remove | ( | sal_Int32 | nPos | ) |
Removes a split by position.
Definition at line 43 of file csvsplits.cxx.
References CSV_VEC_NOTFOUND, GetIndex(), maVec, nIndex, and nPos.
Referenced by ScCsvGrid::ApplyLayout(), ScCsvGrid::ImplRemoveSplit(), ScCsvGrid::ImplSetTextLineSep(), ScCsvGrid::MoveSplit(), ScCsvRuler::MoveSplit(), and ScCsvRuler::RemoveSplit().
void ScCsvSplits::RemoveRange | ( | sal_Int32 | nPosStart, |
sal_Int32 | nPosEnd | ||
) |
Removes a range of splits in the given position range.
Definition at line 53 of file csvsplits.cxx.
References CSV_VEC_NOTFOUND, LowerBound(), maVec, and UpperBound().
Referenced by ScCsvGrid::ApplyLayout().
sal_uInt32 ScCsvSplits::UpperBound | ( | sal_Int32 | nPos | ) | const |
Returns index of the last split less than or equal to nPos.
Definition at line 82 of file csvsplits.cxx.
References Count(), CSV_VEC_NOTFOUND, GetPos(), LowerBound(), nIndex, and nPos.
Referenced by ScCsvGrid::GetColumnFromPos(), ScCsvRuler::ImplDrawRulerDev(), ScCsvRuler::MoveCursorToSplit(), and RemoveRange().
|
private |
Definition at line 38 of file csvsplits.hxx.
Referenced by Clear(), Count(), GetIndex(), GetIterIndex(), GetPos(), Insert(), LowerBound(), Remove(), and RemoveRange().