LCOV - code coverage report
Current view: top level - rsc/source/res - rscarray.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 156 211 73.9 %
Date: 2012-08-25 Functions: 29 37 78.4 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 89 180 49.4 %

           Branch data     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                 :            : /****************** I N C L U D E S **************************************/
      21                 :            : 
      22                 :            : // C and C++ Includes.
      23                 :            : #include <stdlib.h>
      24                 :            : #include <stdio.h>
      25                 :            : #include <string.h>
      26                 :            : 
      27                 :            : // Programmabhaengige Includes.
      28                 :            : #include <rscconst.hxx>
      29                 :            : #include <rscarray.hxx>
      30                 :            : #include <rscdb.hxx>
      31                 :            : 
      32                 :            : /****************** C O D E **********************************************/
      33                 :            : /****************** R s c I n s t N o d e ********************************/
      34                 :            : /*************************************************************************
      35                 :            : |*
      36                 :            : |*    RscInstNode::RscInstNode()
      37                 :            : |*
      38                 :            : *************************************************************************/
      39                 :      86304 : RscInstNode::RscInstNode( sal_uInt32 nId )
      40                 :            : {
      41                 :      86304 :     nTypeId = nId;
      42                 :      86304 : }
      43                 :            : 
      44                 :            : /*************************************************************************
      45                 :            : |*
      46                 :            : |*    RscInstNode::~RscInstNode()
      47                 :            : |*
      48                 :            : *************************************************************************/
      49                 :      86304 : RscInstNode::~RscInstNode()
      50                 :            : {
      51         [ +  - ]:      86304 :     if( aInst.IsInst() )
      52                 :            :     {
      53         [ +  - ]:      86304 :         aInst.pClass->Destroy( aInst );
      54                 :      86304 :         rtl_freeMemory( aInst.pData );
      55                 :            :     }
      56         [ -  + ]:     172608 : }
      57                 :            : 
      58                 :            : /*************************************************************************
      59                 :            : |*
      60                 :            : |*    RscInstNode::GetId()
      61                 :            : |*
      62                 :            : *************************************************************************/
      63                 :     130124 : sal_uInt32 RscInstNode::GetId() const
      64                 :            : {
      65                 :     130124 :     return nTypeId;
      66                 :            : }
      67                 :            : 
      68                 :            : /****************** R s c A r r a y *************************************/
      69                 :            : /*************************************************************************
      70                 :            : |*
      71                 :            : |*    RscArray::RscArray()
      72                 :            : |*
      73                 :            : *************************************************************************/
      74                 :      11520 : RscArray::RscArray( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper, RscEnum * pTypeCl )
      75                 :      11520 :         : RscTop( nId, nTypeId, pSuper )
      76                 :            : {
      77                 :      11520 :     pTypeClass = pTypeCl;
      78         [ +  - ]:      11520 :     nOffInstData = RscTop::Size();
      79                 :      11520 :     nSize = nOffInstData + ALIGNED_SIZE( sizeof( RscArrayInst ) );
      80                 :      11520 : }
      81                 :            : 
      82                 :            : /*************************************************************************
      83                 :            : |*
      84                 :            : |*    RscArray::~RscArray()
      85                 :            : |*
      86                 :            : *************************************************************************/
      87                 :      11520 : RscArray::~RscArray()
      88                 :            : {
      89         [ -  + ]:      17280 : }
      90                 :            : 
      91                 :            : /*************************************************************************
      92                 :            : |*
      93                 :            : |*    RscArray::~RscArray()
      94                 :            : |*
      95                 :            : *************************************************************************/
      96                 :          0 : RSCCLASS_TYPE RscArray::GetClassType() const
      97                 :            : {
      98                 :          0 :     return RSCCLASS_ENUMARRAY;
      99                 :            : }
     100                 :            : 
     101                 :            : /*************************************************************************
     102                 :            : |*
     103                 :            : |*    RscArray::GetIndexType()
     104                 :            : |*
     105                 :            : *************************************************************************/
     106                 :          0 : RscTop * RscArray::GetTypeClass() const
     107                 :            : {
     108                 :          0 :     return pTypeClass;
     109                 :            : }
     110                 :            : 
     111                 :            : /*************************************************************************
     112                 :            : |*
     113                 :            : |*    RscArray::Create()
     114                 :            : |*
     115                 :            : *************************************************************************/
     116                 :        600 : static RscInstNode * Create( RscInstNode * pNode )
     117                 :            : {
     118                 :        600 :     RscInstNode * pRetNode = NULL;
     119                 :            :     RscInstNode * pTmpNode;
     120                 :            : 
     121         [ +  + ]:        600 :     if( pNode )
     122                 :            :     {
     123         [ +  - ]:        180 :         pRetNode = new RscInstNode( pNode->GetId() );
     124                 :        180 :         pRetNode->aInst = pNode->aInst.pClass->Create( NULL, pNode->aInst );
     125         [ -  + ]:        180 :         if( (pTmpNode = Create( pNode->Left() )) != NULL )
     126                 :          0 :             pRetNode->Insert( pTmpNode );
     127         [ -  + ]:        180 :         if( (pTmpNode = Create( pNode->Right() )) != NULL )
     128                 :          0 :             pRetNode->Insert( pTmpNode );
     129                 :            :     }
     130                 :            : 
     131                 :        600 :     return pRetNode;
     132                 :            : }
     133                 :            : 
     134                 :     119288 : RSCINST RscArray::Create( RSCINST * pInst, const RSCINST & rDflt,
     135                 :            :                           sal_Bool bOwnClass )
     136                 :            : {
     137                 :     119288 :     RSCINST aInst;
     138                 :            :     RscArrayInst *  pClassData;
     139                 :            : 
     140         [ +  - ]:     119288 :     if( !pInst )
     141                 :            :     {
     142                 :     119288 :         aInst.pClass = this;
     143                 :     119288 :         aInst.pData = (CLASS_DATA) rtl_allocateMemory( Size() );
     144                 :            :     }
     145                 :            :     else
     146                 :          0 :         aInst = *pInst;
     147 [ +  - ][ +  + ]:     119288 :     if( !bOwnClass && rDflt.IsInst() )
                 [ +  + ]
     148                 :        240 :         bOwnClass = rDflt.pClass->InHierarchy( this );
     149                 :            : 
     150                 :     119288 :     RscTop::Create( &aInst, rDflt, bOwnClass );
     151                 :            : 
     152                 :     119288 :     pClassData          = (RscArrayInst *)(aInst.pData + nOffInstData);
     153                 :     119288 :     pClassData->pNode   = NULL;
     154         [ +  + ]:     119288 :     if( bOwnClass )
     155                 :            :     {
     156                 :            :         RscArrayInst *   pDfltClassData;
     157                 :            : 
     158                 :        240 :         pDfltClassData = (RscArrayInst *)(rDflt.pData + nOffInstData);
     159                 :            : 
     160                 :        240 :         pClassData->pNode = ::Create( pDfltClassData->pNode );
     161                 :            :     }
     162                 :     119288 :     return( aInst );
     163                 :            : }
     164                 :            : 
     165                 :            : /*************************************************************************
     166                 :            : |*
     167                 :            : |*    RscArray::Destroy()
     168                 :            : |*
     169                 :            : |*    Beschreibung
     170                 :            : |*
     171                 :            : *************************************************************************/
     172                 :     290582 : static void Destroy( RscInstNode * pNode )
     173                 :            : {
     174         [ +  + ]:     290582 :     if( pNode )
     175                 :            :     {
     176                 :      86304 :         Destroy( pNode->Left() );
     177                 :      86304 :         Destroy( pNode->Right() );
     178         [ +  - ]:      86304 :         delete pNode;
     179                 :            :     }
     180                 :     290582 : }
     181                 :            : 
     182                 :     117974 : void RscArray::Destroy( const RSCINST & rInst )
     183                 :            : {
     184                 :            :     RscArrayInst *  pClassData;
     185                 :            : 
     186                 :     117974 :     RscTop::Destroy( rInst );
     187                 :            : 
     188                 :     117974 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     189                 :            : 
     190                 :            :     //Baum rekursiv loeschen
     191                 :     117974 :     ::Destroy( pClassData->pNode );
     192                 :     117974 : }
     193                 :            : 
     194                 :            : /*************************************************************************
     195                 :            : |*
     196                 :            : |*    RscArray::GetValueEle()
     197                 :            : |*
     198                 :            : |*    Beschreibung
     199                 :            : |*
     200                 :            : *************************************************************************/
     201                 :      86124 : ERRTYPE RscArray::GetValueEle
     202                 :            : (
     203                 :            :     const RSCINST & rInst,
     204                 :            :     sal_Int32 lValue,
     205                 :            :     RscTop * pCreateClass,
     206                 :            :     RSCINST * pGetInst
     207                 :            : )
     208                 :            : {
     209                 :            :     RscArrayInst *  pClassData;
     210                 :            :     RscInstNode *   pNode;
     211                 :            : 
     212                 :      86124 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     213                 :            : 
     214                 :      86124 :     ERRTYPE     aError;
     215                 :            : 
     216                 :            :     Atom  nId;
     217 [ -  + ][ +  - ]:      86124 :     if( !pTypeClass->GetValueConst( sal_uInt32(lValue), &nId ) )
     218                 :            :     { // nicht gefunden
     219                 :          0 :         return ERR_ARRAY_INVALIDINDEX;
     220                 :            :     }
     221                 :            : 
     222         [ +  + ]:      86124 :     if( pClassData->pNode )
     223         [ +  - ]:        214 :         pNode = pClassData->pNode->Search( sal_uInt32(lValue) );
     224                 :            :     else
     225                 :      85910 :         pNode = NULL;
     226                 :            : 
     227         [ +  - ]:      86124 :     if( !pNode )
     228                 :            :     {
     229 [ +  - ][ +  - ]:      86124 :         pNode = new RscInstNode( sal_uInt32(lValue) );
     230 [ -  + ][ #  # ]:      86124 :         if( pCreateClass && GetSuperClass()->InHierarchy( pCreateClass ) )
         [ #  # ][ -  + ]
     231         [ #  # ]:          0 :             pNode->aInst = pCreateClass->Create( NULL, rInst );
     232                 :            :         else
     233         [ +  - ]:      86124 :             pNode->aInst = GetSuperClass()->Create( NULL, rInst );
     234         [ +  - ]:      86124 :         pNode->aInst.pClass->SetToDefault( pNode->aInst );
     235         [ +  + ]:      86124 :         if( pClassData->pNode )
     236         [ +  - ]:        214 :             pClassData->pNode->Insert( pNode );
     237                 :            :         else
     238                 :      85910 :             pClassData->pNode = pNode;
     239                 :            :     }
     240                 :            : 
     241                 :      86124 :     *pGetInst = pNode->aInst;
     242                 :      86124 :     return aError;
     243                 :            : }
     244                 :            : 
     245                 :            : /*************************************************************************
     246                 :            : |*
     247                 :            : |*    RscArray::GetArrayEle()
     248                 :            : |*
     249                 :            : |*    Beschreibung
     250                 :            : |*
     251                 :            : *************************************************************************/
     252                 :      86124 : ERRTYPE RscArray::GetArrayEle
     253                 :            : (
     254                 :            :     const RSCINST & rInst,
     255                 :            :     Atom nId,
     256                 :            :     RscTop * pCreateClass,
     257                 :            :     RSCINST * pGetInst
     258                 :            : )
     259                 :            : {
     260                 :            :     sal_Int32  lValue;
     261 [ +  - ][ -  + ]:      86124 :     if( !pTypeClass->GetConstValue( nId, &lValue ) )
     262                 :            :     { // nicht gefunden
     263                 :          0 :         return ERR_ARRAY_INVALIDINDEX;
     264                 :            :     }
     265                 :            : 
     266         [ +  - ]:      86124 :     return GetValueEle( rInst, lValue, pCreateClass, pGetInst );
     267                 :            : }
     268                 :            : 
     269                 :            : /*************************************************************************
     270                 :            : |*
     271                 :            : |*    RscArray::IsConsistent()
     272                 :            : |*
     273                 :            : *************************************************************************/
     274                 :          0 : static sal_Bool IsConsistent( RscInstNode * pNode )
     275                 :            : {
     276                 :          0 :     sal_Bool bRet = sal_True;
     277                 :            : 
     278         [ #  # ]:          0 :     if( pNode )
     279                 :            :     {
     280                 :          0 :         bRet = pNode->aInst.pClass->IsConsistent( pNode->aInst );
     281         [ #  # ]:          0 :         if( !IsConsistent( pNode->Left() ) )
     282                 :          0 :             bRet = sal_False;
     283         [ #  # ]:          0 :         if( !IsConsistent( pNode->Right() ) )
     284                 :          0 :             bRet = sal_False;
     285                 :            :     }
     286                 :          0 :     return bRet;
     287                 :            : }
     288                 :            : 
     289                 :          0 : sal_Bool RscArray::IsConsistent( const RSCINST & rInst )
     290                 :            : {
     291                 :            :     RscArrayInst * pClassData;
     292                 :            :     sal_Bool    bRet;
     293                 :            : 
     294                 :          0 :     bRet = RscTop::IsConsistent( rInst );
     295                 :            : 
     296                 :          0 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     297         [ #  # ]:          0 :     if( !::IsConsistent( pClassData->pNode ) )
     298                 :          0 :         bRet = sal_False;
     299                 :            : 
     300                 :          0 :     return( bRet );
     301                 :            : }
     302                 :            : 
     303                 :            : /*************************************************************************
     304                 :            : |*
     305                 :            : |*    RscArray::SetToDefault()
     306                 :            : |*
     307                 :            : *************************************************************************/
     308                 :          0 : static void SetToDefault( RscInstNode * pNode )
     309                 :            : {
     310         [ #  # ]:          0 :     if( pNode )
     311                 :            :     {
     312                 :          0 :         pNode->aInst.pClass->SetToDefault( pNode->aInst );
     313                 :          0 :         SetToDefault( pNode->Left() );
     314                 :          0 :         SetToDefault( pNode->Right() );
     315                 :            :     }
     316                 :          0 : }
     317                 :            : 
     318                 :          0 : void RscArray::SetToDefault( const RSCINST & rInst )
     319                 :            : {
     320                 :            :     RscArrayInst * pClassData;
     321                 :            : 
     322                 :          0 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     323                 :            : 
     324                 :          0 :     ::SetToDefault( pClassData->pNode );
     325                 :            : 
     326                 :          0 :     RscTop::SetToDefault( rInst );
     327                 :          0 : }
     328                 :            : 
     329                 :            : /*************************************************************************
     330                 :            : |*
     331                 :            : |*    RscArray::IsDefault()
     332                 :            : |*
     333                 :            : *************************************************************************/
     334                 :      48512 : static sal_Bool IsDefault( RscInstNode * pNode )
     335                 :            : {
     336                 :      48512 :     sal_Bool bRet = sal_True;
     337                 :            : 
     338         [ +  + ]:      48512 :     if( pNode )
     339                 :            :     {
     340                 :      43008 :         bRet = pNode->aInst.pClass->IsDefault( pNode->aInst );
     341         [ -  + ]:      43008 :         if( bRet )
     342                 :          0 :             bRet = IsDefault( pNode->Left() );
     343         [ -  + ]:      43008 :         if( bRet )
     344                 :          0 :             bRet = IsDefault( pNode->Right() );
     345                 :            :     }
     346                 :      48512 :     return bRet;
     347                 :            : }
     348                 :            : 
     349                 :      48512 : sal_Bool RscArray::IsDefault( const RSCINST & rInst )
     350                 :            : {
     351                 :            :     RscArrayInst * pClassData;
     352                 :            : 
     353                 :      48512 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     354                 :            : 
     355                 :      48512 :     sal_Bool bRet = ::IsDefault( pClassData->pNode );
     356                 :            : 
     357         [ +  + ]:      48512 :     if( bRet )
     358                 :       5504 :         bRet = RscTop::IsDefault( rInst );
     359                 :      48512 :     return bRet;
     360                 :            : }
     361                 :            : 
     362                 :            : /*************************************************************************
     363                 :            : |*
     364                 :            : |*    RscArray::IsValueDefault()
     365                 :            : |*
     366                 :            : *************************************************************************/
     367                 :      43290 : static sal_Bool IsValueDefault( RscInstNode * pNode, CLASS_DATA pDef )
     368                 :            : {
     369                 :      43290 :     sal_Bool bRet = sal_True;
     370                 :            : 
     371         [ +  + ]:      43290 :     if( pNode )
     372                 :            :     {
     373                 :      43078 :         bRet = pNode->aInst.pClass->IsValueDefault( pNode->aInst, pDef );
     374         [ +  + ]:      43078 :         if( bRet )
     375                 :         80 :             bRet = IsValueDefault( pNode->Left(), pDef );
     376         [ +  + ]:      43078 :         if( bRet )
     377                 :         74 :             bRet = IsValueDefault( pNode->Right(), pDef );
     378                 :            :     }
     379                 :      43290 :     return bRet;
     380                 :            : }
     381                 :            : 
     382                 :      50082 : sal_Bool RscArray::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
     383                 :            : {
     384                 :            :     RscArrayInst * pClassData;
     385                 :            :     sal_Bool bRet;
     386                 :            : 
     387                 :      50082 :     bRet = RscTop::IsValueDefault( rInst, pDef );
     388                 :            : 
     389         [ +  + ]:      50082 :     if( bRet )
     390                 :            :     {
     391                 :      43136 :         pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     392                 :            : 
     393                 :      43136 :         bRet = ::IsValueDefault( pClassData->pNode, pDef );
     394                 :            :     }
     395                 :      50082 :     return bRet;
     396                 :            : }
     397                 :            : 
     398                 :            : /*************************************************************************
     399                 :            : |*    RscArray::WriteSrcHeader()
     400                 :            : |*
     401                 :            : |*    Beschreibung
     402                 :            : *************************************************************************/
     403                 :      48512 : void RscArray::WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
     404                 :            :                                RscTypCont * pTC, sal_uInt32 nTab,
     405                 :            :                                const RscId & aId, const char * pVarName )
     406                 :            : {
     407                 :            :     RscArrayInst * pClassData;
     408                 :            : 
     409                 :      48512 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     410                 :            : 
     411         [ -  + ]:      48512 :     if( pTC->IsSrsDefault() )
     412                 :            :     { // nur einen Wert schreiben
     413                 :          0 :         RscInstNode *   pNode = NULL;
     414         [ #  # ]:          0 :         if( pClassData->pNode )
     415                 :            :         {
     416                 :          0 :             std::vector< sal_uInt32 >::const_iterator it;
     417 [ #  # ][ #  # ]:          0 :             for( it = pTC->GetFallbacks().begin(); !pNode && it != pTC->GetFallbacks().end(); ++it )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     418 [ #  # ][ #  # ]:          0 :                 pNode = pClassData->pNode->Search( *it );
     419                 :            :         }
     420                 :            : 
     421         [ #  # ]:          0 :         if( pNode )
     422                 :            :         {
     423         [ #  # ]:          0 :             if( pNode->aInst.pClass->IsDefault( pNode->aInst ) )
     424                 :          0 :                 fprintf( fOutput, "Default" );
     425                 :            :             else
     426                 :            :                 pNode->aInst.pClass->WriteSrcHeader(
     427                 :            :                                         pNode->aInst, fOutput,
     428                 :          0 :                                         pTC, nTab, aId, pVarName );
     429                 :      48512 :             return;
     430                 :            :         }
     431                 :            :     }
     432                 :            : 
     433         [ -  + ]:      48512 :     if( IsDefault( rInst ) )
     434                 :          0 :         fprintf( fOutput, "Default" );
     435                 :            :     else
     436                 :            :     {
     437                 :      48512 :         RSCINST aSuper( GetSuperClass(), rInst.pData );
     438                 :            :         aSuper.pClass->WriteSrcHeader( aSuper, fOutput, pTC,
     439         [ +  - ]:      48512 :                                         nTab, aId, pVarName );
     440                 :            :     }
     441         [ +  - ]:      48512 :     if( !pTC->IsSrsDefault() )
     442                 :      48512 :         WriteSrc( rInst, fOutput, pTC, nTab, pVarName );
     443                 :            : }
     444                 :            : 
     445                 :            : /*************************************************************************
     446                 :            : |*    RscArray::WriteSrc()
     447                 :            : |*
     448                 :            : |*    Beschreibung
     449                 :            : *************************************************************************/
     450                 :     134748 : static void WriteSrc( RscInstNode * pNode, FILE * fOutput, RscTypCont * pTC,
     451                 :            :                          sal_uInt32 nTab, const char * pVarName,
     452                 :            :                          CLASS_DATA pDfltData, RscConst * pTypeClass )
     453                 :            : {
     454         [ +  + ]:     134748 :     if( pNode )
     455                 :            :     {
     456                 :            :         WriteSrc( pNode->Left(), fOutput, pTC, nTab, pVarName,
     457                 :      43118 :                     pDfltData, pTypeClass );
     458         [ +  + ]:      43118 :         if( !pNode->aInst.pClass->IsValueDefault( pNode->aInst, pDfltData ) )
     459                 :            :         {
     460         [ +  - ]:      43112 :             fprintf( fOutput, ";\n" );
     461         [ +  + ]:     136064 :             for( sal_uInt32 n = 0; n < nTab; n++ )
     462         [ +  - ]:      92952 :                 fputc( '\t', fOutput );
     463                 :            : 
     464                 :            :             Atom  nIdxId;
     465 [ +  - ][ +  - ]:      43112 :             pTypeClass->GetValueConst( pNode->GetId(), &nIdxId );
     466 [ +  - ][ +  - ]:      43112 :             fprintf( fOutput, "%s[ %s ] = ", pVarName, pHS->getString( nIdxId ).getStr() );
     467                 :            :             pNode->aInst.pClass->WriteSrcHeader( pNode->aInst, fOutput, pTC,
     468 [ +  - ][ +  - ]:      43112 :                                                 nTab, RscId(), pVarName );
     469                 :            :         }
     470                 :            :         WriteSrc( pNode->Right(), fOutput, pTC, nTab, pVarName,
     471                 :      43118 :                     pDfltData, pTypeClass );
     472                 :            :     }
     473                 :     134748 : }
     474                 :            : 
     475                 :      48512 : void RscArray::WriteSrcArray( const RSCINST & rInst, FILE * fOutput,
     476                 :            :                              RscTypCont * pTC, sal_uInt32 nTab,
     477                 :            :                              const char * pVarName )
     478                 :            : {
     479                 :            :     RscArrayInst * pClassData;
     480                 :            : 
     481                 :      48512 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     482                 :            : 
     483                 :            :     ::WriteSrc( pClassData->pNode, fOutput, pTC, nTab, pVarName,
     484                 :      48512 :                 rInst.pData, pTypeClass );
     485                 :      48512 : };
     486                 :            : 
     487                 :      48512 : void RscArray::WriteSrc( const RSCINST & rInst, FILE * fOutput,
     488                 :            :                          RscTypCont * pTC, sal_uInt32 nTab,
     489                 :            :                          const char * pVarName )
     490                 :            : {
     491                 :      48512 :     WriteSrcArray( rInst, fOutput, pTC, nTab, pVarName );
     492                 :      48512 : }
     493                 :            : 
     494                 :            : /*************************************************************************
     495                 :            : |*    RscArray::WriteRc()
     496                 :            : |*
     497                 :            : |*    Beschreibung
     498                 :            : *************************************************************************/
     499                 :     130958 : ERRTYPE RscArray::WriteRc( const RSCINST & rInst, RscWriteRc & rMem,
     500                 :            :                             RscTypCont * pTC, sal_uInt32 nDeep, sal_Bool bExtra )
     501                 :            : {
     502                 :     130958 :     ERRTYPE aError;
     503                 :            :     RscArrayInst * pClassData;
     504                 :     130958 :     RscInstNode *   pNode = NULL;
     505                 :            : 
     506                 :     130958 :     pClassData = (RscArrayInst *)(rInst.pData + nOffInstData);
     507                 :            : 
     508         [ +  + ]:     130958 :     if( pClassData->pNode )
     509                 :            :     {
     510                 :            : #if OSL_DEBUG_LEVEL > 2
     511                 :            :         fprintf( stderr, "RscArray::WriteRc: Fallback " );
     512                 :            : #endif
     513                 :      43062 :         std::vector< sal_uInt32 >::const_iterator it;
     514 [ +  - ][ +  + ]:      86124 :         for( it = pTC->GetFallbacks().begin(); !pNode && it != pTC->GetFallbacks().end(); ++it )
         [ +  - ][ +  - ]
         [ +  + ][ +  + ]
                 [ #  # ]
     515                 :            :         {
     516 [ +  - ][ +  - ]:      43062 :             pNode = pClassData->pNode->Search( *it );
     517                 :            : #if OSL_DEBUG_LEVEL > 2
     518                 :            :             fprintf( stderr, " 0x%hx", *it );
     519                 :            : #endif
     520                 :            :         }
     521                 :            : #if OSL_DEBUG_LEVEL > 2
     522                 :            :             fprintf( stderr, "\n" );
     523                 :            : #endif
     524                 :            :     }
     525                 :            : 
     526         [ +  + ]:     130958 :     if( pNode )
     527                 :            :         aError = pNode->aInst.pClass->WriteRc( pNode->aInst, rMem, pTC,
     528         [ +  - ]:      43062 :                                                 nDeep, bExtra );
     529                 :            :     else
     530         [ +  - ]:      87896 :         aError = RscTop::WriteRc( rInst, rMem, pTC, nDeep, bExtra );
     531                 :            : 
     532                 :     130958 :     return aError;
     533                 :            : }
     534                 :            : 
     535                 :            : //========================================================================
     536                 :          0 : void RscArray::WriteRcAccess
     537                 :            : (
     538                 :            :     FILE * fOutput,
     539                 :            :     RscTypCont * pTC,
     540                 :            :     const char * pName
     541                 :            : )
     542                 :            : {
     543                 :          0 :     GetSuperClass()->WriteRcAccess( fOutput, pTC, pName );
     544                 :          0 : }
     545                 :            : 
     546                 :            : /*************************************************************************
     547                 :            : |*
     548                 :            : |*    RscClassArray::RscClassArray()
     549                 :            : |*
     550                 :            : *************************************************************************/
     551                 :       1440 : RscClassArray::RscClassArray( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper,
     552                 :            :                               RscEnum * pTypeCl )
     553                 :       1440 :     : RscArray( nId, nTypeId, pSuper, pTypeCl )
     554                 :            : {
     555                 :       1440 : }
     556                 :            : 
     557                 :            : /*************************************************************************
     558                 :            : |*
     559                 :            : |*    RscClassArray::~RscClassArray()
     560                 :            : |*
     561                 :            : *************************************************************************/
     562                 :       1440 : RscClassArray::~RscClassArray()
     563                 :            : {
     564         [ -  + ]:       2880 : }
     565                 :            : 
     566                 :            : /*************************************************************************
     567                 :            : |*
     568                 :            : |*    RscClassArray::WriteSrcHeader()
     569                 :            : |*
     570                 :            : *************************************************************************/
     571                 :          8 : void RscClassArray::WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
     572                 :            :                                     RscTypCont * pTC, sal_uInt32 nTab,
     573                 :            :                                     const RscId & aId, const char * pName )
     574                 :            : {
     575                 :          8 :     RscArray::WriteSrcHeader( rInst, fOutput, pTC, nTab, aId, pName );
     576                 :          8 : }
     577                 :            : 
     578                 :            : /*************************************************************************
     579                 :            : |*
     580                 :            : |*    RscClassArray::WriteSrc()
     581                 :            : |*
     582                 :            : *************************************************************************/
     583                 :          8 : void RscClassArray::WriteSrc( const RSCINST & rInst, FILE * fOutput,
     584                 :            :                              RscTypCont * pTC, sal_uInt32 nTab,
     585                 :            :                                  const char * pVarName )
     586                 :            : {
     587                 :          8 :     RscArray::WriteSrc( rInst, fOutput, pTC, nTab, pVarName );
     588                 :          8 : }
     589                 :            : 
     590                 :            : /*************************************************************************
     591                 :            : |*
     592                 :            : |*    RscClassArray::WriteRcHeader()
     593                 :            : |*
     594                 :            : *************************************************************************/
     595                 :          8 : ERRTYPE RscClassArray::WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
     596                 :            :                                        RscTypCont * pTC, const RscId & aId,
     597                 :            :                                        sal_uInt32 nDeep, sal_Bool bExtra )
     598                 :            : {
     599                 :            :     // Eigenen Typ schreiben
     600                 :          8 :     return GetSuperClass()->WriteRcHeader( rInst, aMem, pTC, aId,
     601                 :          8 :                                         nDeep, bExtra );
     602                 :            : }
     603                 :            : 
     604                 :            : /*************************************************************************
     605                 :            : |*
     606                 :            : |*    RscLangArray::RscLangArray()
     607                 :            : |*
     608                 :            : *************************************************************************/
     609                 :       4320 : RscLangArray::RscLangArray( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper,
     610                 :            :                           RscEnum * pTypeCl )
     611                 :       4320 :     : RscArray( nId, nTypeId, pSuper, pTypeCl )
     612                 :            : {
     613                 :       4320 : }
     614                 :            : 
     615                 :            : /*************************************************************************
     616                 :            : |*
     617                 :            : |*    RscLangArray::RscLangArray()
     618                 :            : |*
     619                 :            : *************************************************************************/
     620                 :          0 : RSCCLASS_TYPE RscLangArray::GetClassType() const
     621                 :            : {
     622         [ #  # ]:          0 :     if( GetSuperClass() )
     623                 :          0 :         return GetSuperClass()->GetClassType();
     624                 :            :     else
     625                 :          0 :         return RscArray::GetClassType();
     626                 :            : 
     627                 :            : }
     628                 :            : 
     629                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10