merge the formfield patch from ooo-build
[ooovba.git] / lotuswordpro / source / filter / lwptblcell.cxx
blob3d8dcb48aa01b59645d3ea064008e258c9acd21d
1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /**
56 * @file
57 * For LWP filter architecture prototype - table cell numerics format
59 /*************************************************************************
60 * Change History
61 Mar 2005 Created
62 ************************************************************************/
64 #include "lwpoverride.hxx"
65 #include "lwpobjid.hxx"
66 #include "lwptblcell.hxx"
67 #include "lwppara.hxx"
69 //////////////////////////////////////////////////////////////////
70 LwpCellList::LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
73 LwpCellList::~LwpCellList()
76 void LwpCellList::Read()
78 // CDLFVList read construction
79 LwpDLVList::Read();
81 LwpDLVListHeadTail cChild;
82 cChild.Read(m_pObjStrm);
84 cParent.ReadIndexed(m_pObjStrm);
86 if (LwpFileHeader::m_nFileRevision < 0x0006)
87 m_pObjStrm->SkipExtra();
89 cValue.ReadIndexed(m_pObjStrm);
91 LwpObjectID cDependent;
92 cDependent.ReadIndexed(m_pObjStrm);
94 cColumn = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
95 // sal_uInt8 cCellFlags = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
96 m_pObjStrm->SeekRel(2);//CellFlags
97 m_pObjStrm->SkipExtra();
100 void LwpCellList::Parse(IXFStream* pOutputStream)
103 void LwpCellList::Convert(XFCell * pCell, LwpTableLayout* pCellsMap)
105 LwpObjectID aValueID = GetValueID();
106 LwpNumericValue* pValue = (LwpNumericValue*)aValueID.obj();
107 if (pValue)
109 pCell->SetValue( pValue->GetValue() );
113 //////////////////////////////////////////////////////////////////
114 LwpNumericValue::LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpObject(objHdr, pStrm)
117 LwpNumericValue::~LwpNumericValue()
120 void LwpNumericValue::Read()
122 m_pObjStrm->QuickRead(&cNumber, sizeof(cNumber));
123 m_pObjStrm->SkipExtra();
126 void LwpNumericValue::Parse(IXFStream* pOutputStream)
129 //////////////////////////////////////////////////////////////////
130 LwpRowList::LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
133 LwpRowList::~LwpRowList()
136 void LwpRowList::Read()
138 // CDLFVList read construction
139 LwpDLVList::Read();
141 cChild.Read(m_pObjStrm);
142 cParent.ReadIndexed(m_pObjStrm);
144 if (LwpFileHeader::m_nFileRevision < 0x0006)
145 m_pObjStrm->SkipExtra();
147 cRowID = m_pObjStrm->QuickReaduInt16();
149 m_pObjStrm->SkipExtra();
151 void LwpRowList::Parse(IXFStream* pOutputStream)
155 //////////////////////////////////////////////////////////////////
156 LwpTableRange::LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
157 :LwpDLVList(objHdr, pStrm)
160 LwpTableRange::~LwpTableRange()
163 void LwpTableRange::Read()
165 LwpDLVList::Read();
167 cqTable.ReadIndexed(m_pObjStrm);
168 cpCellRange.ReadIndexed(m_pObjStrm);
169 m_pObjStrm->SkipExtra();
171 void LwpTableRange::Parse(IXFStream* pOutputStream)
174 //////////////////////////////////////////////////////////////////
175 LwpCellRange::LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpObject(objHdr, pStrm)
178 LwpCellRange::~LwpCellRange()
181 void LwpCellRange::Read()
183 cpFolder.ReadIndexed(m_pObjStrm);
184 m_pObjStrm->SkipExtra();
186 void LwpCellRange::Parse(IXFStream* pOutputStream)
189 //////////////////////////////////////////////////////////////////
191 LwpFolder::LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
194 LwpFolder::~LwpFolder()
197 void LwpFolder::Read()
199 // CDLFVList read construction
200 LwpDLVList::Read();
202 cChild.Read(m_pObjStrm);
203 cParent.ReadIndexed(m_pObjStrm);
205 if (LwpFileHeader::m_nFileRevision < 0x0006)
206 m_pObjStrm->SkipExtra();
208 cqTable.ReadIndexed(m_pObjStrm);
209 m_pObjStrm->SkipExtra();
211 void LwpFolder::Parse(IXFStream* pOutputStream)
214 //////////////////////////////////////////////////////////////////
216 LwpDependent::LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
219 LwpDependent::~LwpDependent()
222 void LwpDependent::Read()
224 LwpDLVList::Read();
226 cFormulaInfo.ReadIndexed(m_pObjStrm);
227 cReferenceOffset = m_pObjStrm->QuickReaduInt16();
228 cFlags = (sal_uInt8)m_pObjStrm->QuickReaduInt16(); // Written as lushort.
230 m_pObjStrm->SkipExtra();
232 void LwpDependent::Parse(IXFStream* pOutputStream)
235 //////////////////////////////////////////////////////////////////
237 void LwpRowSpecifier::QuickRead(LwpObjectStream *pStrm)
239 cRow = pStrm->QuickReaduInt16();
240 cQualifier.QuickRead(pStrm);
242 void LwpColumnSpecifier::QuickRead(LwpObjectStream *pStrm)
244 cColumn = (sal_uInt8)pStrm->QuickReaduInt16();
245 cQualifier.QuickRead(pStrm);
248 void LwpRowColumnQualifier::QuickRead(LwpObjectStream *pStrm)
250 // written as lushort for future flags
251 cFlags = (sal_uInt8)pStrm->QuickReaduInt16();