bump product version to 4.1.6.2
[LibreOffice.git] / filter / source / graphicfilter / icgm / class7.cxx
blob304ba32952ff4ba3082ac17c4fae4823085bb1d5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <main.hxx>
22 #include <chart.hxx>
23 #include <outact.hxx>
25 // ---------------------------------------------------------------
27 void CGM::ImplDoClass7()
29 switch ( mnElementID )
31 case 0x01 : /*Message */break;
32 case 0x02 :
34 sal_uInt8* pAppData = mpSource + 12;
35 sal_uInt16* pTemp = (sal_uInt16*)mpSource;
36 sal_uInt16 nOpcode = pTemp[ 4 ];
38 if ( mpChart || ( nOpcode == 0 ) )
40 switch ( nOpcode )
42 case 0x000 : /*AppData - Beginning of File Opcodes*/
44 if ( mpChart == NULL )
45 mpChart = new CGMChart( *this );
46 mpChart->mnCurrentFileType = pAppData[ 3 ];
48 break;
49 case 0x001 : /*AppData - End of File Opcodes */break;
50 case 0x190 : /*AppData - FDESC */break;
51 case 0x192 : /*AppData - FNOTES */break;
52 case 0x1F4 : /*AppData - BOGENFILE */break;
53 case 0x1F5 : /*AppData - EOGENFILE */break;
54 case 0x1F8 : /*AppData - BOCHTGROUP */break;
55 case 0x1F9 : /*AppData - EOCHTGROUP */break;
56 case 0x1FC : /*AppData - BOCHTDATA */break;
57 case 0x1FD : /*AppData - EOCHTDATA*/
59 mpOutAct->DrawChart();
61 break;
62 case 0x200 : /*AppData - BOSYMGROUP */break;
63 case 0x201 : /*AppData - EOSYMGROUP */break;
64 case 0x204 : /*AppData - BEGSYMBOL */break;
65 case 0x205 : /*AppData - ENDSYMBOL */break;
66 case 0x208 : /*AppData - BOSHWGROUP */break;
67 case 0x209 : /*AppData - EOSHWGROUP */break;
68 case 0x260 : /*AppData - BEGGROUP */break;
69 case 0x262 : /*AppData - ENDGROUP */break;
70 case 0x264 : /*AppData - DATANODE*/
72 mpChart->mDataNode[ 0 ] = *(DataNode*)( pAppData );
73 sal_Int8 nZoneEnum = mpChart->mDataNode[ 0 ].nZoneEnum;
74 if ( nZoneEnum && ( nZoneEnum <= 6 ) )
75 mpChart->mDataNode[ nZoneEnum ] = *(DataNode*)( pAppData );
77 break;
78 case 0x2BE : /*AppData - SHWSLIDEREC*/
80 if ( mnMode & CGM_EXPORT_IMPRESS )
82 if ( pAppData[ 16 ] == 0 ) // a blank template ?
84 if ( pAppData[ 2 ] == 46 )
86 // this starts the document -> maybe we could insert a new document
88 else if ( pAppData[ 2 ] & 0x80 )
90 // this is a template
92 else
94 mpOutAct->InsertPage();
97 mpChart->ResetAnnotation();
100 break;
101 case 0x2C0 : /*AppData - SHWKEYTABLE */break;
102 case 0x2C2 : /*AppData - SHWBUTTONTAB */break;
103 case 0x2C4 : /*AppData - SHWGLOBAL */break;
104 case 0x2C6 : /*AppData - SHWTITLE */break;
105 case 0x2CA : /*AppData - SHWAPP */break;
106 case 0x320 : /*AppData - TEXT*/
108 TextEntry* pTextEntry = new TextEntry;
109 pTextEntry->nTypeOfText = *((sal_uInt16*)( pAppData ) );
110 pTextEntry->nRowOrLineNum = *((sal_uInt16*)( pAppData + 2 ) );
111 pTextEntry->nColumnNum = *((sal_uInt16*)( pAppData + 4 ) );
112 sal_uInt16 nAttributes = *( (sal_uInt16*)( pAppData + 6 ) );
113 pTextEntry->nZoneSize = nAttributes & 0xff;
114 pTextEntry->nLineType = ( nAttributes >> 8 ) & 0xf;
115 nAttributes >>= 12;
116 pTextEntry->nAttributes = nAttributes;
117 pAppData += 8;
118 sal_uInt32 nLen = strlen( (char*)( pAppData ) ) + 1;
119 pTextEntry->pText = new char[ nLen ];
120 memcpy( pTextEntry->pText, pAppData, nLen );
121 pAppData += nLen;
123 TextAttribute* pTextOld = 0;
124 for ( sal_uInt16 i = 0; i < nAttributes; i++ )
126 TextAttribute* pTextAttr = new TextAttribute;
128 *pTextAttr = *(TextAttribute*)( pAppData );
130 pTextAttr->pNextAttribute = NULL;
131 if ( i == 0 )
132 pTextEntry->pAttribute = pTextAttr;
133 else
134 pTextOld->pNextAttribute = pTextAttr;
136 pAppData += sizeof( TextAttribute ) - 4;
137 pTextOld = pTextAttr;
139 mpChart->InsertTextEntry( pTextEntry );
141 break;
142 case 0x321 : /*AppData - IOC_TABS */break;
143 case 0x322 : /*AppData - CHARTZONE*/
145 mpChart->mChartZone = *( ChartZone* )( pAppData );
147 break;
148 case 0x324 : /*AppData - TITLEZONE */break;
149 case 0x328 : /*AppData - FOOTNOTEZONE */break;
150 case 0x32A : /*AppData - LEGENDZONE */break;
151 case 0x330 : /*AppData - PAGEORIENTDIM*/
153 mpChart->mPageOrientDim = *( PageOrientDim*)( pAppData );
155 break;
156 case 0x334 : /*AppData - CHTZONEOPTN*/
158 mpChart->mZoneOption = *( ZoneOption*)( pAppData );
160 break;
161 case 0x336 : /*AppData - CHTINTL*/
163 mpChart->mIntSettings = *( IntSettings*)( pAppData );
165 break;
166 case 0x338 : /*AppData - CHTLINESPC */break;
167 case 0x384 : /*AppData - ORGGRIDSTATE */break;
168 case 0x386 : /*AppData - ORGSCRSTATE */break;
169 case 0x388 : /*AppData - ORGTREESTATE */break;
170 case 0x38A : /*AppData - ORGTEXTOPTN */break;
171 case 0x38E : /*AppData - ORGBOXOPTN */break;
172 case 0x390 : /*AppData - ORGBOXDIM */break;
173 case 0x392 : /*AppData - ORGBOX */break;
174 case 0x3EA : /*AppData - TTLTEXTOPTN */break;
175 case 0x3EE : /*AppData - TTLAUTOBUILD */break;
176 case 0x44E : /*AppData - BULTEXTOPTN */break;
177 case 0x452 : /*AppData - BULLETOPTN*/
179 mpChart->mBulletOption = *( BulletOption*)( pAppData );
181 break;
182 case 0x454 : /*AppData - BULLETLINES*/
184 mpChart->mBulletLines = *( BulletLines*)( pAppData );
186 break;
187 case 0x456 : /*AppData - BULAUTOBUILD */break;
188 case 0x4B2 : /*AppData - TBLTEXTOPTN */break;
189 case 0x4B6 : /*AppData - TBLOPTN */break;
190 case 0x4B8 : /*AppData - TBLCOLOPTN */break;
191 case 0x4BA : /*AppData - TBLLEGENDOPTN */break;
192 case 0x4BC : /*AppData - TBLRANGEOPTN */break;
193 case 0x4BE : /*AppData - TBLROWOPTN */break;
194 case 0x4C0 : /*AppData - TBLAUTOBUILD */break;
195 case 0x518 : /*AppData - PIECHARTOPTN */break;
196 case 0x51A : /*AppData - PIELEGENDOPTN */break;
197 case 0x51C : /*AppData - PIETEXTOPTN */break;
198 case 0x51E : /*AppData - PIEOPTN */break;
199 case 0x520 : /*AppData - PIEPCTLABOPTN */break;
200 case 0x522 : /*AppData - PIEVALLABOPTN */break;
201 case 0x524 : /*AppData - PIESLICE */break;
202 case 0x57A : /*AppData - XYAXISOPTN */break;
203 case 0x57C : /*AppData - XYGRIDOPTN */break;
204 case 0x57D : /*AppData - XYGRIDSHOWFILL */break;
205 case 0x57E : /*AppData - XYSERIESOPTN */break;
206 case 0x580 : /*AppData - XYSTYLEOPTN */break;
207 case 0x582 : /*AppData - XYTABLEOPTN */break;
208 case 0x584 : /*AppData - XYTEXTOPTN */break;
209 case 0x586 : /*AppData - XYDATAOPTN */break;
210 case 0x58A : /*AppData - XYLEGENDOPN */break;
211 case 0x58C : /*AppData - XYCALCULATION */break;
212 case 0x58E : /*AppData - XYXVALUE */break;
213 case 0x590 : /*AppData - XYYVALUE */break;
214 case 0x592 : /*AppData - XYXEXTVALUE */break;
215 case 0x618 : /*AppData - IOC_CHTCOLRTAB */break;
216 case 0x619 : /*AppData - IOC_CHTFONTTAB */break;
217 case 0x1fff : /*AppData - 0x1fff */break;
218 default : /*UNKNOWN Application Data */break;
221 mnParaSize = mnElementSize;
222 break;
224 default: break;
228 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */