summaryrefslogtreecommitdiff
path: root/goodies/source/filter.vcl/icgm/class7.cxx
blob: 5c3eb9c7ef890e6b759e1d3d1f2193f2473bd3f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: class7.cxx,v $
 * $Revision: 1.5 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_goodies.hxx"

#include <main.hxx>
#include <chart.hxx>
#include <outact.hxx>

// ---------------------------------------------------------------

void CGM::ImplDoClass7()
{
    switch ( mnElementID )
    {
        case 0x01 : ComOut( CGM_LEVEL1, "Message" ) break;
        case 0x02 :
        {
            sal_uInt8*  pAppData = mpSource + 12;
            sal_uInt16* pTemp = (sal_uInt16*)mpSource;
            sal_uInt16 nOpcode = pTemp[ 4 ];

            if ( mpChart || ( nOpcode == 0 ) )
            {
                switch ( nOpcode )
                {
                    case 0x000 : ComOut( CGM_LEVEL1, "AppData - Beginning of File Opcodes" )
                    {
                        if ( mpChart == NULL )
                            mpChart = new CGMChart( *this );
                        mpChart->mnCurrentFileType = pAppData[ 3 ];
                    }
                    break;
                    case 0x001 : ComOut( CGM_LEVEL1, "AppData - End of File Opcodes" ) break;
                    case 0x190 : ComOut( CGM_LEVEL1, "AppData - FDESC" ) break;
                    case 0x192 : ComOut( CGM_LEVEL1, "AppData - FNOTES" ) break;
                    case 0x1F4 : ComOut( CGM_LEVEL1, "AppData - BOGENFILE" ) break;
                    case 0x1F5 : ComOut( CGM_LEVEL1, "AppData - EOGENFILE" ) break;
                    case 0x1F8 : ComOut( CGM_LEVEL1, "AppData - BOCHTGROUP" ) break;
                    case 0x1F9 : ComOut( CGM_LEVEL1, "AppData - EOCHTGROUP" ) break;
                    case 0x1FC : ComOut( CGM_LEVEL1, "AppData - BOCHTDATA" ) break;
                    case 0x1FD : ComOut( CGM_LEVEL1, "AppData - EOCHTDATA" )
                    {
                        mpOutAct->DrawChart();
                    }
                    break;
                    case 0x200 : ComOut( CGM_LEVEL1, "AppData - BOSYMGROUP" ) break;
                    case 0x201 : ComOut( CGM_LEVEL1, "AppData - EOSYMGROUP" ) break;
                    case 0x204 : ComOut( CGM_LEVEL1, "AppData - BEGSYMBOL" ) break;
                    case 0x205 : ComOut( CGM_LEVEL1, "AppData - ENDSYMBOL" ) break;
                    case 0x208 : ComOut( CGM_LEVEL1, "AppData - BOSHWGROUP" ) break;
                    case 0x209 : ComOut( CGM_LEVEL1, "AppData - EOSHWGROUP" ) break;
                    case 0x260 : ComOut( CGM_LEVEL1, "AppData - BEGGROUP" ) break;
                    case 0x262 : ComOut( CGM_LEVEL1, "AppData - ENDGROUP" ) break;
                    case 0x264 : ComOut( CGM_LEVEL1, "AppData - DATANODE" )
                    {
                        mpChart->mDataNode[ 0 ] = *(DataNode*)( pAppData );
                        sal_Int8 nZoneEnum = mpChart->mDataNode[ 0 ].nZoneEnum;
                        if ( nZoneEnum && ( nZoneEnum <= 6 ) )
                            mpChart->mDataNode[ nZoneEnum ] = *(DataNode*)( pAppData );
                    }
                    break;
                    case 0x2BE : ComOut( CGM_LEVEL1, "AppData - SHWSLIDEREC" )
                    {
                        if ( mnMode & CGM_EXPORT_IMPRESS )
                        {
                            if ( pAppData[ 16 ] == 0 )		// a blank template ?
                            {
                                if ( pAppData[ 2 ] == 46 )
                                {
                                    // this starts the document -> maybe we could insert a new document
                                }
                                else if ( pAppData[ 2 ] & 0x80 )
                                {
                                    // this is a template
                                }
                                else
                                {
                                    mpOutAct->InsertPage();
                                }
                            }
                            mpChart->ResetAnnotation();
                        }
                    }
                    break;
                    case 0x2C0 : ComOut( CGM_LEVEL1, "AppData - SHWKEYTABLE" ) break;
                    case 0x2C2 : ComOut( CGM_LEVEL1, "AppData - SHWBUTTONTAB" ) break;
                    case 0x2C4 : ComOut( CGM_LEVEL1, "AppData - SHWGLOBAL" ) break;
                    case 0x2C6 : ComOut( CGM_LEVEL1, "AppData - SHWTITLE" ) break;
                    case 0x2CA : ComOut( CGM_LEVEL1, "AppData - SHWAPP" ) break;
                    case 0x320 : ComOut( CGM_LEVEL1, "AppData - TEXT" )
                    {
                        TextEntry* pTextEntry = new TextEntry;
                        pTextEntry->nTypeOfText = *((sal_uInt16*)( pAppData ) );
                        pTextEntry->nRowOrLineNum = *((sal_uInt16*)( pAppData + 2 ) );
                        pTextEntry->nColumnNum = *((sal_uInt16*)( pAppData + 4 ) );
                        sal_uInt16 nAttributes = *( (sal_uInt16*)( pAppData + 6 ) );
                        pTextEntry->nZoneSize = nAttributes & 0xff;
                        pTextEntry->nLineType = ( nAttributes >> 8 ) & 0xf;
                        nAttributes >>= 12;
                        pTextEntry->nAttributes = nAttributes;
                        pAppData += 8;
                        sal_uInt32 nLen = strlen( (char*)( pAppData ) ) + 1;
                        pTextEntry->pText = new char[ nLen ];
                        memcpy( pTextEntry->pText, pAppData, nLen );
                        pAppData += nLen;

                        TextAttribute* pTextOld = 0;
                        for ( sal_uInt16 i = 0; i < nAttributes; i++ )
                        {
                            TextAttribute* pTextAttr = new TextAttribute;

                            *pTextAttr = *(TextAttribute*)( pAppData );

                            pTextAttr->pNextAttribute = NULL;
                            if ( i == 0 )
                                pTextEntry->pAttribute = pTextAttr;
                            else
                                pTextOld->pNextAttribute = pTextAttr;

                            pAppData += sizeof( TextAttribute ) - 4;
                            pTextOld = pTextAttr;
                        }
                        mpChart->InsertTextEntry( pTextEntry );
                    }
                    break;
                    case 0x321 : ComOut( CGM_LEVEL1, "AppData - IOC_TABS" ) break;
                    case 0x322 : ComOut( CGM_LEVEL1, "AppData - CHARTZONE" )
                    {
                        mpChart->mChartZone = *( ChartZone* )( pAppData );
                    }
                    break;
                    case 0x324 : ComOut( CGM_LEVEL1, "AppData - TITLEZONE" ) break;
                    case 0x328 : ComOut( CGM_LEVEL1, "AppData - FOOTNOTEZONE" ) break;
                    case 0x32A : ComOut( CGM_LEVEL1, "AppData - LEGENDZONE" ) break;
                    case 0x330 : ComOut( CGM_LEVEL1, "AppData - PAGEORIENTDIM" )
                    {
                        mpChart->mPageOrientDim = *( PageOrientDim*)( pAppData );
                    }
                    break;
                    case 0x334 : ComOut( CGM_LEVEL1, "AppData - CHTZONEOPTN" )
                    {
                        mpChart->mZoneOption = *( ZoneOption*)( pAppData );
                    }
                    break;
                    case 0x336 : ComOut( CGM_LEVEL1, "AppData - CHTINTL" )
                    {
                        mpChart->mIntSettings = *( IntSettings*)( pAppData );
                    }
                    break;
                    case 0x338 : ComOut( CGM_LEVEL1, "AppData - CHTLINESPC" ) break;
                    case 0x384 : ComOut( CGM_LEVEL1, "AppData - ORGGRIDSTATE" ) break;
                    case 0x386 : ComOut( CGM_LEVEL1, "AppData - ORGSCRSTATE" ) break;
                    case 0x388 : ComOut( CGM_LEVEL1, "AppData - ORGTREESTATE" ) break;
                    case 0x38A : ComOut( CGM_LEVEL1, "AppData - ORGTEXTOPTN" ) break;
                    case 0x38E : ComOut( CGM_LEVEL1, "AppData - ORGBOXOPTN" ) break;
                    case 0x390 : ComOut( CGM_LEVEL1, "AppData - ORGBOXDIM" ) break;
                    case 0x392 : ComOut( CGM_LEVEL1, "AppData - ORGBOX" ) break;
                    case 0x3EA : ComOut( CGM_LEVEL1, "AppData - TTLTEXTOPTN" ) break;
                    case 0x3EE : ComOut( CGM_LEVEL1, "AppData - TTLAUTOBUILD" ) break;
                    case 0x44E : ComOut( CGM_LEVEL1, "AppData - BULTEXTOPTN" ) break;
                    case 0x452 : ComOut( CGM_LEVEL1, "AppData - BULLETOPTN" )
                    {
                        mpChart->mBulletOption = *( BulletOption*)( pAppData );
                    }
                    break;
                    case 0x454 : ComOut( CGM_LEVEL1, "AppData - BULLETLINES" )
                    {
                        mpChart->mBulletLines = *( BulletLines*)( pAppData );
                    }
                    break;
                    case 0x456 : ComOut( CGM_LEVEL1, "AppData - BULAUTOBUILD" ) break;
                    case 0x4B2 : ComOut( CGM_LEVEL1, "AppData - TBLTEXTOPTN" ) break;
                    case 0x4B6 : ComOut( CGM_LEVEL1, "AppData - TBLOPTN" ) break;
                    case 0x4B8 : ComOut( CGM_LEVEL1, "AppData - TBLCOLOPTN" ) break;
                    case 0x4BA : ComOut( CGM_LEVEL1, "AppData - TBLLEGENDOPTN" ) break;
                    case 0x4BC : ComOut( CGM_LEVEL1, "AppData - TBLRANGEOPTN" ) break;
                    case 0x4BE : ComOut( CGM_LEVEL1, "AppData - TBLROWOPTN" ) break;
                    case 0x4C0 : ComOut( CGM_LEVEL1, "AppData - TBLAUTOBUILD" ) break;
                    case 0x518 : ComOut( CGM_LEVEL1, "AppData - PIECHARTOPTN" ) break;
                    case 0x51A : ComOut( CGM_LEVEL1, "AppData - PIELEGENDOPTN" ) break;
                    case 0x51C : ComOut( CGM_LEVEL1, "AppData - PIETEXTOPTN" ) break;
                    case 0x51E : ComOut( CGM_LEVEL1, "AppData - PIEOPTN" ) break;
                    case 0x520 : ComOut( CGM_LEVEL1, "AppData - PIEPCTLABOPTN" ) break;
                    case 0x522 : ComOut( CGM_LEVEL1, "AppData - PIEVALLABOPTN" ) break;
                    case 0x524 : ComOut( CGM_LEVEL1, "AppData - PIESLICE" ) break;
                    case 0x57A : ComOut( CGM_LEVEL1, "AppData - XYAXISOPTN" ) break;
                    case 0x57C : ComOut( CGM_LEVEL1, "AppData - XYGRIDOPTN" ) break;
                    case 0x57D : ComOut( CGM_LEVEL1, "AppData - XYGRIDSHOWFILL" ) break;
                    case 0x57E : ComOut( CGM_LEVEL1, "AppData - XYSERIESOPTN" ) break;
                    case 0x580 : ComOut( CGM_LEVEL1, "AppData - XYSTYLEOPTN" ) break;
                    case 0x582 : ComOut( CGM_LEVEL1, "AppData - XYTABLEOPTN" ) break;
                    case 0x584 : ComOut( CGM_LEVEL1, "AppData - XYTEXTOPTN" ) break;
                    case 0x586 : ComOut( CGM_LEVEL1, "AppData - XYDATAOPTN" ) break;
                    case 0x58A : ComOut( CGM_LEVEL1, "AppData - XYLEGENDOPN" ) break;
                    case 0x58C : ComOut( CGM_LEVEL1, "AppData - XYCALCULATION" ) break;
                    case 0x58E : ComOut( CGM_LEVEL1, "AppData - XYXVALUE" ) break;
                    case 0x590 : ComOut( CGM_LEVEL1, "AppData - XYYVALUE" ) break;
                    case 0x592 : ComOut( CGM_LEVEL1, "AppData - XYXEXTVALUE" ) break;
                    case 0x618 : ComOut( CGM_LEVEL1, "AppData - IOC_CHTCOLRTAB" ) break;
                    case 0x619 : ComOut( CGM_LEVEL1, "AppData - IOC_CHTFONTTAB" ) break;
                    case 0x1fff : ComOut( CGM_LEVEL1, "AppData - 0x1fff" ) break;
                    default : ComOut( CGM_LEVEL1, "UNKNOWN Application Data" ) break;
                }
            }
            mnParaSize = mnElementSize;
            break;
        }
        default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
    }
};