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 //////////////////////////////////////////////////////////////////
71 LwpCellList::LwpCellList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpDLVList(objHdr
, pStrm
)
74 LwpCellList::~LwpCellList()
77 void LwpCellList::Read()
79 // CDLFVList read construction
82 LwpDLVListHeadTail cChild
;
83 cChild
.Read(m_pObjStrm
);
85 cParent
.ReadIndexed(m_pObjStrm
);
87 if (LwpFileHeader::m_nFileRevision
< 0x0006)
88 m_pObjStrm
->SkipExtra();
90 cValue
.ReadIndexed(m_pObjStrm
);
92 LwpObjectID cDependent
;
93 cDependent
.ReadIndexed(m_pObjStrm
);
95 cColumn
= (sal_uInt8
) m_pObjStrm
->QuickReaduInt16(); // written as a sal_uInt16
96 // sal_uInt8 cCellFlags = (sal_uInt8) m_pObjStrm->QuickReaduInt16(); // written as a sal_uInt16
97 m_pObjStrm
->SeekRel(2);//CellFlags
98 m_pObjStrm
->SkipExtra();
102 void LwpCellList::Parse(IXFStream
* /*pOutputStream*/)
106 void LwpCellList::Convert(XFCell
* pCell
, LwpTableLayout
* /*pCellsMap*/)
108 LwpObjectID aValueID
= GetValueID();
109 LwpNumericValue
* pValue
= (LwpNumericValue
*)aValueID
.obj();
112 pCell
->SetValue( pValue
->GetValue() );
116 //////////////////////////////////////////////////////////////////
117 LwpNumericValue::LwpNumericValue(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpObject(objHdr
, pStrm
)
120 LwpNumericValue::~LwpNumericValue()
123 void LwpNumericValue::Read()
125 cNumber
= m_pObjStrm
->QuickReadDouble();
126 m_pObjStrm
->SkipExtra();
129 void LwpNumericValue::Parse(IXFStream
* /*pOutputStream*/)
132 //////////////////////////////////////////////////////////////////
133 LwpRowList::LwpRowList(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpDLVList(objHdr
, pStrm
)
136 LwpRowList::~LwpRowList()
139 void LwpRowList::Read()
141 // CDLFVList read construction
144 cChild
.Read(m_pObjStrm
);
145 cParent
.ReadIndexed(m_pObjStrm
);
147 if (LwpFileHeader::m_nFileRevision
< 0x0006)
148 m_pObjStrm
->SkipExtra();
150 cRowID
= m_pObjStrm
->QuickReaduInt16();
152 m_pObjStrm
->SkipExtra();
154 void LwpRowList::Parse(IXFStream
* /*pOutputStream*/)
158 //////////////////////////////////////////////////////////////////
159 LwpTableRange::LwpTableRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
)
160 :LwpDLVList(objHdr
, pStrm
)
163 LwpTableRange::~LwpTableRange()
166 void LwpTableRange::Read()
170 cqTable
.ReadIndexed(m_pObjStrm
);
171 cpCellRange
.ReadIndexed(m_pObjStrm
);
172 m_pObjStrm
->SkipExtra();
175 void LwpTableRange::Parse(IXFStream
* /*pOutputStream*/)
179 //////////////////////////////////////////////////////////////////
180 LwpCellRange::LwpCellRange(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpObject(objHdr
, pStrm
)
183 LwpCellRange::~LwpCellRange()
186 void LwpCellRange::Read()
188 cpFolder
.ReadIndexed(m_pObjStrm
);
189 m_pObjStrm
->SkipExtra();
192 void LwpCellRange::Parse(IXFStream
* /*pOutputStream*/)
196 //////////////////////////////////////////////////////////////////
198 LwpFolder::LwpFolder(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpDLVList(objHdr
, pStrm
)
201 LwpFolder::~LwpFolder()
204 void LwpFolder::Read()
206 // CDLFVList read construction
209 cChild
.Read(m_pObjStrm
);
210 cParent
.ReadIndexed(m_pObjStrm
);
212 if (LwpFileHeader::m_nFileRevision
< 0x0006)
213 m_pObjStrm
->SkipExtra();
215 cqTable
.ReadIndexed(m_pObjStrm
);
216 m_pObjStrm
->SkipExtra();
219 void LwpFolder::Parse(IXFStream
* /*pOutputStream*/)
223 //////////////////////////////////////////////////////////////////
225 LwpDependent::LwpDependent(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
):LwpDLVList(objHdr
, pStrm
)
228 LwpDependent::~LwpDependent()
231 void LwpDependent::Read()
235 cFormulaInfo
.ReadIndexed(m_pObjStrm
);
236 cReferenceOffset
= m_pObjStrm
->QuickReaduInt16();
237 cFlags
= (sal_uInt8
)m_pObjStrm
->QuickReaduInt16(); // Written as lushort.
239 m_pObjStrm
->SkipExtra();
242 void LwpDependent::Parse(IXFStream
* /*pOutputStream*/)
245 //////////////////////////////////////////////////////////////////
247 void LwpRowSpecifier::QuickRead(LwpObjectStream
*pStrm
)
249 cRow
= pStrm
->QuickReaduInt16();
250 cQualifier
.QuickRead(pStrm
);
252 void LwpColumnSpecifier::QuickRead(LwpObjectStream
*pStrm
)
254 cColumn
= (sal_uInt8
)pStrm
->QuickReaduInt16();
255 cQualifier
.QuickRead(pStrm
);
258 void LwpRowColumnQualifier::QuickRead(LwpObjectStream
*pStrm
)
260 // written as lushort for future flags
261 cFlags
= (sal_uInt8
)pStrm
->QuickReaduInt16();
264 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */