LCOV - code coverage report
Current view: top level - idl/source/objects - basobj.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 194 313 62.0 %
Date: 2014-04-11 Functions: 35 74 47.3 %
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 <ctype.h>
      22             : #include <stdio.h>
      23             : 
      24             : #include <tools/debug.hxx>
      25             : 
      26             : #include <basobj.hxx>
      27             : #include <module.hxx>
      28             : #include <globals.hxx>
      29             : #include <database.hxx>
      30             : 
      31       36248 : SV_IMPL_META_FACTORY1( SvMetaObject, SvRttiBase )
      32       30389 : SvMetaObject::SvMetaObject()
      33             : {
      34       30389 : }
      35             : 
      36           0 : void SvMetaObject::Load( SvPersistStream & )
      37             : {
      38           0 : }
      39             : 
      40       25084 : void SvMetaObject::Save( SvPersistStream & )
      41             : {
      42       25084 : }
      43             : 
      44      149856 : void SvMetaObject::WriteTab( SvStream & rOutStm, sal_uInt16 nTab )
      45             : {
      46      633403 :     while( nTab-- )
      47      333691 :         rOutStm.WriteCharPtr( "    " );
      48      149856 : }
      49             : 
      50         616 : void SvMetaObject::WriteStars( SvStream & rOutStm )
      51             : {
      52         616 :     rOutStm.WriteChar( '/' );
      53        4312 :     for( int i = 6; i > 0; i-- )
      54        3696 :         rOutStm.WriteCharPtr( "**********" );
      55         616 :     rOutStm.WriteChar( '/' ) << endl;
      56         616 : }
      57             : 
      58       61383 : sal_Bool SvMetaObject::TestAndSeekSpaceOnly( SvStream & rOutStm, sal_uLong nBegPos )
      59             : {
      60             :     // write no empty brackets
      61       61383 :     sal_uLong nPos = rOutStm.Tell();
      62       61383 :     rOutStm.Seek( nBegPos );
      63       61383 :     sal_Bool bOnlySpace = sal_True;
      64      357599 :     while( bOnlySpace && rOutStm.Tell() < nPos )
      65             :     {
      66             :         char c;
      67      234833 :         rOutStm.ReadChar( c );
      68      234833 :         if( !isspace( c ) )
      69       25734 :             bOnlySpace = sal_False;
      70             :     }
      71       61383 :     if( bOnlySpace )
      72             :         // nothing written
      73       35649 :         rOutStm.Seek( nBegPos );
      74             :     else
      75       25734 :         rOutStm.Seek( nPos );
      76       61383 :     return bOnlySpace;
      77             : }
      78             : 
      79         137 : void SvMetaObject::Back2Delemitter( SvStream & rOutStm )
      80             : {
      81             :     // write no empty brackets
      82         137 :     sal_uLong nPos = rOutStm.Tell();
      83         137 :     rOutStm.SeekRel( -1 );
      84         137 :     char c = 0;
      85         137 :     rOutStm.ReadChar( c );
      86             : 
      87         411 :     while( isspace( c ) && rOutStm.Tell() != 1 )
      88             :     {
      89         137 :         rOutStm.SeekRel( -2 );
      90         137 :         rOutStm.ReadChar( c );
      91             :     }
      92             : 
      93         137 :     if( c == ';' || c == ',' )
      94         137 :         rOutStm.SeekRel( -1 );
      95             :     else
      96           0 :         rOutStm.Seek( nPos );
      97         137 : }
      98             : 
      99           0 : sal_Bool SvMetaObject::ReadSvIdl( SvIdlDataBase &, SvTokenStream & )
     100             : {
     101           0 :     return sal_False;
     102             : }
     103             : 
     104           0 : void SvMetaObject::WriteSvIdl( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */ )
     105             : {
     106           0 : }
     107             : 
     108           0 : void SvMetaObject::Write( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */,
     109             :                              WriteType, WriteAttribute )
     110             : {
     111           0 : }
     112             : 
     113       36248 : SV_IMPL_META_FACTORY1( SvMetaName, SvMetaObject );
     114       30389 : SvMetaName::SvMetaName()
     115             : {
     116       30389 : }
     117             : 
     118           0 : void SvMetaName::Load( SvPersistStream & rStm )
     119             : {
     120           0 :     SvMetaObject::Load( rStm );
     121             :     sal_uInt8 nMask;
     122           0 :     rStm.ReadUChar( nMask );
     123             : 
     124           0 :     if( nMask >= 0x20 )
     125             :     {
     126           0 :         rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
     127             :         OSL_FAIL( "wrong format" );
     128           0 :         return;
     129             :     }
     130           0 :     if( nMask & 0x01 )  rStm >> aName;
     131           0 :     if( nMask & 0x02 )  rStm >> aHelpContext;
     132           0 :     if( nMask & 0x04 )  rStm >> aHelpText;
     133           0 :     if( nMask & 0x08 )  rStm >> aConfigName;
     134           0 :     if( nMask & 0x10 )  rStm >> aDescription;
     135             : }
     136             : 
     137       25084 : void SvMetaName::Save( SvPersistStream & rStm )
     138             : {
     139       25084 :     SvMetaObject::Save( rStm );
     140       25084 :     sal_uInt8 nMask = 0;
     141       25084 :     if( aName.IsSet() )         nMask |= 0x01;
     142       25084 :     if( aHelpContext.IsSet() )  nMask |= 0x02;
     143       25084 :     if( aHelpText.IsSet() )     nMask |= 0x04;
     144       25084 :     if( aConfigName.IsSet() )   nMask |= 0x08;
     145       25084 :     if( aDescription.IsSet() )  nMask |= 0x10;
     146             : 
     147       25084 :     rStm.WriteUChar( nMask );
     148       25084 :     if( nMask & 0x01 ) WriteSvString( rStm, aName );
     149       25084 :     if( nMask & 0x02 ) WriteSvNumberIdentifier( rStm, aHelpContext );
     150       25084 :     if( nMask & 0x04 ) WriteSvString( rStm, aHelpText );
     151       25084 :     if( nMask & 0x08 ) WriteSvString( rStm, aConfigName );
     152       25084 :     if( nMask & 0x10 ) WriteSvString( rStm, aDescription );
     153       25084 : }
     154             : 
     155       20677 : sal_Bool SvMetaName::SetName( const OString& rName, SvIdlDataBase * )
     156             : {
     157       20677 :     aName.setString(rName);
     158       20677 :     return sal_True;
     159             : }
     160             : 
     161       16735 : sal_Bool SvMetaName::ReadNameSvIdl( SvIdlDataBase & rBase,
     162             :                                 SvTokenStream & rInStm )
     163             : {
     164       16735 :     sal_uInt32 nTokPos = rInStm.Tell();
     165       16735 :     SvToken * pTok = rInStm.GetToken_Next();
     166             : 
     167             :     // read module name
     168       16735 :     if( pTok->IsIdentifier() )
     169       16516 :         if( SetName( pTok->GetString(), &rBase ) )
     170       16516 :             return sal_True;
     171             : 
     172         219 :     rInStm.Seek( nTokPos );
     173         219 :     return sal_False;
     174             : }
     175             : 
     176      166266 : void SvMetaName::ReadAttributesSvIdl( SvIdlDataBase & rBase,
     177             :                                       SvTokenStream & rInStm )
     178             : {
     179      166266 :     sal_uInt32 nTokPos = rInStm.Tell();
     180      166266 :     if( aName.ReadSvIdl( SvHash_Name(), rInStm ) )
     181             :     {
     182           0 :         if( !SetName( aName.getString(), &rBase ) )
     183           0 :             rInStm.Seek( nTokPos );
     184             :     }
     185             : 
     186      166266 :     aHelpContext.ReadSvIdl( rBase, SvHash_HelpContext(), rInStm );
     187      166266 :     aHelpText.ReadSvIdl( rBase, rInStm );
     188      166266 :     aConfigName.ReadSvIdl( SvHash_ConfigName(), rInStm );
     189      166266 :     aDescription.ReadSvIdl( SvHash_Description(), rInStm );
     190      166266 : }
     191             : 
     192        5172 : void SvMetaName::DoReadContextSvIdl( SvIdlDataBase & rBase,
     193             :                                    SvTokenStream & rInStm, char cDel )
     194             : {
     195        5172 :     sal_uInt32 nBeginPos = 0; // can not happen with Tell
     196       26136 :     while( nBeginPos != rInStm.Tell() )
     197             :     {
     198       15792 :         nBeginPos = rInStm.Tell();
     199       15792 :         ReadContextSvIdl( rBase, rInStm );
     200       15792 :         if( cDel == '\0' )
     201       15792 :             rInStm.ReadDelemiter();
     202             :         else
     203           0 :             rInStm.Read( cDel );
     204             :     }
     205        5172 : }
     206             : 
     207           0 : void SvMetaName::ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & )
     208             : {
     209           0 : }
     210             : 
     211           0 : sal_Bool SvMetaName::Test( SvIdlDataBase &, SvTokenStream & )
     212             : {
     213           0 :     return sal_True;
     214             : }
     215             : 
     216       18718 : void SvMetaName::WriteContextSvIdl( SvIdlDataBase &, SvStream &, sal_uInt16 )
     217             : {
     218       18718 : }
     219             : 
     220           0 : void SvMetaName::WriteDescription( SvStream & rOutStm )
     221             : {
     222           0 :     rOutStm.WriteCharPtr( "<DESCRIPTION>" ) << endl;
     223             : 
     224           0 :     OString aDesc( GetDescription().getString() );
     225           0 :     sal_Int32 nPos = aDesc.indexOf('\n');
     226           0 :     while ( nPos != -1 )
     227             :     {
     228           0 :         rOutStm.WriteCharPtr( aDesc.copy( 0, nPos ).getStr() ) << endl;
     229           0 :         aDesc = aDesc.copy(nPos+1);
     230           0 :         nPos = aDesc.indexOf('\n');
     231             :     }
     232             : 
     233           0 :     rOutStm.WriteCharPtr( aDesc.getStr() ) << endl;
     234           0 :     rOutStm.WriteCharPtr( "</DESCRIPTION>" ) << endl;
     235           0 : }
     236             : 
     237       20600 : void SvMetaName::WriteAttributesSvIdl( SvIdlDataBase & rBase,
     238             :                                        SvStream & rOutStm,
     239             :                                        sal_uInt16 nTab )
     240             : {
     241       20600 :     if( aHelpContext.IsSet() || aHelpText.IsSet() || aConfigName.IsSet() )
     242             :     {
     243           8 :         WriteTab( rOutStm, nTab );
     244           8 :         rOutStm.WriteCharPtr( "// class SvMetaName" ) << endl;
     245             :     }
     246       20600 :     if( aHelpContext.IsSet() )
     247             :     {
     248           0 :         WriteTab( rOutStm, nTab );
     249           0 :         aHelpContext.WriteSvIdl( SvHash_HelpContext(), rOutStm, nTab );
     250           0 :         rOutStm.WriteChar( ';' ) << endl;
     251             :     }
     252       20600 :     if( aHelpText.IsSet() )
     253             :     {
     254           8 :         WriteTab( rOutStm, nTab );
     255           8 :         aHelpText.WriteSvIdl( rBase, rOutStm, nTab );
     256           8 :         rOutStm.WriteChar( ';' ) << endl;
     257             :     }
     258       20600 :     if( aConfigName.IsSet() )
     259             :     {
     260           0 :         WriteTab( rOutStm, nTab );
     261           0 :         aConfigName.WriteSvIdl( SvHash_ConfigName(), rOutStm, nTab );
     262           0 :         rOutStm.WriteChar( ';' ) << endl;
     263             :     }
     264       20600 : }
     265             : 
     266       19052 : sal_Bool SvMetaName::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
     267             : {
     268       19052 :     sal_uInt32 nTokPos = rInStm.Tell();
     269       19052 :     sal_Bool bOk = sal_True;
     270       19052 :     if( rInStm.Read( '[' ) )
     271             :     {
     272       12426 :         sal_uInt32 nBeginPos = 0; // can not happen with Tell
     273      191118 :         while( nBeginPos != rInStm.Tell() )
     274             :         {
     275      166266 :             nBeginPos = rInStm.Tell();
     276      166266 :             ReadAttributesSvIdl( rBase, rInStm );
     277      166266 :             rInStm.ReadDelemiter();
     278             :         }
     279       12426 :         bOk = rInStm.Read( ']' );
     280             :     }
     281             : 
     282       19052 :     if( bOk )
     283             :     {
     284       19052 :         if( rInStm.Read( '{' ) )
     285             :         {
     286         724 :             DoReadContextSvIdl( rBase, rInStm );
     287         724 :             bOk = rInStm.Read( '}' );
     288             :         }
     289             :     }
     290             : 
     291       19052 :     if( !bOk )
     292           0 :         rInStm.Seek( nTokPos );
     293       19052 :     return bOk;
     294             : }
     295             : 
     296       20600 : void SvMetaName::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
     297             :                              sal_uInt16 nTab )
     298             : {
     299       20600 :     sal_uLong nBeginPos = rOutStm.Tell();
     300       20600 :     WriteTab( rOutStm, nTab );
     301       20600 :     rOutStm.WriteChar( '[' ) << endl;
     302       20600 :     sal_uLong nOldPos = rOutStm.Tell();
     303       20600 :     WriteAttributesSvIdl( rBase, rOutStm, nTab +1 );
     304             : 
     305             :     // write no empty brackets
     306       20600 :     if( TestAndSeekSpaceOnly( rOutStm, nOldPos ) )
     307             :         // nothing written
     308        8082 :         rOutStm.Seek( nBeginPos );
     309             :     else
     310             :     {
     311       12518 :         WriteTab( rOutStm, nTab );
     312       12518 :         rOutStm.WriteChar( ']' );
     313       12518 :         nBeginPos = rOutStm.Tell();
     314       12518 :           rOutStm << endl;
     315             :     }
     316             : 
     317       20600 :     WriteTab( rOutStm, nTab );
     318       20600 :     rOutStm.WriteChar( '{' ) << endl;
     319       20600 :     nOldPos = rOutStm.Tell();
     320       20600 :     WriteContextSvIdl( rBase, rOutStm, nTab +1 );
     321             : 
     322             :     // write no empty brackets
     323       20600 :     if( TestAndSeekSpaceOnly( rOutStm, nOldPos ) )
     324             :         // nothing written
     325       19890 :         rOutStm.Seek( nBeginPos );
     326             :     else
     327             :     {
     328         710 :         WriteTab( rOutStm, nTab );
     329         710 :         rOutStm.WriteChar( '}' );
     330             :     }
     331       20600 : }
     332             : 
     333           0 : void SvMetaName::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
     334             :                            sal_uInt16 nTab,
     335             :                          WriteType nT, WriteAttribute nA )
     336             : {
     337           0 :     sal_uLong nBeginPos = rOutStm.Tell();
     338           0 :     WriteTab( rOutStm, nTab );
     339           0 :     rOutStm.WriteChar( '[' ) << endl;
     340           0 :     sal_uLong nOldPos = rOutStm.Tell();
     341           0 :     WriteAttributes( rBase, rOutStm, nTab +1, nT, nA );
     342             : 
     343             :     // write no empty brackets
     344           0 :     sal_uLong nPos = rOutStm.Tell();
     345           0 :     rOutStm.Seek( nOldPos );
     346           0 :     sal_Bool bOnlySpace = sal_True;
     347           0 :     while( bOnlySpace && rOutStm.Tell() < nPos )
     348             :     {
     349             :         char c;
     350           0 :         rOutStm.ReadChar( c );
     351           0 :         if( !isspace( c ) )
     352           0 :             bOnlySpace = sal_False;
     353             :     }
     354           0 :     if( bOnlySpace )
     355             :         // nothing written
     356           0 :         rOutStm.Seek( nBeginPos );
     357             :     else
     358             :     {
     359           0 :         rOutStm.Seek( nPos );
     360           0 :         WriteTab( rOutStm, nTab );
     361           0 :         rOutStm.WriteChar( ']' ) << endl;
     362             :     }
     363           0 : }
     364             : 
     365           0 : void SvMetaName::WriteAttributes( SvIdlDataBase &, SvStream & rOutStm,
     366             :                                 sal_uInt16 nTab,
     367             :                                  WriteType, WriteAttribute )
     368             : {
     369           0 :     if( GetHelpText().IsSet() || GetHelpContext().IsSet() )
     370             :     {
     371           0 :         WriteTab( rOutStm, nTab );
     372           0 :         rOutStm.WriteCharPtr( "// class SvMetaName" ) << endl;
     373             :     }
     374           0 :     if( GetHelpText().IsSet() )
     375             :     {
     376           0 :         WriteTab( rOutStm, nTab );
     377           0 :         rOutStm.WriteCharPtr( "helpstring(\"" ).WriteCharPtr( GetHelpText().getString().getStr() ).WriteCharPtr( "\")," ) << endl;
     378             :     }
     379           0 :     if( GetHelpContext().IsSet() )
     380             :     {
     381           0 :         WriteTab( rOutStm, nTab );
     382           0 :         rOutStm.WriteCharPtr( "helpcontext(" )
     383           0 :                .WriteCharPtr( OString::number(GetHelpContext().GetValue()).getStr() )
     384           0 :                .WriteCharPtr( ")," ) << endl;
     385             :     }
     386           0 : }
     387             : 
     388           0 : void SvMetaName::WriteContext( SvIdlDataBase &, SvStream &,
     389             :                                 sal_uInt16,
     390             :                                  WriteType, WriteAttribute )
     391             : {
     392           0 : }
     393             : 
     394       36248 : SV_IMPL_META_FACTORY1( SvMetaReference, SvMetaName );
     395             : 
     396       28690 : SvMetaReference::SvMetaReference()
     397             : {
     398       28690 : }
     399             : 
     400           0 : void SvMetaReference::Load( SvPersistStream & rStm )
     401             : {
     402           0 :     SvMetaName::Load( rStm );
     403             : 
     404             :     sal_uInt8 nMask;
     405           0 :     rStm.ReadUChar( nMask );
     406           0 :     if( nMask >= 0x2 )
     407             :     {
     408           0 :         rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
     409             :         OSL_FAIL( "wrong format" );
     410           0 :         return;
     411             :     }
     412           0 :     if( nMask & 0x01 )
     413             :     {
     414             :         SvMetaReference * pRef;
     415           0 :         rStm >> pRef;
     416           0 :         aRef = pRef;
     417             :     }
     418             : }
     419             : 
     420       23604 : void SvMetaReference::Save( SvPersistStream & rStm )
     421             : {
     422       23604 :     SvMetaName::Save( rStm );
     423             : 
     424             :     // create mask
     425       23604 :     sal_uInt8 nMask = 0;
     426       23604 :     if( aRef.Is() )
     427        9671 :         nMask |= 0x01;
     428             : 
     429             :     // write data
     430       23604 :     rStm.WriteUChar( nMask );
     431       23604 :     if( nMask & 0x01 ) WriteSvPersistBase( rStm, aRef );
     432       23604 : }
     433             : 
     434       36216 : SV_IMPL_META_FACTORY1( SvMetaExtern, SvMetaReference );
     435             : 
     436        6442 : SvMetaExtern::SvMetaExtern()
     437             :     : pModule( NULL )
     438             :     , bReadUUId( sal_False )
     439        6442 :     , bReadVersion( sal_False )
     440             : {
     441        6442 : }
     442             : 
     443           0 : void SvMetaExtern::Load( SvPersistStream & rStm )
     444             : {
     445           0 :     SvMetaReference::Load( rStm );
     446             : 
     447             :     sal_uInt8 nMask;
     448           0 :     rStm.ReadUChar( nMask );
     449           0 :     if( nMask >= 0x20 )
     450             :     {
     451           0 :         rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
     452             :         OSL_FAIL( "wrong format" );
     453           0 :         return;
     454             :     }
     455           0 :     if( nMask & 0x01 ) rStm >> pModule;
     456           0 :     if( nMask & 0x02 ) rStm >> aUUId;
     457           0 :     if( nMask & 0x04 ) rStm >> aVersion;
     458           0 :     if( nMask & 0x08 ) bReadUUId = sal_True;
     459           0 :     if( nMask & 0x10 ) bReadVersion = sal_True;
     460             : }
     461             : 
     462        6442 : void SvMetaExtern::Save( SvPersistStream & rStm )
     463             : {
     464        6442 :     SvMetaReference::Save( rStm );
     465             : 
     466             :     // create mask
     467        6442 :     sal_uInt8 nMask = 0;
     468        6442 :     if( pModule )                   nMask |= 0x01;
     469        6442 :     if( aUUId != SvGlobalName() )   nMask |= 0x02;
     470        6442 :     if( aVersion != SvVersion() )   nMask |= 0x04;
     471        6442 :     if( bReadUUId )                 nMask |= 0x08;
     472        6442 :     if( bReadVersion )              nMask |= 0x10;
     473             : 
     474             :     // write data
     475        6442 :     rStm.WriteUChar( nMask );
     476        6442 :     if( nMask & 0x01 ) WriteSvPersistBase( rStm, pModule );
     477        6442 :     if( nMask & 0x02 ) WriteSvGlobalName( rStm, aUUId );
     478        6442 :     if( nMask & 0x04 ) WriteSvVersion( rStm, aVersion );
     479        6442 : }
     480             : 
     481        1473 : SvMetaModule * SvMetaExtern::GetModule() const
     482             : {
     483             :     DBG_ASSERT( pModule != NULL, "module not set" );
     484        1473 :     return pModule;
     485             : }
     486             : 
     487        1473 : const SvGlobalName & SvMetaExtern::GetUUId() const
     488             : {
     489        1473 :     if( aUUId == SvGlobalName() )
     490        1473 :         GetModule()->FillNextName( &((SvMetaExtern *)this)->aUUId );
     491        1473 :     return aUUId;
     492             : }
     493             : 
     494        3363 : void SvMetaExtern::SetModule( SvIdlDataBase & rBase )
     495             : {
     496        3363 :     pModule = (SvMetaModule *)rBase.GetStack().Get( TYPE( SvMetaModule ) );
     497        3363 : }
     498             : 
     499         205 : void SvMetaExtern::ReadAttributesSvIdl( SvIdlDataBase & rBase,
     500             :                                         SvTokenStream & rInStm )
     501             : {
     502         205 :     SvMetaReference::ReadAttributesSvIdl( rBase, rInStm );
     503         205 :     if( aUUId.ReadSvIdl( rBase, rInStm ) )
     504          68 :         bReadUUId = sal_True;
     505         205 :     if( aVersion.ReadSvIdl( rInStm ) )
     506           0 :         bReadVersion = sal_True;
     507         205 : }
     508             : 
     509        1890 : void SvMetaExtern::WriteAttributesSvIdl( SvIdlDataBase & rBase,
     510             :                                          SvStream & rOutStm, sal_uInt16 nTab )
     511             : {
     512        1890 :     SvMetaReference::WriteAttributesSvIdl( rBase, rOutStm, nTab );
     513        1890 :     if( bReadUUId || bReadVersion )
     514             :     {
     515          68 :         WriteTab( rOutStm, nTab );
     516          68 :         rOutStm.WriteCharPtr( "// class SvMetaExtern" ) << endl;
     517             : 
     518          68 :         if( bReadUUId )
     519             :         {
     520          68 :             WriteTab( rOutStm, nTab );
     521          68 :             aUUId.WriteSvIdl( rOutStm );
     522          68 :             rOutStm.WriteChar( ';' ) << endl;
     523             :         }
     524          68 :         if( bReadVersion )
     525             :         {
     526           0 :             WriteTab( rOutStm, nTab );
     527           0 :             aVersion.WriteSvIdl( rOutStm );
     528           0 :             rOutStm.WriteChar( ';' ) << endl;
     529             :         }
     530             :     }
     531        1890 : }
     532             : 
     533        1473 : sal_Bool SvMetaExtern::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
     534             : {
     535        1473 :     SetModule( rBase );
     536        1473 :     GetUUId(); // id gets created
     537        1473 :     return SvMetaReference::ReadSvIdl( rBase, rInStm );
     538             : }
     539             : 
     540        1481 : void SvMetaExtern::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
     541             :                                sal_uInt16 nTab )
     542             : {
     543        1481 :     SvMetaReference::WriteSvIdl( rBase, rOutStm, nTab );
     544        1481 : }
     545             : 
     546           0 : void SvMetaExtern::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
     547             :                         sal_uInt16 nTab,
     548             :                          WriteType nT, WriteAttribute nA )
     549             : {
     550           0 :     SvMetaReference::Write( rBase, rOutStm, nTab, nT, nA );
     551           0 : }
     552             : 
     553           0 : void SvMetaExtern::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
     554             :                                      sal_uInt16 nTab,
     555             :                                      WriteType nT, WriteAttribute nA )
     556             : {
     557           0 :     SvMetaReference::WriteAttributes( rBase, rOutStm, nTab, nT, nA );
     558             : 
     559           0 :     WriteTab( rOutStm, nTab );
     560           0 :     rOutStm.WriteCharPtr( "// class SvMetaExtern" ) << endl;
     561           0 :     WriteTab( rOutStm, nTab );
     562           0 :     rOutStm.WriteCharPtr( "uuid(" ).WriteCharPtr( OUStringToOString(GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8).getStr() ).WriteCharPtr( ")," ) << endl;
     563           0 :     WriteTab( rOutStm, nTab );
     564           0 :     rOutStm.WriteCharPtr( "version(" )
     565           0 :        .WriteCharPtr( OString::number(aVersion.GetMajorVersion()).getStr() )
     566           0 :        .WriteChar( '.' )
     567           0 :        .WriteCharPtr( OString::number(aVersion.GetMinorVersion()).getStr() )
     568           0 :        .WriteCharPtr( ")," ) << endl;
     569           0 : }
     570             : 
     571             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10