1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/* { dg-do compile } */
typedef unsigned int UT_uint32;
typedef UT_uint32 PT_DocPosition;
typedef UT_uint32 PT_BlockOffset;
typedef enum _PTStruxType { PTX_Block } PTStruxType;
typedef UT_uint32 PL_ListenerId;
typedef const void * PL_StruxFmtHandle;
class PX_ChangeRecord;
class pf_Frag {
public:
typedef enum _PFType { PFT_Object } PFType;
inline PFType getType(void) const { }
inline pf_Frag * getNext(void) const { }
PT_DocPosition getPos(void) const { }
};
class pf_Fragments {
public:
pf_Frag * getFirst() const;
};
class pt_PieceTable {
bool getStruxOfTypeFromPosition(PL_ListenerId listenerId, PT_DocPosition docPos, PTStruxType pts, PL_StruxFmtHandle * psfh) const;
bool _tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd);
pf_Fragments m_fragments;
};
class pf_Frag_Object : public pf_Frag
{
public:
virtual bool createSpecialChangeRecord(PX_ChangeRecord ** ppcr, PT_DocPosition dpos, PT_BlockOffset blockOffset) const;
};
bool pt_PieceTable::_tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd)
{
PL_StruxFmtHandle sfh = 0;
PT_DocPosition sum = 0;
UT_uint32 blockOffset = 0;
for (pf_Frag * pf = m_fragments.getFirst(); (pf); pf=pf->getNext())
{
pf_Frag_Object * pfo = static_cast<pf_Frag_Object *> (pf);
PX_ChangeRecord * pcr = __null;
bool bStatus1 = false;
if(sfh != __null) {
bStatus1 = pfo->createSpecialChangeRecord(&pcr,sum,blockOffset);
if (!(bStatus1))
return (false);
}
else
{
PT_DocPosition pos = pf->getPos();
getStruxOfTypeFromPosition(listenerId,pos,PTX_Block,&sfh);
bStatus1 = pfo->createSpecialChangeRecord(&pcr,pos,blockOffset);
if (!(bStatus1))
return (false);
}
if (!(bStatus1))
return (false);
}
}
|