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

Base class for single records with any content. More...

#include <xerecord.hxx>

Inheritance diagram for XclExpRecord:
[legend]
Collaboration diagram for XclExpRecord:
[legend]

Public Member Functions

 XclExpRecord (sal_uInt16 nRecId=EXC_ID_UNKNOWN, std::size_t nRecSize=0)
 
 XclExpRecord (XclExpRecord const &)=default
 
virtual ~XclExpRecord () override
 
sal_uInt16 GetRecId () const
 Returns the current record ID. More...
 
std::size_t GetRecSize () const
 Returns the current record size prediction. More...
 
void SetRecId (sal_uInt16 nRecId)
 Sets a new record ID. More...
 
void SetRecSize (std::size_t nRecSize)
 Sets a new record size prediction. More...
 
void AddRecSize (std::size_t nRecSize)
 Adds a size value to the record size prediction. More...
 
void SetRecHeader (sal_uInt16 nRecId, std::size_t nRecSize)
 Sets record ID and size with one call. More...
 
virtual void Save (XclExpStream &rStrm) override
 Writes the record header and calls WriteBody(). More...
 
- Public Member Functions inherited from XclExpRecordBase
 XclExpRecordBase ()
 
 XclExpRecordBase (XclExpRecordBase const &)
 
 XclExpRecordBase (XclExpRecordBase &&)
 
XclExpRecordBaseoperator= (XclExpRecordBase const &)
 
XclExpRecordBaseoperator= (XclExpRecordBase &&) noexcept
 
virtual ~XclExpRecordBase ()
 
virtual void SaveXml (XclExpXmlStream &rStrm)
 
- Public Member Functions inherited from salhelper::SimpleReferenceObject
 SimpleReferenceObject ()
 
void acquire ()
 
void release ()
 

Protected Member Functions

virtual void WriteBody (XclExpStream &rStrm)
 Writes the body of the record (without record header). More...
 
- Protected Member Functions inherited from salhelper::SimpleReferenceObject
virtual ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE
 

Private Attributes

std::size_t mnRecSize
 
sal_uInt16 mnRecId
 The predicted record size. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from salhelper::SimpleReferenceObject
static voidoperator new (std::size_t nSize)
 
static voidoperator 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 Attributes inherited from salhelper::SimpleReferenceObject
oslInterlockedCount m_nCount
 

Detailed Description

Base class for single records with any content.

This class handles writing the record header. Derived classes only have to write the record body. Calculating the record size before saving optimizes the write process (the stream does not have to seek back and update the written record size). But it is not required to calculate a valid size (maybe it would be too complex or just impossible until the record is really written).

Definition at line 143 of file xerecord.hxx.

Constructor & Destructor Documentation

XclExpRecord::XclExpRecord ( sal_uInt16  nRecId = EXC_ID_UNKNOWN,
std::size_t  nRecSize = 0 
)
explicit
Parameters
nRecIdThe record ID of this record. May be set later with SetRecId().
nRecSizeThe predicted record size. May be set later with SetRecSize().

Definition at line 130 of file xerecord.cxx.

XclExpRecord::XclExpRecord ( XclExpRecord const &  )
default
XclExpRecord::~XclExpRecord ( )
overridevirtual

Definition at line 136 of file xerecord.cxx.

Member Function Documentation

void XclExpRecord::AddRecSize ( std::size_t  nRecSize)
inline

Adds a size value to the record size prediction.

Definition at line 166 of file xerecord.hxx.

References mnRecSize.

Referenced by XclExpAutofilter::AddCondition(), XclObjAny::Save(), XclExpSingleCellBase::Save(), XclObj::WriteSubRecs(), and XclObjDropDown::XclObjDropDown().

sal_uInt16 XclExpRecord::GetRecId ( ) const
inline
std::size_t XclExpRecord::GetRecSize ( ) const
inline

Returns the current record size prediction.

Definition at line 159 of file xerecord.hxx.

References mnRecSize.

Referenced by XclExpFutureRecord::Save(), XclExpMultiCellBase::Save(), and XclExpDummyRecord::WriteBody().

void XclExpRecord::Save ( XclExpStream rStrm)
overridevirtual

Writes the record header and calls WriteBody().

Reimplemented from XclExpRecordBase.

Reimplemented in XclExpChLabelRange, XclExpRow, XclExpDefcolwidth, XclExpFileSharing, XclExpMultiCellBase, XclExpFormulaCell, ExcEScenarioManager, XclExpChSourceLink, XclExpChTrAction, XclExpChFrame, XclExpDval, XclExpNote, XclExpSingleCellBase, XclExpChartObj, XclExpFutureRecord, XclExpChEscherFormat, XclObjAny, XclObjOle, XclExpCondfmt, XclTxo, XclExpTableop, XclExpBlindFont, XclExpChFutureRecordBase, XclObjComment, XclExpChGroupBase, XclObj, XclExpPalette, XclExpPCField, XclExpObjList, XclExpUserBViewList, XclExpPageBreaks, ExcDummyRec, ExcEmptyRec, ExcRecord, and ExcXmlRecord.

Definition at line 150 of file xerecord.cxx.

References XclExpStream::EndRecord(), EXC_ID_UNKNOWN, mnRecId, mnRecSize, XclExpStream::StartRecord(), and WriteBody().

Referenced by ExcRecord::Save(), XclExpPageBreaks::Save(), XclExpPCField::Save(), XclExpPageSettings::Save(), XclExpPalette::Save(), XclExpChartPageSettings::Save(), XclObj::Save(), XclExpChGroupBase::Save(), XclExpTableop::Save(), XclExpCondfmt::Save(), XclExpSingleCellBase::Save(), XclExpNote::Save(), XclExpDval::Save(), XclExpChSourceLink::Save(), XclExpFileSharing::Save(), XclExpDefcolwidth::Save(), XclExpRow::Save(), XclExpRowBuffer::Save(), XclExpChLabelRange::Save(), XclExpPivotCache::WriteCacheStream(), XclExpTabViewSettings::WritePane(), XclExpTabViewSettings::WriteScl(), XclExpTabViewSettings::WriteSelection(), XclExpChTypeGroup::WriteSubRecords(), XclExpChAxesSet::WriteSubRecords(), XclExpTabViewSettings::WriteTabBgColor(), and XclExpTabViewSettings::WriteWindow2().

void XclExpRecord::SetRecHeader ( sal_uInt16  nRecId,
std::size_t  nRecSize 
)

Sets record ID and size with one call.

Definition at line 140 of file xerecord.cxx.

References SetRecId(), and SetRecSize().

Referenced by XclExpXF::InitDefault(), ExcRecord::Save(), and XclExpDimensions::XclExpDimensions().

void XclExpRecord::SetRecId ( sal_uInt16  nRecId)
inline

Sets a new record ID.

Definition at line 162 of file xerecord.hxx.

References mnRecId.

Referenced by XclExpChType::Convert(), XclExpLabelCell::Init(), and SetRecHeader().

void XclExpRecord::SetRecSize ( std::size_t  nRecSize)
inline
void XclExpRecord::WriteBody ( XclExpStream rStrm)
protectedvirtual

Writes the body of the record (without record header).

Usually this method will be overwritten by derived classes.

Reimplemented in XclExpChChart, XclExpChAxesSet, XclExpChAxis, XclExpChTick, XclExpChValueRange, XclExpChLabelRange, XclExpChTypeGroup, XclExpRow, XclExpChDropBar, XclExpChLegend, XclExpChChart3d, XclExpDefrowheight, XclExpChType, XclExpChSeries, XclExpColinfo, XclExpChSerErrorBar, XclExpChSerTrendLine, XclExpDimensions, XclExpChDataFormat, XclExpGuts, XclExpCh3dDataFormat, XclExpProt4RevPass, XclExpProt4Rev, XclExpFileSharing, XclExpChMarkerFormat, XclExpWriteAccess, XclExpStyle, XclExpInterfaceEnd, XclExpInterfaceHdr, XclExpChText, XclExpFileEncryption, XclExpXF, XclExpChFrLabelProps, XclExpSheetEnhancedProtection, XclExpChObjectLink, XclExpSheetProtectOptions, XclExpChSourceLink, XclExpChFrame, XclExpAutofilter, XclExpDval, XclExpNote, XclExpSingleCellBase, XclExpDV, XclExpChEscherFormat, XclExpDummyRecord, XclExpCountry, XclExpChAreaFormat, XclExpBoolRecord, XclExpChLineFormat, XclExpPTItem, XclExpCondfmt, XclExpTableop, XclExpValueRecord< Type >, XclExpChFramePos, XclExpPassHash, XclExpCF, XclExpFont, XclExpShrfmla, XclExpPCField, XclExpTabBgColor, XclObj, XclExpHyperlink, XclExpMsoDrawingBase, XclExpArray, XclExpSelection, XclExpPalette, XclExpPane, XclExpPageBreaks, XclExpScl, XclExpSetup, XclExpWindow2, XclExpStringRec, XclExpPCItem, ExcRecord, XclExpHeaderFooter, and XclExpWindow1.

Definition at line 146 of file xerecord.cxx.

Referenced by Save(), and XclExpFutureRecord::Save().

Member Data Documentation

sal_uInt16 XclExpRecord::mnRecId
private

The predicted record size.

Definition at line 180 of file xerecord.hxx.

Referenced by GetRecId(), Save(), and SetRecId().

std::size_t XclExpRecord::mnRecSize
private

Definition at line 179 of file xerecord.hxx.

Referenced by AddRecSize(), GetRecSize(), Save(), and SetRecSize().


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