merge the formfield patch from ooo-build
[ooovba.git] / goodies / source / filter.vcl / icgm / class3.cxx
blob92166a8095e5994cf54678c1c7f762c9841d08d7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: class3.cxx,v $
10 * $Revision: 1.6 $
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"
34 #include <main.hxx>
35 #include <outact.hxx>
37 // ---------------------------------------------------------------
39 void CGM::ImplDoClass3()
41 sal_uInt32 nUInteger;
42 long nI0, nI1;
43 switch ( mnElementID )
45 case 0x01 : ComOut( CGM_LEVEL1, "VDC Integer Precision" )
47 switch( ImplGetI( pElement->nIntegerPrecision ) )
49 case 16 : pElement->nVDCIntegerPrecision = 2; break;
50 case 32 : pElement->nVDCIntegerPrecision = 4; break;
51 default : mbStatus = sal_False; break;
54 break;
55 case 0x02 : ComOut( CGM_LEVEL1, "VDC Real Precision" )
57 nUInteger = ImplGetUI16();
58 nI0 = ImplGetI( pElement->nIntegerPrecision ); // exponent
59 nI1 = ImplGetI( pElement->nIntegerPrecision ); // mantisse
60 switch( nUInteger )
62 case 0 :
63 pElement->eVDCRealPrecision = RP_FLOAT;
64 switch ( nI0 )
66 case 9 :
67 if ( nI1 != 23 )
68 mbStatus = sal_False;
69 pElement->nVDCRealSize = 4;
70 break;
71 case 12 :
72 if ( nI1 != 52 )
73 mbStatus =sal_False;
74 pElement->nVDCRealSize = 8;
75 break;
76 default:
77 mbStatus = sal_False;
78 break;
80 break;
81 case 1 :
82 pElement->eVDCRealPrecision = RP_FIXED;
83 if ( nI0 != nI1 )
84 mbStatus = sal_False;
85 if ( nI0 == 16 )
86 pElement->nVDCRealSize = 4;
87 else if ( nI0 == 32 )
88 pElement->nVDCRealSize = 8;
89 else
90 mbStatus = sal_False;
91 break;
92 default :
93 mbStatus = sal_False; break;
96 break;
97 case 0x03 : ComOut( CGM_LEVEL1, "Auxiliary Colour" )
99 pElement->nAuxiliaryColor = ImplGetBitmapColor();
101 break;
102 case 0x04 : ComOut( CGM_LEVEL1, "Transparency" )
104 switch( ImplGetUI16() )
106 case 0 : pElement->eTransparency = T_OFF; break;
107 case 1 : pElement->eTransparency = T_ON; break;
108 default : mbStatus = sal_False; break;
111 break;
112 case 0x05 : ComOut( CGM_LEVEL1, "Clip Rectangle" )
113 ImplGetRectangle( pElement->aClipRect );
114 break;
115 case 0x06 : ComOut( CGM_LEVEL1, "Clip Indicator" )
117 switch( ImplGetUI16() )
119 case 0 : pElement->eClipIndicator = CI_OFF; break;
120 case 1 : pElement->eClipIndicator = CI_ON; break;
121 default : mbStatus = sal_False; break;
124 break;
125 case 0x07 : ComOut( CGM_LEVEL2, "Line Clipping Mode" ) break; // NS
126 case 0x08 : ComOut( CGM_LEVEL2, "Marker Clipping Mode" ) break; // NS
127 case 0x09 : ComOut( CGM_LEVEL2, "Edge Clipping Mode" ) break; // NS
128 case 0x0a : ComOut( CGM_LEVEL2, "New Region" )
129 mpOutAct->NewRegion();
130 break;
131 case 0x0b : ComOut( CGM_LEVEL2, "Save Primitive Context" ) break; // NS
132 case 0x0c : ComOut( CGM_LEVEL2, "Restore Primitive Context" ) break; // NS
133 case 0x11 : ComOut( CGM_LEVEL3, "Protection Region Indicator" ) break;
134 case 0x12 : ComOut( CGM_LEVEL3, "Generalized Text Path Mode" ) break; // NS
135 case 0x13 : ComOut( CGM_LEVEL3, "Mitre Limit" )
136 pElement->nMitreLimit = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
137 break; // NS
138 case 0x14 : ComOut( CGM_LEVEL3, "Transparent Cell Color" ) break; // NS
139 case 0xfc : ComOut( CGM_GDSF_ONLY, "Text Path Alignment Modes" ) break;
140 case 0xfd : ComOut( CGM_GDSF_ONLY, "Pop Transformation Stack" ) break;
141 case 0xfe : ComOut( CGM_GDSF_ONLY, "Push Transformation Stack" ) break;
142 case 0xff : ComOut( CGM_GDSF_ONLY, "Set Patch ID" ) break;
143 default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;