LibreOffice Module lotuswordpro (master) 1
lwplaypiece.cxx
Go to the documentation of this file.
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
59 ************************************************************************/
60
61#include "lwplaypiece.hxx"
62#include "lwpstyledef.hxx"
63#include <lwpfilehdr.hxx>
64
65
67 : m_nRotation(0)
68{}
69
71{
72 m_nRotation = pStrm->QuickReadInt16();
73}
74
76 : LwpVirtualPiece(objHdr, pStrm)
77 , m_nWidth(0)
78 , m_nHeight(0)
79 , m_ContentOrientation(0)
80{}
81
83{}
84
86{
88
90 {
91 m_nWidth = m_pObjStrm->QuickReadInt32();
92 m_nHeight = m_pObjStrm->QuickReadInt32();
96 m_ContentOrientation = m_pObjStrm->QuickReaduInt8();
97 m_pObjStrm->SkipExtra();
98 }
99}
100void LwpLayoutGeometry::Parse(IXFStream* /*pOutputStream*/)
101{}
102
104 : LwpVirtualPiece(objHdr, pStrm)
105 , m_nScaleMode(0)
106 , m_nScalePercentage(0)
107 , m_nScaleWidth(0)
108 , m_nScaleHeight(0)
109 , m_nContentRotation(0)
110 , m_nPlacement(0)
111{}
112
114{}
115
117{
119
121 {
122 m_nScaleMode = m_pObjStrm->QuickReaduInt16();
123 m_nScalePercentage = m_pObjStrm->QuickReaduInt32();
124 m_nScaleWidth = m_pObjStrm->QuickReadInt32();
125 m_nScaleHeight = m_pObjStrm->QuickReadInt32();
126 m_nContentRotation = m_pObjStrm->QuickReaduInt16();
127 m_Offset.Read(m_pObjStrm.get());
128
129 m_nPlacement = m_pObjStrm->QuickReaduInt16();
130 m_pObjStrm->SkipExtra();
131 }
132}
133
134void LwpLayoutScale::Parse(IXFStream* /*pOutputStream*/)
135{}
136
138 : LwpVirtualPiece(objHdr, pStrm)
139{}
140
142{}
143
145{
147
148 if( LwpFileHeader::m_nFileRevision >= 0x000B )
149 {
153 m_pObjStrm->SkipExtra();
154 }
155}
156
157void LwpLayoutMargins::Parse(IXFStream* /*pOutputStream*/)
158{}
159
161 : LwpVirtualPiece(objHdr, pStrm)
162{}
163
165{}
166
168{
170
171 if( LwpFileHeader::m_nFileRevision >= 0x000B )
172 {
174 m_pObjStrm->SkipExtra();
175 }
176}
177
178void LwpLayoutBorder::Parse(IXFStream* /*pOutputStream*/)
179{}
180
182 : LwpVirtualPiece(objHdr, pStrm)
183{}
184
186{}
187
189{
191
192 if( LwpFileHeader::m_nFileRevision >= 0x000B )
193 {
195 m_pObjStrm->SkipExtra();
196 }
197}
198
199void LwpLayoutBackground::Parse(IXFStream* /*pOutputStream*/)
200{}
201
203{}
204
206{}
207
209{
210 if( LwpFileHeader::m_nFileRevision < 0x000F )
211 return;
212
213 //enum {BORDER,JOIN};
214 m_LeftName.Read(pStrm);
215 m_TopName.Read(pStrm);
216 m_RightName.Read(pStrm);
217 m_BottomName.Read(pStrm);
218 // TODO: Do not know what it is for
219 /*cLeftName = CStyleMgr::GetUniqueMetaFileName(cLeftName,BORDER);
220 cRightName = CStyleMgr::GetUniqueMetaFileName(cRightName,BORDER);
221 cTopName = CStyleMgr::GetUniqueMetaFileName(cTopName,BORDER);
222 cBottomName = CStyleMgr::GetUniqueMetaFileName(cBottomName,BORDER);*/
223 pStrm->SkipExtra();
224}
225
227 : LwpVirtualPiece(objHdr, pStrm)
228{}
229
231{}
232
234{
236
237 if( LwpFileHeader::m_nFileRevision >= 0x000B )
238 {
240 m_pObjStrm->SkipExtra();
241 }
242}
243
245{}
246
248 : m_nWidth(0)
249 , m_nGap(0)
250{}
251
253{
254 m_nWidth = pStrm->QuickReadInt32();
255 m_nGap = pStrm->QuickReadInt32();
256}
257
259 : LwpVirtualPiece(objHdr, pStrm)
260 , m_nNumCols(0)
261{}
262
264{
265}
266
268{
270
271 if( LwpFileHeader::m_nFileRevision >= 0x000B )
272 {
273 m_nNumCols = m_pObjStrm->QuickReaduInt16();
274 m_pColumns.reset( new LwpColumnInfo[m_nNumCols] );
275 for(int i=0; i<m_nNumCols; i++)
276 {
277 m_pColumns[i].Read(m_pObjStrm.get());
278 }
279 m_pObjStrm->SkipExtra();
280 }
281}
282
283double LwpLayoutColumns::GetColGap(sal_uInt16 nIndex)
284{
285 if(nIndex >= m_nNumCols)
286 {
287 return 0;
288 }
289 return m_pColumns[nIndex].GetGap();
290}
291
292void LwpLayoutColumns::Parse(IXFStream* /*pOutputStream*/)
293{}
294
296 : LwpVirtualPiece(objHdr, pStrm)
297{}
298
300{}
301
303{
305
306 if( LwpFileHeader::m_nFileRevision >= 0x000B )
307 {
309 m_pObjStrm->SkipExtra();
310 }
311}
312
313void LwpLayoutGutters::Parse(IXFStream* /*pOutputStream*/)
314{}
315
317 : m_nPercentage(0)
318 , m_nCorners(0)
319 , m_nWidth(0)
320 , m_nHeight(0)
321 , m_nID(0)
322 , m_nScaling(0)
323{}
324
326{
327 m_nWidth = pStrm->QuickReadInt32();
328 m_nHeight = pStrm->QuickReadInt32();
330 m_nID = pStrm->QuickReaduInt16();
331 m_nCorners = pStrm->QuickReaduInt16();
332 m_nScaling = pStrm->QuickReaduInt16();
333 m_Color.Read(pStrm);
334 pStrm->SkipExtra();
335
336 // Bug fix: if reading in from something older than Release 9
337 // then check for the external ID and change it to solid.
339 {
340 if (m_nID & EXTERNAL_ID)
341 m_nID = MITRE;
342 }
343}
344
346 : LwpVirtualPiece(objHdr, pStrm)
347{}
348
350{}
351
353{
355
356 if( LwpFileHeader::m_nFileRevision >= 0x000B )
357 {
359 m_pObjStrm->SkipExtra();
360 }
361}
362
363void LwpLayoutJoins::Parse(IXFStream* /*pOutputStream*/)
364{}
365
367 : LwpVirtualPiece(objHdr, pStrm)
368{}
369
371{}
372
374{
376
377 if( LwpFileHeader::m_nFileRevision >= 0x000B )
378 {
379 m_Shadow.Read(m_pObjStrm.get());
380 m_pObjStrm->SkipExtra();
381 }
382}
383
384void LwpLayoutShadow::Parse(IXFStream* /*pOutputStream*/)
385{}
386
388 : m_nRelType(LAY_PARENT_RELATIVE),
389 m_nRelFromWhere(LAY_UPPERLEFT),
390 m_nTether(LAY_UPPERLEFT),
391 m_nTetherWhere(LAY_BORDER),
392 m_nFlags(0)
393{
396}
397/**************************************************************************
398 * @descr: Read LayoutRelativityGuts' information.
399**************************************************************************/
401{
402 m_nRelType = pStrm->QuickReaduInt8();
404 m_RelDistance.Read(pStrm);
405 m_nTether = pStrm->QuickReaduInt8();
408 {
409 m_nFlags = pStrm->QuickReaduInt8();
410 }
411 else
412 {
413 m_nFlags = 0;
414 }
415}
416
418 : LwpVirtualPiece(objHdr, pStrm)
419{
420}
421
423{
424}
425
427{
430 {
432 m_pObjStrm->SkipExtra();
433 }
434}
435
436void LwpLayoutRelativity::Parse(IXFStream * /*pOutputStream*/)
437{
438}
439
440/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
void Read(LwpObjectStream *pStrm)
@descr read atomholder from object stream the default encoding used in Word Pro is 1252
void Read(LwpObjectStream *pStrm)
void Read(LwpObjectStream *pStrm)
void Read(LwpObjectStream *pStrm)
@descr read color and then resolve the RGB values
Definition: lwpcolor.cxx:74
sal_Int32 m_nWidth
void Read(LwpObjectStream *pStrm)
sal_Int32 m_nGap
LwpAtomHolder m_BottomName
LwpAtomHolder m_TopName
LwpAtomHolder m_RightName
void Read(LwpObjectStream *pStrm)
LwpAtomHolder m_LeftName
static sal_uInt16 m_nFileRevision
Definition: lwpfilehdr.hxx:77
sal_Int32 m_nWidth
sal_uInt16 m_nCorners
void Read(LwpObjectStream *pStrm)
LwpColor m_Color
sal_uInt16 m_nScaling
sal_uInt16 m_nPercentage
sal_Int32 m_nHeight
sal_uInt16 m_nID
LwpLayoutBackground(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
LwpBackgroundStuff m_BackgroundStuff
virtual ~LwpLayoutBackground() override
virtual void Read() override
@descr Read LwpDLVList data from object stream
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
LwpLayoutBorder(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual ~LwpLayoutBorder() override
LwpBorderStuff m_BorderStuff
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
virtual void Read() override
@descr Read LwpDLVList data from object stream
double GetColGap(sal_uInt16 nIndex)
LwpLayoutColumns(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual ~LwpLayoutColumns() override
sal_uInt16 m_nNumCols
virtual void Read() override
@descr Read LwpDLVList data from object stream
std::unique_ptr< LwpColumnInfo[]> m_pColumns
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
LwpLayoutExternalBorder(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
LwpExternalBorder m_ExtranalBorder
virtual void Read() override
@descr Read LwpDLVList data from object stream
virtual ~LwpLayoutExternalBorder() override
sal_Int32 m_nHeight
Definition: lwplaypiece.hxx:96
LwpPoint m_AbsoluteOrigin
Definition: lwplaypiece.hxx:98
LwpRotor m_ContainerRotor
Definition: lwplaypiece.hxx:99
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
LwpLayoutGeometry(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwplaypiece.cxx:75
sal_Int32 m_nWidth
Definition: lwplaypiece.hxx:95
sal_uInt8 m_ContentOrientation
virtual void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwplaypiece.cxx:85
virtual ~LwpLayoutGeometry() override
Definition: lwplaypiece.cxx:82
LwpLayoutGutters(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
LwpBorderStuff m_BorderBuffer
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
virtual ~LwpLayoutGutters() override
virtual void Read() override
@descr Read LwpDLVList data from object stream
LwpJoinStuff m_JoinStuff
virtual ~LwpLayoutJoins() override
virtual void Read() override
@descr Read LwpDLVList data from object stream
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
LwpLayoutJoins(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
LwpMargins m_ExtMargins
virtual void Read() override
@descr Read LwpDLVList data from object stream
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
LwpMargins m_ExtraMargins
virtual ~LwpLayoutMargins() override
LwpMargins m_Margins
LwpLayoutMargins(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void Read(LwpObjectStream *pStrm)
virtual void Read() override
@descr Read LwpDLVList data from object stream
LwpLayoutRelativity(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
LwpLayoutRelativityGuts m_RelGuts
virtual ~LwpLayoutRelativity() override
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
sal_Int32 m_nScaleHeight
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
virtual void Read() override
@descr Read LwpDLVList data from object stream
sal_uInt16 m_nContentRotation
sal_uInt32 m_nScalePercentage
sal_uInt16 m_nScaleMode
LwpLayoutScale(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
sal_uInt16 m_nPlacement
virtual ~LwpLayoutScale() override
sal_Int32 m_nScaleWidth
LwpPoint m_Offset
LwpLayoutShadow(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
LwpShadow m_Shadow
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
virtual void Read() override
@descr Read LwpDLVList data from object stream
virtual ~LwpLayoutShadow() override
void Read(LwpObjectStream *pStrm)
Definition: lwpmargins.hxx:73
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
sal_uInt16 QuickReaduInt16(bool *pFailure=nullptr)
@descr Quick read sal_uInt32
Definition: lwpobjstrm.cxx:200
void SkipExtra()
@descr skip extra bytes
Definition: lwpobjstrm.cxx:258
sal_Int16 QuickReadInt16()
@descr Quick read sal_Int16
Definition: lwpobjstrm.cxx:220
sal_uInt8 QuickReaduInt8(bool *pFailure=nullptr)
@descr Quick read sal_uInt8
Definition: lwpobjstrm.cxx:230
sal_Int32 QuickReadInt32()
@descr Quick read sal_Int32
Definition: lwpobjstrm.cxx:211
std::unique_ptr< LwpObjectStream > m_pObjStrm
Definition: lwpobj.hxx:90
void Read(LwpObjectStream *pStrm)
@descr read point from object stream
Definition: lwpbasetype.cxx:79
void SetY(sal_Int32 nY)
void SetX(sal_Int32 nX)
sal_Int16 m_nRotation
Definition: lwplaypiece.hxx:77
void Read(LwpObjectStream *pStrm)
Definition: lwplaypiece.cxx:70
void Read(LwpObjectStream *pStrm)
Definition: lwpshadow.hxx:71
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
virtual void Read() override
@descr Read LwpDLVList data from object stream
Definition: lwppiece.hxx:83
sal_Int32 m_nFlags
sal_Int32 nIndex
#define EXTERNAL_ID
Definition: lwpstyledef.hxx:61
int i