bump product version to 4.1.6.2
[LibreOffice.git] / filter / source / graphicfilter / icgm / class0.cxx
blobfa65008815f9816b3f8553fd7f6ee9b9cceada5e
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 .
20 #include <main.hxx>
21 #include <outact.hxx>
23 // ---------------------------------------------------------------
25 void CGM::ImplDoClass0()
27 switch ( mnElementID )
29 case 0x01 : /*Begin Metafile*/
31 ImplSetMapMode();
32 mbMetaFile = sal_True;
34 break;
35 case 0x02 : /*End MetaFile*/
37 if ( mpBitmapInUse ) // process existend graphic
39 CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
40 // do anything with the bitmap
41 mpOutAct->DrawBitmap( pBmpDesc );
42 delete mpBitmapInUse;
43 mpBitmapInUse = NULL;
45 mbIsFinished = sal_True;
46 mbPictureBody = sal_False;
47 mbMetaFile = sal_False;
49 break;
50 case 0x03 : /*Begin Picture*/
52 ImplDefaultReplacement();
53 ImplSetMapMode();
54 if ( mbPicture )
55 mbStatus = sal_False;
56 else
58 *pCopyOfE = *pElement;
59 mbPicture = mbFirstOutPut = sal_True;
60 mbFigure = sal_False;
61 mnAct4PostReset = 0;
62 if ( mpChart == NULL ) // normal CGM Files determines "BeginPic"
63 mpOutAct->InsertPage(); // as the next slide
66 break;
67 case 0x04 : /*Begin Picture Body*/
68 mbPictureBody = sal_True;
69 break;
70 case 0x05 : /* End Picture*/
72 if ( mbPicture )
74 if ( mpBitmapInUse ) // process existend graphic
76 CGMBitmapDescriptor* pBmpDesc = mpBitmapInUse->GetBitmap();
77 // do anything with the bitmap
78 mpOutAct->DrawBitmap( pBmpDesc );
79 delete mpBitmapInUse;
80 mpBitmapInUse = NULL;
82 mpOutAct->EndFigure(); // close potential figures
83 mpOutAct->EndGrouping(); // finish potential groups
84 *pElement = *pCopyOfE;
85 mbFigure = mbFirstOutPut = mbPicture = mbPictureBody = sal_False;
87 else
88 mbStatus = sal_False;
90 break;
91 case 0x06 : /*Begin Segment*/
92 pElement->bSegmentCount = sal_True;
93 break;
94 case 0x07 : /*End Segment*/
95 pElement->bSegmentCount = sal_True;
96 break;
97 case 0x08 : /*Begin Figure*/
98 mbFigure = sal_True;
99 mpOutAct->BeginFigure();
100 break;
101 case 0x09 : /*End Figure*/
102 mpOutAct->EndFigure();
103 mbFigure = sal_False;
104 break;
105 case 0x0d : /*Begin Protection Region */break;
106 case 0x0e : /*End Protection Region */break;
107 case 0x0f : /*Begin Compound Line */break;
108 case 0x10 : /*End Compound Line */break;
109 case 0x11 : /*Begin Compound Text Path */break;
110 case 0x12 : /*End Compound Text Path */break;
111 case 0x13 : /*Begin Tile Array */break; // NS
112 case 0x14 : /*End Tile Array */break; // NS
113 case 0xff : /*Filter Setup */break;
114 case 0xfe : /*Begin Block Text Region */break;
115 case 0xfd : /*End Block Text Region */break;
116 case 0xfc : /*Begin Group*/
117 mpOutAct->BeginGroup();
118 break;
119 case 0xfb : /*End Group*/
120 mpOutAct->EndGroup();
121 break;
122 case 0xfa : /*Begin Patch */break;
123 case 0xf9 : /*Begin Patch */break;
124 default: break;
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */