1*9e0fc027SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9e0fc027SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9e0fc027SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9e0fc027SAndrew Rist  * distributed with this work for additional information
6*9e0fc027SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9e0fc027SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9e0fc027SAndrew Rist  * "License"); you may not use this file except in compliance
9*9e0fc027SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9e0fc027SAndrew Rist  *
11*9e0fc027SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9e0fc027SAndrew Rist  *
13*9e0fc027SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9e0fc027SAndrew Rist  * software distributed under the License is distributed on an
15*9e0fc027SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9e0fc027SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9e0fc027SAndrew Rist  * specific language governing permissions and limitations
18*9e0fc027SAndrew Rist  * under the License.
19*9e0fc027SAndrew Rist  *
20*9e0fc027SAndrew Rist  *************************************************************/
21*9e0fc027SAndrew Rist 
22*9e0fc027SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_filter.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <main.hxx>
28cdf0e10cSrcweir #include <chart.hxx>
29cdf0e10cSrcweir #include <outact.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir // ---------------------------------------------------------------
32cdf0e10cSrcweir 
ImplDoClass7()33cdf0e10cSrcweir void CGM::ImplDoClass7()
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 	switch ( mnElementID )
36cdf0e10cSrcweir 	{
37cdf0e10cSrcweir 		case 0x01 : ComOut( CGM_LEVEL1, "Message" ) break;
38cdf0e10cSrcweir 		case 0x02 :
39cdf0e10cSrcweir 		{
40cdf0e10cSrcweir 			sal_uInt8*  pAppData = mpSource + 12;
41cdf0e10cSrcweir 			sal_uInt16* pTemp = (sal_uInt16*)mpSource;
42cdf0e10cSrcweir 			sal_uInt16 nOpcode = pTemp[ 4 ];
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 			if ( mpChart || ( nOpcode == 0 ) )
45cdf0e10cSrcweir 			{
46cdf0e10cSrcweir 				switch ( nOpcode )
47cdf0e10cSrcweir 				{
48cdf0e10cSrcweir 					case 0x000 : ComOut( CGM_LEVEL1, "AppData - Beginning of File Opcodes" )
49cdf0e10cSrcweir 					{
50cdf0e10cSrcweir 						if ( mpChart == NULL )
51cdf0e10cSrcweir 							mpChart = new CGMChart( *this );
52cdf0e10cSrcweir 						mpChart->mnCurrentFileType = pAppData[ 3 ];
53cdf0e10cSrcweir 					}
54cdf0e10cSrcweir 					break;
55cdf0e10cSrcweir 					case 0x001 : ComOut( CGM_LEVEL1, "AppData - End of File Opcodes" ) break;
56cdf0e10cSrcweir 					case 0x190 : ComOut( CGM_LEVEL1, "AppData - FDESC" ) break;
57cdf0e10cSrcweir 					case 0x192 : ComOut( CGM_LEVEL1, "AppData - FNOTES" ) break;
58cdf0e10cSrcweir 					case 0x1F4 : ComOut( CGM_LEVEL1, "AppData - BOGENFILE" ) break;
59cdf0e10cSrcweir 					case 0x1F5 : ComOut( CGM_LEVEL1, "AppData - EOGENFILE" ) break;
60cdf0e10cSrcweir 					case 0x1F8 : ComOut( CGM_LEVEL1, "AppData - BOCHTGROUP" ) break;
61cdf0e10cSrcweir 					case 0x1F9 : ComOut( CGM_LEVEL1, "AppData - EOCHTGROUP" ) break;
62cdf0e10cSrcweir 					case 0x1FC : ComOut( CGM_LEVEL1, "AppData - BOCHTDATA" ) break;
63cdf0e10cSrcweir 					case 0x1FD : ComOut( CGM_LEVEL1, "AppData - EOCHTDATA" )
64cdf0e10cSrcweir 					{
65cdf0e10cSrcweir 						mpOutAct->DrawChart();
66cdf0e10cSrcweir 					}
67cdf0e10cSrcweir 					break;
68cdf0e10cSrcweir 					case 0x200 : ComOut( CGM_LEVEL1, "AppData - BOSYMGROUP" ) break;
69cdf0e10cSrcweir 					case 0x201 : ComOut( CGM_LEVEL1, "AppData - EOSYMGROUP" ) break;
70cdf0e10cSrcweir 					case 0x204 : ComOut( CGM_LEVEL1, "AppData - BEGSYMBOL" ) break;
71cdf0e10cSrcweir 					case 0x205 : ComOut( CGM_LEVEL1, "AppData - ENDSYMBOL" ) break;
72cdf0e10cSrcweir 					case 0x208 : ComOut( CGM_LEVEL1, "AppData - BOSHWGROUP" ) break;
73cdf0e10cSrcweir 					case 0x209 : ComOut( CGM_LEVEL1, "AppData - EOSHWGROUP" ) break;
74cdf0e10cSrcweir 					case 0x260 : ComOut( CGM_LEVEL1, "AppData - BEGGROUP" ) break;
75cdf0e10cSrcweir 					case 0x262 : ComOut( CGM_LEVEL1, "AppData - ENDGROUP" ) break;
76cdf0e10cSrcweir 					case 0x264 : ComOut( CGM_LEVEL1, "AppData - DATANODE" )
77cdf0e10cSrcweir 					{
78cdf0e10cSrcweir 						mpChart->mDataNode[ 0 ] = *(DataNode*)( pAppData );
79cdf0e10cSrcweir 						sal_Int8 nZoneEnum = mpChart->mDataNode[ 0 ].nZoneEnum;
80cdf0e10cSrcweir 						if ( nZoneEnum && ( nZoneEnum <= 6 ) )
81cdf0e10cSrcweir 							mpChart->mDataNode[ nZoneEnum ] = *(DataNode*)( pAppData );
82cdf0e10cSrcweir 					}
83cdf0e10cSrcweir 					break;
84cdf0e10cSrcweir 					case 0x2BE : ComOut( CGM_LEVEL1, "AppData - SHWSLIDEREC" )
85cdf0e10cSrcweir 					{
86cdf0e10cSrcweir 						if ( mnMode & CGM_EXPORT_IMPRESS )
87cdf0e10cSrcweir 						{
88cdf0e10cSrcweir 							if ( pAppData[ 16 ] == 0 )		// a blank template ?
89cdf0e10cSrcweir 							{
90cdf0e10cSrcweir 								if ( pAppData[ 2 ] == 46 )
91cdf0e10cSrcweir 								{
92cdf0e10cSrcweir 									// this starts the document -> maybe we could insert a new document
93cdf0e10cSrcweir 								}
94cdf0e10cSrcweir 								else if ( pAppData[ 2 ] & 0x80 )
95cdf0e10cSrcweir 								{
96cdf0e10cSrcweir 									// this is a template
97cdf0e10cSrcweir 								}
98cdf0e10cSrcweir 								else
99cdf0e10cSrcweir 								{
100cdf0e10cSrcweir 									mpOutAct->InsertPage();
101cdf0e10cSrcweir 								}
102cdf0e10cSrcweir 							}
103cdf0e10cSrcweir 							mpChart->ResetAnnotation();
104cdf0e10cSrcweir 						}
105cdf0e10cSrcweir 					}
106cdf0e10cSrcweir 					break;
107cdf0e10cSrcweir 					case 0x2C0 : ComOut( CGM_LEVEL1, "AppData - SHWKEYTABLE" ) break;
108cdf0e10cSrcweir 					case 0x2C2 : ComOut( CGM_LEVEL1, "AppData - SHWBUTTONTAB" ) break;
109cdf0e10cSrcweir 					case 0x2C4 : ComOut( CGM_LEVEL1, "AppData - SHWGLOBAL" ) break;
110cdf0e10cSrcweir 					case 0x2C6 : ComOut( CGM_LEVEL1, "AppData - SHWTITLE" ) break;
111cdf0e10cSrcweir 					case 0x2CA : ComOut( CGM_LEVEL1, "AppData - SHWAPP" ) break;
112cdf0e10cSrcweir 					case 0x320 : ComOut( CGM_LEVEL1, "AppData - TEXT" )
113cdf0e10cSrcweir 					{
114cdf0e10cSrcweir 						TextEntry* pTextEntry = new TextEntry;
115cdf0e10cSrcweir 						pTextEntry->nTypeOfText = *((sal_uInt16*)( pAppData ) );
116cdf0e10cSrcweir 						pTextEntry->nRowOrLineNum = *((sal_uInt16*)( pAppData + 2 ) );
117cdf0e10cSrcweir 						pTextEntry->nColumnNum = *((sal_uInt16*)( pAppData + 4 ) );
118cdf0e10cSrcweir 						sal_uInt16 nAttributes = *( (sal_uInt16*)( pAppData + 6 ) );
119cdf0e10cSrcweir 						pTextEntry->nZoneSize = nAttributes & 0xff;
120cdf0e10cSrcweir 						pTextEntry->nLineType = ( nAttributes >> 8 ) & 0xf;
121cdf0e10cSrcweir 						nAttributes >>= 12;
122cdf0e10cSrcweir 						pTextEntry->nAttributes = nAttributes;
123cdf0e10cSrcweir 						pAppData += 8;
124cdf0e10cSrcweir 						sal_uInt32 nLen = strlen( (char*)( pAppData ) ) + 1;
125cdf0e10cSrcweir 						pTextEntry->pText = new char[ nLen ];
126cdf0e10cSrcweir 						memcpy( pTextEntry->pText, pAppData, nLen );
127cdf0e10cSrcweir 						pAppData += nLen;
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 						TextAttribute* pTextOld = 0;
130cdf0e10cSrcweir 						for ( sal_uInt16 i = 0; i < nAttributes; i++ )
131cdf0e10cSrcweir 						{
132cdf0e10cSrcweir 							TextAttribute* pTextAttr = new TextAttribute;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 							*pTextAttr = *(TextAttribute*)( pAppData );
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 							pTextAttr->pNextAttribute = NULL;
137cdf0e10cSrcweir 							if ( i == 0 )
138cdf0e10cSrcweir 								pTextEntry->pAttribute = pTextAttr;
139cdf0e10cSrcweir 							else
140cdf0e10cSrcweir 								pTextOld->pNextAttribute = pTextAttr;
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 							pAppData += sizeof( TextAttribute ) - 4;
143cdf0e10cSrcweir 							pTextOld = pTextAttr;
144cdf0e10cSrcweir 						}
145cdf0e10cSrcweir 						mpChart->InsertTextEntry( pTextEntry );
146cdf0e10cSrcweir 					}
147cdf0e10cSrcweir 					break;
148cdf0e10cSrcweir 					case 0x321 : ComOut( CGM_LEVEL1, "AppData - IOC_TABS" ) break;
149cdf0e10cSrcweir 					case 0x322 : ComOut( CGM_LEVEL1, "AppData - CHARTZONE" )
150cdf0e10cSrcweir 					{
151cdf0e10cSrcweir 						mpChart->mChartZone = *( ChartZone* )( pAppData );
152cdf0e10cSrcweir 					}
153cdf0e10cSrcweir 					break;
154cdf0e10cSrcweir 					case 0x324 : ComOut( CGM_LEVEL1, "AppData - TITLEZONE" ) break;
155cdf0e10cSrcweir 					case 0x328 : ComOut( CGM_LEVEL1, "AppData - FOOTNOTEZONE" ) break;
156cdf0e10cSrcweir 					case 0x32A : ComOut( CGM_LEVEL1, "AppData - LEGENDZONE" ) break;
157cdf0e10cSrcweir 					case 0x330 : ComOut( CGM_LEVEL1, "AppData - PAGEORIENTDIM" )
158cdf0e10cSrcweir 					{
159cdf0e10cSrcweir 						mpChart->mPageOrientDim = *( PageOrientDim*)( pAppData );
160cdf0e10cSrcweir 					}
161cdf0e10cSrcweir 					break;
162cdf0e10cSrcweir 					case 0x334 : ComOut( CGM_LEVEL1, "AppData - CHTZONEOPTN" )
163cdf0e10cSrcweir 					{
164cdf0e10cSrcweir 						mpChart->mZoneOption = *( ZoneOption*)( pAppData );
165cdf0e10cSrcweir 					}
166cdf0e10cSrcweir 					break;
167cdf0e10cSrcweir 					case 0x336 : ComOut( CGM_LEVEL1, "AppData - CHTINTL" )
168cdf0e10cSrcweir 					{
169cdf0e10cSrcweir 						mpChart->mIntSettings = *( IntSettings*)( pAppData );
170cdf0e10cSrcweir 					}
171cdf0e10cSrcweir 					break;
172cdf0e10cSrcweir 					case 0x338 : ComOut( CGM_LEVEL1, "AppData - CHTLINESPC" ) break;
173cdf0e10cSrcweir 					case 0x384 : ComOut( CGM_LEVEL1, "AppData - ORGGRIDSTATE" ) break;
174cdf0e10cSrcweir 					case 0x386 : ComOut( CGM_LEVEL1, "AppData - ORGSCRSTATE" ) break;
175cdf0e10cSrcweir 					case 0x388 : ComOut( CGM_LEVEL1, "AppData - ORGTREESTATE" ) break;
176cdf0e10cSrcweir 					case 0x38A : ComOut( CGM_LEVEL1, "AppData - ORGTEXTOPTN" ) break;
177cdf0e10cSrcweir 					case 0x38E : ComOut( CGM_LEVEL1, "AppData - ORGBOXOPTN" ) break;
178cdf0e10cSrcweir 					case 0x390 : ComOut( CGM_LEVEL1, "AppData - ORGBOXDIM" ) break;
179cdf0e10cSrcweir 					case 0x392 : ComOut( CGM_LEVEL1, "AppData - ORGBOX" ) break;
180cdf0e10cSrcweir 					case 0x3EA : ComOut( CGM_LEVEL1, "AppData - TTLTEXTOPTN" ) break;
181cdf0e10cSrcweir 					case 0x3EE : ComOut( CGM_LEVEL1, "AppData - TTLAUTOBUILD" ) break;
182cdf0e10cSrcweir 					case 0x44E : ComOut( CGM_LEVEL1, "AppData - BULTEXTOPTN" ) break;
183cdf0e10cSrcweir 					case 0x452 : ComOut( CGM_LEVEL1, "AppData - BULLETOPTN" )
184cdf0e10cSrcweir 					{
185cdf0e10cSrcweir 						mpChart->mBulletOption = *( BulletOption*)( pAppData );
186cdf0e10cSrcweir 					}
187cdf0e10cSrcweir 					break;
188cdf0e10cSrcweir 					case 0x454 : ComOut( CGM_LEVEL1, "AppData - BULLETLINES" )
189cdf0e10cSrcweir 					{
190cdf0e10cSrcweir 						mpChart->mBulletLines = *( BulletLines*)( pAppData );
191cdf0e10cSrcweir 					}
192cdf0e10cSrcweir 					break;
193cdf0e10cSrcweir 					case 0x456 : ComOut( CGM_LEVEL1, "AppData - BULAUTOBUILD" ) break;
194cdf0e10cSrcweir 					case 0x4B2 : ComOut( CGM_LEVEL1, "AppData - TBLTEXTOPTN" ) break;
195cdf0e10cSrcweir 					case 0x4B6 : ComOut( CGM_LEVEL1, "AppData - TBLOPTN" ) break;
196cdf0e10cSrcweir 					case 0x4B8 : ComOut( CGM_LEVEL1, "AppData - TBLCOLOPTN" ) break;
197cdf0e10cSrcweir 					case 0x4BA : ComOut( CGM_LEVEL1, "AppData - TBLLEGENDOPTN" ) break;
198cdf0e10cSrcweir 					case 0x4BC : ComOut( CGM_LEVEL1, "AppData - TBLRANGEOPTN" ) break;
199cdf0e10cSrcweir 					case 0x4BE : ComOut( CGM_LEVEL1, "AppData - TBLROWOPTN" ) break;
200cdf0e10cSrcweir 					case 0x4C0 : ComOut( CGM_LEVEL1, "AppData - TBLAUTOBUILD" ) break;
201cdf0e10cSrcweir 					case 0x518 : ComOut( CGM_LEVEL1, "AppData - PIECHARTOPTN" ) break;
202cdf0e10cSrcweir 					case 0x51A : ComOut( CGM_LEVEL1, "AppData - PIELEGENDOPTN" ) break;
203cdf0e10cSrcweir 					case 0x51C : ComOut( CGM_LEVEL1, "AppData - PIETEXTOPTN" ) break;
204cdf0e10cSrcweir 					case 0x51E : ComOut( CGM_LEVEL1, "AppData - PIEOPTN" ) break;
205cdf0e10cSrcweir 					case 0x520 : ComOut( CGM_LEVEL1, "AppData - PIEPCTLABOPTN" ) break;
206cdf0e10cSrcweir 					case 0x522 : ComOut( CGM_LEVEL1, "AppData - PIEVALLABOPTN" ) break;
207cdf0e10cSrcweir 					case 0x524 : ComOut( CGM_LEVEL1, "AppData - PIESLICE" ) break;
208cdf0e10cSrcweir 					case 0x57A : ComOut( CGM_LEVEL1, "AppData - XYAXISOPTN" ) break;
209cdf0e10cSrcweir 					case 0x57C : ComOut( CGM_LEVEL1, "AppData - XYGRIDOPTN" ) break;
210cdf0e10cSrcweir 					case 0x57D : ComOut( CGM_LEVEL1, "AppData - XYGRIDSHOWFILL" ) break;
211cdf0e10cSrcweir 					case 0x57E : ComOut( CGM_LEVEL1, "AppData - XYSERIESOPTN" ) break;
212cdf0e10cSrcweir 					case 0x580 : ComOut( CGM_LEVEL1, "AppData - XYSTYLEOPTN" ) break;
213cdf0e10cSrcweir 					case 0x582 : ComOut( CGM_LEVEL1, "AppData - XYTABLEOPTN" ) break;
214cdf0e10cSrcweir 					case 0x584 : ComOut( CGM_LEVEL1, "AppData - XYTEXTOPTN" ) break;
215cdf0e10cSrcweir 					case 0x586 : ComOut( CGM_LEVEL1, "AppData - XYDATAOPTN" ) break;
216cdf0e10cSrcweir 					case 0x58A : ComOut( CGM_LEVEL1, "AppData - XYLEGENDOPN" ) break;
217cdf0e10cSrcweir 					case 0x58C : ComOut( CGM_LEVEL1, "AppData - XYCALCULATION" ) break;
218cdf0e10cSrcweir 					case 0x58E : ComOut( CGM_LEVEL1, "AppData - XYXVALUE" ) break;
219cdf0e10cSrcweir 					case 0x590 : ComOut( CGM_LEVEL1, "AppData - XYYVALUE" ) break;
220cdf0e10cSrcweir 					case 0x592 : ComOut( CGM_LEVEL1, "AppData - XYXEXTVALUE" ) break;
221cdf0e10cSrcweir 					case 0x618 : ComOut( CGM_LEVEL1, "AppData - IOC_CHTCOLRTAB" ) break;
222cdf0e10cSrcweir 					case 0x619 : ComOut( CGM_LEVEL1, "AppData - IOC_CHTFONTTAB" ) break;
223cdf0e10cSrcweir 					case 0x1fff : ComOut( CGM_LEVEL1, "AppData - 0x1fff" ) break;
224cdf0e10cSrcweir 					default : ComOut( CGM_LEVEL1, "UNKNOWN Application Data" ) break;
225cdf0e10cSrcweir 				}
226cdf0e10cSrcweir 			}
227cdf0e10cSrcweir 			mnParaSize = mnElementSize;
228cdf0e10cSrcweir 			break;
229cdf0e10cSrcweir 		}
230cdf0e10cSrcweir 		default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
231cdf0e10cSrcweir 	}
232cdf0e10cSrcweir };
233cdf0e10cSrcweir 
234