LibreOffice Module filter (master) 1
class3.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
21#include "cgm.hxx"
22#include "elements.hxx"
23#include "outact.hxx"
24
25
27{
28 sal_uInt32 nUInteger;
29 switch ( mnElementID )
30 {
31 case 0x01 : /*VDC Integer Precision*/
32 {
33 switch( ImplGetI( pElement->nIntegerPrecision ) )
34 {
35 case 16 : pElement->nVDCIntegerPrecision = 2; break;
36 case 32 : pElement->nVDCIntegerPrecision = 4; break;
37 default : mbStatus = false; break;
38 }
39 }
40 break;
41 case 0x02 : /*VDC Real Precision*/
42 {
43 nUInteger = ImplGetUI16();
44 const tools::Long nI0 = ImplGetI( pElement->nIntegerPrecision ); // exponent
45 const tools::Long nI1 = ImplGetI( pElement->nIntegerPrecision ); // mantissa
46 switch( nUInteger )
47 {
48 case 0 :
49 pElement->eVDCRealPrecision = RP_FLOAT;
50 switch ( nI0 )
51 {
52 case 9 :
53 if ( nI1 != 23 )
54 mbStatus = false;
55 pElement->nVDCRealSize = 4;
56 break;
57 case 12 :
58 if ( nI1 != 52 )
59 mbStatus =false;
60 pElement->nVDCRealSize = 8;
61 break;
62 default:
63 mbStatus = false;
64 break;
65 }
66 break;
67 case 1 :
68 pElement->eVDCRealPrecision = RP_FIXED;
69 if ( nI0 != nI1 )
70 mbStatus = false;
71 if ( nI0 == 16 )
72 pElement->nVDCRealSize = 4;
73 else if ( nI0 == 32 )
74 pElement->nVDCRealSize = 8;
75 else
76 mbStatus = false;
77 break;
78 default :
79 mbStatus = false; break;
80 }
81 }
82 break;
83 case 0x03 : /*Auxiliary Colour*/
84 {
85 pElement->nAuxiliaryColor = ImplGetBitmapColor();
86 }
87 break;
88 case 0x04 : /*Transparency*/
89 {
90 switch( ImplGetUI16() )
91 {
92 case 0 : pElement->eTransparency = T_OFF; break;
93 case 1 : pElement->eTransparency = T_ON; break;
94 default : mbStatus = false; break;
95 }
96 }
97 break;
98 case 0x05 : /*Clip Rectangle*/
99 ImplGetRectangle( pElement->aClipRect );
100 break;
101 case 0x06 : /*Clip Indicator*/
102 {
103 switch( ImplGetUI16() )
104 {
105 case 0 : pElement->eClipIndicator = CI_OFF; break;
106 case 1 : pElement->eClipIndicator = CI_ON; break;
107 default : mbStatus = false; break;
108 }
109 }
110 break;
111 case 0x07 : /*Line Clipping Mode */break; // NS
112 case 0x08 : /*Marker Clipping Mode */break; // NS
113 case 0x09 : /*Edge Clipping Mode */break; // NS
114 case 0x0a : /*New Region*/
115 mpOutAct->NewRegion();
116 break;
117 case 0x0b : /*Save Primitive Context */break; // NS
118 case 0x0c : /*Restore Primitive Context */break; // NS
119 case 0x11 : /*Protection vcl::Region Indicator */break;
120 case 0x12 : /*Generalized Text Path Mode */break; // NS
121 case 0x13 : /*Mitre Limit*/
122 pElement->nMitreLimit = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
123 break; // NS
124 case 0x14 : /*Transparent Cell Color */break; // NS
125 case 0xfc : /*Text Path Alignment Modes */break;
126 case 0xfd : /*Pop Transformation Stack */break;
127 case 0xfe : /*Push Transformation Stack */break;
128 case 0xff : /*Set Patch ID */break;
129 default: break;
130 }
131};
132
133
134/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ T_OFF
Definition: cgmtypes.hxx:121
@ T_ON
Definition: cgmtypes.hxx:121
@ CI_ON
Definition: cgmtypes.hxx:95
@ CI_OFF
Definition: cgmtypes.hxx:95
@ RP_FIXED
Definition: cgmtypes.hxx:85
@ RP_FLOAT
Definition: cgmtypes.hxx:85
std::unique_ptr< CGMImpressOutAct > mpOutAct
Definition: cgm.hxx:71
double ImplGetFloat(RealPrecision, sal_uInt32 nRealSize)
Definition: cgm.cxx:172
bool mbStatus
Definition: cgm.hxx:55
sal_Int32 ImplGetI(sal_uInt32 nPrecision)
Definition: cgm.cxx:96
sal_uInt32 mnElementID
Definition: cgm.hxx:86
sal_uInt32 ImplGetBitmapColor(bool bDirectColor=false)
Definition: cgm.cxx:334
sal_uInt32 ImplGetUI16()
Definition: cgm.cxx:82
void ImplDoClass3()
Definition: class3.cxx:26
void ImplGetRectangle(FloatRect &, bool bMap=false)
Definition: cgm.cxx:290
std::unique_ptr< CGMElements > pElement
Definition: cgm.hxx:69
long Long