1 /* AbiWord
2 * Copyright (C) 1998 AbiSource, Inc.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA.
18 */
19
20
21 #include "ut_types.h"
22 #include "pt_Types.h"
23 #include "px_ChangeRecord.h"
24 #include "px_CR_ObjectChange.h"
25
PX_ChangeRecord_ObjectChange(PXType type,PT_DocPosition position,PT_AttrPropIndex indexOldAP,PT_AttrPropIndex indexNewAP,PTObjectType pto,PT_BlockOffset blockOffset,bool bRevisionDelete)26 PX_ChangeRecord_ObjectChange::PX_ChangeRecord_ObjectChange(PXType type,
27 PT_DocPosition position,
28 PT_AttrPropIndex indexOldAP,
29 PT_AttrPropIndex indexNewAP,
30 PTObjectType pto,
31 PT_BlockOffset blockOffset,
32 bool bRevisionDelete)
33 : PX_ChangeRecord(type, position, indexNewAP, 0),
34 m_bRevisionDelete(bRevisionDelete)
35 {
36 m_indexOldAP = indexOldAP;
37 m_objectType = pto;
38 m_blockOffset = blockOffset;
39 }
40
~PX_ChangeRecord_ObjectChange()41 PX_ChangeRecord_ObjectChange::~PX_ChangeRecord_ObjectChange()
42 {
43 }
44
reverse(void) const45 PX_ChangeRecord * PX_ChangeRecord_ObjectChange::reverse(void) const
46 {
47 PX_ChangeRecord_ObjectChange * pcr
48 = new PX_ChangeRecord_ObjectChange(getRevType(),
49 m_position,
50 m_indexAP,m_indexOldAP,
51 m_objectType,
52 m_blockOffset,
53 m_bRevisionDelete);
54 UT_ASSERT_HARMLESS(pcr);
55 return pcr;
56 }
57
getOldIndexAP(void) const58 PT_AttrPropIndex PX_ChangeRecord_ObjectChange::getOldIndexAP(void) const
59 {
60 return m_indexOldAP;
61 }
62
getObjectType(void) const63 PTObjectType PX_ChangeRecord_ObjectChange::getObjectType(void) const
64 {
65 return m_objectType;
66 }
67
getBlockOffset(void) const68 PT_BlockOffset PX_ChangeRecord_ObjectChange::getBlockOffset(void) const
69 {
70 return m_blockOffset;
71 }
72