xref: /aoo41x/main/idl/source/objects/module.cxx (revision 79aad27f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_idl.hxx"
26 
27 #include <ctype.h>
28 #include <stdio.h>
29 
30 #include <attrib.hxx>
31 #include <module.hxx>
32 #include <globals.hxx>
33 #include <database.hxx>
34 #include <tools/fsys.hxx>
35 #include <tools/debug.hxx>
36 
37 /****************** SvMetaModule ******************************************/
38 SV_IMPL_META_FACTORY1( SvMetaModule, SvMetaExtern );
39 
40 /*************************************************************************
41 |*
42 |*    SvMetaModule::SvMetaModule()
43 |*
44 |*    Beschreibung
45 |*    Ersterstellung    MM 12.12.94
46 |*    Letzte Aenderung  MM 12.12.94
47 |*
48 *************************************************************************/
SvMetaModule()49 SvMetaModule::SvMetaModule()
50 #ifdef IDL_COMPILER
51     : bImported( sal_False )
52     , bIsModified( sal_False )
53 #endif
54 {
55 }
56 
57 #ifdef IDL_COMPILER
SvMetaModule(const String & rIdlFileName,sal_Bool bImp)58 SvMetaModule::SvMetaModule( const String & rIdlFileName, sal_Bool bImp )
59     : aIdlFileName( rIdlFileName )
60     , bImported( bImp ), bIsModified( sal_False )
61 {
62 }
63 #endif
64 
65 /*************************************************************************
66 |*
67 |*    SvMetaModule::Load()
68 |*
69 |*    Beschreibung
70 |*    Ersterstellung    MM 12.12.94
71 |*    Letzte Aenderung  MM 12.12.94
72 |*
73 *************************************************************************/
74 #define MODULE_VER      0x0001
Load(SvPersistStream & rStm)75 void SvMetaModule::Load( SvPersistStream & rStm )
76 {
77     bImported = sal_True; // immer importiert
78     SvMetaExtern::Load( rStm );
79 
80     sal_uInt16 nVer;
81 
82     rStm >> nVer; // Version
83     DBG_ASSERT( (nVer & ~IDL_WRITE_MASK) == MODULE_VER, "false version" );
84 
85     rStm >> aClassList;
86     rStm >> aTypeList;
87     rStm >> aAttrList;
88     // Browser
89     rStm.ReadByteString( aIdlFileName );
90     rStm.ReadByteString( aHelpFileName );
91     rStm.ReadByteString( aSlotIdFile );
92     rStm.ReadByteString( aModulePrefix );
93 
94     // Compiler Daten lesen
95     sal_uInt16 nCmpLen;
96     rStm >> nCmpLen;
97 #ifdef IDL_COMPILER
98     DBG_ASSERT( (nVer & IDL_WRITE_MASK) == IDL_WRITE_COMPILER,
99                 "no idl compiler format" );
100     rStm >> aBeginName;
101     rStm >> aEndName;
102     rStm >> aNextName;
103 #else
104     rStm->SeekRel( nCmpLen );
105 #endif
106 }
107 
108 /*************************************************************************
109 |*
110 |*    SvMetaModule::Save()
111 |*
112 |*    Beschreibung
113 |*    Ersterstellung    MM 12.12.94
114 |*    Letzte Aenderung  MM 12.12.94
115 |*
116 *************************************************************************/
Save(SvPersistStream & rStm)117 void SvMetaModule::Save( SvPersistStream & rStm )
118 {
119     SvMetaExtern::Save( rStm );
120 
121     rStm << (sal_uInt16)(MODULE_VER | IDL_WRITE_COMPILER); // Version
122 
123     rStm << aClassList;
124     rStm << aTypeList;
125     rStm << aAttrList;
126     // Browser
127     rStm.WriteByteString( aIdlFileName );
128     rStm.WriteByteString( aHelpFileName );
129     rStm.WriteByteString( aSlotIdFile );
130     rStm.WriteByteString( aModulePrefix );
131 
132     // Compiler Daten schreiben
133     sal_uInt16 nCmpLen = 0;
134     sal_uLong nLenPos = rStm.Tell();
135     rStm << nCmpLen;
136 #ifdef IDL_COMPILER
137     rStm << aBeginName;
138     rStm << aEndName;
139     rStm << aNextName;
140     // Laenge der Compiler Daten schreiben
141     sal_uLong nPos = rStm.Tell();
142     rStm.Seek( nLenPos );
143     rStm << (sal_uInt16)( nPos - nLenPos - sizeof( sal_uInt16 ) );
144     rStm.Seek( nPos );
145 #endif
146 }
147 
148 /*************************************************************************
149 |*
150 |*    SvMetaModule::SetName()
151 |*
152 |*    Beschreibung
153 |*    Ersterstellung    MM 12.12.94
154 |*    Letzte Aenderung  MM 12.12.94
155 |*
156 *************************************************************************/
SetName(const ByteString & rName,SvIdlDataBase * pBase)157 sal_Bool SvMetaModule::SetName( const ByteString & rName, SvIdlDataBase * pBase )
158 {
159     if( pBase )
160     {
161         if( pBase->GetModule( rName ) )
162             return sal_False;
163     }
164     return SvMetaExtern::SetName( rName );
165 }
166 
167 #ifdef IDL_COMPILER
168 /*************************************************************************
169 |*    SvMetaModule::GetNextName()
170 |*
171 |*    Beschreibung
172 *************************************************************************/
FillNextName(SvGlobalName * pName)173 sal_Bool SvMetaModule::FillNextName( SvGlobalName * pName )
174 {
175     *pName = aNextName;
176 
177     if( aNextName < aEndName )
178     {
179         ++aNextName;
180         bIsModified = sal_True;
181         return sal_True;
182     }
183     return sal_False;
184 }
185 
186 /*************************************************************************
187 |*    SvMetaModule::ReadSvIdl()
188 |*
189 |*    Beschreibung
190 *************************************************************************/
ReadAttributesSvIdl(SvIdlDataBase & rBase,SvTokenStream & rInStm)191 void SvMetaModule::ReadAttributesSvIdl( SvIdlDataBase & rBase,
192                                         SvTokenStream & rInStm )
193 {
194     SvMetaExtern::ReadAttributesSvIdl( rBase, rInStm );
195 
196     aHelpFileName.ReadSvIdl( SvHash_HelpFile(), rInStm );
197     if( aSlotIdFile.ReadSvIdl( SvHash_SlotIdFile(), rInStm ) )
198     {
199 	    sal_uInt32 nTokPos = rInStm.Tell();
200         if( !rBase.ReadIdFile( String::CreateFromAscii( aSlotIdFile.GetBuffer() ) ) )
201         {
202             ByteString aStr = "cannot read file: ";
203             aStr += aSlotIdFile;
204             rBase.SetError( aStr, rInStm.GetToken() );
205             rBase.WriteError( rInStm );
206 
207             rInStm.Seek( nTokPos );
208         }
209     }
210     aTypeLibFile.ReadSvIdl( SvHash_TypeLibFile(), rInStm );
211 	aModulePrefix.ReadSvIdl( SvHash_ModulePrefix(), rInStm );
212 }
213 
214 /*************************************************************************
215 |*    SvMetaModule::WriteAttributesSvIdl()
216 |*
217 |*    Beschreibung
218 *************************************************************************/
WriteAttributesSvIdl(SvIdlDataBase & rBase,SvStream & rOutStm,sal_uInt16 nTab)219 void SvMetaModule::WriteAttributesSvIdl( SvIdlDataBase & rBase,
220                                          SvStream & rOutStm,
221                                          sal_uInt16 nTab )
222 {
223     SvMetaExtern::WriteAttributesSvIdl( rBase, rOutStm, nTab );
224     if( aTypeLibFile.Len() || aSlotIdFile.Len() || aTypeLibFile.Len() )
225 	{
226 	    if( aHelpFileName.Len() )
227 	    {
228 		    WriteTab( rOutStm, nTab );
229 	        aHelpFileName.WriteSvIdl( SvHash_HelpFile(), rOutStm, nTab +1 );
230 	        rOutStm << ';' << endl;
231 	    }
232 	    if( aSlotIdFile.Len() )
233 	    {
234 	        WriteTab( rOutStm, nTab );
235 	        aSlotIdFile.WriteSvIdl( SvHash_SlotIdFile(), rOutStm, nTab +1 );
236 	        rOutStm << ';' << endl;
237 	    }
238 	    if( aTypeLibFile.Len() )
239 	    {
240 	        WriteTab( rOutStm, nTab );
241 	        aTypeLibFile.WriteSvIdl( SvHash_TypeLibFile(), rOutStm, nTab +1 );
242 	        rOutStm << ';' << endl;
243 	    }
244 	}
245 }
246 
247 /*************************************************************************
248 |*    SvMetaModule::ReadContextSvIdl()
249 |*
250 |*    Beschreibung
251 *************************************************************************/
ReadContextSvIdl(SvIdlDataBase & rBase,SvTokenStream & rInStm)252 void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
253                                      SvTokenStream & rInStm )
254 {
255     sal_uInt32  nTokPos = rInStm.Tell();
256     if( rInStm.GetToken()->Is( SvHash_interface() )
257       || rInStm.GetToken()->Is( SvHash_shell() ) )
258     {
259         SvMetaClassRef aClass = new SvMetaClass();
260         if( aClass->ReadSvIdl( rBase, rInStm ) )
261         {
262             aClassList.Append( aClass );
263             // Global bekanntgeben
264             rBase.GetClassList().Append( aClass );
265         }
266     }
267     else if( rInStm.GetToken()->Is( SvHash_enum() ) )
268     {
269         SvMetaTypeEnumRef aEnum = new SvMetaTypeEnum();
270 
271         if( aEnum->ReadSvIdl( rBase, rInStm ) )
272         {
273             // Im Modul deklariert
274             aTypeList.Append( aEnum );
275             // Global bekanntgeben
276             rBase.GetTypeList().Append( aEnum );
277         }
278     }
279     else if( rInStm.GetToken()->Is( SvHash_item() )
280       || rInStm.GetToken()->Is( SvHash_struct() )
281       || rInStm.GetToken()->Is( SvHash_typedef() ) )
282     {
283         SvMetaTypeRef xItem = new SvMetaType();
284 
285         if( xItem->ReadSvIdl( rBase, rInStm ) )
286         {
287             // Im Modul deklariert
288             aTypeList.Append( xItem );
289             // Global bekanntgeben
290             rBase.GetTypeList().Append( xItem );
291         }
292     }
293     else if( rInStm.GetToken()->Is( SvHash_include() ) )
294     {
295         sal_Bool bOk = sal_False;
296         rInStm.GetToken_Next();
297         SvToken * pTok = rInStm.GetToken_Next();
298         if( pTok->IsString() )
299         {
300             DirEntry aFullName( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
301 			rBase.StartNewFile( aFullName.GetFull() );
302             if( aFullName.Find( rBase.GetPath() ) )
303             {
304                 SvTokenStream aTokStm( aFullName.GetFull() );
305                 if( SVSTREAM_OK == aTokStm.GetStream().GetError() )
306                 {
307 					// Fehler aus alter Datei retten
308 					SvIdlError aOldErr = rBase.GetError();
309 					// Fehler zuruecksetzen
310 					rBase.SetError( SvIdlError() );
311 
312                     sal_uInt32 nBeginPos = 0xFFFFFFFF; // kann mit Tell nicht vorkommen
313                     while( nBeginPos != aTokStm.Tell() )
314                     {
315                         nBeginPos = aTokStm.Tell();
316                         ReadContextSvIdl( rBase, aTokStm );
317                         aTokStm.ReadDelemiter();
318                     }
319                     bOk = aTokStm.GetToken()->IsEof();
320                     if( !bOk )
321                     {
322                         rBase.WriteError( aTokStm );
323                     }
324 					// Fehler aus alter Datei wieder herstellen
325 					rBase.SetError( aOldErr );
326                 }
327                 else
328                 {
329                     ByteString aStr = "cannot open file: ";
330                     aStr += ByteString( aFullName.GetFull(), RTL_TEXTENCODING_UTF8 );
331                     rBase.SetError( aStr, pTok );
332                 }
333             }
334             else
335             {
336                 ByteString aStr = "cannot find file: ";
337                 aStr += ByteString( aFullName.GetFull(), RTL_TEXTENCODING_UTF8 );
338                 rBase.SetError( aStr, pTok );
339             }
340         }
341         if( !bOk )
342             rInStm.Seek( nTokPos );
343     }
344     else
345     {
346         SvMetaSlotRef xSlot = new SvMetaSlot();
347 
348         if( xSlot->ReadSvIdl( rBase, rInStm ) )
349         {
350 	    	if( xSlot->Test( rBase, rInStm ) )
351 			{
352 	            // Im Modul deklariert
353 	            aAttrList.Append( xSlot );
354 	            // Global bekanntgeben
355 	            rBase.AppendAttr( xSlot );
356 			}
357         }
358     }
359 }
360 
361 /*************************************************************************
362 |*    SvMetaModule::WriteContextSvIdl()
363 |*
364 |*    Beschreibung
365 *************************************************************************/
WriteContextSvIdl(SvIdlDataBase & rBase,SvStream & rOutStm,sal_uInt16 nTab)366 void SvMetaModule::WriteContextSvIdl( SvIdlDataBase & rBase,
367                                       SvStream & rOutStm,
368                                       sal_uInt16 nTab )
369 {
370     SvMetaExtern::WriteContextSvIdl( rBase, rOutStm, nTab );
371 	sal_uLong n;
372     for( n = 0; n < aTypeList.Count(); n++ )
373     {
374         WriteTab( rOutStm, nTab );
375         aTypeList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab );
376     }
377 	rOutStm << endl;
378     for( n = 0; n < aAttrList.Count(); n++ )
379     {
380         WriteTab( rOutStm, nTab );
381         aAttrList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab );
382     }
383 	rOutStm << endl;
384     for( n = 0; n < aClassList.Count(); n++ )
385     {
386         WriteTab( rOutStm, nTab );
387         aClassList.GetObject( n )->WriteSvIdl( rBase, rOutStm, nTab );
388     }
389 }
390 
391 /*************************************************************************
392 |*
393 |*    SvMetaModule::ReadSvIdl()
394 |*
395 |*    Beschreibung
396 |*
397 *************************************************************************/
ReadSvIdl(SvIdlDataBase & rBase,SvTokenStream & rInStm)398 sal_Bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
399 {
400     bIsModified = sal_True; // bisher immer wenn Compiler laueft
401 
402     sal_uInt32  nTokPos = rInStm.Tell();
403     SvToken * pTok  = rInStm.GetToken_Next();
404     sal_Bool bOk        = sal_False;
405     bOk = pTok->Is( SvHash_module() );
406     if( bOk )
407     {
408         pTok = rInStm.GetToken_Next();
409         if( pTok->IsString() )
410              bOk = aBeginName.MakeId( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
411     }
412     rInStm.ReadDelemiter();
413     if( bOk )
414     {
415         pTok = rInStm.GetToken_Next();
416         if( pTok->IsString() )
417              bOk = aEndName.MakeId( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
418     }
419     rInStm.ReadDelemiter();
420     if( bOk )
421     {
422         aNextName = aBeginName;
423 
424         rBase.Push( this ); // auf den Context Stack
425 
426         if( ReadNameSvIdl( rBase, rInStm ) )
427         {
428             // Zeiger auf sich selbst setzen
429 			SetModule( rBase );
430             bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
431         }
432         rBase.GetStack().Pop(); // und runter
433     }
434     if( !bOk )
435         rInStm.Seek( nTokPos );
436     return bOk;
437 }
438 
439 /*************************************************************************
440 |*
441 |*    SvMetaModule::WriteSvIdl()
442 |*
443 |*    Beschreibung
444 |*
445 *************************************************************************/
WriteSvIdl(SvIdlDataBase & rBase,SvStream & rOutStm,sal_uInt16 nTab)446 void SvMetaModule::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
447                                sal_uInt16 nTab )
448 {
449     rOutStm << SvHash_module()->GetName().GetBuffer() << endl
450             << '\"';
451     rOutStm.WriteByteString( aBeginName.GetHexName() );
452     rOutStm << '\"' << endl << '\"';
453     rOutStm.WriteByteString( aEndName.GetHexName() );
454     rOutStm << '\"' << endl;
455     SvMetaExtern::WriteSvIdl( rBase, rOutStm, nTab );
456 }
457 
458 /*************************************************************************
459 |*    SvMetaModule::WriteSfx()
460 *************************************************************************/
WriteSfx(SvIdlDataBase & rBase,SvStream & rOutStm)461 void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
462 {
463     for( sal_uLong n = 0; n < aClassList.Count(); n++ )
464 	{
465         SvMetaClass * pClass = aClassList.GetObject( n );
466 		pClass->WriteSfx( rBase, rOutStm );
467 	}
468 }
469 
WriteHelpIds(SvIdlDataBase & rBase,SvStream & rOutStm,Table * pTable)470 void SvMetaModule::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
471 							Table* pTable )
472 {
473     for( sal_uLong n = 0; n < aClassList.Count(); n++ )
474 	{
475         SvMetaClass * pClass = aClassList.GetObject( n );
476 		pClass->WriteHelpIds( rBase, rOutStm, pTable );
477 	}
478 }
479 
480 /*************************************************************************
481 |*    SvMetaModule::WriteAttributes()
482 *************************************************************************/
WriteAttributes(SvIdlDataBase & rBase,SvStream & rOutStm,sal_uInt16 nTab,WriteType nT,WriteAttribute nA)483 void SvMetaModule::WriteAttributes( SvIdlDataBase & rBase,
484 									SvStream & rOutStm,
485                              		sal_uInt16 nTab,
486 		 						    WriteType nT, WriteAttribute nA )
487 {
488 	SvMetaExtern::WriteAttributes( rBase, rOutStm, nTab, nT, nA );
489     if( aHelpFileName.Len() )
490 	{
491 		WriteTab( rOutStm, nTab );
492 		rOutStm << "// class SvMetaModule" << endl;
493 		WriteTab( rOutStm, nTab );
494         rOutStm << "helpfile(\"" << aHelpFileName.GetBuffer() << "\");" << endl;
495 	}
496 }
497 
498 /*************************************************************************
499 |*    SvMetaModule::WriteSbx()
500 *************************************************************************/
501 /*
502 void SvMetaModule::WriteSbx( SvIdlDataBase & rBase, SvStream & rOutStm,
503 								SvNamePosList & rList )
504 {
505 	for( sal_uLong n = 0; n < aClassList.Count(); n++ )
506 	{
507 	    SvMetaClass * pClass = aClassList.GetObject( n );
508 		if( !pClass->IsShell() && pClass->GetAutomation() )
509 		{
510 			rList.Insert( new SvNamePos( pClass->GetUUId(), rOutStm.Tell() ),
511 						LIST_APPEND );
512 			SbxObjectRef xSbxObj = new SbxObject( pClass->GetName() );
513 			pClass->FillSbxObject( rBase, xSbxObj );
514 			xSbxObj->Store( rOutStm );
515 		}
516 	}
517 }
518  */
519 
520 /*************************************************************************
521 |*    SvMetaModule::Write()
522 *************************************************************************/
Write(SvIdlDataBase & rBase,SvStream & rOutStm,sal_uInt16 nTab,WriteType nT,WriteAttribute nA)523 void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
524                           	sal_uInt16 nTab,
525 		 					WriteType nT, WriteAttribute nA )
526 {
527 	switch ( nT )
528 	{
529 	case WRITE_ODL:
530 	{
531 	    if( aSlotIdFile.Len() )
532 		{
533 			WriteTab( rOutStm, nTab );
534             rOutStm << "#include \"" << aSlotIdFile.GetBuffer() << '"' << endl << endl;
535 	    }
536 		SvMetaExtern::Write( rBase, rOutStm, nTab, nT, nA );
537 		rOutStm << endl;
538 		WriteTab( rOutStm, nTab );
539         rOutStm << "library " << GetName().GetBuffer() << endl;
540 		WriteTab( rOutStm, nTab );
541 	    rOutStm << '{' << endl;
542 		WriteTab( rOutStm, nTab );
543 		rOutStm << "importlib(\"STDOLE.TLB\");" << endl;
544 
545 	/*
546 	    for( sal_uLong n = 0; n < aTypeList.Count(); n++ )
547 	    {
548 	        SvMetaType * pType = aTypeList.GetObject( n );
549 	        if( !pType ->Write( rBase, rOutStm, nTab +1, nT, nA ) )
550 	            return sal_False;
551 	    }
552 	*/
553 		/*
554 	    for( sal_uLong n = 0; n < rBase.GetModuleList().Count(); n++ )
555 	    {
556 	        SvMetaModule * pModule = rBase.GetModuleList().GetObject( n );
557 	        const SvMetaTypeMemberList &rTypeList = pModule->GetTypeList();
558 	        for( sal_uLong n = 0; n < rTypeList.Count(); n++ )
559 	        {
560 	            SvMetaType * pType = rTypeList.GetObject( n );
561 	            pType->Write( rBase, rOutStm, nTab +1, nT, nA );
562 	        }
563 	    }
564 		*/
565 
566 	    for( sal_uLong n = 0; n < aClassList.Count(); n++ )
567 	    {
568 	        SvMetaClass * pClass = aClassList.GetObject( n );
569 			if( !pClass->IsShell() && pClass->GetAutomation() )
570 			{
571 				WriteTab( rOutStm, nTab );
572 				WriteStars( rOutStm );
573 		        pClass->Write( rBase, rOutStm, nTab +1, nT, nA );
574 			    if( n +1 < aClassList.Count() )
575 					rOutStm << endl;
576 			}
577 	    }
578 
579 	    rOutStm << '}' << endl;
580 	}
581 	break;
582 	case WRITE_DOCU:
583 	{
584 		rOutStm << "SvIDL interface documentation" << endl << endl;
585         rOutStm << "<MODULE>" << endl << GetName().GetBuffer() << endl;
586 		WriteDescription( rOutStm );
587 		rOutStm	<< "</MODULE>" << endl << endl;
588 
589 		rOutStm << "<CLASSES>" << endl;
590 	    for( sal_uLong n = 0; n < aClassList.Count(); n++ )
591 	    {
592 	        SvMetaClass * pClass = aClassList.GetObject( n );
593 			if( !pClass->IsShell() )
594 			{
595                 rOutStm << pClass->GetName().GetBuffer();
596 				SvMetaClass* pSC = pClass->GetSuperClass();
597 			    if( pSC )
598                     rOutStm << " : " << pSC->GetName().GetBuffer();
599 
600 				// Importierte Klassen
601 				const SvClassElementMemberList& rClassList = pClass->GetClassList();
602 				if ( rClassList.Count() )
603 				{
604 					rOutStm << " ( ";
605 
606 					for( sal_uLong m=0; m<rClassList.Count(); m++ )
607 					{
608 						SvClassElement *pEle = rClassList.GetObject(m);
609 						SvMetaClass *pCl = pEle->GetClass();
610                         rOutStm << pCl->GetName().GetBuffer();
611 						if ( m+1 == rClassList.Count() )
612 							rOutStm << " )";
613 						else
614 							rOutStm << " , ";
615 					}
616 				}
617 
618 				rOutStm << endl;
619 			}
620 		}
621 		rOutStm << "</CLASSES>" << endl << endl;
622 		// kein Break!
623 	}
624 
625 	case WRITE_C_SOURCE:
626 	case WRITE_C_HEADER:
627 	{
628 	    for( sal_uLong n = 0; n < aClassList.Count(); n++ )
629 	    {
630 	        SvMetaClass * pClass = aClassList.GetObject( n );
631 			if( !pClass->IsShell() /* && pClass->GetAutomation() */ )
632 	        	pClass->Write( rBase, rOutStm, nTab, nT, nA );
633 	    }
634 	}
635 	break;
636 
637     default:
638         break;
639 	}
640 }
641 
642 /*************************************************************************
643 |*    SvMetaModule::WriteSrc()
644 *************************************************************************/
WriteSrc(SvIdlDataBase & rBase,SvStream & rOutStm,Table * pTable)645 void SvMetaModule::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
646                              Table * pTable )
647 {
648 //	rOutStm << "#pragma CHARSET IBMPC" << endl;
649     if( aSlotIdFile.Len() )
650         rOutStm << "//#include <" << aSlotIdFile.GetBuffer() << '>' << endl;
651     for( sal_uLong n = 0; n < aClassList.Count(); n++ )
652     {
653         aClassList.GetObject( n )->WriteSrc( rBase, rOutStm, pTable );
654     }
655 }
656 
657 /*************************************************************************
658 |*    SvMetaModule::WriteHxx()
659 *************************************************************************/
WriteHxx(SvIdlDataBase & rBase,SvStream & rOutStm,sal_uInt16 nTab)660 void SvMetaModule::WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm,
661                              sal_uInt16 nTab )
662 {
663     for( sal_uLong n = 0; n < aClassList.Count(); n++ )
664     {
665         SvMetaClass * pClass = aClassList.GetObject( n );
666         pClass->WriteHxx( rBase, rOutStm, nTab );
667     }
668 }
669 
670 /*************************************************************************
671 |*    SvMetaModule::WriteCxx()
672 *************************************************************************/
WriteCxx(SvIdlDataBase & rBase,SvStream & rOutStm,sal_uInt16 nTab)673 void SvMetaModule::WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm,
674                              sal_uInt16 nTab )
675 {
676     for( sal_uLong n = 0; n < aClassList.Count(); n++ )
677     {
678         SvMetaClass * pClass = aClassList.GetObject( n );
679         pClass->WriteCxx( rBase, rOutStm, nTab );
680     }
681 }
682 
683 #endif // IDL_COMPILER
684 
685