Update ooo320-m1
[ooovba.git] / goodies / source / filter.vcl / icgm / class0.cxx
blob25f582e1ad7f8f9a6a6c90422c126577e117ec34
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: class0.cxx,v $
10 * $Revision: 1.4 $
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"
33 #include <main.hxx>
34 #include <outact.hxx>
36 // ---------------------------------------------------------------
38 void CGM::ImplDoClass0()
40 switch ( mnElementID )
42 case 0x01 : ComOut( CGM_LEVEL1, "Begin Metafile" )
44 ImplSetMapMode();
45 mbMetaFile = sal_True;
47 break;
48 case 0x02 : ComOut( CGM_LEVEL1, "End MetaFile" )
50 if ( mpBitmapInUse ) // vorhandene grafik verarbeiten,
52 CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
53 // irgendetwas mit der Bitmap anfangen
54 mpOutAct->DrawBitmap( pBmpDesc );
55 delete mpBitmapInUse;
56 mpBitmapInUse = NULL;
58 mbIsFinished = sal_True;
59 mbPictureBody = sal_False;
60 mbMetaFile = sal_False;
62 break;
63 case 0x03 : ComOut( CGM_LEVEL1, "Begin Picture" )
65 ImplDefaultReplacement();
66 ImplSetMapMode();
67 if ( mbPicture )
68 mbStatus = sal_False;
69 else
71 *pCopyOfE = *pElement;
72 mbPicture = mbFirstOutPut = sal_True;
73 mbFigure = sal_False;
74 mnAct4PostReset = 0;
75 if ( mpChart == NULL ) // normal CGM Files determines "BeginPic"
76 mpOutAct->InsertPage(); // as the next slide
79 break;
80 case 0x04 : ComOut( CGM_LEVEL1, "Begin Picture Body" )
81 mbPictureBody = sal_True;
82 break;
83 case 0x05 : ComOut( CGM_LEVEL1, " End Picture" )
85 if ( mbPicture )
87 if ( mpBitmapInUse ) // vorhandene grafik verarbeiten,
89 CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
90 // irgendetwas mit der Bitmap anfangen
91 mpOutAct->DrawBitmap( pBmpDesc );
92 delete mpBitmapInUse;
93 mpBitmapInUse = NULL;
95 mpOutAct->EndFigure(); // eventuelle figuren schliessen
96 mpOutAct->EndGrouping(); // eventuelle gruppierungen noch abschliessen
97 *pElement = *pCopyOfE;
98 mbFigure = mbFirstOutPut = mbPicture = mbPictureBody = sal_False;
100 else
101 mbStatus = sal_False;
103 break;
104 case 0x06 : ComOut( CGM_LEVEL2, "Begin Segment" )
105 pElement->bSegmentCount = sal_True;
106 break;
107 case 0x07 : ComOut( CGM_LEVEL2, "End Segment" )
108 pElement->bSegmentCount = sal_True;
109 break;
110 case 0x08 : ComOut( CGM_LEVEL2, "Begin Figure" )
111 mbFigure = sal_True;
112 mpOutAct->BeginFigure();
113 break;
114 case 0x09 : ComOut( CGM_LEVEL2, "End Figure" )
115 mpOutAct->EndFigure();
116 mbFigure = sal_False;
117 break;
118 case 0x0d : ComOut( CGM_LEVEL3, "Begin Protection Region" ) break;
119 case 0x0e : ComOut( CGM_LEVEL3, "End Protection Region" ) break;
120 case 0x0f : ComOut( CGM_LEVEL3, "Begin Compound Line" ) break;
121 case 0x10 : ComOut( CGM_LEVEL3, "End Compound Line" ) break;
122 case 0x11 : ComOut( CGM_LEVEL3, "Begin Compound Text Path" ) break;
123 case 0x12 : ComOut( CGM_LEVEL3, "End Compound Text Path" ) break;
124 case 0x13 : ComOut( CGM_LEVEL3, "Begin Tile Array" ) break; // NS
125 case 0x14 : ComOut( CGM_LEVEL3, "End Tile Array" ) break; // NS
126 case 0xff : ComOut( CGM_GDSF_ONLY, "Filter Setup" ) break;
127 case 0xfe : ComOut( CGM_GDSF_ONLY, "Begin Block Text Region" ) break;
128 case 0xfd : ComOut( CGM_GDSF_ONLY, "End Block Text Region" ) break;
129 case 0xfc : ComOut( CGM_GDSF_ONLY, "Begin Group" )
130 mpOutAct->BeginGroup();
131 break;
132 case 0xfb : ComOut( CGM_GDSF_ONLY, "End Group" )
133 mpOutAct->EndGroup();
134 break;
135 case 0xfa : ComOut( CGM_GDSF_ONLY, "Begin Patch" ) break;
136 case 0xf9 : ComOut( CGM_GDSF_ONLY, "Begin Patch" ) break;
137 default: ComOut( CGM_UNKNOWN_COMMAND, "" ) break;