1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: class7.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_goodies.hxx"
38 // ---------------------------------------------------------------
40 void CGM::ImplDoClass7()
42 switch ( mnElementID
)
44 case 0x01 : ComOut( CGM_LEVEL1
, "Message" ) break;
47 sal_uInt8
* pAppData
= mpSource
+ 12;
48 sal_uInt16
* pTemp
= (sal_uInt16
*)mpSource
;
49 sal_uInt16 nOpcode
= pTemp
[ 4 ];
51 if ( mpChart
|| ( nOpcode
== 0 ) )
55 case 0x000 : ComOut( CGM_LEVEL1
, "AppData - Beginning of File Opcodes" )
57 if ( mpChart
== NULL
)
58 mpChart
= new CGMChart( *this );
59 mpChart
->mnCurrentFileType
= pAppData
[ 3 ];
62 case 0x001 : ComOut( CGM_LEVEL1
, "AppData - End of File Opcodes" ) break;
63 case 0x190 : ComOut( CGM_LEVEL1
, "AppData - FDESC" ) break;
64 case 0x192 : ComOut( CGM_LEVEL1
, "AppData - FNOTES" ) break;
65 case 0x1F4 : ComOut( CGM_LEVEL1
, "AppData - BOGENFILE" ) break;
66 case 0x1F5 : ComOut( CGM_LEVEL1
, "AppData - EOGENFILE" ) break;
67 case 0x1F8 : ComOut( CGM_LEVEL1
, "AppData - BOCHTGROUP" ) break;
68 case 0x1F9 : ComOut( CGM_LEVEL1
, "AppData - EOCHTGROUP" ) break;
69 case 0x1FC : ComOut( CGM_LEVEL1
, "AppData - BOCHTDATA" ) break;
70 case 0x1FD : ComOut( CGM_LEVEL1
, "AppData - EOCHTDATA" )
72 mpOutAct
->DrawChart();
75 case 0x200 : ComOut( CGM_LEVEL1
, "AppData - BOSYMGROUP" ) break;
76 case 0x201 : ComOut( CGM_LEVEL1
, "AppData - EOSYMGROUP" ) break;
77 case 0x204 : ComOut( CGM_LEVEL1
, "AppData - BEGSYMBOL" ) break;
78 case 0x205 : ComOut( CGM_LEVEL1
, "AppData - ENDSYMBOL" ) break;
79 case 0x208 : ComOut( CGM_LEVEL1
, "AppData - BOSHWGROUP" ) break;
80 case 0x209 : ComOut( CGM_LEVEL1
, "AppData - EOSHWGROUP" ) break;
81 case 0x260 : ComOut( CGM_LEVEL1
, "AppData - BEGGROUP" ) break;
82 case 0x262 : ComOut( CGM_LEVEL1
, "AppData - ENDGROUP" ) break;
83 case 0x264 : ComOut( CGM_LEVEL1
, "AppData - DATANODE" )
85 mpChart
->mDataNode
[ 0 ] = *(DataNode
*)( pAppData
);
86 sal_Int8 nZoneEnum
= mpChart
->mDataNode
[ 0 ].nZoneEnum
;
87 if ( nZoneEnum
&& ( nZoneEnum
<= 6 ) )
88 mpChart
->mDataNode
[ nZoneEnum
] = *(DataNode
*)( pAppData
);
91 case 0x2BE : ComOut( CGM_LEVEL1
, "AppData - SHWSLIDEREC" )
93 if ( mnMode
& CGM_EXPORT_IMPRESS
)
95 if ( pAppData
[ 16 ] == 0 ) // a blank template ?
97 if ( pAppData
[ 2 ] == 46 )
99 // this starts the document -> maybe we could insert a new document
101 else if ( pAppData
[ 2 ] & 0x80 )
103 // this is a template
107 mpOutAct
->InsertPage();
110 mpChart
->ResetAnnotation();
114 case 0x2C0 : ComOut( CGM_LEVEL1
, "AppData - SHWKEYTABLE" ) break;
115 case 0x2C2 : ComOut( CGM_LEVEL1
, "AppData - SHWBUTTONTAB" ) break;
116 case 0x2C4 : ComOut( CGM_LEVEL1
, "AppData - SHWGLOBAL" ) break;
117 case 0x2C6 : ComOut( CGM_LEVEL1
, "AppData - SHWTITLE" ) break;
118 case 0x2CA : ComOut( CGM_LEVEL1
, "AppData - SHWAPP" ) break;
119 case 0x320 : ComOut( CGM_LEVEL1
, "AppData - TEXT" )
121 TextEntry
* pTextEntry
= new TextEntry
;
122 pTextEntry
->nTypeOfText
= *((sal_uInt16
*)( pAppData
) );
123 pTextEntry
->nRowOrLineNum
= *((sal_uInt16
*)( pAppData
+ 2 ) );
124 pTextEntry
->nColumnNum
= *((sal_uInt16
*)( pAppData
+ 4 ) );
125 sal_uInt16 nAttributes
= *( (sal_uInt16
*)( pAppData
+ 6 ) );
126 pTextEntry
->nZoneSize
= nAttributes
& 0xff;
127 pTextEntry
->nLineType
= ( nAttributes
>> 8 ) & 0xf;
129 pTextEntry
->nAttributes
= nAttributes
;
131 sal_uInt32 nLen
= strlen( (char*)( pAppData
) ) + 1;
132 pTextEntry
->pText
= new char[ nLen
];
133 memcpy( pTextEntry
->pText
, pAppData
, nLen
);
136 TextAttribute
* pTextOld
= 0;
137 for ( sal_uInt16 i
= 0; i
< nAttributes
; i
++ )
139 TextAttribute
* pTextAttr
= new TextAttribute
;
141 *pTextAttr
= *(TextAttribute
*)( pAppData
);
143 pTextAttr
->pNextAttribute
= NULL
;
145 pTextEntry
->pAttribute
= pTextAttr
;
147 pTextOld
->pNextAttribute
= pTextAttr
;
149 pAppData
+= sizeof( TextAttribute
) - 4;
150 pTextOld
= pTextAttr
;
152 mpChart
->InsertTextEntry( pTextEntry
);
155 case 0x321 : ComOut( CGM_LEVEL1
, "AppData - IOC_TABS" ) break;
156 case 0x322 : ComOut( CGM_LEVEL1
, "AppData - CHARTZONE" )
158 mpChart
->mChartZone
= *( ChartZone
* )( pAppData
);
161 case 0x324 : ComOut( CGM_LEVEL1
, "AppData - TITLEZONE" ) break;
162 case 0x328 : ComOut( CGM_LEVEL1
, "AppData - FOOTNOTEZONE" ) break;
163 case 0x32A : ComOut( CGM_LEVEL1
, "AppData - LEGENDZONE" ) break;
164 case 0x330 : ComOut( CGM_LEVEL1
, "AppData - PAGEORIENTDIM" )
166 mpChart
->mPageOrientDim
= *( PageOrientDim
*)( pAppData
);
169 case 0x334 : ComOut( CGM_LEVEL1
, "AppData - CHTZONEOPTN" )
171 mpChart
->mZoneOption
= *( ZoneOption
*)( pAppData
);
174 case 0x336 : ComOut( CGM_LEVEL1
, "AppData - CHTINTL" )
176 mpChart
->mIntSettings
= *( IntSettings
*)( pAppData
);
179 case 0x338 : ComOut( CGM_LEVEL1
, "AppData - CHTLINESPC" ) break;
180 case 0x384 : ComOut( CGM_LEVEL1
, "AppData - ORGGRIDSTATE" ) break;
181 case 0x386 : ComOut( CGM_LEVEL1
, "AppData - ORGSCRSTATE" ) break;
182 case 0x388 : ComOut( CGM_LEVEL1
, "AppData - ORGTREESTATE" ) break;
183 case 0x38A : ComOut( CGM_LEVEL1
, "AppData - ORGTEXTOPTN" ) break;
184 case 0x38E : ComOut( CGM_LEVEL1
, "AppData - ORGBOXOPTN" ) break;
185 case 0x390 : ComOut( CGM_LEVEL1
, "AppData - ORGBOXDIM" ) break;
186 case 0x392 : ComOut( CGM_LEVEL1
, "AppData - ORGBOX" ) break;
187 case 0x3EA : ComOut( CGM_LEVEL1
, "AppData - TTLTEXTOPTN" ) break;
188 case 0x3EE : ComOut( CGM_LEVEL1
, "AppData - TTLAUTOBUILD" ) break;
189 case 0x44E : ComOut( CGM_LEVEL1
, "AppData - BULTEXTOPTN" ) break;
190 case 0x452 : ComOut( CGM_LEVEL1
, "AppData - BULLETOPTN" )
192 mpChart
->mBulletOption
= *( BulletOption
*)( pAppData
);
195 case 0x454 : ComOut( CGM_LEVEL1
, "AppData - BULLETLINES" )
197 mpChart
->mBulletLines
= *( BulletLines
*)( pAppData
);
200 case 0x456 : ComOut( CGM_LEVEL1
, "AppData - BULAUTOBUILD" ) break;
201 case 0x4B2 : ComOut( CGM_LEVEL1
, "AppData - TBLTEXTOPTN" ) break;
202 case 0x4B6 : ComOut( CGM_LEVEL1
, "AppData - TBLOPTN" ) break;
203 case 0x4B8 : ComOut( CGM_LEVEL1
, "AppData - TBLCOLOPTN" ) break;
204 case 0x4BA : ComOut( CGM_LEVEL1
, "AppData - TBLLEGENDOPTN" ) break;
205 case 0x4BC : ComOut( CGM_LEVEL1
, "AppData - TBLRANGEOPTN" ) break;
206 case 0x4BE : ComOut( CGM_LEVEL1
, "AppData - TBLROWOPTN" ) break;
207 case 0x4C0 : ComOut( CGM_LEVEL1
, "AppData - TBLAUTOBUILD" ) break;
208 case 0x518 : ComOut( CGM_LEVEL1
, "AppData - PIECHARTOPTN" ) break;
209 case 0x51A : ComOut( CGM_LEVEL1
, "AppData - PIELEGENDOPTN" ) break;
210 case 0x51C : ComOut( CGM_LEVEL1
, "AppData - PIETEXTOPTN" ) break;
211 case 0x51E : ComOut( CGM_LEVEL1
, "AppData - PIEOPTN" ) break;
212 case 0x520 : ComOut( CGM_LEVEL1
, "AppData - PIEPCTLABOPTN" ) break;
213 case 0x522 : ComOut( CGM_LEVEL1
, "AppData - PIEVALLABOPTN" ) break;
214 case 0x524 : ComOut( CGM_LEVEL1
, "AppData - PIESLICE" ) break;
215 case 0x57A : ComOut( CGM_LEVEL1
, "AppData - XYAXISOPTN" ) break;
216 case 0x57C : ComOut( CGM_LEVEL1
, "AppData - XYGRIDOPTN" ) break;
217 case 0x57D : ComOut( CGM_LEVEL1
, "AppData - XYGRIDSHOWFILL" ) break;
218 case 0x57E : ComOut( CGM_LEVEL1
, "AppData - XYSERIESOPTN" ) break;
219 case 0x580 : ComOut( CGM_LEVEL1
, "AppData - XYSTYLEOPTN" ) break;
220 case 0x582 : ComOut( CGM_LEVEL1
, "AppData - XYTABLEOPTN" ) break;
221 case 0x584 : ComOut( CGM_LEVEL1
, "AppData - XYTEXTOPTN" ) break;
222 case 0x586 : ComOut( CGM_LEVEL1
, "AppData - XYDATAOPTN" ) break;
223 case 0x58A : ComOut( CGM_LEVEL1
, "AppData - XYLEGENDOPN" ) break;
224 case 0x58C : ComOut( CGM_LEVEL1
, "AppData - XYCALCULATION" ) break;
225 case 0x58E : ComOut( CGM_LEVEL1
, "AppData - XYXVALUE" ) break;
226 case 0x590 : ComOut( CGM_LEVEL1
, "AppData - XYYVALUE" ) break;
227 case 0x592 : ComOut( CGM_LEVEL1
, "AppData - XYXEXTVALUE" ) break;
228 case 0x618 : ComOut( CGM_LEVEL1
, "AppData - IOC_CHTCOLRTAB" ) break;
229 case 0x619 : ComOut( CGM_LEVEL1
, "AppData - IOC_CHTFONTTAB" ) break;
230 case 0x1fff : ComOut( CGM_LEVEL1
, "AppData - 0x1fff" ) break;
231 default : ComOut( CGM_LEVEL1
, "UNKNOWN Application Data" ) break;
234 mnParaSize
= mnElementSize
;
237 default: ComOut( CGM_UNKNOWN_COMMAND
, "" ) break;