LCOV - code coverage report
Current view: top level - libreoffice/filter/source/graphicfilter/icgm - class1.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 105 0.0 %
Date: 2012-12-27 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 <main.hxx>
      22             : 
      23             : // ---------------------------------------------------------------
      24             : 
      25           0 : void CGM::ImplDoClass1()
      26             : {
      27             :     long    nInteger, nI0, nI1;
      28             :     sal_uInt32  nUInteger;
      29             : 
      30           0 :     switch ( mnElementID )
      31             :     {
      32             :         case 0x01 : /*Metafile Version*/
      33           0 :             pElement->nMetaFileVersion = ImplGetI( pElement->nIntegerPrecision );
      34           0 :         break;
      35           0 :         case 0x02 : /*Metafile Description */break;
      36             :         case 0x03 : /*VDC Type*/
      37             :         {
      38           0 :             nUInteger = ImplGetUI16();
      39           0 :             switch( nUInteger )
      40             :             {
      41           0 :                 case 0 : pElement->eVDCType = VDC_INTEGER; break;
      42           0 :                 case 1 : pElement->eVDCType = VDC_REAL; break;
      43           0 :                 default: mbStatus = sal_False; break;
      44             :             }
      45             :         }
      46           0 :         break;
      47             :         case 0x04 : /*Integer Precision*/
      48             :         {
      49           0 :             nInteger = ImplGetI( pElement->nIntegerPrecision );
      50           0 :             switch ( nInteger )
      51             :             {
      52             :                 case 32 :
      53             :                 case 24 :
      54             :                 case 16 :
      55           0 :                 case 8 : pElement->nIntegerPrecision = nInteger >> 3; break;
      56           0 :                 default : mbStatus = sal_False; break;
      57             :             }
      58             :         }
      59           0 :         break;
      60             :         case 0x05 : /*Real Precision*/
      61             :         {
      62           0 :             nUInteger = ImplGetUI16( 4 );
      63           0 :             nI0 = ImplGetI( pElement->nIntegerPrecision );  // exponent
      64           0 :             nI1 = ImplGetI( pElement->nIntegerPrecision );  // mantisse
      65           0 :             switch( nUInteger )
      66             :             {
      67             :                 case 0 :
      68           0 :                     pElement->eRealPrecision = RP_FLOAT;
      69           0 :                     switch ( nI0 )
      70             :                     {
      71             :                         case 9 :
      72           0 :                             if ( nI1 != 23 )
      73           0 :                                 mbStatus = sal_False;
      74           0 :                             pElement->nRealSize = 4;
      75           0 :                             break;
      76             :                         case 12 :
      77           0 :                             if ( nI1 != 52 )
      78           0 :                                 mbStatus =sal_False;
      79           0 :                             pElement->nRealSize = 8;
      80           0 :                             break;
      81             :                         default:
      82           0 :                             mbStatus = sal_False;
      83           0 :                             break;
      84             :                     }
      85           0 :                     break;
      86             :                 case 1 :
      87           0 :                     pElement->eRealPrecision = RP_FIXED;
      88           0 :                     if ( nI0 != nI1 )
      89           0 :                         mbStatus = sal_False;
      90           0 :                     if ( nI0 == 16 )
      91           0 :                         pElement->nRealSize = 4;
      92           0 :                     else if ( nI0 == 32 )
      93           0 :                         pElement->nRealSize = 8;
      94             :                     else
      95           0 :                         mbStatus = sal_False;
      96           0 :                     break;
      97             :                 default :
      98           0 :                     mbStatus = sal_False; break;
      99             :             }
     100             :         }
     101           0 :         break;
     102             :         case 0x06 : /*Index Precision*/
     103             :         {
     104           0 :             nInteger = ImplGetI( pElement->nIntegerPrecision );
     105           0 :             switch ( nInteger )
     106             :             {
     107             :                 case 32 :
     108             :                 case 24 :
     109             :                 case 16 :
     110           0 :                 case 8 : pElement->nIndexPrecision = nInteger >> 3; break;
     111           0 :                 default : mbStatus = sal_False; break;
     112             :             }
     113             :         }
     114           0 :         break;
     115             :         case 0x07 : /*Color Precision*/
     116             :         {
     117           0 :             nInteger = ImplGetI( pElement->nIntegerPrecision );
     118           0 :             switch ( nInteger )
     119             :             {
     120             :                 case 32 :
     121             :                 case 24 :
     122             :                 case 16 :
     123           0 :                 case 8 : pElement->nColorPrecision = nInteger >> 3; break;
     124           0 :                 default : mbStatus = sal_False; break;
     125             :             }
     126             :         }
     127           0 :         break;
     128             :         case 0x08 : /*Color Index Precision*/
     129             :         {
     130           0 :             nInteger = ImplGetI( pElement->nIntegerPrecision );
     131           0 :             switch ( nInteger )
     132             :             {
     133             :                 case 32 :
     134             :                 case 24 :
     135             :                 case 16 :
     136           0 :                 case 8 : pElement->nColorIndexPrecision = nInteger >> 3; break;
     137           0 :                 default : mbStatus = sal_False; break;
     138             :             }
     139             :         }
     140           0 :         break;
     141             :         case 0x09 : /*Maximum Colour Index*/
     142             :         {
     143           0 :             pElement->nColorMaximumIndex = ImplGetUI( pElement->nColorIndexPrecision );
     144           0 :             if ( ( pElement->nColorMaximumIndex > 256 /*255*/ ) || ( pElement->nColorMaximumIndex == 0 ) )
     145           0 :                 mbStatus = sal_False;
     146             :         }
     147           0 :         break;
     148             :         case 0x0a : /*Color Value Extent*/
     149             :         {
     150           0 :             if ( pElement->eColorModel == CM_RGB )
     151           0 :                 nI1 = 6;
     152             :             else
     153             :             {
     154           0 :                 nI1 = 8;
     155           0 :                 mbStatus = sal_False;                               // CMYK is not supported
     156             :             }
     157           0 :             for ( nI0 = 0; nI0 < nI1; nI0++ )
     158             :             {
     159           0 :                 pElement->nColorValueExtent[ nI0 ] = (sal_uInt8)ImplGetUI( pElement->nColorPrecision );
     160             :             }
     161             :         }
     162           0 :         break;
     163           0 :         case 0x0b : /*MetaFile Element List */break;
     164             :         case 0x0c : /*MetaFile Default Replacement*/
     165             :         {
     166           0 :             if ( mnElementSize > 1 )
     167             :             {
     168           0 :                 sal_uInt8* pBuf = new sal_uInt8[ mnElementSize ];
     169           0 :                 if ( pBuf )
     170             :                 {
     171           0 :                     memcpy( pBuf, mpSource, mnElementSize );
     172           0 :                     maDefRepList.push_back( pBuf );
     173           0 :                     maDefRepSizeList.push_back( mnElementSize );
     174             :                 }
     175             :             }
     176           0 :             mnParaSize = mnElementSize;
     177             :         }
     178           0 :         break;
     179             :         case 0x0d : /*Font List*/
     180             :         {
     181           0 :             while ( mnParaSize < mnElementSize )
     182             :             {
     183             :                 sal_uInt32 nSize;
     184           0 :                 nSize = ImplGetUI( 1 );
     185           0 :                 pElement->aFontList.InsertName( mpSource + mnParaSize, nSize );
     186           0 :                 mnParaSize += nSize;
     187             :             }
     188             :         }
     189           0 :         break;
     190             :         case 0x0e : /*Character Set List*/
     191             :         {
     192           0 :             while ( mnParaSize < mnElementSize )
     193             :             {
     194             :                 sal_uInt32 nCharSetType;
     195             :                 sal_uInt32 nSize;
     196           0 :                 nCharSetType = ImplGetUI16();
     197           0 :                 nSize = ImplGetUI( 1 );
     198           0 :                 pElement->aFontList.InsertCharSet( (CharSetType)nCharSetType, mpSource + mnParaSize, nSize );
     199           0 :                 mnParaSize += nSize;
     200             :             }
     201             :         }
     202           0 :         break;
     203             :         case 0x0f : /*Character Coding Announcer*/
     204           0 :             pElement->eCharacterCodingA = (CharacterCodingA)ImplGetUI16();
     205           0 :         break;
     206           0 :         case 0x10 : /*Name Precision */break;                   // NS
     207           0 :         case 0x11 : /*Maximum VDC Extent */break;               // NS
     208           0 :         case 0x12 : /*Segment Priority Extent */break;          // NS
     209           0 :         case 0x13 : /*Color Model */break;                      // NS
     210           0 :         case 0x14 : /*Color Calibration */break;                // NS
     211           0 :         case 0x15 : /*Font Properties */break;                  // NS
     212           0 :         case 0x16 : /*Glyph Mapping */break;                    // NS
     213           0 :         case 0x17 : /*Symbol Library List */break;              // NS
     214           0 :         case 0xfc : /*Inquire Function Support */break;
     215           0 :         case 0xfa : /*End Metafile Defaults Replacement */break;
     216           0 :         case 0xf8 : /*Set Color Value Desc Extent */break;
     217           0 :         default: break;
     218             :     }
     219           0 : };
     220             : 
     221             : 
     222             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10