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 //#define VCL_NEED_BASETSD
27cdf0e10cSrcweir
28cdf0e10cSrcweir #include <main.hxx>
29cdf0e10cSrcweir #include <outact.hxx>
30cdf0e10cSrcweir
31cdf0e10cSrcweir
32cdf0e10cSrcweir // ---------------------------------------------------------------
33cdf0e10cSrcweir
ImplDoClass5()34cdf0e10cSrcweir void CGM::ImplDoClass5()
35cdf0e10cSrcweir {
36cdf0e10cSrcweir switch ( mnElementID )
37cdf0e10cSrcweir {
38cdf0e10cSrcweir case 0x01 : ComOut( CGM_LEVEL1, "Line Bundle Index" )
39cdf0e10cSrcweir pElement->pLineBundle = (LineBundle*)pElement->GetBundleIndex( ImplGetI( pElement->nIndexPrecision ), pElement->aLineList, pElement->aLineBundle );
40cdf0e10cSrcweir break;
41cdf0e10cSrcweir case 0x02 : ComOut( CGM_LEVEL1, "Line Type" )
42cdf0e10cSrcweir {
43cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_LINETYPE )
44cdf0e10cSrcweir pElement->pLineBundle->eLineType = (LineType)ImplGetI( pElement->nIndexPrecision );
45cdf0e10cSrcweir else
46cdf0e10cSrcweir pElement->aLineBundle.eLineType = (LineType)ImplGetI( pElement->nIndexPrecision );
47cdf0e10cSrcweir }
48cdf0e10cSrcweir break;
49cdf0e10cSrcweir case 0x03 : ComOut( CGM_LEVEL1, "Line Width" )
50cdf0e10cSrcweir {
51cdf0e10cSrcweir double nWidth;
52cdf0e10cSrcweir if ( pElement->eLineWidthSpecMode == SM_ABSOLUTE )
53cdf0e10cSrcweir {
54cdf0e10cSrcweir if ( pElement->eVDCType == VDC_REAL )
55cdf0e10cSrcweir nWidth = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
56cdf0e10cSrcweir else
57cdf0e10cSrcweir nWidth = (double)ImplGetI( pElement->nVDCIntegerPrecision );
58cdf0e10cSrcweir
59cdf0e10cSrcweir ImplMapDouble( nWidth );
60cdf0e10cSrcweir }
61cdf0e10cSrcweir else
62cdf0e10cSrcweir nWidth = (sal_uInt32)ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize ) * 25; // scaling in 1/4 mm
63cdf0e10cSrcweir
64cdf0e10cSrcweir ( pElement->nAspectSourceFlags & ASF_LINEWIDTH )
65cdf0e10cSrcweir ? pElement->aLineBundle.nLineWidth = nWidth
66cdf0e10cSrcweir : pElement->aLineBundle.nLineWidth = nWidth;
67cdf0e10cSrcweir }
68cdf0e10cSrcweir break;
69cdf0e10cSrcweir case 0x04 : ComOut( CGM_LEVEL1, "Line Color" )
70cdf0e10cSrcweir {
71cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_LINECOLOR )
72cdf0e10cSrcweir pElement->pLineBundle->SetColor( ImplGetBitmapColor() );
73cdf0e10cSrcweir else
74cdf0e10cSrcweir pElement->aLineBundle.SetColor( ImplGetBitmapColor() );
75cdf0e10cSrcweir }
76cdf0e10cSrcweir break;
77cdf0e10cSrcweir case 0x05 : ComOut( CGM_LEVEL1, "Marker Bundle Index" )
78cdf0e10cSrcweir pElement->pMarkerBundle = (MarkerBundle*)pElement->GetBundleIndex( ImplGetI( pElement->nIndexPrecision ), pElement->aMarkerList, pElement->aMarkerBundle );
79cdf0e10cSrcweir break;
80cdf0e10cSrcweir case 0x06 : ComOut( CGM_LEVEL1, "Marker Type" )
81cdf0e10cSrcweir {
82cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_MARKERTYPE )
83cdf0e10cSrcweir pElement->pMarkerBundle->eMarkerType = (MarkerType)ImplGetI( pElement->nIndexPrecision );
84cdf0e10cSrcweir else
85cdf0e10cSrcweir pElement->aMarkerBundle.eMarkerType = (MarkerType)ImplGetI( pElement->nIndexPrecision );
86cdf0e10cSrcweir }
87cdf0e10cSrcweir break;
88cdf0e10cSrcweir case 0x07 : ComOut( CGM_LEVEL1, "Marker Size" )
89cdf0e10cSrcweir {
90cdf0e10cSrcweir double nWidth;
91cdf0e10cSrcweir if ( pElement->eMarkerSizeSpecMode == SM_ABSOLUTE )
92cdf0e10cSrcweir {
93cdf0e10cSrcweir if ( pElement->eVDCType == VDC_REAL )
94cdf0e10cSrcweir nWidth = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
95cdf0e10cSrcweir else
96cdf0e10cSrcweir nWidth = (double)ImplGetI( pElement->nVDCIntegerPrecision );
97cdf0e10cSrcweir ImplMapDouble( nWidth );
98cdf0e10cSrcweir }
99cdf0e10cSrcweir else
100cdf0e10cSrcweir nWidth = (sal_uInt32)ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize ) * 25;
101cdf0e10cSrcweir ( pElement->nAspectSourceFlags & ASF_MARKERSIZE )
102cdf0e10cSrcweir ? pElement->aMarkerBundle.nMarkerSize = nWidth
103cdf0e10cSrcweir : pElement->aMarkerBundle.nMarkerSize = nWidth;
104cdf0e10cSrcweir }
105cdf0e10cSrcweir break;
106cdf0e10cSrcweir case 0x08 : ComOut( CGM_LEVEL1, "Marker Color" )
107cdf0e10cSrcweir {
108cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_MARKERCOLOR )
109cdf0e10cSrcweir pElement->pMarkerBundle->SetColor( ImplGetBitmapColor() );
110cdf0e10cSrcweir else
111cdf0e10cSrcweir pElement->aMarkerBundle.SetColor( ImplGetBitmapColor() );
112cdf0e10cSrcweir }
113cdf0e10cSrcweir break;
114cdf0e10cSrcweir case 0x09 : ComOut( CGM_LEVEL1, "Text Bundle Index" )
115cdf0e10cSrcweir pElement->pTextBundle = (TextBundle*)pElement->GetBundleIndex( ImplGetI( pElement->nIndexPrecision ), pElement->aTextList, pElement->aTextBundle );
116cdf0e10cSrcweir break;
117cdf0e10cSrcweir case 0x0a : ComOut( CGM_LEVEL1, "Text Font Index" )
118cdf0e10cSrcweir {
119cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_TEXTFONTINDEX )
120cdf0e10cSrcweir pElement->pTextBundle->nTextFontIndex = ImplGetI( pElement->nIndexPrecision );
121cdf0e10cSrcweir else
122cdf0e10cSrcweir pElement->aTextBundle.nTextFontIndex = ImplGetI( pElement->nIndexPrecision );
123cdf0e10cSrcweir }
124cdf0e10cSrcweir break;
125cdf0e10cSrcweir case 0x0b : ComOut( CGM_LEVEL1, "Text Precision" )
126cdf0e10cSrcweir {
127cdf0e10cSrcweir TextBundle* pBundle;
128cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_TEXTPRECISION )
129cdf0e10cSrcweir pBundle = pElement->pTextBundle;
130cdf0e10cSrcweir else
131cdf0e10cSrcweir pBundle = &pElement->aTextBundle;
132cdf0e10cSrcweir switch( ImplGetUI16() )
133cdf0e10cSrcweir {
134cdf0e10cSrcweir case 0 : pBundle->eTextPrecision = TPR_STRING; break;
135cdf0e10cSrcweir case 1 : pBundle->eTextPrecision = TPR_CHARACTER; break;
136cdf0e10cSrcweir case 2 : pBundle->eTextPrecision = TPR_STROKE; break;
137cdf0e10cSrcweir default : pBundle->eTextPrecision = TPR_UNDEFINED; break;
138cdf0e10cSrcweir }
139cdf0e10cSrcweir }
140cdf0e10cSrcweir break;
141cdf0e10cSrcweir case 0x0c : ComOut( CGM_LEVEL1, "Character Expansion Factor" )
142cdf0e10cSrcweir {
143cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_CHARACTEREXPANSION )
144cdf0e10cSrcweir pElement->pTextBundle->nCharacterExpansion = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
145cdf0e10cSrcweir else
146cdf0e10cSrcweir pElement->aTextBundle.nCharacterExpansion = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
147cdf0e10cSrcweir }
148cdf0e10cSrcweir break;
149cdf0e10cSrcweir case 0x0d : ComOut( CGM_LEVEL1, "Character Spacing" )
150cdf0e10cSrcweir {
151cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_CHARACTERSPACING )
152cdf0e10cSrcweir pElement->pTextBundle->nCharacterSpacing = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
153cdf0e10cSrcweir else
154cdf0e10cSrcweir pElement->aTextBundle.nCharacterSpacing = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
155cdf0e10cSrcweir }
156cdf0e10cSrcweir break;
157cdf0e10cSrcweir case 0x0e : ComOut( CGM_LEVEL1, "Text Color" )
158cdf0e10cSrcweir {
159cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_TEXTCOLOR )
160cdf0e10cSrcweir pElement->pTextBundle->SetColor( ImplGetBitmapColor() );
161cdf0e10cSrcweir else
162cdf0e10cSrcweir pElement->aTextBundle.SetColor( ImplGetBitmapColor() );
163cdf0e10cSrcweir }
164cdf0e10cSrcweir break;
165cdf0e10cSrcweir case 0x0f : ComOut( CGM_LEVEL1, "Character Height" )
166cdf0e10cSrcweir {
167cdf0e10cSrcweir if ( pElement->eVDCType == VDC_INTEGER )
168cdf0e10cSrcweir pElement->nCharacterHeight = ImplGetI( pElement->nVDCIntegerPrecision );
169cdf0e10cSrcweir else // ->floating points
170cdf0e10cSrcweir pElement->nCharacterHeight = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
171cdf0e10cSrcweir ImplMapDouble( pElement->nCharacterHeight );
172cdf0e10cSrcweir pElement->nCharacterHeight /= 18.0;
173cdf0e10cSrcweir }
174cdf0e10cSrcweir break;
175cdf0e10cSrcweir case 0x10 : ComOut( CGM_LEVEL1, "Character Orientation" )
176cdf0e10cSrcweir {
177cdf0e10cSrcweir if ( pElement->eVDCType == VDC_INTEGER )
178cdf0e10cSrcweir {
179cdf0e10cSrcweir pElement->nCharacterOrientation[0] = ImplGetI( pElement->nVDCIntegerPrecision );
180cdf0e10cSrcweir pElement->nCharacterOrientation[1] = ImplGetI( pElement->nVDCIntegerPrecision );
181cdf0e10cSrcweir pElement->nCharacterOrientation[2] = ImplGetI( pElement->nVDCIntegerPrecision );
182cdf0e10cSrcweir pElement->nCharacterOrientation[3] = ImplGetI( pElement->nVDCIntegerPrecision );
183cdf0e10cSrcweir }
184cdf0e10cSrcweir else // ->floating points
185cdf0e10cSrcweir {
186cdf0e10cSrcweir pElement->nCharacterOrientation[0] = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
187cdf0e10cSrcweir pElement->nCharacterOrientation[1] = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
188cdf0e10cSrcweir pElement->nCharacterOrientation[2] = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
189cdf0e10cSrcweir pElement->nCharacterOrientation[3] = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
190cdf0e10cSrcweir }
191cdf0e10cSrcweir }
192cdf0e10cSrcweir break;
193cdf0e10cSrcweir case 0x11 : ComOut( CGM_LEVEL1, "Text Path" )
194cdf0e10cSrcweir {
195cdf0e10cSrcweir switch( ImplGetUI16() )
196cdf0e10cSrcweir {
197cdf0e10cSrcweir case 0 : pElement->eTextPath = TPR_RIGHT; break;
198cdf0e10cSrcweir case 1 : pElement->eTextPath = TPR_LEFT; break;
199cdf0e10cSrcweir case 2 : pElement->eTextPath = TPR_UP; break;
200cdf0e10cSrcweir case 3 : pElement->eTextPath = TPR_DOWN; break;
201cdf0e10cSrcweir default : mbStatus = sal_False; break;
202cdf0e10cSrcweir }
203cdf0e10cSrcweir }
204cdf0e10cSrcweir break;
205cdf0e10cSrcweir case 0x12 : ComOut( CGM_LEVEL1, "Text Alignment" )
206cdf0e10cSrcweir {
207cdf0e10cSrcweir pElement->eTextAlignmentH = (TextAlignmentH)ImplGetUI16();
208cdf0e10cSrcweir pElement->eTextAlignmentV = (TextAlignmentV)ImplGetUI16( 8 );
209cdf0e10cSrcweir pElement->nTextAlignmentHCont = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
210cdf0e10cSrcweir pElement->nTextAlignmentVCont = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
211cdf0e10cSrcweir }
212cdf0e10cSrcweir break;
213cdf0e10cSrcweir case 0x13 : ComOut( CGM_LEVEL1 | CGM_DRAWING_PLUS_CONTROL_SET, "Character Set Index" )
214cdf0e10cSrcweir pElement->nCharacterSetIndex = ImplGetI( pElement->nIndexPrecision );
215cdf0e10cSrcweir break;
216cdf0e10cSrcweir case 0x14 : ComOut( CGM_LEVEL1 | CGM_DRAWING_PLUS_CONTROL_SET, "Alternate Character Set Index" )
217cdf0e10cSrcweir pElement->nAlternateCharacterSetIndex = ImplGetI( pElement->nIndexPrecision );
218cdf0e10cSrcweir break;
219cdf0e10cSrcweir case 0x15 : ComOut( CGM_LEVEL1, "Fill Bundle Index" )
220cdf0e10cSrcweir pElement->pFillBundle = (FillBundle*)pElement->GetBundleIndex( ImplGetI( pElement->nIndexPrecision ), pElement->aFillList, pElement->aFillBundle );
221cdf0e10cSrcweir break;
222cdf0e10cSrcweir case 0x16 : ComOut( CGM_LEVEL1, "Fill Interior Style" )
223cdf0e10cSrcweir {
224cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_FILLINTERIORSTYLE )
225cdf0e10cSrcweir pElement->pFillBundle->eFillInteriorStyle = (FillInteriorStyle)ImplGetUI16();
226cdf0e10cSrcweir else
227cdf0e10cSrcweir pElement->aFillBundle.eFillInteriorStyle = (FillInteriorStyle)ImplGetUI16();
228cdf0e10cSrcweir }
229cdf0e10cSrcweir break;
230cdf0e10cSrcweir case 0x17 : ComOut( CGM_LEVEL1, "Fill Color" )
231cdf0e10cSrcweir {
232cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_FILLCOLOR )
233cdf0e10cSrcweir pElement->pFillBundle->SetColor( ImplGetBitmapColor() );
234cdf0e10cSrcweir else
235cdf0e10cSrcweir pElement->aFillBundle.SetColor( ImplGetBitmapColor() );
236cdf0e10cSrcweir }
237cdf0e10cSrcweir break;
238cdf0e10cSrcweir case 0x18 : ComOut( CGM_LEVEL1, "Fill Hatch Index" )
239cdf0e10cSrcweir {
240cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_HATCHINDEX )
241cdf0e10cSrcweir pElement->pFillBundle->nFillHatchIndex = ImplGetI( pElement->nIndexPrecision );
242cdf0e10cSrcweir else
243cdf0e10cSrcweir pElement->aFillBundle.nFillHatchIndex = ImplGetI( pElement->nIndexPrecision );
244cdf0e10cSrcweir }
245cdf0e10cSrcweir break;
246cdf0e10cSrcweir case 0x19 : ComOut( CGM_LEVEL1, "Fill Pattern Index" )
247cdf0e10cSrcweir {
248cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_PATTERNINDEX )
249cdf0e10cSrcweir pElement->pFillBundle->nFillPatternIndex = ImplGetI( pElement->nIndexPrecision );
250cdf0e10cSrcweir else
251cdf0e10cSrcweir pElement->aFillBundle.nFillPatternIndex = ImplGetI( pElement->nIndexPrecision );
252cdf0e10cSrcweir }
253cdf0e10cSrcweir break;
254cdf0e10cSrcweir case 0x1a : ComOut( CGM_LEVEL1, "Edge Bundle Index" )
255cdf0e10cSrcweir pElement->pEdgeBundle = (EdgeBundle*)pElement->GetBundleIndex( ImplGetI( pElement->nIndexPrecision ), pElement->aEdgeList, pElement->aEdgeBundle );
256cdf0e10cSrcweir break;
257cdf0e10cSrcweir case 0x1b : ComOut( CGM_LEVEL1, "Edge Type" )
258cdf0e10cSrcweir {
259cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_EDGETYPE )
260cdf0e10cSrcweir pElement->pEdgeBundle->eEdgeType = (EdgeType)ImplGetI( pElement->nIndexPrecision );
261cdf0e10cSrcweir else
262cdf0e10cSrcweir pElement->aEdgeBundle.eEdgeType = (EdgeType)ImplGetI( pElement->nIndexPrecision );
263cdf0e10cSrcweir }
264cdf0e10cSrcweir break;
265cdf0e10cSrcweir case 0x1c : ComOut( CGM_LEVEL1, "Edge Width" )
266cdf0e10cSrcweir {
267cdf0e10cSrcweir double nWidth;
268cdf0e10cSrcweir if ( pElement->eEdgeWidthSpecMode == SM_ABSOLUTE )
269cdf0e10cSrcweir {
270cdf0e10cSrcweir if ( pElement->eVDCType == VDC_REAL )
271cdf0e10cSrcweir nWidth = ImplGetFloat( pElement->eVDCRealPrecision, pElement->nVDCRealSize );
272cdf0e10cSrcweir else
273cdf0e10cSrcweir nWidth = (double)ImplGetI( pElement->nVDCIntegerPrecision );
274cdf0e10cSrcweir
275cdf0e10cSrcweir ImplMapDouble( nWidth );
276cdf0e10cSrcweir }
277cdf0e10cSrcweir else
278cdf0e10cSrcweir nWidth = (sal_uInt32)ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize ) * 25;
279cdf0e10cSrcweir ( pElement->nAspectSourceFlags & ASF_EDGEWIDTH )
280cdf0e10cSrcweir ? pElement->aEdgeBundle.nEdgeWidth = nWidth
281cdf0e10cSrcweir : pElement->aEdgeBundle.nEdgeWidth = nWidth;
282cdf0e10cSrcweir }
283cdf0e10cSrcweir break;
284cdf0e10cSrcweir case 0x1d : ComOut( CGM_LEVEL1, "Edge Color" )
285cdf0e10cSrcweir {
286cdf0e10cSrcweir if ( pElement->nAspectSourceFlags & ASF_EDGECOLOR )
287cdf0e10cSrcweir pElement->pEdgeBundle->SetColor( ImplGetBitmapColor() );
288cdf0e10cSrcweir else
289cdf0e10cSrcweir pElement->aEdgeBundle.SetColor( ImplGetBitmapColor() );
290cdf0e10cSrcweir }
291cdf0e10cSrcweir break;
292cdf0e10cSrcweir case 0x1e : ComOut( CGM_LEVEL1, "Edge Visibility" )
293cdf0e10cSrcweir {
294cdf0e10cSrcweir switch( ImplGetUI16() )
295cdf0e10cSrcweir {
296cdf0e10cSrcweir case 0 : pElement->eEdgeVisibility = EV_OFF; break;
297cdf0e10cSrcweir case 1 : pElement->eEdgeVisibility = EV_ON; break;
298cdf0e10cSrcweir default : mbStatus = sal_False;
299cdf0e10cSrcweir }
300cdf0e10cSrcweir }
301cdf0e10cSrcweir break;
302cdf0e10cSrcweir case 0x1f : ComOut( CGM_LEVEL1, "Fill Reference Point" )
303cdf0e10cSrcweir ImplGetPoint( pElement->aFillRefPoint );
304cdf0e10cSrcweir break;
305cdf0e10cSrcweir case 0x20 : ComOut( CGM_LEVEL1, "Pattern Table" ) break;
306cdf0e10cSrcweir case 0x21 : ComOut( CGM_LEVEL1, "Pattern Size" ) break;
307cdf0e10cSrcweir case 0x22 : ComOut( CGM_LEVEL1, "Color Table" )
308cdf0e10cSrcweir {
309cdf0e10cSrcweir sal_uInt32 nColorStartIndex = ImplGetUI( pElement->nColorIndexPrecision );
310cdf0e10cSrcweir if ( ( nColorStartIndex > 255 ) ||
311cdf0e10cSrcweir ( ( ( mnElementSize - pElement->nColorIndexPrecision ) % ( pElement->nColorPrecision * 3 ) ) != 0 ) )
312cdf0e10cSrcweir {
313cdf0e10cSrcweir mbStatus = sal_False;
314cdf0e10cSrcweir }
315cdf0e10cSrcweir else
316cdf0e10cSrcweir {
317cdf0e10cSrcweir sal_uInt32 nColors = ( mnElementSize - pElement->nColorIndexPrecision ) / ( 3 * pElement->nColorPrecision );
318cdf0e10cSrcweir if ( nColors )
319cdf0e10cSrcweir {
320cdf0e10cSrcweir sal_uInt32 nMaxColorIndex = nColorStartIndex + nColors - 1;
321cdf0e10cSrcweir sal_uInt32 nIndex;
322cdf0e10cSrcweir if ( nMaxColorIndex > 255 )
323cdf0e10cSrcweir {
324cdf0e10cSrcweir mbStatus = sal_False;
325cdf0e10cSrcweir }
326cdf0e10cSrcweir else
327cdf0e10cSrcweir {
328cdf0e10cSrcweir if ( pElement->nLatestColorMaximumIndex < nMaxColorIndex )
329cdf0e10cSrcweir pElement->nLatestColorMaximumIndex = nMaxColorIndex;
330cdf0e10cSrcweir
331cdf0e10cSrcweir for ( nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ )
332cdf0e10cSrcweir {
333cdf0e10cSrcweir pElement->aLatestColorTable[ nIndex ] = ImplGetBitmapColor( sal_True );
334cdf0e10cSrcweir }
335cdf0e10cSrcweir }
336cdf0e10cSrcweir pElement->nColorMaximumIndex = pElement->nLatestColorMaximumIndex;
337cdf0e10cSrcweir for ( nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ )
338cdf0e10cSrcweir {
339cdf0e10cSrcweir if ( !pElement->aColorTableEntryIs[ nIndex ] )
340cdf0e10cSrcweir {
341cdf0e10cSrcweir pElement->aColorTableEntryIs[ nIndex ] = 1;
342cdf0e10cSrcweir pElement->aColorTable[ nIndex ] = pElement->aLatestColorTable[ nIndex ];
343cdf0e10cSrcweir }
344cdf0e10cSrcweir }
345cdf0e10cSrcweir }
346cdf0e10cSrcweir }
347cdf0e10cSrcweir }
348cdf0e10cSrcweir break;
349cdf0e10cSrcweir case 0x23 : ComOut( CGM_LEVEL1, "Aspect Source Flags" )
350cdf0e10cSrcweir {
351cdf0e10cSrcweir int nFlags = mnElementSize >> 2;
352cdf0e10cSrcweir while ( nFlags-- > 0 )
353cdf0e10cSrcweir {
354cdf0e10cSrcweir sal_uInt32 nFlag = 0;
355cdf0e10cSrcweir switch( ImplGetUI16() )
356cdf0e10cSrcweir {
357cdf0e10cSrcweir case 0 : nFlag = ASF_LINETYPE; break;
358cdf0e10cSrcweir case 1 : nFlag = ASF_LINEWIDTH; break;
359cdf0e10cSrcweir case 2 : nFlag = ASF_LINECOLOR; break;
360cdf0e10cSrcweir case 3 : nFlag = ASF_MARKERTYPE; break;
361cdf0e10cSrcweir case 4 : nFlag = ASF_MARKERSIZE; break;
362cdf0e10cSrcweir case 5 : nFlag = ASF_MARKERCOLOR; break;
363cdf0e10cSrcweir case 6 : nFlag = ASF_FILLINTERIORSTYLE; break;
364cdf0e10cSrcweir case 7 : nFlag = ASF_HATCHINDEX; break;
365cdf0e10cSrcweir case 8 : nFlag = ASF_PATTERNINDEX; break;
366cdf0e10cSrcweir case 9 : nFlag = ASF_BITMAPINDEX; break;
367cdf0e10cSrcweir case 10 : nFlag = ASF_FILLCOLOR; break;
368cdf0e10cSrcweir case 11 : nFlag = ASF_EDGETYPE; break;
369cdf0e10cSrcweir case 12 : nFlag = ASF_EDGEWIDTH; break;
370cdf0e10cSrcweir case 13 : nFlag = ASF_EDGECOLOR; break;
371cdf0e10cSrcweir case 14 : nFlag = ASF_TEXTFONTINDEX; break;
372cdf0e10cSrcweir case 15 : nFlag = ASF_TEXTPRECISION; break;
373cdf0e10cSrcweir case 16 : nFlag = ASF_CHARACTEREXPANSION; break;
374cdf0e10cSrcweir case 17 : nFlag = ASF_CHARACTERSPACING; break;
375cdf0e10cSrcweir case 18 : nFlag = ASF_TEXTCOLOR; break;
376cdf0e10cSrcweir default : mbStatus = sal_False; break;
377cdf0e10cSrcweir }
378cdf0e10cSrcweir sal_uInt32 nASF = ImplGetUI16();
379cdf0e10cSrcweir switch ( nASF )
380cdf0e10cSrcweir {
381cdf0e10cSrcweir case 0 : pElement->nAspectSourceFlags &= ~nFlag; break; // INDIVIDUAL
382cdf0e10cSrcweir case 1 : pElement->nAspectSourceFlags |= nFlag; break; // BUNDLED
383cdf0e10cSrcweir default : mbStatus = sal_False; break;
384cdf0e10cSrcweir }
385cdf0e10cSrcweir }
386cdf0e10cSrcweir }
387cdf0e10cSrcweir break;
388cdf0e10cSrcweir case 0x24 : ComOut( CGM_LEVEL2, "Pick Identifier" ) break;
389cdf0e10cSrcweir case 0x25 : ComOut( CGM_LEVEL3, "Line Cap" )
390cdf0e10cSrcweir {
391cdf0e10cSrcweir switch( ImplGetUI16() )
392cdf0e10cSrcweir {
393cdf0e10cSrcweir case 0 : pElement->eLineCapType = LCT_BUTT; break;
394cdf0e10cSrcweir case 1 : pElement->eLineCapType = LCT_ROUND; break;
395cdf0e10cSrcweir case 2 : pElement->eLineCapType = LCT_SQUARE; break;
396cdf0e10cSrcweir case 3 : pElement->eLineCapType = LCT_TRIANGLE; break;
397cdf0e10cSrcweir case 4 : pElement->eLineCapType = LCT_ARROW; break;
398cdf0e10cSrcweir default : pElement->eLineCapType = LCT_NONE; break;
399cdf0e10cSrcweir }
400cdf0e10cSrcweir }
401cdf0e10cSrcweir break;
402cdf0e10cSrcweir case 0x26 : ComOut( CGM_LEVEL3, "Line Join" )
403cdf0e10cSrcweir {
404cdf0e10cSrcweir switch( ImplGetUI16() )
405cdf0e10cSrcweir {
406cdf0e10cSrcweir case 0 : pElement->eLineJoinType = LJT_MITER; break;
407cdf0e10cSrcweir case 1 : pElement->eLineJoinType = LJT_ROUND; break;
408cdf0e10cSrcweir case 2 : pElement->eLineJoinType = LJT_BEVEL; break;
409cdf0e10cSrcweir default : pElement->eLineJoinType = LJT_NONE; break;
410cdf0e10cSrcweir }
411cdf0e10cSrcweir }
412cdf0e10cSrcweir break;
413cdf0e10cSrcweir case 0x27 : ComOut( CGM_LEVEL3, "Line Type Continuation" ) break; // NS
414cdf0e10cSrcweir case 0x28 : ComOut( CGM_LEVEL3, "Line Type Initial Offset" ) break; // NS
415cdf0e10cSrcweir case 0x29 : ComOut( CGM_LEVEL3, "Text Score Type" ) break;
416cdf0e10cSrcweir case 0x2a : ComOut( CGM_LEVEL3, "Restricted Text Type" ) break;
417cdf0e10cSrcweir case 0x2b : ComOut( CGM_LEVEL3, "Interpolated interior" ) break;
418cdf0e10cSrcweir case 0x2c : ComOut( CGM_LEVEL3, "Edge Cap" ) break; // NS
419cdf0e10cSrcweir case 0x2d : ComOut( CGM_LEVEL3, "Edge Join" ) break;
420cdf0e10cSrcweir case 0x2e : ComOut( CGM_LEVEL3, "Edge Type Continuation" ) break; // NS
421cdf0e10cSrcweir case 0x2f : ComOut( CGM_LEVEL3, "Edge Type Initial Offset" ) break; // NS
422cdf0e10cSrcweir case 0x30 : ComOut( CGM_LEVEL3, "Symbol Library Index" ) break; // NS
423cdf0e10cSrcweir case 0x31 : ComOut( CGM_LEVEL3, "Symbol Color" ) break; // NS
424cdf0e10cSrcweir case 0x32 : ComOut( CGM_LEVEL3, "Symbol Size" ) break; // NS
425cdf0e10cSrcweir case 0x33 : ComOut( CGM_LEVEL3, "Symbol Orientation" ) break; // NS
426cdf0e10cSrcweir case 0x50 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Region Margins" ) break;
427cdf0e10cSrcweir case 0x51 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Region Expansion" ) break;
428cdf0e10cSrcweir case 0x52 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Region Anchor" ) break;
429cdf0e10cSrcweir case 0x53 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Horizontal Alignment" ) break;
430cdf0e10cSrcweir case 0x54 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Vertical Alignment" ) break;
431cdf0e10cSrcweir case 0x55 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Line Flow" ) break;
432cdf0e10cSrcweir case 0x60 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Spacing" ) break;
433cdf0e10cSrcweir case 0x61 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Indent" ) break;
434cdf0e10cSrcweir case 0x62 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Tabs" ) break;
435cdf0e10cSrcweir case 0x63 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Bullets" ) break;
436cdf0e10cSrcweir case 0x64 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Bullet Level" ) break;
437cdf0e10cSrcweir case 0x65 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Line Horizontal Alignment" ) break;
438cdf0e10cSrcweir case 0x66 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Line Vertical Alignment" ) break;
439cdf0e10cSrcweir case 0x67 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragragh Line Spacing" ) break;
440cdf0e10cSrcweir case 0x68 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Paragraph Word Wrap" ) break;
441cdf0e10cSrcweir case 0x70 : ComOut( CGM_UNKNOWN_LEVEL, "Block Text Forward Advance Distance" ) break;
442cdf0e10cSrcweir case 0x71 : ComOut( CGM_UNKNOWN_LEVEL, "Word Spacing" ) break;
443cdf0e10cSrcweir case 0x72 : ComOut( CGM_UNKNOWN_LEVEL, "External Leading" ) break;
444cdf0e10cSrcweir case 0x7a : ComOut( CGM_UNKNOWN_LEVEL, "set Gradient Offset" )
445cdf0e10cSrcweir {
446cdf0e10cSrcweir long nHorzOffset = ImplGetI( pElement->nIndexPrecision );
447cdf0e10cSrcweir long nVertOffset = ImplGetI( pElement->nIndexPrecision );
448cdf0e10cSrcweir sal_uInt32 nType = ImplGetUI16();
449cdf0e10cSrcweir mpOutAct->SetGradientOffset( nHorzOffset, nVertOffset, nType );
450cdf0e10cSrcweir mnAct4PostReset |= ACT4_GRADIENT_ACTION;
451cdf0e10cSrcweir }
452cdf0e10cSrcweir break;
453cdf0e10cSrcweir case 0x7b : ComOut( CGM_UNKNOWN_LEVEL, "set Gradient Edge" )
454cdf0e10cSrcweir {
455cdf0e10cSrcweir mnAct4PostReset |= ACT4_GRADIENT_ACTION;
456cdf0e10cSrcweir }
457cdf0e10cSrcweir break;
458cdf0e10cSrcweir case 0x7c : ComOut( CGM_UNKNOWN_LEVEL, "set Gradient Angle" )
459cdf0e10cSrcweir {
460cdf0e10cSrcweir mpOutAct->SetGradientAngle( ImplGetI( pElement->nIndexPrecision ) );
461cdf0e10cSrcweir mnAct4PostReset |= ACT4_GRADIENT_ACTION;
462cdf0e10cSrcweir }
463cdf0e10cSrcweir break;
464cdf0e10cSrcweir case 0x7d : ComOut( CGM_UNKNOWN_LEVEL, "set Gradient Description" )
465cdf0e10cSrcweir {
466cdf0e10cSrcweir ImplGetI( pElement->nIndexPrecision ); // -Wall is this needed?
467cdf0e10cSrcweir sal_uInt32 nNumberOfStages = ImplGetI( pElement->nIndexPrecision );
468cdf0e10cSrcweir sal_uInt32 i, nColorFrom = 0;
469cdf0e10cSrcweir sal_uInt32 nColorTo = 0xffffff;
470cdf0e10cSrcweir
471cdf0e10cSrcweir //FIXME, does this loop actually do anything?
472cdf0e10cSrcweir for ( i = 0; i < nNumberOfStages; i++ )
473cdf0e10cSrcweir {
474cdf0e10cSrcweir ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize ); // -Wall is this needed
475cdf0e10cSrcweir }
476cdf0e10cSrcweir
477cdf0e10cSrcweir for ( i = 0; i <= nNumberOfStages; i++ )
478cdf0e10cSrcweir {
479cdf0e10cSrcweir sal_uInt32 nPara = mnParaSize + 24;
480cdf0e10cSrcweir if ( i == 0 )
481cdf0e10cSrcweir {
482cdf0e10cSrcweir nColorTo = ImplGetBitmapColor();
483cdf0e10cSrcweir nColorFrom = nColorTo ^ 0xffffff;
484cdf0e10cSrcweir }
485cdf0e10cSrcweir else if ( i == 1 )
486cdf0e10cSrcweir nColorFrom = ImplGetBitmapColor();
487cdf0e10cSrcweir mnParaSize = nPara;
488cdf0e10cSrcweir }
489cdf0e10cSrcweir if ( nNumberOfStages > 1 )
490cdf0e10cSrcweir mpOutAct->SetGradientStyle( 0xff, 1 );
491cdf0e10cSrcweir
492cdf0e10cSrcweir mpOutAct->SetGradientDescriptor( nColorFrom, nColorTo );
493cdf0e10cSrcweir mnAct4PostReset |= ACT4_GRADIENT_ACTION;
494cdf0e10cSrcweir }
495cdf0e10cSrcweir break;
496cdf0e10cSrcweir case 0x7e : ComOut( CGM_UNKNOWN_LEVEL, "set Gradient Style" )
497cdf0e10cSrcweir {
498cdf0e10cSrcweir sal_uInt32 nStyle = ImplGetUI16( 8 );
499cdf0e10cSrcweir double fRatio = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
500cdf0e10cSrcweir mpOutAct->SetGradientStyle( nStyle, fRatio );
501cdf0e10cSrcweir mnAct4PostReset |= ACT4_GRADIENT_ACTION;
502cdf0e10cSrcweir }
503cdf0e10cSrcweir break;
504cdf0e10cSrcweir case 0xff : ComOut( CGM_GDSF_ONLY, "inquire Font metrics" ) break;
505cdf0e10cSrcweir case 0xfe : ComOut( CGM_GDSF_ONLY, "inquire character widths" ) break;
506cdf0e10cSrcweir case 0xfd : ComOut( CGM_GDSF_ONLY, "set Text Font" ) break;
507cdf0e10cSrcweir case 0xfc : ComOut( CGM_GDSF_ONLY, "set current position" ) break;
508cdf0e10cSrcweir case 0xfb : ComOut( CGM_GDSF_ONLY, "set current position mode" ) break;
509cdf0e10cSrcweir case 0xfa : ComOut( CGM_GDSF_ONLY, "set character height mode" ) break;
510cdf0e10cSrcweir case 0xf9 : ComOut( CGM_GDSF_ONLY, "set Transform matrix 2D" ) break;
511cdf0e10cSrcweir case 0xf8 : ComOut( CGM_GDSF_ONLY, "set Transform matrix 3D" ) break;
512cdf0e10cSrcweir case 0xf7 : ComOut( CGM_GDSF_ONLY, "pop transformation state" ) break;
513cdf0e10cSrcweir case 0xf6 : ComOut( CGM_GDSF_ONLY, "clear transformation state" ) break;
514cdf0e10cSrcweir case 0xf5 : ComOut( CGM_GDSF_ONLY, "set character widths" ) break;
515cdf0e10cSrcweir case 0xf4 : ComOut( CGM_GDSF_ONLY, "set color name - for Pantone support" ) break;
516cdf0e10cSrcweir default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;
517cdf0e10cSrcweir }
518cdf0e10cSrcweir };
519cdf0e10cSrcweir
520cdf0e10cSrcweir
521