Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / lotuswordpro / source / filter / lwptblcell.cxx
blob249d6101cb8daca733d8b92a5bf09aa0a19a3f34
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /**
57 * @file
58 * For LWP filter architecture prototype - table cell numerics format
61 #include "lwpoverride.hxx"
62 #include "lwpobjid.hxx"
63 #include "lwptblcell.hxx"
64 #include "lwppara.hxx"
66 LwpCellList::LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
67 : LwpDLVList(objHdr, pStrm)
68 , cColumn(0)
71 LwpCellList::~LwpCellList()
74 void LwpCellList::Read()
76 // CDLFVList read construction
77 LwpDLVList::Read();
79 LwpDLVListHeadTail cChild;
80 cChild.Read(m_pObjStrm);
82 cParent.ReadIndexed(m_pObjStrm);
84 if (LwpFileHeader::m_nFileRevision < 0x0006)
85 m_pObjStrm->SkipExtra();
87 cValue.ReadIndexed(m_pObjStrm);
89 LwpObjectID cDependent;
90 cDependent.ReadIndexed(m_pObjStrm);
92 cColumn = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
93 // sal_uInt8 cCellFlags = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
94 m_pObjStrm->SeekRel(2);//CellFlags
95 m_pObjStrm->SkipExtra();
99 void LwpCellList::Parse(IXFStream* /*pOutputStream*/)
103 void LwpCellList::Convert(XFCell * pCell, LwpTableLayout* /*pCellsMap*/)
105 LwpObjectID aValueID = GetValueID();
106 LwpNumericValue* pValue = dynamic_cast<LwpNumericValue*>(aValueID.obj().get());
107 if (pValue)
109 pCell->SetValue( pValue->GetValue() );
113 LwpNumericValue::LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
114 : LwpObject(objHdr, pStrm)
115 , cNumber(0)
118 LwpNumericValue::~LwpNumericValue()
121 void LwpNumericValue::Read()
123 cNumber = m_pObjStrm->QuickReadDouble();
124 m_pObjStrm->SkipExtra();
128 void LwpNumericValue::Parse(IXFStream* /*pOutputStream*/)
132 LwpRowList::LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
133 : LwpDLVList(objHdr, pStrm)
134 , cRowID(0)
137 LwpRowList::~LwpRowList()
140 void LwpRowList::Read()
142 // CDLFVList read construction
143 LwpDLVList::Read();
145 cChild.Read(m_pObjStrm);
146 cParent.ReadIndexed(m_pObjStrm);
148 if (LwpFileHeader::m_nFileRevision < 0x0006)
149 m_pObjStrm->SkipExtra();
151 cRowID = m_pObjStrm->QuickReaduInt16();
153 m_pObjStrm->SkipExtra();
155 void LwpRowList::Parse(IXFStream* /*pOutputStream*/)
159 LwpTableRange::LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
160 :LwpDLVList(objHdr, pStrm)
163 LwpTableRange::~LwpTableRange()
166 void LwpTableRange::Read()
168 LwpDLVList::Read();
170 cqTable.ReadIndexed(m_pObjStrm);
171 cpCellRange.ReadIndexed(m_pObjStrm);
172 m_pObjStrm->SkipExtra();
175 void LwpTableRange::Parse(IXFStream* /*pOutputStream*/)
179 LwpCellRange::LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpObject(objHdr, pStrm)
182 LwpCellRange::~LwpCellRange()
185 void LwpCellRange::Read()
187 cpFolder.ReadIndexed(m_pObjStrm);
188 m_pObjStrm->SkipExtra();
191 void LwpCellRange::Parse(IXFStream* /*pOutputStream*/)
195 LwpFolder::LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
198 LwpFolder::~LwpFolder()
201 void LwpFolder::Read()
203 // CDLFVList read construction
204 LwpDLVList::Read();
206 cChild.Read(m_pObjStrm);
207 cParent.ReadIndexed(m_pObjStrm);
209 if (LwpFileHeader::m_nFileRevision < 0x0006)
210 m_pObjStrm->SkipExtra();
212 cqTable.ReadIndexed(m_pObjStrm);
213 m_pObjStrm->SkipExtra();
216 void LwpFolder::Parse(IXFStream* /*pOutputStream*/)
220 LwpDependent::LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
221 : LwpDLVList(objHdr, pStrm)
222 , cReferenceOffset(0)
223 , cFlags(0)
226 LwpDependent::~LwpDependent()
229 void LwpDependent::Read()
231 LwpDLVList::Read();
233 cFormulaInfo.ReadIndexed(m_pObjStrm);
234 cReferenceOffset = m_pObjStrm->QuickReaduInt16();
235 cFlags = (sal_uInt8)m_pObjStrm->QuickReaduInt16(); // Written as lushort.
237 m_pObjStrm->SkipExtra();
240 void LwpDependent::Parse(IXFStream* /*pOutputStream*/)
244 void LwpRowSpecifier::QuickRead(LwpObjectStream *pStrm)
246 cRow = pStrm->QuickReaduInt16();
247 cQualifier.QuickRead(pStrm);
249 void LwpColumnSpecifier::QuickRead(LwpObjectStream *pStrm)
251 cColumn = (sal_uInt8)pStrm->QuickReaduInt16();
252 cQualifier.QuickRead(pStrm);
255 void LwpRowColumnQualifier::QuickRead(LwpObjectStream *pStrm)
257 // written as lushort for future flags
258 cFlags = (sal_uInt8)pStrm->QuickReaduInt16();
261 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */