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,
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 ************************************************************************/
58 * For LWP filter architecture prototype - table cell numerics format
60 /*************************************************************************
63 ************************************************************************/
65 #include "lwpoverride.hxx"
66 #include "lwpobjid.hxx"
67 #include "lwptblcell.hxx"
68 #include "lwppara.hxx"
70 LwpCellList::LwpCellList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
)
71 : LwpDLVList(objHdr
, pStrm
)
75 LwpCellList::~LwpCellList()
78 void LwpCellList::Read()
80 // CDLFVList read construction
83 LwpDLVListHeadTail cChild
;
84 cChild
.Read(m_pObjStrm
);
86 cParent
.ReadIndexed(m_pObjStrm
);
88 if (LwpFileHeader::m_nFileRevision
< 0x0006)
89 m_pObjStrm
->SkipExtra();
91 cValue
.ReadIndexed(m_pObjStrm
);
93 LwpObjectID cDependent
;
94 cDependent
.ReadIndexed(m_pObjStrm
);
96 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 m_pObjStrm
->SeekRel(2);//CellFlags
99 m_pObjStrm
->SkipExtra();
103 void LwpCellList::Parse(IXFStream
* /*pOutputStream*/)
107 void LwpCellList::Convert(XFCell
* pCell
, LwpTableLayout
* /*pCellsMap*/)
109 LwpObjectID aValueID
= GetValueID();
110 LwpNumericValue
* pValue
= static_cast<LwpNumericValue
*>(aValueID
.obj().get());
113 pCell
->SetValue( pValue
->GetValue() );
117 LwpNumericValue::LwpNumericValue(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
)
118 : LwpObject(objHdr
, pStrm
)
122 LwpNumericValue::~LwpNumericValue()
125 void LwpNumericValue::Read()
127 cNumber
= m_pObjStrm
->QuickReadDouble();
128 m_pObjStrm
->SkipExtra();
132 void LwpNumericValue::Parse(IXFStream
* /*pOutputStream*/)
136 LwpRowList::LwpRowList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
)
137 : LwpDLVList(objHdr
, pStrm
)
141 LwpRowList::~LwpRowList()
144 void LwpRowList::Read()
146 // CDLFVList read construction
149 cChild
.Read(m_pObjStrm
);
150 cParent
.ReadIndexed(m_pObjStrm
);
152 if (LwpFileHeader::m_nFileRevision
< 0x0006)
153 m_pObjStrm
->SkipExtra();
155 cRowID
= m_pObjStrm
->QuickReaduInt16();
157 m_pObjStrm
->SkipExtra();
159 void LwpRowList::Parse(IXFStream
* /*pOutputStream*/)
163 LwpTableRange::LwpTableRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
)
164 :LwpDLVList(objHdr
, pStrm
)
167 LwpTableRange::~LwpTableRange()
170 void LwpTableRange::Read()
174 cqTable
.ReadIndexed(m_pObjStrm
);
175 cpCellRange
.ReadIndexed(m_pObjStrm
);
176 m_pObjStrm
->SkipExtra();
179 void LwpTableRange::Parse(IXFStream
* /*pOutputStream*/)
183 LwpCellRange::LwpCellRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpObject(objHdr
, pStrm
)
186 LwpCellRange::~LwpCellRange()
189 void LwpCellRange::Read()
191 cpFolder
.ReadIndexed(m_pObjStrm
);
192 m_pObjStrm
->SkipExtra();
195 void LwpCellRange::Parse(IXFStream
* /*pOutputStream*/)
199 LwpFolder::LwpFolder(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpDLVList(objHdr
, pStrm
)
202 LwpFolder::~LwpFolder()
205 void LwpFolder::Read()
207 // CDLFVList read construction
210 cChild
.Read(m_pObjStrm
);
211 cParent
.ReadIndexed(m_pObjStrm
);
213 if (LwpFileHeader::m_nFileRevision
< 0x0006)
214 m_pObjStrm
->SkipExtra();
216 cqTable
.ReadIndexed(m_pObjStrm
);
217 m_pObjStrm
->SkipExtra();
220 void LwpFolder::Parse(IXFStream
* /*pOutputStream*/)
224 LwpDependent::LwpDependent(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
)
225 : LwpDLVList(objHdr
, pStrm
)
226 , cReferenceOffset(0)
230 LwpDependent::~LwpDependent()
233 void LwpDependent::Read()
237 cFormulaInfo
.ReadIndexed(m_pObjStrm
);
238 cReferenceOffset
= m_pObjStrm
->QuickReaduInt16();
239 cFlags
= (sal_uInt8
)m_pObjStrm
->QuickReaduInt16(); // Written as lushort.
241 m_pObjStrm
->SkipExtra();
244 void LwpDependent::Parse(IXFStream
* /*pOutputStream*/)
248 void LwpRowSpecifier::QuickRead(LwpObjectStream
*pStrm
)
250 cRow
= pStrm
->QuickReaduInt16();
251 cQualifier
.QuickRead(pStrm
);
253 void LwpColumnSpecifier::QuickRead(LwpObjectStream
*pStrm
)
255 cColumn
= (sal_uInt8
)pStrm
->QuickReaduInt16();
256 cQualifier
.QuickRead(pStrm
);
259 void LwpRowColumnQualifier::QuickRead(LwpObjectStream
*pStrm
)
261 // written as lushort for future flags
262 cFlags
= (sal_uInt8
)pStrm
->QuickReaduInt16();
265 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */