00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PT_PIECETABLE_H
00023 #define PT_PIECETABLE_H
00024
00025 #include <stdio.h>
00026 #include "ut_types.h"
00027 #include "ut_growbuf.h"
00028 #include "ut_hash.h"
00029 #include "ut_stack.h"
00030 #include "pt_Types.h"
00031 #include "pp_TableAttrProp.h"
00032 #include "pf_Fragments.h"
00033 #include "pt_VarSet.h"
00034 #include "pp_Revision.h"
00035 #include "px_ChangeHistory.h"
00036
00037 class pf_Frag_Object;
00038 class pf_Frag_FmtMark;
00039 class pf_Frag_Text;
00040 class pf_Frag_Strux;
00041 class pf_Frag_Strux_Block;
00042 class pf_Frag_Strux_Section;
00043 class PX_ChangeRecord_Span;
00044 class PD_Style;
00045
00046 #ifdef PT_TEST
00047 #include "ut_test.h"
00048 #endif
00049
00052
00053
00054
00055 class ABI_EXPORT pt_PieceTable
00056 {
00057 friend class PX_ChangeRecord;
00058 public:
00059 pt_PieceTable(PD_Document * pDocument);
00060 ~pt_PieceTable();
00061
00062 void setPieceTableState(PTState pts);
00063 PTState getPieceTableState() const {return m_pts;}
00064 void beginMultiStepGlob(void);
00065 void endMultiStepGlob(void);
00066 void beginUserAtomicGlob(void);
00067 void endUserAtomicGlob(void);
00068
00069 void setClean(void);
00070 bool isDirty(void) const;
00071
00072 bool canDo(bool bUndo) const;
00073 UT_uint32 undoCount(bool bUndo) const;
00074 bool undoCmd(void);
00075 bool redoCmd(void);
00076 bool getNthUndo(PX_ChangeRecord ** ppcr, UT_uint32 undoNdx) const
00077 { return m_history.getNthUndo(ppcr, undoNdx); }
00078 bool getUndo(PX_ChangeRecord ** ppcr, bool bStatic=false) const
00079 { return m_history.getUndo(ppcr, bStatic); }
00080 bool getRedo(PX_ChangeRecord ** ppcr) const
00081 { return m_history.getRedo(ppcr); }
00082 void clearUndo() {m_history.clearHistory();}
00083
00084 static void s_getLocalisedStyleName(const char *szStyle, UT_UTF8String &utf8);
00085
00086 protected:
00087 bool _realInsertObject(PT_DocPosition dpos,
00088 PTObjectType pto,
00089 const gchar ** attributes,
00090 const gchar ** properties);
00091
00092 bool _realInsertObject(PT_DocPosition dpos,
00093 PTObjectType pto,
00094 const gchar ** attributes,
00095 const gchar ** properties, pf_Frag_Object ** ppfo );
00096
00097 bool _realInsertSpan(PT_DocPosition dpos,
00098 const UT_UCSChar * p,
00099 UT_uint32 length,
00100 const gchar ** attributes,
00101 const gchar ** properties,
00102 fd_Field * pField = NULL,
00103 bool bAddChangeRec = true);
00104
00105 bool _realDeleteSpan(PT_DocPosition dpos1,
00106 PT_DocPosition dpos2,
00107 PP_AttrProp *p_AttrProp_Before,
00108 bool bDeleteTableStruxes,
00109 bool bDontGlob=false);
00110
00111 #if 0
00112
00113 bool _realInsertSpan_norec(PT_DocPosition dpos,
00114 const UT_UCSChar * p,
00115 UT_uint32 length, fd_Field * pField = NULL);
00116 bool _realDeleteFieldFrag(pf_Frag * pf);
00117 #endif
00118
00119
00120 void _realDeleteHdrFtrStrux(pf_Frag_Strux * pfs);
00121
00122 bool _realChangeSpanFmt(PTChangeFmt ptc,
00123 PT_DocPosition dpos1,
00124 PT_DocPosition dpos2,
00125 const gchar ** attributes,
00126 const gchar ** properties,
00127 bool bRevisionDelete);
00128
00129 bool _realInsertStrux(PT_DocPosition dpos,
00130 PTStruxType pts,
00131 const gchar ** attributes,
00132 const gchar ** properties,
00133 pf_Frag_Strux ** ppfs_ret);
00134
00135 bool _realChangeStruxFmt(PTChangeFmt ptc,
00136 PT_DocPosition dpos1,
00137 PT_DocPosition dpos2,
00138 const gchar ** attributes,
00139 const gchar ** properties,
00140 PTStruxType pts,
00141 bool bRevisionDelete);
00142
00143 bool _realChangeStruxForLists(PL_StruxDocHandle sdh,
00144 const char * pszParentID,
00145 bool bRevisionDelete);
00146
00147 bool _realChangeSectionAttsNoUpdate(pf_Frag_Strux * pfStrux, const char * attr, const char * attvalue);
00148
00149
00150
00151
00152 public:
00153 bool insertObject(PT_DocPosition dpos,
00154 PTObjectType pto,
00155 const gchar ** attributes,
00156 const gchar ** properties);
00157
00158 bool insertObject(PT_DocPosition dpos,
00159 PTObjectType pto,
00160 const gchar ** attributes,
00161 const gchar ** properties, pf_Frag_Object ** ppfo );
00162
00163 bool insertSpan(PT_DocPosition dpos,
00164 const UT_UCSChar * p,
00165 UT_uint32 length, fd_Field * pField = NULL,
00166 bool bAddChangeRec = true);
00167
00168 bool deleteSpan(PT_DocPosition dpos1,
00169 PT_DocPosition dpos2,
00170 PP_AttrProp *p_AttrProp_Before,
00171 UT_uint32 &iRealDeleteCount,
00172 bool bDontGlob=false);
00173
00174
00175 bool deleteSpan(PT_DocPosition dpos1,
00176 PT_DocPosition dpos2,
00177 PP_AttrProp *p_AttrProp_Before,
00178 UT_uint32 &iRealDeleteCount,
00179 bool bDeleteTableStruxes,
00180 bool bDontGlob);
00181 bool createAndSendCR(PT_DocPosition dpos,
00182 UT_sint32 iType,bool bSave, UT_Byte iGlob);
00183
00184 bool createAndSendDocPropCR( const gchar ** pAtts, const gchar ** pProps);
00185
00186 bool deleteSpanWithTable(PT_DocPosition dpos1,
00187 PT_DocPosition dpos2,
00188 PP_AttrProp *p_AttrProp_Before,
00189 UT_uint32 &iRealDeleteCount,
00190 bool bDeleteTableStrux);
00191
00192 bool deleteFieldFrag(pf_Frag * pf);
00193
00194 void deleteHdrFtrStrux(pf_Frag_Strux * pfs);
00195
00196 bool changeSpanFmt(PTChangeFmt ptc,
00197 PT_DocPosition dpos1,
00198 PT_DocPosition dpos2,
00199 const gchar ** attributes,
00200 const gchar ** properties);
00201
00202 bool insertStrux(PT_DocPosition dpos,
00203 PTStruxType pts,
00204 pf_Frag_Strux ** ppfs_ret = 0);
00205
00206 bool insertStrux(PT_DocPosition dpos,
00207 PTStruxType pts,
00208 const gchar ** attributes,
00209 const gchar ** properties,
00210 pf_Frag_Strux ** ppfs_ret = 0
00211 );
00212
00213 bool changeStruxFmt(PTChangeFmt ptc,
00214 PT_DocPosition dpos1,
00215 PT_DocPosition dpos2,
00216 const gchar ** attributes,
00217 const gchar ** properties,
00218 PTStruxType pts=PTX_StruxDummy);
00219
00220
00221 bool changeStruxFmtNoUndo(PTChangeFmt ptc,
00222 pf_Frag_Strux * pfs,
00223 const gchar ** attributes,
00224 const gchar ** properties);
00225
00226 bool changeStruxFormatNoUpdate(PTChangeFmt ptc, pf_Frag_Strux * pfs,const gchar ** attributes);
00227
00228 bool changeObjectFormatNoUpdate(PTChangeFmt ptc, pf_Frag_Object * pfo,const gchar ** attributes,const gchar ** properties);
00229
00230 bool changeStruxForLists(PL_StruxDocHandle sdh,
00231 const char * pszParentID);
00232 bool changeSectionAttsNoUpdate(pf_Frag_Strux * pfStrux, const char * attr, const char * attvalue);
00233 bool deleteStruxNoUpdate(PL_StruxDocHandle sdh);
00234 bool deleteFragNoUpdate(pf_Frag * pf);
00235 bool deleteStruxWithNotify(PL_StruxDocHandle sdh);
00236 bool insertStruxNoUpdateBefore(PL_StruxDocHandle sdh, PTStruxType pts,const gchar ** attributes );
00237 bool changeLastStruxFmtNoUndo(PT_DocPosition dpos, PTStruxType pts,
00238 const gchar ** attrs, const gchar ** props,
00239 bool bSkipEmbededSections);
00240
00241 bool changeLastStruxFmtNoUndo(PT_DocPosition dpos, PTStruxType pts,
00242 const gchar ** attrs, const gchar * props,
00243 bool bSkipEmbededSections);
00244
00245
00246
00247 bool insertFmtMark(PTChangeFmt ptc,
00248 PT_DocPosition dpos,
00249 PP_AttrProp *p_AttrProp)
00250 {
00251 return _insertFmtMarkFragWithNotify(ptc,dpos,p_AttrProp);
00252 }
00253 bool deleteFmtMark(PT_DocPosition dpos);
00254
00255
00256
00257
00258 PD_Document * getDocument(void);
00259 bool appendStrux(PTStruxType pts, const gchar ** attributes, pf_Frag_Strux ** ppfs_ret = 0);
00260 bool appendStruxFmt(pf_Frag_Strux * pfs, const gchar ** attributes);
00261 bool appendLastStruxFmt(PTStruxType pts, const gchar ** attrs, const gchar ** props,
00262 bool bSkipEmbededSections);
00263 bool appendLastStruxFmt(PTStruxType pts, const gchar ** attrs, const gchar * props,
00264 bool bSkipEmbededSections);
00265
00266 bool appendFmt(const gchar ** attributes);
00267 bool appendFmt(const UT_GenericVector<const gchar*> * pVecAttributes);
00268 bool appendSpan(const UT_UCSChar * p, UT_uint32 length);
00269 bool appendObject(PTObjectType pto, const gchar ** attributes);
00270 bool appendFmtMark(void);
00271 bool appendStyle(const gchar ** attributes);
00272
00273 bool insertStruxBeforeFrag(pf_Frag * pF, PTStruxType pts,
00274 const gchar ** attributes, pf_Frag_Strux ** ppfs_ret = 0);
00275 bool insertSpanBeforeFrag(pf_Frag * pF, const UT_UCSChar * p, UT_uint32 length);
00276 bool insertObjectBeforeFrag(pf_Frag * pF, PTObjectType pto,
00277 const gchar ** attributes);
00278 bool insertFmtMarkBeforeFrag(pf_Frag * pF);
00279 bool insertFmtMarkBeforeFrag(pf_Frag * pF, const gchar ** attributes);
00280
00281 bool removeStyle(const gchar * name);
00282 size_t getStyleCount(void) const;
00283
00284 bool tellListener(PL_Listener * pListener);
00285 bool tellListenerSubset(PL_Listener * pListener,
00286 PD_DocumentRange * pDocRange);
00287
00288 bool addListener(PL_Listener * pListener,
00289 PL_ListenerId listenerId);
00290
00291 bool getAttrProp(PT_AttrPropIndex indexAP,
00292 const PP_AttrProp ** ppAP) const;
00293 bool getSpanAttrProp(PL_StruxDocHandle sdh, UT_uint32 offset, bool bLeftSide,
00294 const PP_AttrProp ** ppAP) const;
00295
00296 inline const UT_UCSChar *getPointer(PT_BufIndex bi) const
00297 {
00298
00299
00300
00301
00302 return m_varset.getPointer(bi);
00303 }
00304
00305 bool getBlockBuf(PL_StruxDocHandle sdh, UT_GrowBuf * pgb) const;
00306
00307 bool getBounds(bool bEnd, PT_DocPosition & docPos) const;
00308 PT_DocPosition getStruxPosition(PL_StruxDocHandle sdh) const;
00309 PT_DocPosition getFragPosition(const pf_Frag * pfToFind) const;
00310
00311 bool getFragFromPosition(PT_DocPosition docPos,
00312 pf_Frag ** ppf,
00313 PT_BlockOffset * pOffset) const;
00314
00315 bool getStruxOfTypeFromPosition(PL_ListenerId listenerId,
00316 PT_DocPosition docPos,
00317 PTStruxType pts,
00318 PL_StruxFmtHandle * psfh) const;
00319
00320
00321 bool getStruxOfTypeFromPosition(PT_DocPosition docPos,
00322 PTStruxType pts,
00323 PL_StruxDocHandle * sdh) const;
00324
00325 bool getStruxFromPosition(PL_ListenerId listenerId,
00326 PT_DocPosition docPos,
00327 PL_StruxFmtHandle * psfh) const;
00328
00329 bool getFragsFromPositions(PT_DocPosition dPos1, PT_DocPosition dPos2,
00330 pf_Frag ** ppf1, PT_BlockOffset * pOffset1,
00331 pf_Frag ** ppf2, PT_BlockOffset * pOffset2) const;
00332
00333 bool getStyle(const char * szName, PD_Style ** ppStyle) const;
00334
00335 bool enumStyles(UT_uint32 k,
00336 const char ** pszName, const PD_Style ** ppStyle) const;
00337
00338 bool enumStyles(UT_GenericVector<PD_Style*> * & pStyles) const;
00339
00340 const UT_GenericStringMap<PD_Style *> & getAllStyles()const {return m_hashStyles;}
00341 bool isEndFootnote(pf_Frag * pf) const;
00342 bool isFootnote(pf_Frag * pf) const;
00343
00344 void clearIfAtFmtMark(PT_DocPosition dpos);
00345 UT_uint32 getFragNumber(pf_Frag * pFrag) const {return m_fragments.getFragNumber(pFrag);}
00346 pt_VarSet & getVarSet(void) {return m_varset;};
00347 pf_Fragments & getFragments(void) {return m_fragments;};
00348
00349 bool purgeFmtMarks();
00350 bool isDoingTheDo(void) const
00351 { return m_bDoingTheDo;}
00352
00353 void setDoNotTweakPosition(bool b) {m_bDoNotTweakPosition = b;}
00354
00355 UT_uint32 getXID();
00356 UT_uint32 getTopXID() const {return m_iXID;}
00357 void setXIDThreshold(UT_uint32 i){m_iXID = i;}
00358 void fixMissingXIDs();
00359 void setCRNumber(UT_sint32 iCRNumber)
00360 { m_iCurCRNumber = iCRNumber;}
00361 #ifdef PT_TEST
00362 UT_TestStatus __test_VerifyCoalescedFrags(FILE * fp) const;
00363 void __dump(FILE * fp) const;
00364 px_ChangeHistory* getChangeHistory(void) const
00365 { return &m_history; }
00366 #endif
00367
00368 protected:
00369
00370 pf_Frag * _findLastStruxOfType(pf_Frag * pfStart, PTStruxType pst, bool bSkipEmbeded);
00371 pf_Frag * _findPrevHyperlink(pf_Frag * pfStart);
00372 pf_Frag * _findNextHyperlink(pf_Frag * pfStart);
00373
00374 bool _tellAndMaybeAddListener(PL_Listener * pListener,
00375 PL_ListenerId listenerId,
00376 bool bAdd);
00377
00378 void _captureActiveSpan(pf_Frag_Strux_Block * pfsBlock);
00379 PT_AttrPropIndex _chooseIndexAP(pf_Frag * pf, PT_BlockOffset fragOffset);
00380 bool _canCoalesceInsertSpan(PX_ChangeRecord_Span * pcrSpan) const;
00381
00382 bool _createStrux(PTStruxType pts,
00383 PT_AttrPropIndex indexAP,
00384 pf_Frag_Strux ** ppfs);
00385
00386 void _insertStrux(pf_Frag * pf,
00387 PT_BlockOffset fragOffset,
00388 pf_Frag_Strux * pfsNew);
00389
00390 bool _insertObject(pf_Frag * pf,
00391 PT_BlockOffset fragOffset,
00392 PTObjectType pto,
00393 PT_AttrPropIndex indexAP,
00394 pf_Frag_Object * &pfo);
00395
00396 bool _createObject(PTObjectType pto,
00397 PT_AttrPropIndex indexAP,
00398 pf_Frag_Object ** ppfo);
00399
00400 bool _insertSpan(pf_Frag * pf,
00401 PT_BufIndex bi,
00402 PT_BlockOffset fragOffset,
00403 UT_uint32 length,
00404 PT_AttrPropIndex indexAP,
00405 fd_Field * pField = NULL);
00406 bool _StruxIsNotTable(pf_Frag_Strux * pfs);
00407 bool _deleteSpan(pf_Frag_Text * pft, UT_uint32 fragOffset,
00408 PT_BufIndex bi, UT_uint32 length,
00409 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00410 void _unlinkFrag(pf_Frag * pf,
00411 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00412 bool _getStruxFromPosition(PT_DocPosition docPos,
00413 pf_Frag_Strux ** ppfs, bool bSkipFootnotes = false) const;
00414 bool _getStruxOfTypeFromPosition(PT_DocPosition dpos,
00415 PTStruxType pts,
00416 pf_Frag_Strux ** ppfs) const;
00417 bool _doTheDo(const PX_ChangeRecord * pcr, bool bUndo);
00418 bool _struxHasContent(pf_Frag_Strux * pfs) const;
00419 bool _struxIsEmpty(pf_Frag_Strux * pfs) const;
00420 bool _unlinkStrux(pf_Frag_Strux * pfs,
00421 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00422 bool _unlinkStrux_Block(pf_Frag_Strux * pfs,
00423 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00424 bool _unlinkStrux_Section(pf_Frag_Strux * pfs,
00425 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00426
00427 bool _canCoalesceDeleteSpan(PX_ChangeRecord_Span * pcrSpan) const;
00428
00429 bool _deleteSpanWithNotify(PT_DocPosition dpos,
00430 pf_Frag_Text * pft, UT_uint32 fragOffset,
00431 UT_uint32 length,
00432 pf_Frag_Strux * pfs,
00433 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd,
00434 bool bAddChangeRec = true);
00435
00436 bool _isSimpleDeleteSpan(PT_DocPosition dpos1,
00437 PT_DocPosition dpos2) const;
00438 void _tweakFieldSpan(PT_DocPosition& dpos1,
00439 PT_DocPosition& dpos2) const;
00440 bool _tweakDeleteSpanOnce(PT_DocPosition& dpos1,
00441 PT_DocPosition& dpos2,
00442 UT_Stack * pstDelayStruxDelete) const;
00443 bool _tweakDeleteSpan(PT_DocPosition& dpos1,
00444 PT_DocPosition& dpos2,
00445 UT_Stack * pstDelayStruxDelete) const;
00446 bool _deleteFormatting(PT_DocPosition dpos1,
00447 PT_DocPosition dpos2);
00448
00449 bool _deleteComplexSpan(PT_DocPosition & dpos1,
00450 PT_DocPosition & dpos2,
00451 UT_Stack *stDelayStruxDelete);
00452
00453
00454 bool _deleteComplexSpan_norec(PT_DocPosition dpos1,
00455 PT_DocPosition dpos2);
00456
00457 bool _deleteObject(pf_Frag_Object * pfo,
00458 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00459
00460 bool _deleteObjectWithNotify(PT_DocPosition dpos,
00461 pf_Frag_Object * pfo, UT_uint32 fragOffset,
00462 UT_uint32 length,
00463 pf_Frag_Strux * pfs,
00464 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd,
00465 bool bAddChangeRec = true);
00466
00467
00468
00469 bool _deleteObject_norec(PT_DocPosition dpos,
00470 pf_Frag_Object * pfo, UT_uint32 fragOffset,
00471 UT_uint32 length,
00472 pf_Frag_Strux * pfs,
00473 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00474
00475 bool _deleteStruxWithNotify(PT_DocPosition dpos,
00476 pf_Frag_Strux * pfs,
00477 pf_Frag ** ppfEnd,
00478 UT_uint32 * pfragOffsetEnd,
00479 bool bWithRec = true);
00480
00481 bool _deleteHdrFtrsFromSectionStruxIfPresent(pf_Frag_Strux_Section * pfStruxSec);
00482
00483 void _deleteHdrFtrStruxWithNotify( pf_Frag_Strux * pfFragStruxHdrFtr);
00484
00485 bool _fixHdrFtrReferences(const gchar * pType, const gchar * pId, bool bNotional = false);
00486
00487 bool _fmtChangeStrux(pf_Frag_Strux * pfs,
00488 PT_AttrPropIndex indexNewAP);
00489
00490 bool _fmtChangeStruxWithNotify(PTChangeFmt ptc,
00491 pf_Frag_Strux * pfs,
00492 const gchar ** attributes,
00493 const gchar ** properties,
00494 bool bRevisionDelete);
00495
00496 bool _fmtChangeStruxWithNotify(PTChangeFmt ptc,
00497 pf_Frag_Strux * pfs,
00498 const gchar ** attributes,
00499 const gchar ** properties,
00500 bool bDoAll,
00501 bool bRevisionDelete);
00502
00503 bool _fmtChangeSpan(pf_Frag_Text * pft, UT_uint32 fragOffset, UT_uint32 length,
00504 PT_AttrPropIndex indexNewAP,
00505 pf_Frag ** ppfNewEnd, UT_uint32 * pfragOffsetNewEnd);
00506
00507 bool _fmtChangeSpanWithNotify(PTChangeFmt ptc,
00508 pf_Frag_Text * pft, UT_uint32 fragOffset,
00509 PT_DocPosition dpos,
00510 UT_uint32 length,
00511 const gchar ** attributes,
00512 const gchar ** properties,
00513 pf_Frag_Strux * pfs,
00514 pf_Frag ** ppfNewEnd,
00515 UT_uint32 * pfragOffsetNewEnd,
00516 bool bRevisionDelete);
00517
00518 bool _fmtChangeObject(pf_Frag_Object * pfo,
00519 PT_AttrPropIndex indexNewAP,
00520 pf_Frag ** ppfNewEnd,
00521 UT_uint32 * pfragOffsetNewEnd);
00522
00523 bool _fmtChangeObjectWithNotify(PTChangeFmt ptc,
00524 pf_Frag_Object * pfo, UT_uint32 fragOffset,
00525 PT_DocPosition dpos,
00526 UT_uint32 length,
00527 const gchar ** attributes,
00528 const gchar ** properties,
00529 pf_Frag_Strux * pfs,
00530 pf_Frag ** ppfNewEnd,
00531 UT_uint32 * pfragOffsetNewEnd,
00532 bool bRevisionDelete);
00533
00534 bool _getStruxFromFrag(pf_Frag * pfStart, pf_Frag_Strux ** ppfs) const;
00535 bool _getStruxFromFragSkip(pf_Frag * pfStart, pf_Frag_Strux ** ppfs) const;
00536
00537 bool _getNextStruxAfterFragSkip(pf_Frag *pfStart, pf_Frag_Strux ** ppfs);
00538
00539 bool _getStruxFromPositionSkip(PT_DocPosition docPos,
00540 pf_Frag_Strux ** ppfs) const;
00541
00542 UT_uint32 _computeBlockOffset(pf_Frag_Strux * pfs,pf_Frag * pfTarget) const;
00543
00544 bool _loadBuiltinStyles(void);
00545 bool _createBuiltinStyle(const char * szName, bool bDisplayed, const gchar ** attributes);
00546
00547 bool _insertFmtMarkFragWithNotify(PTChangeFmt ptc,
00548 PT_DocPosition dpos,
00549 const gchar ** attributes,
00550 const gchar ** properties);
00551 bool _insertFmtMarkFragWithNotify(PTChangeFmt ptc,
00552 PT_DocPosition dpos,
00553 PP_AttrProp *p_AttrProp);
00554 bool _insertFmtMark(pf_Frag * pf, UT_uint32 fragOffset, PT_AttrPropIndex api);
00555 bool _insertFmtMarkAfterBlockWithNotify(pf_Frag_Strux * pfsBlock,
00556 PT_DocPosition dpos,
00557 PT_AttrPropIndex api);
00558 bool _deleteFmtMarkWithNotify(PT_DocPosition dpos, pf_Frag_FmtMark * pffm,
00559 pf_Frag_Strux * pfs,
00560 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00561 bool _deleteFmtMark(pf_Frag_FmtMark * pffm,
00562 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00563 bool _fmtChangeFmtMarkWithNotify(PTChangeFmt ptc, pf_Frag_FmtMark * pffm,
00564 PT_DocPosition dpos,
00565 const gchar ** attributes, const gchar ** properties,
00566 pf_Frag_Strux * pfs,
00567 pf_Frag ** ppfEnd, UT_uint32 * pfragOffsetEnd);
00568 bool _fmtChangeFmtMark(pf_Frag_FmtMark * pffm,
00569 PT_AttrPropIndex indexNewAP,
00570 pf_Frag ** ppfNewEnd,
00571 UT_uint32 * pfragOffsetNewEnd);
00572 bool _computeFmtMarkForNewBlock(pf_Frag_Strux * pfsBlock,
00573 pf_Frag * pfCurrent, PT_BlockOffset fragOffset,
00574 PT_AttrPropIndex * pFmtMarkAP);
00575 bool _getSpanAttrPropHelper(pf_Frag * pf, const PP_AttrProp ** ppAP) const;
00576 bool _lastUndoIsThisFmtMark(PT_DocPosition dpos);
00577
00578 bool _changePointWithNotify(PT_DocPosition dpos);
00579
00580
00581 bool _makeStrux(PTStruxType pts, const gchar ** attributes,
00582 pf_Frag_Strux * &pfs);
00583 bool _makeObject(PTObjectType pto, const gchar ** attributes,
00584 pf_Frag_Object * &pfo);
00585 bool _makeFmtMark(pf_Frag_FmtMark * &pff);
00586 bool _makeFmtMark(pf_Frag_FmtMark * &pff, const gchar ** attributes);
00587 UT_sint32 _getNextChangeRecordNumber(void)
00588 { return m_iCurCRNumber++;}
00589
00590 bool _translateRevisionAttribute(PP_RevisionAttr & Revisions, PT_AttrPropIndex indexAP,
00591 PP_RevisionType eType,
00592 const gchar ** & ppRevAttrib,
00593 const gchar ** & ppRevProps,
00594 const gchar ** ppAttrib,
00595 const gchar ** ppProps);
00596
00597
00598 PTState m_pts;
00599 pt_VarSet m_varset;
00600 px_ChangeHistory m_history;
00601 pf_Fragments m_fragments;
00602 UT_GenericStringMap<PD_Style *> m_hashStyles;
00603
00604 struct {
00605 PT_AttrPropIndex m_indexCurrentInlineAP;
00606 } loading;
00607
00608 PD_Document * m_pDocument;
00609
00610 UT_uint32 m_atomicGlobCount;
00611 bool m_bDoingTheDo;
00612 bool m_bDoNotTweakPosition;
00613
00614 UT_uint32 m_iXID;
00615 UT_sint32 m_iCurCRNumber;
00616 };
00617
00618 #endif