#include <pt_VarSet.h>
pt_VarSet::pt_VarSet | ( | ) |
This class is used to store and manipulate collections of Attributes /Properties.
Amongst it purposes this class: 1. Provides a integer index to every unique Attribute/Property collection. 2. (addFmt) Merges additional Attributes and properties into an existing collection of attributes/properties. 3. (removeFmt) Removes attributes/properties from an existing collection of Attributes properties.
References m_bInitialized, and m_currentVarSet.
pt_VarSet::~pt_VarSet | ( | ) |
bool pt_VarSet::_finishConstruction | ( | void | ) | [private] |
References m_bInitialized, and m_tableAttrProp.
Referenced by storeAP().
PT_AttrPropIndex pt_VarSet::_makeAPIndex | ( | UT_uint32 | varset, | |
UT_uint32 | subscript | |||
) | const [inline, private] |
Referenced by addIfUniqueAP(), and storeAP().
PT_BufIndex pt_VarSet::_makeBufIndex | ( | UT_uint32 | varset, | |
UT_uint32 | subscript | |||
) | const [inline, private] |
Referenced by appendBuf().
UT_uint32 pt_VarSet::_subscriptFromAPIndex | ( | PT_AttrPropIndex | api | ) | const [inline, private] |
UT_uint32 pt_VarSet::_subscriptFromBufIndex | ( | PT_BufIndex | bi | ) | const [inline, private] |
Referenced by overwriteBuf().
UT_uint32 pt_VarSet::_varsetFromAPIndex | ( | PT_AttrPropIndex | api | ) | const [inline, private] |
UT_uint32 pt_VarSet::_varsetFromBufIndex | ( | PT_BufIndex | bi | ) | const [inline, private] |
Referenced by overwriteBuf().
bool pt_VarSet::addIfUniqueAP | ( | PP_AttrProp * | pAP, | |
PT_AttrPropIndex * | papi | |||
) |
This method takes consumes pAP, do not attempt to access pAP after calling this method.
References _makeAPIndex(), m_currentVarSet, m_tableAttrProp, UT_ASSERT_HARMLESS, UT_return_val_if_fail, and UT_SHOULD_NOT_HAPPEN.
Referenced by pt_PieceTable::_realInsertSpan(), PD_Style::addAttributes(), PD_Style::addProperties(), PD_Style::addProperty(), pt_PieceTable::appendLastStruxFmt(), pt_PieceTable::appendStruxFmt(), pt_PieceTable::changeLastStruxFmtNoUndo(), PD_DocumentRDFMutation::commit(), pt_PieceTable::createAndSendDocPropCR(), mergeAP(), PD_DocumentRDF::setAP(), PD_DocumentRDF::setupWithPieceTable(), and storeAP().
bool pt_VarSet::appendBuf | ( | const UT_UCSChar * | pBuf, | |
UT_uint32 | length, | |||
PT_BufIndex * | pbi | |||
) |
References _makeBufIndex(), UT_GrowBuf::getLength(), m_buffer, m_currentVarSet, and UT_DEBUGMSG.
Referenced by pt_PieceTable::_realInsertSpan(), pt_PieceTable::appendSpan(), and pt_PieceTable::insertSpanBeforeFrag().
const PP_AttrProp* pt_VarSet::getAP | ( | PT_AttrPropIndex | api | ) | const [inline] |
PT_BufIndex pt_VarSet::getBufIndex | ( | PT_BufIndex | bi, | |
UT_uint32 | offset | |||
) | const [inline] |
Referenced by pt_PieceTable::_canCoalesceDeleteSpan(), pt_PieceTable::_canCoalesceInsertSpan(), pt_PieceTable::_deleteSpan(), pt_PieceTable::_deleteSpanWithNotify(), pt_PieceTable::_fmtChangeSpan(), pt_PieceTable::_fmtChangeSpanWithNotify(), pt_PieceTable::_insertFmtMark(), pt_PieceTable::_insertObject(), pt_PieceTable::_insertSpan(), pt_PieceTable::_insertStrux(), and PD_Document::updateDocForStyleChange().
const UT_UCSChar* pt_VarSet::getPointer | ( | PT_BufIndex | bi | ) | const [inline] |
Referenced by isContiguous().
bool pt_VarSet::isContiguous | ( | PT_BufIndex | bi, | |
UT_uint32 | length, | |||
PT_BufIndex | bi2 | |||
) | const |
bool pt_VarSet::mergeAP | ( | PTChangeFmt | ptc, | |
PT_AttrPropIndex | apiOld, | |||
const PP_PropertyVector & | attributes, | |||
const PP_PropertyVector & | properties, | |||
PT_AttrPropIndex * | papiNew, | |||
PD_Document * | pDoc | |||
) |
References addIfUniqueAP(), PP_AttrProp::areAlreadyPresent(), PP_AttrProp::areAnyOfTheseNamesPresent(), PP_AttrProp::cloneWithElimination(), PP_AttrProp::cloneWithEliminationIfEqual(), PP_AttrProp::cloneWithReplacements(), PP_AttrProp::createExactly(), gchar, PD_Style::getAllAttributes(), PD_Style::getAllProperties(), getAP(), PP_AttrProp::getAttribute(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), PD_Document::getStyle(), PP_AttrProp::hasProperties(), PP_AttrProp::isEquivalent(), PD_Style::isList(), PP_AttrProp::markReadOnly(), PP_hasAttribute(), PT_STYLE_ATTRIBUTE_NAME, PTC_AddFmt, PTC_AddStyle, PTC_RemoveFmt, PTC_SetExactly, PTC_SetFmt, UT_ASSERT_HARMLESS, UT_DEBUGMSG, and UT_SHOULD_NOT_HAPPEN.
Referenced by pt_PieceTable::_fmtChangeFmtMarkWithNotify(), pt_PieceTable::_fmtChangeObjectWithNotify(), pt_PieceTable::_fmtChangeSpanWithNotify(), pt_PieceTable::_fmtChangeStruxWithNotify(), pt_PieceTable::_insertFmtMarkFragWithNotify(), pt_PieceTable::_realChangeSectionAttsNoUpdate(), pt_PieceTable::_realChangeStruxForLists(), pt_PieceTable::_realInsertObject(), pt_PieceTable::_realInsertSpan(), pt_PieceTable::_realInsertStrux(), pt_PieceTable::changeObjectFormatNoUpdate(), pt_PieceTable::changeStruxFmtNoUndo(), pt_PieceTable::changeStruxFormatNoUpdate(), and pt_PieceTable::insertStruxNoUpdateBefore().
bool pt_VarSet::overwriteBuf | ( | UT_UCSChar * | pBuf, | |
UT_uint32 | length, | |||
PT_BufIndex * | pbi | |||
) |
References _subscriptFromBufIndex(), _varsetFromBufIndex(), m_buffer, and UT_DEBUGMSG.
void pt_VarSet::setPieceTableState | ( | PTState | pts | ) |
References m_currentVarSet, and PTS_Editing.
Referenced by pt_PieceTable::setPieceTableState().
bool pt_VarSet::storeAP | ( | const PP_PropertyVector & | vecAttributes, | |
PT_AttrPropIndex * | papi | |||
) |
References _finishConstruction(), _makeAPIndex(), addIfUniqueAP(), m_bInitialized, PP_AttrProp::markReadOnly(), and PP_AttrProp::setAttributes().
Referenced by pt_PieceTable::_createBuiltinStyle(), pt_PieceTable::_makeFmtMark(), pt_PieceTable::_makeObject(), pt_PieceTable::_makeStrux(), pt_PieceTable::_realInsertObject(), pt_PieceTable::appendFmt(), pt_PieceTable::appendStyle(), PD_Document::createDataItem(), and PD_Style::setAllAttributes().
bool pt_VarSet::m_bInitialized [private] |
Referenced by _finishConstruction(), pt_VarSet(), and storeAP().
UT_GrowBuf pt_VarSet::m_buffer[2] [private] |
Referenced by appendBuf(), and overwriteBuf().
UT_uint32 pt_VarSet::m_currentVarSet [private] |
Referenced by addIfUniqueAP(), appendBuf(), pt_VarSet(), and setPieceTableState().
pp_TableAttrProp pt_VarSet::m_tableAttrProp[2] [private] |
Referenced by _finishConstruction(), and addIfUniqueAP().