Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*************************************************************************
3 : *
4 : * The Contents of this file are made available subject to the terms of
5 : * either of the following licenses
6 : *
7 : * - GNU Lesser General Public License Version 2.1
8 : * - Sun Industry Standards Source License Version 1.1
9 : *
10 : * Sun Microsystems Inc., October, 2000
11 : *
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
16 : *
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.
20 : *
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.
25 : *
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
30 : *
31 : *
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.
38 : *
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.
45 : *
46 : * The Initial Developer of the Original Code is: IBM Corporation
47 : *
48 : * Copyright: 2008 by IBM Corporation
49 : *
50 : * All Rights Reserved.
51 : *
52 : * Contributor(s): _______________________________________
53 : *
54 : *
55 : ************************************************************************/
56 : /**
57 : * @file
58 : * For LWP filter architecture prototype - table cell numerics format
59 : */
60 : /*************************************************************************
61 : * Change History
62 : Mar 2005 Created
63 : ************************************************************************/
64 :
65 : #include "lwpoverride.hxx"
66 : #include "lwpobjid.hxx"
67 : #include "lwptblcell.hxx"
68 : #include "lwppara.hxx"
69 :
70 0 : LwpCellList::LwpCellList(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
71 : : LwpDLVList(objHdr, pStrm)
72 0 : , cColumn(0)
73 0 : {}
74 :
75 0 : LwpCellList::~LwpCellList()
76 0 : {}
77 :
78 0 : void LwpCellList::Read()
79 : {
80 : // CDLFVList read construction
81 0 : LwpDLVList::Read();
82 :
83 0 : LwpDLVListHeadTail cChild;
84 0 : cChild.Read(m_pObjStrm);
85 :
86 0 : cParent.ReadIndexed(m_pObjStrm);
87 :
88 0 : if (LwpFileHeader::m_nFileRevision < 0x0006)
89 0 : m_pObjStrm->SkipExtra();
90 :
91 0 : cValue.ReadIndexed(m_pObjStrm);
92 :
93 0 : LwpObjectID cDependent;
94 0 : cDependent.ReadIndexed(m_pObjStrm);
95 :
96 0 : cColumn = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
97 : // sal_uInt8 cCellFlags = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
98 0 : m_pObjStrm->SeekRel(2);//CellFlags
99 0 : m_pObjStrm->SkipExtra();
100 :
101 0 : }
102 :
103 0 : void LwpCellList::Parse(IXFStream* /*pOutputStream*/)
104 : {
105 0 : }
106 :
107 0 : void LwpCellList::Convert(XFCell * pCell, LwpTableLayout* /*pCellsMap*/)
108 : {
109 0 : LwpObjectID aValueID = GetValueID();
110 0 : LwpNumericValue* pValue = static_cast<LwpNumericValue*>(aValueID.obj().get());
111 0 : if (pValue)
112 : {
113 0 : pCell->SetValue( pValue->GetValue() );
114 : }
115 0 : }
116 :
117 0 : LwpNumericValue::LwpNumericValue(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
118 : : LwpObject(objHdr, pStrm)
119 0 : , cNumber(0)
120 0 : {}
121 :
122 0 : LwpNumericValue::~LwpNumericValue()
123 0 : {}
124 :
125 0 : void LwpNumericValue::Read()
126 : {
127 0 : cNumber = m_pObjStrm->QuickReadDouble();
128 0 : m_pObjStrm->SkipExtra();
129 :
130 0 : }
131 :
132 0 : void LwpNumericValue::Parse(IXFStream* /*pOutputStream*/)
133 : {
134 0 : }
135 :
136 0 : LwpRowList::LwpRowList(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
137 : : LwpDLVList(objHdr, pStrm)
138 0 : , cRowID(0)
139 0 : {}
140 :
141 0 : LwpRowList::~LwpRowList()
142 0 : {}
143 :
144 0 : void LwpRowList::Read()
145 : {
146 : // CDLFVList read construction
147 0 : LwpDLVList::Read();
148 :
149 0 : cChild.Read(m_pObjStrm);
150 0 : cParent.ReadIndexed(m_pObjStrm);
151 :
152 0 : if (LwpFileHeader::m_nFileRevision < 0x0006)
153 0 : m_pObjStrm->SkipExtra();
154 :
155 0 : cRowID = m_pObjStrm->QuickReaduInt16();
156 :
157 0 : m_pObjStrm->SkipExtra();
158 0 : }
159 0 : void LwpRowList::Parse(IXFStream* /*pOutputStream*/)
160 : {
161 0 : }
162 :
163 0 : LwpTableRange::LwpTableRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
164 0 : :LwpDLVList(objHdr, pStrm)
165 0 : {}
166 :
167 0 : LwpTableRange::~LwpTableRange()
168 0 : {}
169 :
170 0 : void LwpTableRange::Read()
171 : {
172 0 : LwpDLVList::Read();
173 :
174 0 : cqTable.ReadIndexed(m_pObjStrm);
175 0 : cpCellRange.ReadIndexed(m_pObjStrm);
176 0 : m_pObjStrm->SkipExtra();
177 0 : }
178 :
179 0 : void LwpTableRange::Parse(IXFStream* /*pOutputStream*/)
180 : {
181 0 : }
182 :
183 0 : LwpCellRange::LwpCellRange(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpObject(objHdr, pStrm)
184 0 : {}
185 :
186 0 : LwpCellRange::~LwpCellRange()
187 0 : {}
188 :
189 0 : void LwpCellRange::Read()
190 : {
191 0 : cpFolder.ReadIndexed(m_pObjStrm);
192 0 : m_pObjStrm->SkipExtra();
193 0 : }
194 :
195 0 : void LwpCellRange::Parse(IXFStream* /*pOutputStream*/)
196 : {
197 0 : }
198 :
199 0 : LwpFolder::LwpFolder(LwpObjectHeader &objHdr, LwpSvStream* pStrm):LwpDLVList(objHdr, pStrm)
200 0 : {}
201 :
202 0 : LwpFolder::~LwpFolder()
203 0 : {}
204 :
205 0 : void LwpFolder::Read()
206 : {
207 : // CDLFVList read construction
208 0 : LwpDLVList::Read();
209 :
210 0 : cChild.Read(m_pObjStrm);
211 0 : cParent.ReadIndexed(m_pObjStrm);
212 :
213 0 : if (LwpFileHeader::m_nFileRevision < 0x0006)
214 0 : m_pObjStrm->SkipExtra();
215 :
216 0 : cqTable.ReadIndexed(m_pObjStrm);
217 0 : m_pObjStrm->SkipExtra();
218 0 : }
219 :
220 0 : void LwpFolder::Parse(IXFStream* /*pOutputStream*/)
221 : {
222 0 : }
223 :
224 0 : LwpDependent::LwpDependent(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
225 : : LwpDLVList(objHdr, pStrm)
226 : , cReferenceOffset(0)
227 0 : , cFlags(0)
228 0 : {}
229 :
230 0 : LwpDependent::~LwpDependent()
231 0 : {}
232 :
233 0 : void LwpDependent::Read()
234 : {
235 0 : LwpDLVList::Read();
236 :
237 0 : cFormulaInfo.ReadIndexed(m_pObjStrm);
238 0 : cReferenceOffset = m_pObjStrm->QuickReaduInt16();
239 0 : cFlags = (sal_uInt8)m_pObjStrm->QuickReaduInt16(); // Written as lushort.
240 :
241 0 : m_pObjStrm->SkipExtra();
242 0 : }
243 :
244 0 : void LwpDependent::Parse(IXFStream* /*pOutputStream*/)
245 : {
246 0 : }
247 :
248 0 : void LwpRowSpecifier::QuickRead(LwpObjectStream *pStrm)
249 : {
250 0 : cRow = pStrm->QuickReaduInt16();
251 0 : cQualifier.QuickRead(pStrm);
252 0 : }
253 0 : void LwpColumnSpecifier::QuickRead(LwpObjectStream *pStrm)
254 : {
255 0 : cColumn = (sal_uInt8)pStrm->QuickReaduInt16();
256 0 : cQualifier.QuickRead(pStrm);
257 0 : }
258 :
259 0 : void LwpRowColumnQualifier::QuickRead(LwpObjectStream *pStrm)
260 : {
261 : // written as lushort for future flags
262 0 : cFlags = (sal_uInt8)pStrm->QuickReaduInt16();
263 0 : }
264 :
265 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|