Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends

pt_PieceTable Class Reference

#include <pt_PieceTable.h>

List of all members.

Classes

struct  embeddedStrux

Public Member Functions

 pt_PieceTable (PD_Document *pDocument)
 ~pt_PieceTable ()
void setPieceTableState (PTState pts)
PTState getPieceTableState () const
void beginMultiStepGlob (void)
void endMultiStepGlob (void)
void beginUserAtomicGlob (void)
void endUserAtomicGlob (void)
void setClean (void)
bool isDirty (void) const
bool canDo (bool bUndo) const
UT_uint32 undoCount (bool bUndo) const
bool undoCmd (void)
bool redoCmd (void)
bool getNthUndo (PX_ChangeRecord **ppcr, UT_uint32 undoNdx) const
bool getUndo (PX_ChangeRecord **ppcr, bool bStatic=false) const
bool getRedo (PX_ChangeRecord **ppcr) const
void clearUndo ()
bool insertObject (PT_DocPosition dpos, PTObjectType pto, const PP_PropertyVector &attributes, const PP_PropertyVector &properties)
bool insertObject (PT_DocPosition dpos, PTObjectType pto, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, pf_Frag_Object **ppfo)
bool insertSpan (PT_DocPosition dpos, const UT_UCSChar *p, UT_uint32 length, fd_Field *pField=NULL, bool bAddChangeRec=true)
pf_FraggetEndOfBlock (PT_DocPosition currentpos, PT_DocPosition endpos)
 MIQ11: Work out if we are deleting from one paragraph to another in a way that we want to emit a delta:merge to have the two paragraphs merged in ODT.
pf_Frag_StruxinSameBlock (PT_DocPosition startpos, PT_DocPosition endpos)
 Return the strux PTX_Block if both startpos and endpos are contained in the same block.
bool deleteSpan (PT_DocPosition dpos1, PT_DocPosition dpos2, PP_AttrProp *p_AttrProp_Before, UT_uint32 &iRealDeleteCount, bool bDontGlob=false)
bool deleteSpan (PT_DocPosition dpos1, PT_DocPosition dpos2, PP_AttrProp *p_AttrProp_Before, UT_uint32 &iRealDeleteCount, bool bDeleteTableStruxes, bool bDontGlob)
 Add a change tracking attribute/value to the given fragment.
bool createAndSendCR (PT_DocPosition dpos, UT_sint32 iType, bool bSave, UT_Byte iGlob)
bool createAndSendDocPropCR (const PP_PropertyVector &pAtts, const PP_PropertyVector &pProps)
bool deleteSpanWithTable (PT_DocPosition dpos1, PT_DocPosition dpos2, PP_AttrProp *p_AttrProp_Before, UT_uint32 &iRealDeleteCount, bool bDeleteTableStrux)
bool deleteFieldFrag (pf_Frag *pf)
void deleteHdrFtrStrux (pf_Frag_Strux *pfs)
bool changeSpanFmt (PTChangeFmt ptc, PT_DocPosition dpos1, PT_DocPosition dpos2, const PP_PropertyVector &attributes, const PP_PropertyVector &properties)
bool insertStrux (PT_DocPosition dpos, PTStruxType pts, pf_Frag_Strux **ppfs_ret=0)
bool insertStrux (PT_DocPosition dpos, PTStruxType pts, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, pf_Frag_Strux **ppfs_ret=0)
bool changeStruxFmt (PTChangeFmt ptc, PT_DocPosition dpos1, PT_DocPosition dpos2, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, PTStruxType pts=PTX_StruxDummy)
bool changeStruxFmtNoUndo (PTChangeFmt ptc, pf_Frag_Strux *pfs, const PP_PropertyVector &attributes, const PP_PropertyVector &properties)
bool changeStruxFormatNoUpdate (PTChangeFmt ptc, pf_Frag_Strux *pfs, const PP_PropertyVector &attributes)
bool changeObjectFormatNoUpdate (PTChangeFmt ptc, pf_Frag_Object *pfo, const PP_PropertyVector &attributes, const PP_PropertyVector &properties)
bool changeStruxForLists (pf_Frag_Strux *sdh, const char *pszParentID)
bool changeSectionAttsNoUpdate (pf_Frag_Strux *pfStrux, const char *attr, const char *attvalue)
bool deleteStruxNoUpdate (pf_Frag_Strux *sdh)
bool deleteFragNoUpdate (pf_Frag *pf)
bool deleteStruxWithNotify (pf_Frag_Strux *sdh)
bool insertStruxNoUpdateBefore (pf_Frag_Strux *sdh, PTStruxType pts, const PP_PropertyVector &attributes)
bool changeLastStruxFmtNoUndo (PT_DocPosition dpos, PTStruxType pts, const PP_PropertyVector &attrs, const PP_PropertyVector &props, bool bSkipEmbededSections)
bool changeLastStruxFmtNoUndo (PT_DocPosition dpos, PTStruxType pts, const PP_PropertyVector &attrs, const std::string &props, bool bSkipEmbededSections)
bool insertFmtMark (PTChangeFmt ptc, PT_DocPosition dpos, PP_AttrProp *p_AttrProp)
bool deleteFmtMark (PT_DocPosition dpos)
PD_DocumentgetDocument (void)
bool appendStrux (PTStruxType pts, const PP_PropertyVector &attributes, pf_Frag_Strux **ppfs_ret=0)
bool appendStruxFmt (pf_Frag_Strux *pfs, const PP_PropertyVector &attributes)
bool appendLastStruxFmt (PTStruxType pts, const PP_PropertyVector &attrs, const PP_PropertyVector &props, bool bSkipEmbededSections)
bool appendLastStruxFmt (PTStruxType pts, const PP_PropertyVector &attrs, const std::string &props, bool bSkipEmbededSections)
bool appendFmt (const PP_PropertyVector &vecAttributes)
bool appendSpan (const UT_UCSChar *p, UT_uint32 length)
bool appendObject (PTObjectType pto, const PP_PropertyVector &attributes)
bool appendFmtMark (void)
bool appendStyle (const PP_PropertyVector &attributes)
bool insertStruxBeforeFrag (pf_Frag *pF, PTStruxType pts, const PP_PropertyVector &attributes, pf_Frag_Strux **ppfs_ret=0)
bool insertSpanBeforeFrag (pf_Frag *pF, const UT_UCSChar *p, UT_uint32 length)
bool insertObjectBeforeFrag (pf_Frag *pF, PTObjectType pto, const PP_PropertyVector &attributes)
bool insertFmtMarkBeforeFrag (pf_Frag *pF)
bool insertFmtMarkBeforeFrag (pf_Frag *pF, const PP_PropertyVector &attributes)
bool removeStyle (const gchar *name)
size_t getStyleCount (void) const
bool tellListener (PL_Listener *pListener)
bool tellListenerSubset (PL_Listener *pListener, PD_DocumentRange *pDocRange, PL_ListenerCoupleCloser *closer=0)
bool addListener (PL_Listener *pListener, PL_ListenerId listenerId)
bool getAttrProp (PT_AttrPropIndex indexAP, const PP_AttrProp **ppAP) const
bool getSpanAttrProp (pf_Frag_Strux *sdh, UT_uint32 offset, bool bLeftSide, const PP_AttrProp **ppAP) const
const UT_UCSChargetPointer (PT_BufIndex bi) const
bool getBlockBuf (pf_Frag_Strux *sdh, UT_GrowBuf *pgb) const
PT_DocPosition getPosEnd ()
bool getBounds (bool bEnd, PT_DocPosition &docPos) const
PT_DocPosition getStruxPosition (pf_Frag_Strux *sdh) const
PT_DocPosition getFragPosition (const pf_Frag *pfToFind) const
bool dumpDoc (const char *msg, PT_DocPosition currentpos, PT_DocPosition endpos)
bool getFragFromPosition (PT_DocPosition docPos, pf_Frag **ppf, PT_BlockOffset *pOffset) const
bool getStruxOfTypeFromPosition (PL_ListenerId listenerId, PT_DocPosition docPos, PTStruxType pts, fl_ContainerLayout **psfh) const
pf_Frag_StruxgetBlockFromPosition (PT_DocPosition pos) const
bool getStruxOfTypeFromPosition (PT_DocPosition docPos, PTStruxType pts, pf_Frag_Strux **sdh) const
 return the SDH of the last strux of the given type immediately prior to the given absolute document position.
bool getStruxFromPosition (PL_ListenerId listenerId, PT_DocPosition docPos, fl_ContainerLayout **psfh) const
bool getFragsFromPositions (PT_DocPosition dPos1, PT_DocPosition dPos2, pf_Frag **ppf1, PT_BlockOffset *pOffset1, pf_Frag **ppf2, PT_BlockOffset *pOffset2) const
bool getStyle (const char *szName, PD_Style **ppStyle) const
bool enumStyles (UT_uint32 k, const char **pszName, const PD_Style **ppStyle) const
bool enumStyles (UT_GenericVector< PD_Style * > *&pStyles) const
const std::map< std::string,
PD_Style * > & 
getAllStyles () const
bool isEndFootnote (pf_Frag *pf) const
bool isFootnote (pf_Frag *pf) const
bool isInsideFootnote (PT_DocPosition dpos, pf_Frag **pfBegin=NULL) const
bool hasEmbedStruxOfTypeInRange (PT_DocPosition posStart, PT_DocPosition posEnd, PTStruxType iType) const
void clearIfAtFmtMark (PT_DocPosition dpos)
pt_VarSetgetVarSet (void)
pf_FragmentsgetFragments (void)
bool purgeFmtMarks ()
bool isDoingTheDo (void) const
void setDoNotTweakPosition (bool b)
UT_uint32 getXID ()
UT_uint32 getTopXID () const
void setXIDThreshold (UT_uint32 i)
void fixMissingXIDs ()
UT_sint32 calcDocsize (void)
void setCRNumber (UT_sint32 iCRNumber)

Static Public Member Functions

static void s_getLocalisedStyleName (const char *szStyle, std::string &utf8)
static const char * s_getUnlocalisedStyleName (const char *szLocStyle)

Protected Types

typedef std::map< std::string,
PD_Style * > 
StyleMap

Protected Member Functions

bool _realInsertObject (PT_DocPosition dpos, PTObjectType pto, const PP_PropertyVector &attributes, const PP_PropertyVector &properties)
bool _realInsertObject (PT_DocPosition dpos, PTObjectType pto, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, pf_Frag_Object **ppfo)
bool _realInsertSpan (PT_DocPosition dpos, const UT_UCSChar *p, UT_uint32 length, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, fd_Field *pField=NULL, bool bAddChangeRec=true)
bool _realDeleteSpan (PT_DocPosition dpos1, PT_DocPosition dpos2, PP_AttrProp *p_AttrProp_Before, bool bDeleteTableStruxes, bool bDontGlob=false)
void _realDeleteHdrFtrStrux (pf_Frag_Strux *pfs)
bool _realChangeSpanFmt (PTChangeFmt ptc, PT_DocPosition dpos1, PT_DocPosition dpos2, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, bool bRevisionDelete)
bool _realInsertStrux (PT_DocPosition dpos, PTStruxType pts, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, pf_Frag_Strux **ppfs_ret)
bool _realChangeStruxFmt (PTChangeFmt ptc, PT_DocPosition dpos1, PT_DocPosition dpos2, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, PTStruxType pts, bool bRevisionDelete)
bool _realChangeStruxForLists (pf_Frag_Strux *sdh, const char *pszParentID, bool bRevisionDelete)
bool _realChangeSectionAttsNoUpdate (pf_Frag_Strux *pfStrux, const char *attr, const char *attvalue)
pf_Frag_Strux_findLastStruxOfType (pf_Frag *pfStart, PTStruxType pst, PTStruxType *stopConditions, bool bSkipEmbededSections)
 MIQ11: Extends the old _findLastStruxOfType adding a stopCondition for failure and returning a Strux* directly in the case of success.
pf_Frag_Strux_findLastStruxOfType (pf_Frag *pfStart, PTStruxType pst, bool bSkipEmbeded)
pf_Frag_findPrevHyperlink (pf_Frag *pfStart)
pf_Frag_findNextHyperlink (pf_Frag *pfStart)
bool _tellAndMaybeAddListener (PL_Listener *pListener, PL_ListenerId listenerId, bool bAdd)
void _captureActiveSpan (pf_Frag_Strux_Block *pfsBlock)
PT_AttrPropIndex _chooseIndexAP (pf_Frag *pf, PT_BlockOffset fragOffset)
bool _canCoalesceInsertSpan (PX_ChangeRecord_Span *pcrSpan) const
bool _createStrux (PTStruxType pts, PT_AttrPropIndex indexAP, pf_Frag_Strux **ppfs)
void _insertStrux (pf_Frag *pf, PT_BlockOffset fragOffset, pf_Frag_Strux *pfsNew)
bool _insertObject (pf_Frag *pf, PT_BlockOffset fragOffset, PTObjectType pto, PT_AttrPropIndex indexAP, pf_Frag_Object *&pfo)
bool _createObject (PTObjectType pto, PT_AttrPropIndex indexAP, pf_Frag_Object **ppfo)
bool _insertSpan (pf_Frag *pf, PT_BufIndex bi, PT_BlockOffset fragOffset, UT_uint32 length, PT_AttrPropIndex indexAP, fd_Field *pField=NULL)
bool _StruxIsNotTable (pf_Frag_Strux *pfs)
bool _deleteSpan (pf_Frag_Text *pft, UT_uint32 fragOffset, PT_BufIndex bi, UT_uint32 length, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
void _unlinkFrag (pf_Frag *pf, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _getStruxFromPosition (PT_DocPosition docPos, pf_Frag_Strux **ppfs, bool bSkipFootnotes=false) const
bool _getStruxOfTypeFromPosition (PT_DocPosition dpos, PTStruxType pts, pf_Frag_Strux **ppfs) const
pf_Frag_Strux_getBlockFromPosition (PT_DocPosition pos) const
 Get the PTX_Block that contains the given document position.
bool _doTheDo (const PX_ChangeRecord *pcr, bool bUndo)
bool _struxHasContent (pf_Frag_Strux *pfs) const
bool _struxIsEmpty (pf_Frag_Strux *pfs) const
bool _unlinkStrux (pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _unlinkStrux_Block (pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _unlinkStrux_Section (pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _canCoalesceDeleteSpan (PX_ChangeRecord_Span *pcrSpan) const
bool _deleteSpanWithNotify (PT_DocPosition dpos, pf_Frag_Text *pft, UT_uint32 fragOffset, UT_uint32 length, pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd, bool bAddChangeRec=true)
bool _isSimpleDeleteSpan (PT_DocPosition dpos1, PT_DocPosition dpos2) const
void _tweakFieldSpan (PT_DocPosition &dpos1, PT_DocPosition &dpos2) const
bool _tweakDeleteSpanOnce (PT_DocPosition &dpos1, PT_DocPosition &dpos2, UT_Stack *pstDelayStruxDelete) const
bool _tweakDeleteSpan (PT_DocPosition &dpos1, PT_DocPosition &dpos2, UT_Stack *pstDelayStruxDelete) const
bool _deleteFormatting (PT_DocPosition dpos1, PT_DocPosition dpos2)
bool _deleteComplexSpanHAR (pf_Frag_Object *pO, PT_DocPosition dpos1, PT_DocPosition dpos2, UT_uint32 &length, PT_BlockOffset &fragOffset_First, UT_uint32 &lengthThisStep, pf_Frag_Strux *&pfsContainer, pf_Frag *&pfNewEnd, UT_uint32 &fragOffsetNewEnd, const char *startAttrCSTR)
 Since hyperlinks, annotations, and rdf anchors are all very similar code, they are abstracted out here.
bool _deleteComplexSpan (PT_DocPosition &dpos1, PT_DocPosition &dpos2, UT_Stack *stDelayStruxDelete)
bool _deleteComplexSpan_norec (PT_DocPosition dpos1, PT_DocPosition dpos2)
bool _deleteObject (pf_Frag_Object *pfo, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _deleteObjectWithNotify (PT_DocPosition dpos, pf_Frag_Object *pfo, UT_uint32 fragOffset, UT_uint32 length, pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd, bool bAddChangeRec=true)
bool _deleteObject_norec (PT_DocPosition dpos, pf_Frag_Object *pfo, UT_uint32 fragOffset, UT_uint32 length, pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _deleteStruxWithNotify (PT_DocPosition dpos, pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd, bool bWithRec=true)
bool _deleteHdrFtrsFromSectionStruxIfPresent (pf_Frag_Strux_Section *pfStruxSec)
void _deleteHdrFtrStruxWithNotify (pf_Frag_Strux *pfFragStruxHdrFtr)
bool _fixHdrFtrReferences (const gchar *pType, const gchar *pId, bool bNotional=false)
bool _fmtChangeStrux (pf_Frag_Strux *pfs, PT_AttrPropIndex indexNewAP)
bool _fmtChangeStruxWithNotify (PTChangeFmt ptc, pf_Frag_Strux *pfs, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, bool bRevisionDelete)
bool _fmtChangeStruxWithNotify (PTChangeFmt ptc, pf_Frag_Strux *pfs, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, bool bDoAll, bool bRevisionDelete)
bool _fmtChangeSpan (pf_Frag_Text *pft, UT_uint32 fragOffset, UT_uint32 length, PT_AttrPropIndex indexNewAP, pf_Frag **ppfNewEnd, UT_uint32 *pfragOffsetNewEnd)
bool _fmtChangeSpanWithNotify (PTChangeFmt ptc, pf_Frag_Text *pft, UT_uint32 fragOffset, PT_DocPosition dpos, UT_uint32 length, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, pf_Frag_Strux *pfs, pf_Frag **ppfNewEnd, UT_uint32 *pfragOffsetNewEnd, bool bRevisionDelete)
bool _fmtChangeObject (pf_Frag_Object *pfo, PT_AttrPropIndex indexNewAP, pf_Frag **ppfNewEnd, UT_uint32 *pfragOffsetNewEnd)
bool _fmtChangeObjectWithNotify (PTChangeFmt ptc, pf_Frag_Object *pfo, UT_uint32 fragOffset, PT_DocPosition dpos, UT_uint32 length, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, pf_Frag_Strux *pfs, pf_Frag **ppfNewEnd, UT_uint32 *pfragOffsetNewEnd, bool bRevisionDelete)
bool _getStruxFromFrag (pf_Frag *pfStart, pf_Frag_Strux **ppfs) const
bool _getStruxFromFragSkip (pf_Frag *pfStart, pf_Frag_Strux **ppfs) const
bool _getNextStruxAfterFragSkip (pf_Frag *pfStart, pf_Frag_Strux **ppfs)
bool _getStruxFromPositionSkip (PT_DocPosition docPos, pf_Frag_Strux **ppfs) const
UT_uint32 _computeBlockOffset (pf_Frag_Strux *pfs, pf_Frag *pfTarget) const
bool _loadBuiltinStyles (void)
bool _createBuiltinStyle (const char *szName, bool bDisplayed, const PP_PropertyVector &attributes)
bool _insertFmtMarkFragWithNotify (PTChangeFmt ptc, PT_DocPosition dpos, const PP_PropertyVector &attributes, const PP_PropertyVector &properties)
bool _insertFmtMarkFragWithNotify (PTChangeFmt ptc, PT_DocPosition dpos, PP_AttrProp *p_AttrProp)
bool _insertFmtMark (pf_Frag *pf, UT_uint32 fragOffset, PT_AttrPropIndex api)
bool _insertFmtMarkAfterBlockWithNotify (pf_Frag_Strux *pfsBlock, PT_DocPosition dpos, PT_AttrPropIndex api)
bool _deleteFmtMarkWithNotify (PT_DocPosition dpos, pf_Frag_FmtMark *pffm, pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _deleteFmtMark (pf_Frag_FmtMark *pffm, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _fmtChangeFmtMarkWithNotify (PTChangeFmt ptc, pf_Frag_FmtMark *pffm, PT_DocPosition dpos, const PP_PropertyVector &attributes, const PP_PropertyVector &properties, pf_Frag_Strux *pfs, pf_Frag **ppfEnd, UT_uint32 *pfragOffsetEnd)
bool _fmtChangeFmtMark (pf_Frag_FmtMark *pffm, PT_AttrPropIndex indexNewAP, pf_Frag **ppfNewEnd, UT_uint32 *pfragOffsetNewEnd)
bool _computeFmtMarkForNewBlock (pf_Frag_Strux *pfsBlock, pf_Frag *pfCurrent, PT_BlockOffset fragOffset, PT_AttrPropIndex *pFmtMarkAP)
bool _getSpanAttrPropHelper (pf_Frag *pf, const PP_AttrProp **ppAP) const
bool _lastUndoIsThisFmtMark (PT_DocPosition dpos)
bool _changePointWithNotify (PT_DocPosition dpos)
bool _checkSkipFootnote (PT_DocPosition dpos1, PT_DocPosition dpos2, pf_Frag *pf_End=NULL) const
bool _makeStrux (PTStruxType pts, const PP_PropertyVector &attributes, pf_Frag_Strux *&pfs)
bool _makeObject (PTObjectType pto, const PP_PropertyVector &attributes, pf_Frag_Object *&pfo)
bool _makeFmtMark (pf_Frag_FmtMark *&pff)
bool _makeFmtMark (pf_Frag_FmtMark *&pff, const PP_PropertyVector &attributes)
UT_sint32 _getNextChangeRecordNumber (void)
bool _translateRevisionAttribute (PP_RevisionAttr &Revisions, PT_AttrPropIndex indexAP, PP_RevisionType eType, PP_PropertyVector &ppRevAttrib, PP_PropertyVector &ppRevProps, const PP_PropertyVector &ppAttrib, const PP_PropertyVector &ppProps)
bool _insertNoteInEmbeddedStruxList (pf_Frag_Strux *pfsNew)

Protected Attributes

PTState m_pts
pt_VarSet m_varset
px_ChangeHistory m_history
pf_Fragments m_fragments
StyleMap m_hashStyles
struct {
   PT_AttrPropIndex   m_indexCurrentInlineAP
loading
PD_Documentm_pDocument
UT_uint32 m_atomicGlobCount
bool m_bDoingTheDo
bool m_bDoNotTweakPosition
UT_uint32 m_iXID
UT_sint32 m_iCurCRNumber
std::list< embeddedStruxm_embeddedStrux

Friends

class PX_ChangeRecord

Member Typedef Documentation

typedef std::map<std::string, PD_Style *> pt_PieceTable::StyleMap [protected]

Constructor & Destructor Documentation

pt_PieceTable::pt_PieceTable ( PD_Document pDocument  ) 
pt_PieceTable::~pt_PieceTable (  ) 

Member Function Documentation

bool pt_PieceTable::_canCoalesceDeleteSpan ( PX_ChangeRecord_Span pcrSpan  )  const [protected]
bool pt_PieceTable::_canCoalesceInsertSpan ( PX_ChangeRecord_Span pcrSpan  )  const [protected]
void pt_PieceTable::_captureActiveSpan ( pf_Frag_Strux_Block pfsBlock  )  [protected]
bool pt_PieceTable::_changePointWithNotify ( PT_DocPosition  dpos  )  [protected]
bool pt_PieceTable::_checkSkipFootnote ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
pf_Frag pf_End = NULL 
) const [protected]
PT_AttrPropIndex pt_PieceTable::_chooseIndexAP ( pf_Frag pf,
PT_BlockOffset  fragOffset 
) [protected]
UT_uint32 pt_PieceTable::_computeBlockOffset ( pf_Frag_Strux pfs,
pf_Frag pfTarget 
) const [protected]
bool pt_PieceTable::_computeFmtMarkForNewBlock ( pf_Frag_Strux pfsBlock,
pf_Frag pfCurrent,
PT_BlockOffset  fragOffset,
PT_AttrPropIndex pFmtMarkAP 
) [protected]
bool pt_PieceTable::_createBuiltinStyle ( const char *  szName,
bool  bDisplayed,
const PP_PropertyVector attributes 
) [protected]
bool pt_PieceTable::_createObject ( PTObjectType  pto,
PT_AttrPropIndex  indexAP,
pf_Frag_Object **  ppfo 
) [protected]
bool pt_PieceTable::_createStrux ( PTStruxType  pts,
PT_AttrPropIndex  indexAP,
pf_Frag_Strux **  ppfs 
) [protected]
bool pt_PieceTable::_deleteComplexSpan ( PT_DocPosition dpos1,
PT_DocPosition dpos2,
UT_Stack stDelayStruxDelete 
) [protected]
bool pt_PieceTable::_deleteComplexSpan_norec ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2 
) [protected]
bool pt_PieceTable::_deleteComplexSpanHAR ( pf_Frag_Object pO,
PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
UT_uint32 length,
PT_BlockOffset fragOffset_First,
UT_uint32 lengthThisStep,
pf_Frag_Strux *&  pfsContainer,
pf_Frag *&  pfNewEnd,
UT_uint32 fragOffsetNewEnd,
const char *  startAttrCSTR 
) [protected]
bool pt_PieceTable::_deleteFmtMark ( pf_Frag_FmtMark pffm,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_deleteFmtMarkWithNotify ( PT_DocPosition  dpos,
pf_Frag_FmtMark pffm,
pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_deleteFormatting ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2 
) [protected]
bool pt_PieceTable::_deleteHdrFtrsFromSectionStruxIfPresent ( pf_Frag_Strux_Section pfStruxSec  )  [protected]

This method scans the piecetAble from the section Frag_strux given looking for any Header/Footers that belong to the strux. If it finds them, they are deleted with notifications.

Parameters:
pf_Frag_Strux_Section pfStruxSec the Section strux that might have headers or footers belonging to it. These must be deleted with notification otherwise they won't be recreated on an undo

References _deleteHdrFtrStruxWithNotify(), UT_GenericVector< T >::addItem(), UT_String::c_str(), UT_GenericVector< T >::clear(), gchar, PP_AttrProp::getAttribute(), getAttrProp(), getFragments(), pf_Frag::getIndexAP(), UT_GenericVector< T >::getItemCount(), pf_Fragments::getLast(), pf_Frag::getNext(), UT_GenericVector< T >::getNthItem(), pf_Frag_Strux::getStruxType(), pf_Frag::getType(), and UT_DEBUGMSG.

Referenced by _deleteFormatting().

void pt_PieceTable::_deleteHdrFtrStruxWithNotify ( pf_Frag_Strux pfFragStruxHdrFtr  )  [protected]
bool pt_PieceTable::_deleteObject ( pf_Frag_Object pfo,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]

References _unlinkFrag(), and xxx_UT_DEBUGMSG.

Referenced by _deleteObjectWithNotify(), and _doTheDo().

bool pt_PieceTable::_deleteObject_norec ( PT_DocPosition  dpos,
pf_Frag_Object pfo,
UT_uint32  fragOffset,
UT_uint32  length,
pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_deleteObjectWithNotify ( PT_DocPosition  dpos,
pf_Frag_Object pfo,
UT_uint32  fragOffset,
UT_uint32  length,
pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd,
bool  bAddChangeRec = true 
) [protected]
bool pt_PieceTable::_deleteSpan ( pf_Frag_Text pft,
UT_uint32  fragOffset,
PT_BufIndex  bi,
UT_uint32  length,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_deleteSpanWithNotify ( PT_DocPosition  dpos,
pf_Frag_Text pft,
UT_uint32  fragOffset,
UT_uint32  length,
pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd,
bool  bAddChangeRec = true 
) [protected]
bool pt_PieceTable::_deleteStruxWithNotify ( PT_DocPosition  dpos,
pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd,
bool  bWithRec = true 
) [protected]
bool pt_PieceTable::_doTheDo ( const PX_ChangeRecord pcr,
bool  bUndo 
) [protected]

References _createStrux(), _deleteFmtMark(), _deleteObject(), _deleteSpan(), _fmtChangeFmtMark(), _fmtChangeObject(), _fmtChangeSpan(), _fmtChangeStrux(), _getStruxFromFrag(), _getStruxFromFragSkip(), _getStruxFromPosition(), _insertFmtMark(), _insertNoteInEmbeddedStruxList(), _insertObject(), _insertSpan(), _insertStrux(), _unlinkStrux(), PX_ChangeRecord_FmtMarkChange::AdjustBlockOffset(), PX_ChangeRecord_FmtMark::AdjustBlockOffset(), PX_ChangeRecord_ObjectChange::AdjustBlockOffset(), PX_ChangeRecord_Object::AdjustBlockOffset(), PX_ChangeRecord_SpanChange::AdjustBlockOffset(), PX_ChangeRecord_Span::AdjustBlockOffset(), DONE, PX_ChangeRecord_Span::getBlockOffset(), PX_ChangeRecord_Span::getBufIndex(), pf_Frag::getField(), PX_ChangeRecord_Span::getField(), getFragFromPosition(), pf_Frag::getIndexAP(), PX_ChangeRecord::getIndexAP(), PX_ChangeRecord_SpanChange::getLength(), pf_Frag::getLength(), PX_ChangeRecord_Span::getLength(), pf_Frag::getNext(), pf_Frag_Object::getObjectType(), PX_ChangeRecord_Object::getObjectType(), pf_Frag::getPos(), PX_ChangeRecord::getPosition(), pf_Frag::getPrev(), PX_ChangeRecord_Strux::getStruxType(), pf_Frag::getType(), PX_ChangeRecord::getType(), isEndFootnote(), m_bDoingTheDo, m_pDocument, PD_Document::notifyListeners(), pf_Frag::PFT_Text, PTX_EndAnnotation, PTX_EndEndnote, PTX_EndFootnote, PX_ChangeRecord::PXT_ChangeFmtMark, PX_ChangeRecord::PXT_ChangeObject, PX_ChangeRecord::PXT_ChangePoint, PX_ChangeRecord::PXT_ChangeSpan, PX_ChangeRecord::PXT_ChangeStrux, PX_ChangeRecord::PXT_DeleteFmtMark, PX_ChangeRecord::PXT_DeleteObject, PX_ChangeRecord::PXT_DeleteSpan, PX_ChangeRecord::PXT_DeleteStrux, PX_ChangeRecord::PXT_GlobMarker, PX_ChangeRecord::PXT_InsertFmtMark, PX_ChangeRecord::PXT_InsertObject, PX_ChangeRecord::PXT_InsertSpan, PX_ChangeRecord::PXT_InsertStrux, pf_Frag_Text::setField(), PX_ChangeRecord_Object::setObjectHandle(), UNDO_return_val_if_fail, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_MIN, and xxx_UT_DEBUGMSG.

Referenced by redoCmd(), and undoCmd().

pf_Frag_Strux * pt_PieceTable::_findLastStruxOfType ( pf_Frag pfStart,
PTStruxType  pst,
bool  bSkipEmbeded 
) [protected]
pf_Frag_Strux * pt_PieceTable::_findLastStruxOfType ( pf_Frag pfStart,
PTStruxType  pst,
PTStruxType stopConditions,
bool  bSkipEmbededSections 
) [protected]

MIQ11: Extends the old _findLastStruxOfType adding a stopCondition for failure and returning a Strux* directly in the case of success.

This is like a findBackwards() from a fragment.

stopConditions must be terminated with a PTX_StruxDummy entry like: PTStruxType stopCondition[] = { PTX_SectionTable, PTX_StruxDummy };

Find a fragment of strux type pst looking backwards from pfStart. If a strux fragment matching the stopCondition is found first then the function stops and returns 0. If no fragment with pst is found then 0 is returned.

MAYBE: extend this again to take yes() and no() functors so a function can call _findLastStruxOfType() and decide what is ok and what is not using those. boost::lambda would be handy to simplify the functors?

References pf_Frag::getPrev(), pf_Frag_Strux::getStruxType(), pf_Frag::getType(), PTX_StruxDummy, and UT_return_val_if_fail.

Referenced by _findLastStruxOfType(), appendLastStruxFmt(), changeLastStruxFmtNoUndo(), and deleteSpan().

pf_Frag * pt_PieceTable::_findNextHyperlink ( pf_Frag pfStart  )  [protected]

Scan backwards fromthe given frag until an end hyperlink is found. This method is used to determine if a frag is inside a hyperlink span. Returns NULL if: (a) It encounters a strux first. (b) It encounters a start hyperlink first (c) It encounters the end of document

References gchar, getAttrProp(), pf_Frag::getIndexAP(), pf_Fragments::getLast(), pf_Frag::getNext(), pf_Frag_Object::getObjectType(), pf_Frag::getPieceTable(), pf_Frag::getType(), isEndFootnote(), isFootnote(), m_fragments, and UT_return_val_if_fail.

Referenced by _realInsertStrux().

pf_Frag * pt_PieceTable::_findPrevHyperlink ( pf_Frag pfStart  )  [protected]

Scan backwards from the given frag until a start hyperlink is found. This method is used to determine if a frag is inside a hyperlink span. Returns NULL if: (a) It encounters a strux first. (b) It encounters an end hyperlink first (c) It encounters the begin of document

FIXME!! Should this code work for annotations too?

References gchar, getAttrProp(), pf_Frag::getIndexAP(), pf_Frag_Object::getObjectType(), pf_Frag::getPieceTable(), pf_Frag::getPrev(), pf_Frag::getType(), isEndFootnote(), isFootnote(), and UT_return_val_if_fail.

Referenced by _realInsertStrux().

bool pt_PieceTable::_fixHdrFtrReferences ( const gchar *  pszHdrType,
const gchar *  pszHdrId,
bool  bNotional = false 
) [protected]
bool pt_PieceTable::_fmtChangeFmtMark ( pf_Frag_FmtMark pffm,
PT_AttrPropIndex  indexNewAP,
pf_Frag **  ppfNewEnd,
UT_uint32 pfragOffsetNewEnd 
) [protected]
bool pt_PieceTable::_fmtChangeFmtMarkWithNotify ( PTChangeFmt  ptc,
pf_Frag_FmtMark pffm,
PT_DocPosition  dpos,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_fmtChangeObject ( pf_Frag_Object pfo,
PT_AttrPropIndex  indexNewAP,
pf_Frag **  ppfNewEnd,
UT_uint32 pfragOffsetNewEnd 
) [protected]
bool pt_PieceTable::_fmtChangeObjectWithNotify ( PTChangeFmt  ptc,
pf_Frag_Object pfo,
UT_uint32  fragOffset,
PT_DocPosition  dpos,
UT_uint32  length,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
pf_Frag_Strux pfs,
pf_Frag **  ppfNewEnd,
UT_uint32 pfragOffsetNewEnd,
bool  bRevisionDelete 
) [protected]
bool pt_PieceTable::_fmtChangeSpan ( pf_Frag_Text pft,
UT_uint32  fragOffset,
UT_uint32  length,
PT_AttrPropIndex  indexNewAP,
pf_Frag **  ppfNewEnd,
UT_uint32 pfragOffsetNewEnd 
) [protected]
bool pt_PieceTable::_fmtChangeSpanWithNotify ( PTChangeFmt  ptc,
pf_Frag_Text pft,
UT_uint32  fragOffset,
PT_DocPosition  dpos,
UT_uint32  length,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
pf_Frag_Strux pfs,
pf_Frag **  ppfNewEnd,
UT_uint32 pfragOffsetNewEnd,
bool  bRevisionDelete 
) [protected]
bool pt_PieceTable::_fmtChangeStrux ( pf_Frag_Strux pfs,
PT_AttrPropIndex  indexNewAP 
) [protected]
bool pt_PieceTable::_fmtChangeStruxWithNotify ( PTChangeFmt  ptc,
pf_Frag_Strux pfs,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
bool  bDoAll,
bool  bRevisionDelete 
) [protected]
bool pt_PieceTable::_fmtChangeStruxWithNotify ( PTChangeFmt  ptc,
pf_Frag_Strux pfs,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
bool  bRevisionDelete 
) [protected]
pf_Frag_Strux * pt_PieceTable::_getBlockFromPosition ( PT_DocPosition  pos  )  const [protected]

Get the PTX_Block that contains the given document position.

Note that pos might itself point right at a PTX_Block in which case that is the block that is returned. This might return null if there is no containing block

References _getStruxOfTypeFromPosition(), getFragFromPosition(), PTX_Block, and tryDownCastStrux().

Referenced by getBlockFromPosition(), and inSameBlock().

UT_sint32 pt_PieceTable::_getNextChangeRecordNumber ( void   )  [inline, protected]
bool pt_PieceTable::_getNextStruxAfterFragSkip ( pf_Frag pfStart,
pf_Frag_Strux **  ppfs 
) [protected]
bool pt_PieceTable::_getSpanAttrPropHelper ( pf_Frag pf,
const PP_AttrProp **  ppAP 
) const [protected]
bool pt_PieceTable::_getStruxFromFrag ( pf_Frag pfStart,
pf_Frag_Strux **  ppfs 
) const [protected]
bool pt_PieceTable::_getStruxFromFragSkip ( pf_Frag pfStart,
pf_Frag_Strux **  ppfs 
) const [protected]
bool pt_PieceTable::_getStruxFromPosition ( PT_DocPosition  docPos,
pf_Frag_Strux **  ppfs,
bool  bSkipFootnotes = false 
) const [protected]
bool pt_PieceTable::_getStruxFromPositionSkip ( PT_DocPosition  docPos,
pf_Frag_Strux **  ppfs 
) const [protected]
bool pt_PieceTable::_getStruxOfTypeFromPosition ( PT_DocPosition  dpos,
PTStruxType  pts,
pf_Frag_Strux **  ppfs 
) const [protected]
bool pt_PieceTable::_insertFmtMark ( pf_Frag pf,
UT_uint32  fragOffset,
PT_AttrPropIndex  api 
) [protected]
bool pt_PieceTable::_insertFmtMarkAfterBlockWithNotify ( pf_Frag_Strux pfsBlock,
PT_DocPosition  dpos,
PT_AttrPropIndex  api 
) [protected]
bool pt_PieceTable::_insertFmtMarkFragWithNotify ( PTChangeFmt  ptc,
PT_DocPosition  dpos,
PP_AttrProp p_AttrProp 
) [protected]
bool pt_PieceTable::_insertFmtMarkFragWithNotify ( PTChangeFmt  ptc,
PT_DocPosition  dpos,
const PP_PropertyVector attributes,
const PP_PropertyVector properties 
) [protected]
bool pt_PieceTable::_insertNoteInEmbeddedStruxList ( pf_Frag_Strux pfsNew  )  [protected]
bool pt_PieceTable::_insertObject ( pf_Frag pf,
PT_BlockOffset  fragOffset,
PTObjectType  pto,
PT_AttrPropIndex  indexAP,
pf_Frag_Object *&  pfo 
) [protected]
bool pt_PieceTable::_insertSpan ( pf_Frag pf,
PT_BufIndex  bi,
PT_BlockOffset  fragOffset,
UT_uint32  length,
PT_AttrPropIndex  indexAP,
fd_Field pField = NULL 
) [protected]
void pt_PieceTable::_insertStrux ( pf_Frag pf,
PT_BlockOffset  fragOffset,
pf_Frag_Strux pfsNew 
) [protected]
bool pt_PieceTable::_isSimpleDeleteSpan ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2 
) const [protected]
bool pt_PieceTable::_lastUndoIsThisFmtMark ( PT_DocPosition  dpos  )  [protected]
bool pt_PieceTable::_loadBuiltinStyles ( void   )  [protected]
bool pt_PieceTable::_makeFmtMark ( pf_Frag_FmtMark *&  pff  )  [protected]
bool pt_PieceTable::_makeFmtMark ( pf_Frag_FmtMark *&  pff,
const PP_PropertyVector attributes 
) [protected]
bool pt_PieceTable::_makeObject ( PTObjectType  pto,
const PP_PropertyVector attributes,
pf_Frag_Object *&  pfo 
) [protected]
bool pt_PieceTable::_makeStrux ( PTStruxType  pts,
const PP_PropertyVector attributes,
pf_Frag_Strux *&  pfs 
) [protected]
bool pt_PieceTable::_realChangeSectionAttsNoUpdate ( pf_Frag_Strux pfs,
const char *  atts,
const char *  attsValue 
) [protected]
bool pt_PieceTable::_realChangeSpanFmt ( PTChangeFmt  ptc,
PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
bool  bRevisionDelete 
) [protected]
bool pt_PieceTable::_realChangeStruxFmt ( PTChangeFmt  ptc,
PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
PTStruxType  pts,
bool  bRevisionDelete 
) [protected]
bool pt_PieceTable::_realChangeStruxForLists ( pf_Frag_Strux sdh,
const char *  pszParentID,
bool  bRevisionDelete 
) [protected]
void pt_PieceTable::_realDeleteHdrFtrStrux ( pf_Frag_Strux pfs  )  [protected]
bool pt_PieceTable::_realDeleteSpan ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
PP_AttrProp p_AttrProp_Before,
bool  bDeleteTableStruxes,
bool  bDontGlob = false 
) [protected]
bool pt_PieceTable::_realInsertObject ( PT_DocPosition  dpos,
PTObjectType  pto,
const PP_PropertyVector attributes,
const PP_PropertyVector properties 
) [protected]
bool pt_PieceTable::_realInsertObject ( PT_DocPosition  dpos,
PTObjectType  pto,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
pf_Frag_Object **  ppfo 
) [protected]
bool pt_PieceTable::_realInsertSpan ( PT_DocPosition  dpos,
const UT_UCSChar p,
UT_uint32  length,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
fd_Field pField = NULL,
bool  bAddChangeRec = true 
) [protected]
bool pt_PieceTable::_realInsertStrux ( PT_DocPosition  dpos,
PTStruxType  pts,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
pf_Frag_Strux **  ppfs_ret 
) [protected]
bool pt_PieceTable::_struxHasContent ( pf_Frag_Strux pfs  )  const [protected]
bool pt_PieceTable::_struxIsEmpty ( pf_Frag_Strux pfs  )  const [protected]
bool pt_PieceTable::_StruxIsNotTable ( pf_Frag_Strux pfs  )  [protected]

Returns true if pfs is not a strux connected with a table or frame

References pf_Frag_Strux::getStruxType(), PTX_EndCell, PTX_EndFrame, and PTX_SectionCell.

Referenced by _deleteComplexSpan().

bool pt_PieceTable::_tellAndMaybeAddListener ( PL_Listener pListener,
PL_ListenerId  listenerId,
bool  bAdd 
) [protected]
bool pt_PieceTable::_translateRevisionAttribute ( PP_RevisionAttr Revisions,
PT_AttrPropIndex  indexAP,
PP_RevisionType  eType,
PP_PropertyVector ppRevAttrib,
PP_PropertyVector ppRevProps,
const PP_PropertyVector ppAttrib,
const PP_PropertyVector ppProps 
) [protected]

A helper function which translates a revision attribute associated with fragment of type pts at pos dpos into arrays of attributes and properties suitable for passing into formating and other funcitons.

Revisions -- an instance of an empty PP_RevisionsAttr (i.e., PP_RevisionsAttr(NULL);)

ppRevAttrib -- pointers to arrays of attributes and properties; the actual props and attribs are ppRevProps found inside the Revisions variable, so the returned pointers are only valid within the Revisions scope !!!.

ppAttrib -- pointers to any attributes/properties that are to be added to this revision, can be NULL ppProps

References PP_RevisionAttr::addRevision(), gchar, PP_AttrProp::getAttribute(), getAttrProp(), PP_RevisionAttr::getLastRevision(), AD_Document::getRevisionId(), PP_RevisionAttr::getXMLstring(), AD_Document::isMarkRevisions(), m_pDocument, PP_RevisionAttr::pruneForCumulativeResult(), PP_RevisionAttr::setRevision(), and UT_return_val_if_fail.

Referenced by insertObject(), insertSpan(), and insertStrux().

bool pt_PieceTable::_tweakDeleteSpan ( PT_DocPosition dpos1,
PT_DocPosition dpos2,
UT_Stack pstDelayStruxDelete 
) const [protected]
bool pt_PieceTable::_tweakDeleteSpanOnce ( PT_DocPosition dpos1,
PT_DocPosition dpos2,
UT_Stack pstDelayStruxDelete 
) const [protected]
void pt_PieceTable::_tweakFieldSpan ( PT_DocPosition dpos1,
PT_DocPosition dpos2 
) const [protected]
void pt_PieceTable::_unlinkFrag ( pf_Frag pf,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_unlinkStrux ( pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_unlinkStrux_Block ( pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::_unlinkStrux_Section ( pf_Frag_Strux pfs,
pf_Frag **  ppfEnd,
UT_uint32 pfragOffsetEnd 
) [protected]
bool pt_PieceTable::addListener ( PL_Listener pListener,
PL_ListenerId  listenerId 
)
bool pt_PieceTable::appendFmt ( const PP_PropertyVector vecAttributes  ) 
bool pt_PieceTable::appendFmtMark ( void   ) 
bool pt_PieceTable::appendLastStruxFmt ( PTStruxType  pst,
const PP_PropertyVector attributes,
const PP_PropertyVector props,
bool  bSkipEmbededSections 
)

Changes formating of the last strux of type pts bSkipEmbededSections indicates whether when an end of an embeded section is encountered, the entire section is to be skipped over, for example if the end of the document looks like

<footnote>

</footnote>

when searching for

if bSkipEmbededSections == true the paragraph before <footnote> will be modified

References _findLastStruxOfType(), pt_VarSet::addIfUniqueAP(), PP_AttrProp::cloneWithReplacements(), getAttrProp(), pf_Fragments::getFirst(), pf_Frag::getIndexAP(), pf_Fragments::getLast(), m_fragments, m_pts, m_varset, PP_AttrProp::markReadOnly(), PTS_Loading, pf_Frag::setIndexAP(), and UT_return_val_if_fail.

Referenced by appendLastStruxFmt(), and PD_Document::appendLastStruxFmt().

bool pt_PieceTable::appendLastStruxFmt ( PTStruxType  pst,
const PP_PropertyVector attributes,
const std::string &  props,
bool  bSkipEmbededSections 
)

As above, but props represented by a single XML string

References appendLastStruxFmt(), FREEP, gchar, PP_std_copyProps(), UT_return_val_if_fail, and UT_splitPropsToArray().

bool pt_PieceTable::appendObject ( PTObjectType  pto,
const PP_PropertyVector attributes 
)
bool pt_PieceTable::appendSpan ( const UT_UCSChar p,
UT_uint32  length 
)
bool pt_PieceTable::appendStrux ( PTStruxType  pts,
const PP_PropertyVector attributes,
pf_Frag_Strux **  ppfs_ret = 0 
)
bool pt_PieceTable::appendStruxFmt ( pf_Frag_Strux pfs,
const PP_PropertyVector attributes 
)
bool pt_PieceTable::appendStyle ( const PP_PropertyVector attributes  ) 
void pt_PieceTable::beginMultiStepGlob ( void   ) 
void pt_PieceTable::beginUserAtomicGlob ( void   ) 
UT_sint32 pt_PieceTable::calcDocsize ( void   ) 

Itterate through the document to calculate the document size Don't call this in production code. This is used only for recovery and testing purposes

References pf_Fragments::getFirst(), getFragments(), pf_Frag::getLength(), pf_Frag::getNext(), pf_Frag::getType(), size, and UT_ASSERT.

bool pt_PieceTable::canDo ( bool  bUndo  )  const

References px_ChangeHistory::canDo(), and m_history.

Referenced by PD_Document::canDo().

bool pt_PieceTable::changeLastStruxFmtNoUndo ( PT_DocPosition  dpos,
PTStruxType  pts,
const PP_PropertyVector attrs,
const PP_PropertyVector props,
bool  bSkipEmbededSections 
)
bool pt_PieceTable::changeLastStruxFmtNoUndo ( PT_DocPosition  dpos,
PTStruxType  pts,
const PP_PropertyVector attrs,
const std::string &  props,
bool  bSkipEmbededSections 
)
bool pt_PieceTable::changeObjectFormatNoUpdate ( PTChangeFmt  ptc,
pf_Frag_Object pfo,
const PP_PropertyVector attributes,
const PP_PropertyVector properties 
)
bool pt_PieceTable::changeSectionAttsNoUpdate ( pf_Frag_Strux pfStrux,
const char *  attr,
const char *  attvalue 
)
bool pt_PieceTable::changeSpanFmt ( PTChangeFmt  ptc,
PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
const PP_PropertyVector attributes,
const PP_PropertyVector properties 
)
bool pt_PieceTable::changeStruxFmt ( PTChangeFmt  ptc,
PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
PTStruxType  pts = PTX_StruxDummy 
)
bool pt_PieceTable::changeStruxFmtNoUndo ( PTChangeFmt  ptc,
pf_Frag_Strux pfs,
const PP_PropertyVector attributes,
const PP_PropertyVector properties 
)

This method sends out change records to the layouts but it does put revision marks on them nor are they saved in the undo stack. It's used by the strux resizer for the hdrftr and maybe later for the frame.

References _fmtChangeStrux(), getDocument(), getFragPosition(), pf_Frag::getIndexAP(), pf_Frag::getLength(), pf_Frag_Strux::getStruxType(), m_pDocument, m_varset, pt_VarSet::mergeAP(), PD_Document::notifyListeners(), PX_ChangeRecord::PXT_ChangeStrux, UT_ASSERT_HARMLESS, UT_return_val_if_fail, and xxx_UT_DEBUGMSG.

Referenced by PD_Document::changeStruxFmtNoUndo().

bool pt_PieceTable::changeStruxForLists ( pf_Frag_Strux sdh,
const char *  pszParentID 
)
bool pt_PieceTable::changeStruxFormatNoUpdate ( PTChangeFmt  ptc,
pf_Frag_Strux pfs,
const PP_PropertyVector attributes 
)
void pt_PieceTable::clearIfAtFmtMark ( PT_DocPosition  dpos  ) 
void pt_PieceTable::clearUndo (  )  [inline]

Referenced by PD_Document::_clearUndo().

bool pt_PieceTable::createAndSendCR ( PT_DocPosition  dpos,
UT_sint32  iType,
bool  bSave,
UT_Byte  iGlob 
)
bool pt_PieceTable::createAndSendDocPropCR ( const PP_PropertyVector pAtts,
const PP_PropertyVector pProps 
)
bool pt_PieceTable::deleteFieldFrag ( pf_Frag pf  ) 
bool pt_PieceTable::deleteFmtMark ( PT_DocPosition  dpos  ) 
bool pt_PieceTable::deleteFragNoUpdate ( pf_Frag pf  ) 

Use this for deleting unused sections of the document during import. In Particular use this to remove unused headers/footers.

References getFragments(), pf_Fragments::unlinkFrag(), and UT_DEBUGMSG.

Referenced by PD_Document::_checkAndFixTable(), PD_Document::_removeHdrFtr(), and PD_Document::deleteFragNoUpdate().

void pt_PieceTable::deleteHdrFtrStrux ( pf_Frag_Strux pfs  ) 
bool pt_PieceTable::deleteSpan ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
PP_AttrProp p_AttrProp_Before,
UT_uint32 iRealDeleteCount,
bool  bDontGlob = false 
)
bool pt_PieceTable::deleteSpan ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
PP_AttrProp p_AttrProp_Before,
UT_uint32 iRealDeleteCount,
bool  bDeleteTableStruxes,
bool  bDontGlob 
)

Add a change tracking attribute/value to the given fragment.

If the attribute already exists on the fragment then it is not modified.

References _findLastStruxOfType(), _fixHdrFtrReferences(), _realChangeSpanFmt(), _realChangeStruxFmt(), _realDeleteHdrFtrStrux(), _realDeleteSpan(), ABIATTR_PARA_DELETED_REVISION, ABIATTR_PARA_END_DELETED_REVISION, ABIATTR_PARA_START_DELETED_REVISION, PP_RevisionAttr::addRevision(), pf_Frag_Strux::clearAllFmtHandles(), dumpDoc(), gchar, PP_AttrProp::getAttribute(), getAttrProp(), getEndOfBlock(), getFragFromPosition(), getFragments(), getFragsFromPositions(), PP_RevisionAttr::getGreatestLesserOrEqualRevision(), PP_Revision::getId(), pf_Frag::getIndexAP(), pf_Fragments::getLast(), pf_Frag::getLength(), pf_Frag::getNext(), pf_Frag::getPos(), pf_Frag::getPrev(), AD_Document::getRevisionId(), pf_Frag_Strux::getStruxType(), PP_Revision::getType(), pf_Frag::getType(), PP_RevisionAttr::getXMLstring(), inSameBlock(), AD_Document::isMarkRevisions(), PD_Document::isVDNDinProgress(), m_pDocument, PP_RevisionAttr::mergeAttrIfNotAlreadyThere(), pf_Frag::PFT_EndOfDoc, pf_Frag::PFT_FmtMark, pf_Frag::PFT_Object, pf_Frag::PFT_Strux, pf_Frag::PFT_Text, PP_REVISION_ADDITION_AND_FMT, PP_REVISION_DELETION, PTC_AddFmt, PTX_Block, PTX_EndAnnotation, PTX_EndCell, PTX_EndEndnote, PTX_EndFootnote, PTX_EndFrame, PTX_EndTable, PTX_EndTOC, PTX_Section, PTX_SectionAnnotation, PTX_SectionCell, PTX_SectionEndnote, PTX_SectionFootnote, PTX_SectionFrame, PTX_SectionHdrFtr, PTX_SectionTable, PTX_SectionTOC, tostr(), UT_ASSERT, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_MIN, and UT_NOT_IMPLEMENTED.

bool pt_PieceTable::deleteSpanWithTable ( PT_DocPosition  dpos1,
PT_DocPosition  dpos2,
PP_AttrProp p_AttrProp_Before,
UT_uint32 iRealDeleteCount,
bool  bDeleteTableStrux 
)

References deleteSpan().

Referenced by PD_Document::deleteSpan().

bool pt_PieceTable::deleteStruxNoUpdate ( pf_Frag_Strux sdh  ) 

Use this for deleting unneeded strux during doc import. Particularly useful for importing RTF.

References getFragments(), pf_Frag::getNext(), pf_Frag::getType(), pf_Fragments::unlinkFrag(), and UT_DEBUGMSG.

Referenced by PD_Document::deleteStrux(), and PD_Document::deleteStruxNoUpdate().

bool pt_PieceTable::deleteStruxWithNotify ( pf_Frag_Strux sdh  ) 

Delete the single strux given in sdh and create and record a change record.

References _deleteStruxWithNotify(), and pf_Frag::getPos().

Referenced by PD_Document::deleteStrux().

bool pt_PieceTable::dumpDoc ( const char *  msg,
PT_DocPosition  currentpos,
PT_DocPosition  endpos 
)
void pt_PieceTable::endMultiStepGlob ( void   ) 
void pt_PieceTable::endUserAtomicGlob ( void   ) 
bool pt_PieceTable::enumStyles ( UT_uint32  k,
const char **  pszName,
const PD_Style **  ppStyle 
) const

Do not use this function inside loops, used the other enumStyles() instead !!!

References PD_Style::getName(), UT_GenericVector< T >::getNthItem(), m_hashStyles, UT_ASSERT_HARMLESS, and UT_return_val_if_fail.

Referenced by PD_Document::enumStyles().

bool pt_PieceTable::enumStyles ( UT_GenericVector< PD_Style * > *&  pStyles  )  const

generate vector of styles the caller has to delete pStyle when done ...

References UT_GenericVector< T >::addItem(), and m_hashStyles.

void pt_PieceTable::fixMissingXIDs (  ) 

This function crawls the entire PT and assignes new xid to any fragment that should have one and does not. It is primarily to be used by exporters (accessed throught PD_Document wrapper)

References pf_Fragments::getFirst(), pf_Frag::getNext(), getXID(), pf_Frag::getXID(), m_fragments, pf_Frag::setXID(), and pf_Frag::usesXID().

Referenced by PD_Document::fixMissingXIDs().

const std::map<std::string, PD_Style *>& pt_PieceTable::getAllStyles (  )  const [inline]
bool pt_PieceTable::getAttrProp ( PT_AttrPropIndex  indexAP,
const PP_AttrProp **  ppAP 
) const

References pt_VarSet::getAP(), m_varset, and UT_return_val_if_fail.

Referenced by _deleteComplexSpanHAR(), _deleteHdrFtrsFromSectionStruxIfPresent(), _findNextHyperlink(), _findPrevHyperlink(), _fixHdrFtrReferences(), PD_Style::_getAttributeExpand(), PD_Style::_getPropertyExpand(), _realDeleteSpan(), _realInsertSpan(), _translateRevisionAttribute(), PD_Document::acceptAllRevisions(), PD_Document::acceptRejectRevision(), PD_Style::addAttributes(), PD_Style::addProperties(), PD_Style::addProperty(), PD_DocumentRDF::addXMLIDsForObjects(), appendLastStruxFmt(), appendStruxFmt(), PD_Document::areDocumentFormatsEqual(), PD_Document::areDocumentStylesheetsEqual(), changeLastStruxFmtNoUndo(), changeStruxFmt(), deleteHdrFtrStrux(), deleteSpan(), PD_DocumentRDF::dumpObjectMarkersFromDocument(), PD_Document::findForwardStyleStrux(), PD_Document::findHdrFtrStrux(), PD_Document::findPreviousStyleStrux(), PD_Document::getAllUsedStyles(), PD_Style::getAttribute(), PD_Style::getAttributeCount(), PD_Style::getAttributeExpand(), PD_Document::getAttrProp(), PD_Style::getNthAttribute(), PD_Style::getNthProperty(), PD_DocumentRDF::getObjectsInScopeOfTypesForRange(), PD_Style::getProperty(), PD_Style::getPropertyCount(), PD_Style::getPropertyExpand(), PD_Style::getPropertyType(), PD_Document::getStyleFromSDH(), pf_Frag::getXMLID(), PD_Document::isInsertHyperLinkValid(), pf_Frag::operator==(), pf_Frag_Object::pf_Frag_Object(), PD_DocumentRDF::priv_addRelevantIDsForPosition(), PD_Document::rejectAllHigherRevisions(), PD_Document::removeStyle(), PD_Document::updateDocForStyleChange(), and PD_Document::verifySectionID().

bool pt_PieceTable::getBlockBuf ( pf_Frag_Strux sdh,
UT_GrowBuf pgb 
) const

Copy paragraph (block) into buffer

Parameters:
sdh Paragraph to copy
Return values:
pgb Buffer where text should be copied to
Returns:
Always returns true

Copy the contents (unicode character data) of the paragraph (block) into the growbuf given. We append the content onto the growbuf.

References pf_Frag_Text::getBufIndex(), pf_Frag::getLength(), UT_GrowBuf::getLength(), pf_Frag::getNext(), getPointer(), pf_Frag_Strux::getStruxType(), pf_Frag::getType(), UT_GrowBuf::ins(), isEndFootnote(), isFootnote(), pf_Frag::PFT_EndOfDoc, pf_Frag::PFT_FmtMark, pf_Frag::PFT_Object, pf_Frag::PFT_Strux, pf_Frag::PFT_Text, UT_ASSERT_HARMLESS, UT_return_val_if_fail, and UT_SHOULD_NOT_HAPPEN.

Referenced by PD_Document::getBlockBuf().

pf_Frag_Strux * pt_PieceTable::getBlockFromPosition ( PT_DocPosition  pos  )  const
bool pt_PieceTable::getBounds ( bool  bEnd,
PT_DocPosition docPos 
) const
PD_Document * pt_PieceTable::getDocument ( void   ) 
pf_Frag * pt_PieceTable::getEndOfBlock ( PT_DocPosition  currentpos,
PT_DocPosition  endpos 
)

MIQ11: Work out if we are deleting from one paragraph to another in a way that we want to emit a delta:merge to have the two paragraphs merged in ODT.

Appologies for the complexity of this method, there seem to be an interesting range of "what if..." questions that come up when you are deciding if something is a delta:merge or a delta:removed-content. Having a single method to trap all of those allows the caller to just mark things appropriately using the "revision" attribute.

For .abw format the explicit marking of start/end/para deleted matters less. But the marking needs to be made so that ODT can work properly.

The delta:merge and delta:removed-content allow two or more XML elements to be joined or removed respectively in ODT+GCT [1]. Although I talk about these markup constructs from a serialized ODT file, it is best to work out what has happened at the time of document editing rather than try to work backwards at save time. These pieces of markup are put in place again when a ODT+GCT file is read so that they can again be used during a save.

Basically delta:merge lets to join two paragraphs together into a single one. If you are just removing content from the start or end of a paragraph then you are better off just using delta:removed-content. If the deletion is for one or more complete paragraphs then it is cleaner to use delta:removed-content to get rid of those paragraphs. Likewise, if deleting from mid way through a paragraph to the end of a subsequent one then you are best off using delta:removed-content on the first paragraph content and delta:removed-content on the subsequent paragraphs. It is just these edge cases that this method contains and allows the caller to simply react if we are performing a delta:merge by marking things as needed.

There are three attributes which should be set to the revision number in which they occur. The start and end deleted attributes should only be added when we are performing a delta:merge.

ABIATTR_PARA_DELETED_REVISION The whole paragraph is deleted ABIATTR_PARA_START_DELETED_REVISION The start of the paragraph was deleted, causing it to join with the previous paragraph ABIATTR_PARA_END_DELETED_REVISION The end of this paragraph is deleted, causing a subsequent paragraph to join it's content with this one.

Consider first ABIATTR_PARA_END_DELETED_REVISION which should be set to the current revision if the deletion of the selection can join the next object at the same document scope.

Note that this should only be done when the deletion ends in the middle of a paragraph. Otherwise, we should delete the end content of the paragraph (its pcdata or PFT_Text) and contain the other paragraph(s) in delta:removed-content.

This is the case when:

deleting from a para to another para.

deleting from a para through an entire table to another para

This is NOT the case when:

deleting from a para into an image (draw:frame). In this case the para content to its end is deleted and the image is wrapped in delta:removed-content.

deleting from a para to a para in a table or to a para in another cell of this or another table. In this case starting with para1, para2...paran, tableA, ... celly If the selection extends from ra1 through into celly then The content of para1 "ra1" is deleted with delta:removed-content. para2...paran are enclosed in delta:removed-content to be deleted. Each cell in the selection which from tableA is handled as a subdocument.

Firstly, this is not a delta:merge if the start and end pos are contained within the same paragraph (and startpos+1 != endpos, see below).

__Document Level Considerations__

Failing that, we want to get the paragraph (PTX_Block) for both the first and second position, if both exist then we need to make sure they are in the same table cell or no cell at all. Finding the cell is done by seeking backward from the Block.

If we hit a table end or cell end marker (PTX_EndTable | PTX_EndCell) before we find a cell start (PTX_SectionCell) then we are in a paragraph that is at the top document scope. ie, a paragraph with "no cell".

__Delete To and From the exact Start/End of Paragraph__

Another two special cases; if we are deleting right through to the end of the last paragraph then we do not mark it as a delta:merge because we perfer to delete the end content of the first paragraph and delta:removed-content the other paragraphs as that is a simpler document. Similarly, if we are deleting from the start of a para through it's end then we mark that para with delta:removed-content and remove the starting content from the last para. If there are one or more paragraphs between these start/end cases they should be wrapped in delta:removed-content too.

__Single Character Delete/Backspace To Merge__ __Delete from starting PTX_Block into the para__

When marging two paragraphs using the backspace or delete key, the range is only a single character: startpos+1 == endpos. The startpos will be the PTX_Block and the endpos likely the first char in the PFT_Text. This case is a delta:merge because we are merging the second paragraph into the content of the first. Note that we handle this case when the start and end blocks are the same even when endpos > startpos+1 because the user might have a selection starting at the PTX_Block and into the second paragraph and delete the lot in one operation.

NOTES:

__Selection to Delete Para__

Note that in the GUI you have to select from the start of the previous line in order to delete a paragraph or to merge it with the previous one. eg, if the document text is as below, to merge the second paragraph you either place the carrot at the start of the second line and backspace or the end of the first line and delete.

This is para1 And the second one.

This seems natural enough, but to delete the whole second paragraph you have to start the text selection from the carrot position just after the "para1" string, ie, the end of the first line instead of the start of the second line.

__Variable Names__

MIQ11: I have omitted the pf prefix to pointers to fragments because most of the local variables are of that type.

[1] http://monkeyiq.blogspot.com/2011/04/change-tracking-why.html Get the first strux that marks the end of the block containing currentpos or null. The end of block strux has to be positioned before endpos or null is returned.

Note that if currentpos is itself a block this method will move over that PTX_Block before searching for the end of block.

References getFragFromPosition(), pf_Frag::getLength(), pf_Frag::getPos(), pf_Frag::getType(), PTX_Block, PTX_SectionAnnotation, PTX_SectionEndnote, PTX_SectionFootnote, tryDownCastStrux(), and UT_DEBUGMSG.

Referenced by deleteSpan().

bool pt_PieceTable::getFragFromPosition ( PT_DocPosition  docPos,
pf_Frag **  ppf,
PT_BlockOffset pOffset 
) const
pf_Fragments& pt_PieceTable::getFragments ( void   )  [inline]
PT_DocPosition pt_PieceTable::getFragPosition ( const pf_Frag pfToFind  )  const
bool pt_PieceTable::getFragsFromPositions ( PT_DocPosition  dPos1,
PT_DocPosition  dPos2,
pf_Frag **  ppf1,
PT_BlockOffset pOffset1,
pf_Frag **  ppf2,
PT_BlockOffset pOffset2 
) const
bool pt_PieceTable::getNthUndo ( PX_ChangeRecord **  ppcr,
UT_uint32  undoNdx 
) const [inline]
PTState pt_PieceTable::getPieceTableState (  )  const [inline]
const UT_UCSChar* pt_PieceTable::getPointer ( PT_BufIndex  bi  )  const [inline]
PT_DocPosition pt_PieceTable::getPosEnd (  ) 

References getBounds().

bool pt_PieceTable::getRedo ( PX_ChangeRecord **  ppcr  )  const [inline]
bool pt_PieceTable::getSpanAttrProp ( pf_Frag_Strux sdh,
UT_uint32  offset,
bool  bLeftSide,
const PP_AttrProp **  ppAP 
) const
bool pt_PieceTable::getStruxFromPosition ( PL_ListenerId  listenerId,
PT_DocPosition  docPos,
fl_ContainerLayout **  psfh 
) const
bool pt_PieceTable::getStruxOfTypeFromPosition ( PL_ListenerId  listenerId,
PT_DocPosition  docPos,
PTStruxType  pts,
fl_ContainerLayout **  psfh 
) const
bool pt_PieceTable::getStruxOfTypeFromPosition ( PT_DocPosition  docPos,
PTStruxType  pts,
pf_Frag_Strux **  sdh 
) const

return the SDH of the last strux of the given type immediately prior to the given absolute document position.

References _getStruxOfTypeFromPosition().

PT_DocPosition pt_PieceTable::getStruxPosition ( pf_Frag_Strux sdh  )  const
bool pt_PieceTable::getStyle ( const char *  szName,
PD_Style **  ppStyle 
) const
size_t pt_PieceTable::getStyleCount ( void   )  const

References m_hashStyles.

Referenced by PD_Document::getStyleCount().

UT_uint32 pt_PieceTable::getTopXID (  )  const [inline]
bool pt_PieceTable::getUndo ( PX_ChangeRecord **  ppcr,
bool  bStatic = false 
) const [inline]
pt_VarSet& pt_PieceTable::getVarSet ( void   )  [inline]
UT_uint32 pt_PieceTable::getXID (  ) 
bool pt_PieceTable::hasEmbedStruxOfTypeInRange ( PT_DocPosition  posStart,
PT_DocPosition  posEnd,
PTStruxType  iType 
) const
pf_Frag_Strux * pt_PieceTable::inSameBlock ( PT_DocPosition  startpos,
PT_DocPosition  endpos 
)

Return the strux PTX_Block if both startpos and endpos are contained in the same block.

This way the method can be used both as a test to see if this is the case and the return value has added value if you actually want to inspect the block containing these positions too.

References _getBlockFromPosition(), _getStruxOfTypeFromPosition(), and PTX_Block.

Referenced by deleteSpan().

bool pt_PieceTable::insertFmtMark ( PTChangeFmt  ptc,
PT_DocPosition  dpos,
PP_AttrProp p_AttrProp 
) [inline]
bool pt_PieceTable::insertFmtMarkBeforeFrag ( pf_Frag pF  ) 
bool pt_PieceTable::insertFmtMarkBeforeFrag ( pf_Frag pF,
const PP_PropertyVector attributes 
)
bool pt_PieceTable::insertObject ( PT_DocPosition  dpos,
PTObjectType  pto,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
pf_Frag_Object **  ppfo 
)
bool pt_PieceTable::insertObject ( PT_DocPosition  dpos,
PTObjectType  pto,
const PP_PropertyVector attributes,
const PP_PropertyVector properties 
)
bool pt_PieceTable::insertObjectBeforeFrag ( pf_Frag pF,
PTObjectType  pto,
const PP_PropertyVector attributes 
)
bool pt_PieceTable::insertSpan ( PT_DocPosition  dpos,
const UT_UCSChar p,
UT_uint32  length,
fd_Field pField = NULL,
bool  bAddChangeRec = true 
)
bool pt_PieceTable::insertSpanBeforeFrag ( pf_Frag pF,
const UT_UCSChar p,
UT_uint32  length 
)
bool pt_PieceTable::insertStrux ( PT_DocPosition  dpos,
PTStruxType  pts,
pf_Frag_Strux **  ppfs_ret = 0 
)
bool pt_PieceTable::insertStrux ( PT_DocPosition  dpos,
PTStruxType  pts,
const PP_PropertyVector attributes,
const PP_PropertyVector properties,
pf_Frag_Strux **  ppfs_ret = 0 
)
bool pt_PieceTable::insertStruxBeforeFrag ( pf_Frag pF,
PTStruxType  pts,
const PP_PropertyVector attributes,
pf_Frag_Strux **  ppfs_ret = 0 
)
bool pt_PieceTable::insertStruxNoUpdateBefore ( pf_Frag_Strux sdh,
PTStruxType  pts,
const PP_PropertyVector attributes 
)

This method inserts a strux of type pts immediately before the sdh given. Attributes of the strux can be optionally passed. This method does not throw a change record and should only be used under exceptional circumstances to repair the piecetable during loading. It was necessary to import RTF tables.

References _createStrux(), _insertNoteInEmbeddedStruxList(), getDocument(), pf_Frag::getIndexAP(), pf_Frag::getPrev(), pf_Fragments::insertFrag(), m_fragments, m_pDocument, m_varset, pt_VarSet::mergeAP(), PD_Document::miniDump(), PTC_AddFmt, PTX_EndAnnotation, PTX_EndEndnote, PTX_EndFootnote, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_return_val_if_fail, and UT_UNUSED.

Referenced by PD_Document::insertStruxNoUpdateBefore().

bool pt_PieceTable::isDirty ( void   )  const
bool pt_PieceTable::isDoingTheDo ( void   )  const [inline]
bool pt_PieceTable::isEndFootnote ( pf_Frag pf  )  const
bool pt_PieceTable::isFootnote ( pf_Frag pf  )  const
bool pt_PieceTable::isInsideFootnote ( PT_DocPosition  dpos,
pf_Frag **  pfBegin = NULL 
) const

References m_embeddedStrux.

Referenced by _realChangeStruxFmt().

bool pt_PieceTable::purgeFmtMarks (  ) 
bool pt_PieceTable::redoCmd ( void   ) 
bool pt_PieceTable::removeStyle ( const gchar *  name  ) 
void pt_PieceTable::s_getLocalisedStyleName ( const char *  szStyle,
std::string &  utf8 
) [static]
const char * pt_PieceTable::s_getUnlocalisedStyleName ( const char *  szLocStyle  )  [static]
void pt_PieceTable::setClean ( void   ) 
void pt_PieceTable::setCRNumber ( UT_sint32  iCRNumber  )  [inline]
void pt_PieceTable::setDoNotTweakPosition ( bool  b  )  [inline]
void pt_PieceTable::setPieceTableState ( PTState  pts  ) 
void pt_PieceTable::setXIDThreshold ( UT_uint32  i  )  [inline]
bool pt_PieceTable::tellListener ( PL_Listener pListener  ) 
bool pt_PieceTable::tellListenerSubset ( PL_Listener pListener,
PD_DocumentRange pDocRange,
PL_ListenerCoupleCloser closer = 0 
)

Emit the start tag for things that are closed in the selected range but are not opened in that range.

Note that we walk backwards from the start of the range in order to find the matching open tags as quickly as possible even if the selection is at the end of a really large document.

A null delegate is used while we are walking backwards. If we allowed the closer to emit to the real delegate then the calls to populate() on the delegate would happen in reverse document order. So we walk backwards to find the real startPos that the closer needs and then refresh the closer by walking the range again (in case it uses stacks which were erased during the reverse walk), and then use the real delegate and walk forwards from the correct startPos that we just found. This is admittedly a bit tricky, but for a 1000 page document we really really don't want to walk all the way from the start, so walking the range twice is likely to be a small trade off in performance.

emit the close tag for things that were left open in the range.

References _tellListenerSubsetWalkRange(), pf_Frag_FmtMark::createSpecialChangeRecord(), pf_Frag_Object::createSpecialChangeRecord(), pf_Frag_Strux::createSpecialChangeRecord(), pf_Frag_Text::createSpecialChangeRecord(), DELETEP, finishedFunctorFinishingListener(), PL_ListenerCoupleCloser::getAfterContentListener(), PL_ListenerCoupleCloser::getBeforeContentListener(), getDocument(), getFragFromPosition(), pf_Frag::getLength(), pf_Frag::getNext(), PL_ListenerCoupleCloser::getNullContentListener(), pf_Frag::getType(), PD_DocumentRange::m_pos1, PD_DocumentRange::m_pos2, pf_Frag::PFT_EndOfDoc, pf_Frag::PFT_FmtMark, pf_Frag::PFT_Object, pf_Frag::PFT_Strux, pf_Frag::PFT_Text, PL_ListenerCoupleCloser::populate(), PL_Listener::populate(), PL_ListenerCoupleCloser::populateStrux(), PL_Listener::populateStrux(), PL_ListenerCoupleCloser::reset(), PL_ListenerCoupleCloser::setDelegate(), PL_ListenerCoupleCloser::setDocument(), UT_ASSERT_HARMLESS, UT_return_val_if_fail, and UT_SHOULD_NOT_HAPPEN.

Referenced by PD_Document::tellListenerSubset().

bool pt_PieceTable::undoCmd ( void   ) 
UT_uint32 pt_PieceTable::undoCount ( bool  bUndo  )  const

Friends And Related Function Documentation

friend class PX_ChangeRecord [friend]

Member Data Documentation

struct { ... } pt_PieceTable::loading [protected]
bool pt_PieceTable::m_bDoingTheDo [protected]

Referenced by _doTheDo().

Referenced by PX_ChangeRecord::getXID(), and getXID().


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