LibreOffice Module sc (master) 1
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
XclExpRecordList< RecType > Class Template Reference

A list of Excel record objects. More...

#include <xerecord.hxx>

Inheritance diagram for XclExpRecordList< RecType >:
[legend]
Collaboration diagram for XclExpRecordList< RecType >:
[legend]

Public Types

typedef rtl::Reference< RecType > RecordRefType
 

Public Member Functions

bool IsEmpty () const
 
size_t GetSize () const
 
bool HasRecord (size_t nPos) const
 Returns true, if the passed index points to an exiting record. More...
 
RecType * GetRecord (size_t nPos) const
 Returns reference to an existing record or empty reference on error. More...
 
RecType * GetFirstRecord () const
 Returns reference to the first existing record or empty reference, if list is empty. More...
 
RecType * GetLastRecord () const
 Returns reference to the last existing record or empty reference, if list is empty. More...
 
void InsertRecord (RecType *pRec, size_t nPos)
 Inserts a record at the specified position into the list. More...
 
void InsertRecord (RecordRefType pRec, size_t nPos)
 
void AppendRecord (RecType *pRec)
 Appends a record to the list. More...
 
void AppendRecord (const RecordRefType &xRec)
 
void AppendRecord (RecordRefType xRec) &&
 
void ReplaceRecord (RecType *pRec, size_t nPos)
 Replaces the record at the specified position from the list with the passed record. More...
 
void ReplaceRecord (RecordRefType const &xRec, size_t nPos)
 
void AppendNewRecord (RecType *pRec)
 Appends a newly created record to the list. More...
 
void AppendNewRecord (RecordRefType const &xRec)
 
void AppendNewRecord (RecordRefType xRec) &&
 
void RemoveRecord (size_t nPos)
 Removes the record at the specified position from the list. More...
 
void RemoveAllRecords ()
 Removes all records from the list. More...
 
virtual void Save (XclExpStream &rStrm) override
 Writes the complete record list. More...
 
virtual void SaveXml (XclExpXmlStream &rStrm) override
 
void InvalidateRecord (size_t nPos)
 Optimization for repeated removal. More...
 
void RemoveInvalidatedRecords ()
 
- Public Member Functions inherited from XclExpRecordBase
 XclExpRecordBase ()
 
 XclExpRecordBase (XclExpRecordBase const &)
 
 XclExpRecordBase (XclExpRecordBase &&)
 
XclExpRecordBaseoperator= (XclExpRecordBase const &)
 
XclExpRecordBaseoperator= (XclExpRecordBase &&) noexcept
 
virtual ~XclExpRecordBase ()
 
virtual void Save (XclExpStream &rStrm)
 Overwrite this method to do any operation while saving the record. More...
 
virtual void SaveXml (XclExpXmlStream &rStrm)
 
- Public Member Functions inherited from salhelper::SimpleReferenceObject
 SimpleReferenceObject ()
 
void acquire ()
 
void release ()
 

Private Types

typedef ::std::vector< RecordRefTypeRecordVec
 

Private Attributes

RecordVec maRecs
 

Additional Inherited Members

- Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static void * operator new (std::size_t nSize)
 
static void * operator new (std::size_t nSize, std::nothrow_t const &rNothrow)
 
static void operator delete (void *pPtr)
 
static void operator delete (void *pPtr, std::nothrow_t const &rNothrow)
 
- Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
 
- Protected Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount m_nCount
 

Detailed Description

template<typename RecType = XclExpRecordBase>
class XclExpRecordList< RecType >

A list of Excel record objects.

Provides saving the compete list. This class is derived from XclExpRecordBase, so it can be used as record in another record list. Requires RecType::Save( XclExpStream& ).

Definition at line 321 of file xerecord.hxx.

Member Typedef Documentation

◆ RecordRefType

template<typename RecType = XclExpRecordBase>
typedef rtl::Reference< RecType > XclExpRecordList< RecType >::RecordRefType

Definition at line 324 of file xerecord.hxx.

◆ RecordVec

template<typename RecType = XclExpRecordBase>
typedef ::std::vector< RecordRefType > XclExpRecordList< RecType >::RecordVec
private

Definition at line 404 of file xerecord.hxx.

Member Function Documentation

◆ AppendNewRecord() [1/3]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::AppendNewRecord ( RecordRefType const &  xRec)
inline

Definition at line 363 of file xerecord.hxx.

References XclExpRecordList< RecType >::AppendNewRecord().

◆ AppendNewRecord() [2/3]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::AppendNewRecord ( RecordRefType  xRec) &&
inline

Definition at line 365 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

◆ AppendNewRecord() [3/3]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::AppendNewRecord ( RecType *  pRec)
inline

◆ AppendRecord() [1/3]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::AppendRecord ( const RecordRefType xRec)
inline

Definition at line 350 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

◆ AppendRecord() [2/3]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::AppendRecord ( RecordRefType  xRec) &&
inline

Definition at line 352 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

◆ AppendRecord() [3/3]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::AppendRecord ( RecType *  pRec)
inline

◆ GetFirstRecord()

template<typename RecType = XclExpRecordBase>
RecType * XclExpRecordList< RecType >::GetFirstRecord ( ) const
inline

Returns reference to the first existing record or empty reference, if list is empty.

Definition at line 336 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

Referenced by XclExpChAxesSet::GetFirstTypeGroup(), and XclExpRow::GetFirstUsedXclCol().

◆ GetLastRecord()

template<typename RecType = XclExpRecordBase>
RecType * XclExpRecordList< RecType >::GetLastRecord ( ) const
inline

Returns reference to the last existing record or empty reference, if list is empty.

Definition at line 339 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

Referenced by XclExpRow::Finalize(), XclExpRow::GetFirstFreeXclCol(), and XclExpChAxesSet::GetLastTypeGroup().

◆ GetRecord()

template<typename RecType = XclExpRecordBase>
RecType * XclExpRecordList< RecType >::GetRecord ( size_t  nPos) const
inline

Returns reference to an existing record or empty reference on error.

Definition at line 333 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs, and nPos.

Referenced by XclExpPivotCache::AddGroupFields(), XclExpXFBuffer::AppendXFIndex(), XclExpChAxesSet::Convert(), XclExpChTypeGroup::ConvertCategSequence(), XclExpTableopBuffer::CreateOrExtendTableop(), XclExpPivotTableManager::CreatePivotCache(), ExcAutoFilterRecs::ExcAutoFilterRecs(), XclExpPivotTable::Finalize(), XclExpXFBuffer::Finalize(), XclExpTableopBuffer::Finalize(), XclExpRow::Finalize(), XclExpColinfoBuffer::Finalize(), XclExpFontBuffer::Find(), XclExpNameManagerImpl::FindBuiltInNameIdx(), XclExpXFBuffer::FindXF(), XclExpFontBuffer::GetAppFontData(), ExcAutoFilterRecs::GetByCol(), XclExpPivotCache::GetField(), XclExpPivotTable::GetField(), XclExpPivotTable::GetFieldAcc(), XclExpFontBuffer::GetFont(), XclExpPCField::GetItem(), XclExtLst::GetItem(), XclExpPTField::GetItemAcc(), XclExpPCField::GetItemIndex(), XclExpPTField::GetItemIndex(), XclExpNameManagerImpl::GetName(), XclExpNameManagerImpl::GetUnusedName(), XclExpXFBuffer::GetXFById(), XclExpRow::InsertCell(), XclExpXFBuffer::InsertCellXF(), XclExpXFBuffer::InsertDefaultRecords(), XclExpNameManagerImpl::InsertMacroCall(), XclExpPCField::InsertOrigBoolItem(), XclExpPCField::InsertOrigDateTimeItem(), XclExpPCField::InsertOrigDoubleItem(), XclExpPCField::InsertOrigTextItem(), XclExpNameManagerImpl::InsertRawName(), XclExpXFBuffer::InsertStyleXF(), ExcAutoFilterRecs::IsFiltered(), lcl_GetCellCounts(), XclExpDval::Save(), XclExpComments::SaveXml(), XclExpXFBuffer::SaveXml(), XclExpDval::SearchOrCreateDv(), ExcDocument::Write(), XclExpPivotTableManager::WritePivotTables(), XclExpPivotTable::WriteSxdiList(), XclExpPivotCache::WriteSxindexlistList(), XclExpPivotTable::WriteSxpi(), and ExcDocument::WriteXml().

◆ GetSize()

template<typename RecType = XclExpRecordBase>
size_t XclExpRecordList< RecType >::GetSize ( ) const
inline

Definition at line 327 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

Referenced by XclExpNameManagerImpl::Append(), XclExpXFBuffer::AppendBuiltInXF(), XclExpRow::AppendCell(), XclExpXFBuffer::AppendXFIndex(), XclExpChAxesSet::Convert(), XclExpChTypeGroup::ConvertCategSequence(), XclExpNameManagerImpl::CreateName(), XclExpTableopBuffer::CreateOrExtendTableop(), XclExpPivotTableManager::CreatePivotCache(), XclExpChChart::CreateSeries(), ExcAutoFilterRecs::ExcAutoFilterRecs(), XclExpPCField::Finalize(), XclExpPivotTable::Finalize(), XclExpXFBuffer::Finalize(), XclExpTableopBuffer::Finalize(), XclExpRow::Finalize(), XclExpColinfoBuffer::Finalize(), XclExpFontBuffer::Find(), ExcAutoFilterRecs::GetByCol(), XclExpPivotTable::GetFieldAcc(), XclExpPivotCache::GetFieldCount(), XclExpChTypeGroup::GetFreeFormatIdx(), XclExtLst::GetItem(), XclExpPTField::GetItemAcc(), XclExpPCField::GetItemCount(), XclExpPCField::GetItemIndex(), XclExpPTField::GetItemIndex(), XclExpNameManagerImpl::GetUnusedName(), XclExpNameManagerImpl::Initialize(), XclExpPCField::InitStandardField(), XclExpFontBuffer::Insert(), XclExpXFBuffer::InsertCellXF(), XclExpXFBuffer::InsertDefaultRecords(), XclExpPCField::InsertGroupItem(), XclExpNameManagerImpl::InsertMacroCall(), XclExpPCField::InsertOrigBoolItem(), XclExpPCField::InsertOrigDateTimeItem(), XclExpPCField::InsertOrigDoubleItem(), XclExpPCField::InsertOrigItem(), XclExpPCField::InsertOrigTextItem(), XclExpNameManagerImpl::InsertRawName(), XclExpXFBuffer::InsertStyleXF(), ExcAutoFilterRecs::IsFiltered(), XclExpCondfmt::IsValidForBinary(), lcl_GetCellCounts(), XclExpChChart::RemoveLastSeries(), XclExpDval::Save(), XclExpDval::SaveXml(), XclExpComments::SaveXml(), XclExpFontBuffer::SaveXml(), XclExpXFBuffer::SaveXml(), XclExpDval::SearchOrCreateDv(), ExcDocument::Write(), XclExpCondfmt::WriteBody(), XclExpDval::WriteBody(), XclExpPivotTableManager::WritePivotTables(), XclExpPivotCache::WriteSxindexlistList(), XclExpPCField::WriteSxnumgroup(), ExcDocument::WriteXml(), and XclExpPTField::XclExpPTField().

◆ HasRecord()

template<typename RecType = XclExpRecordBase>
bool XclExpRecordList< RecType >::HasRecord ( size_t  nPos) const
inline

Returns true, if the passed index points to an exiting record.

Definition at line 330 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs, and nPos.

Referenced by XclExpXFBuffer::AppendXFIndex(), XclExpNameManagerImpl::GetName(), and XclExpXFBuffer::InsertStyleXF().

◆ InsertRecord() [1/2]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::InsertRecord ( RecordRefType  pRec,
size_t  nPos 
)
inline

Definition at line 345 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs, and nPos.

◆ InsertRecord() [2/2]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::InsertRecord ( RecType *  pRec,
size_t  nPos 
)
inline

Inserts a record at the specified position into the list.

Definition at line 343 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs, and nPos.

Referenced by XclExpRow::InsertCell(), and XclExpDval::SearchOrCreateDv().

◆ InvalidateRecord()

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::InvalidateRecord ( size_t  nPos)
inline

Optimization for repeated removal.

Since this is internally a vector, repeated RemoveRecord() would repeatedly move all items after the removed position. Instead it's possible to invalidate a record and then call RemoveInvalidatedRecords() at the end (which is necessary, the list is generally not allowed to contain invalid entries).

Definition at line 395 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs, and nPos.

Referenced by XclExpColinfoBuffer::Finalize().

◆ IsEmpty()

template<typename RecType = XclExpRecordBase>
bool XclExpRecordList< RecType >::IsEmpty ( ) const
inline

◆ RemoveAllRecords()

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::RemoveAllRecords ( )
inline

Removes all records from the list.

Definition at line 372 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

Referenced by ExcAutoFilterRecs::ExcAutoFilterRecs(), and ExcDocument::~ExcDocument().

◆ RemoveInvalidatedRecords()

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::RemoveInvalidatedRecords ( )
inline

Definition at line 396 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs.

Referenced by XclExpColinfoBuffer::Finalize().

◆ RemoveRecord()

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::RemoveRecord ( size_t  nPos)
inline

◆ ReplaceRecord() [1/2]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::ReplaceRecord ( RecordRefType const &  xRec,
size_t  nPos 
)
inline

Definition at line 357 of file xerecord.hxx.

References nPos, and XclExpRecordList< RecType >::ReplaceRecord().

◆ ReplaceRecord() [2/2]

template<typename RecType = XclExpRecordBase>
void XclExpRecordList< RecType >::ReplaceRecord ( RecType *  pRec,
size_t  nPos 
)
inline

Replaces the record at the specified position from the list with the passed record.

Definition at line 355 of file xerecord.hxx.

References XclExpRecordList< RecType >::maRecs, nPos, and XclExpRecordList< RecType >::RemoveRecord().

Referenced by XclExpFontBuffer::Insert(), XclExpXFBuffer::InsertCellXF(), XclExpXFBuffer::InsertStyleXF(), and XclExpRecordList< RecType >::ReplaceRecord().

◆ Save()

template<typename RecType = XclExpRecordBase>
virtual void XclExpRecordList< RecType >::Save ( XclExpStream rStrm)
inlineoverridevirtual

◆ SaveXml()

template<typename RecType = XclExpRecordBase>
virtual void XclExpRecordList< RecType >::SaveXml ( XclExpXmlStream rStrm)
inlineoverridevirtual

Member Data Documentation

◆ maRecs

template<typename RecType = XclExpRecordBase>
RecordVec XclExpRecordList< RecType >::maRecs
private

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