xref: /aoo42x/main/idl/source/objects/basobj.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_idl.hxx"
30 
31 #include <ctype.h>
32 #include <stdio.h>
33 
34 #include <tools/debug.hxx>
35 
36 #include <attrib.hxx>
37 #include <basobj.hxx>
38 #include <module.hxx>
39 #include <globals.hxx>
40 #include <database.hxx>
41 
42 /****************** SvMetaObject *****************************************/
43 SV_IMPL_META_FACTORY1( SvMetaObject, SvRttiBase )
44 /*************************************************************************
45 |*    SvMetaObject::SvMetaObject()
46 |*
47 |*    Beschreibung
48 *************************************************************************/
49 SvMetaObject::SvMetaObject()
50 {
51 }
52 
53 void SvMetaObject::Load( SvPersistStream & )
54 {
55 }
56 
57 void SvMetaObject::Save( SvPersistStream & )
58 {
59 }
60 
61 /*************************************************************************
62 |*    SvMetaObject::WriteTab()
63 |*
64 |*    Beschreibung
65 *************************************************************************/
66 #ifdef IDL_COMPILER
67 void SvMetaObject::WriteTab( SvStream & rOutStm, sal_uInt16 nTab )
68 {
69     while( nTab-- )
70         rOutStm << "    ";
71 //        rOutStm << '\t';
72 }
73 
74 /*************************************************************************
75 |*    SvMetaObject::WriteStart()
76 |*
77 |*    Beschreibung
78 *************************************************************************/
79 void SvMetaObject::WriteStars( SvStream & rOutStm )
80 {
81     rOutStm << '/';
82 	for( int i = 6; i > 0; i-- )
83         rOutStm << "**********";
84     rOutStm << '/' << endl;
85 }
86 
87 /*************************************************************************
88 |*    SvMetaObject::TestAndSeekSpaceOnly()
89 |*
90 |*    Beschreibung
91 *************************************************************************/
92 sal_Bool SvMetaObject::TestAndSeekSpaceOnly( SvStream & rOutStm, sal_uLong nBegPos )
93 {
94     // keine leeren Klammern schreiben
95     sal_uLong nPos = rOutStm.Tell();
96     rOutStm.Seek( nBegPos );
97     sal_Bool bOnlySpace = sal_True;
98     while( bOnlySpace && rOutStm.Tell() < nPos )
99     {
100         char c;
101         rOutStm >> c;
102         if( !isspace( c ) )
103             bOnlySpace = sal_False;
104     }
105     if( bOnlySpace )
106         // nichts geschrieben
107         rOutStm.Seek( nBegPos );
108     else
109         rOutStm.Seek( nPos );
110 	return bOnlySpace;
111 }
112 
113 /*************************************************************************
114 |*    SvMetaObject::Back2Delemitter()
115 |*
116 |*    Beschreibung
117 *************************************************************************/
118 void SvMetaObject::Back2Delemitter( SvStream & rOutStm )
119 {
120     // keine leeren Klammern schreiben
121     sal_uLong nPos = rOutStm.Tell();
122     rOutStm.SeekRel( -1 );
123 	char c = 0;
124 	rOutStm >> c;
125 
126     while( isspace( c ) && rOutStm.Tell() != 1 )
127     {
128 	    rOutStm.SeekRel( -2 );
129 		rOutStm >> c;
130     }
131 
132 	if( c == ';' || c == ',' )
133 	    rOutStm.SeekRel( -1 );
134 	else
135     	rOutStm.Seek( nPos );
136 }
137 
138 /*************************************************************************
139 |*    SvMetaObject::ReadSvIdl()
140 |*
141 |*    Beschreibung
142 *************************************************************************/
143 sal_Bool SvMetaObject::ReadSvIdl( SvIdlDataBase &, SvTokenStream & )
144 {
145     return sal_False;
146 }
147 
148 /*************************************************************************
149 |*    SvMetaObject::WriteSvIdl()
150 |*
151 |*    Beschreibung
152 *************************************************************************/
153 void SvMetaObject::WriteSvIdl( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */ )
154 {
155 }
156 
157 /*************************************************************************
158 |*    SvMetaObject::Write()
159 |*
160 |*    Beschreibung
161 *************************************************************************/
162 void SvMetaObject::Write( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */,
163 		 					WriteType, WriteAttribute )
164 {
165 }
166 
167 /*************************************************************************
168 |*    SvMetaObject::WriteCxx()
169 |*
170 |*    Beschreibung
171 *************************************************************************/
172 void SvMetaObject::WriteCxx( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */ )
173 {
174 }
175 
176 /*************************************************************************
177 |*    SvMetaObject::WriteHxx()
178 |*
179 |*    Beschreibung
180 *************************************************************************/
181 void SvMetaObject::WriteHxx( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */ )
182 {
183 }
184 
185 #endif
186 
187 /****************** SvMetaName *****************************************/
188 SV_IMPL_META_FACTORY1( SvMetaName, SvMetaObject );
189 /*************************************************************************
190 |*    SvMetaName::SvMetaName()
191 |*
192 |*    Beschreibung
193 *************************************************************************/
194 SvMetaName::SvMetaName()
195 {
196 }
197 
198 void SvMetaName::Load( SvPersistStream & rStm )
199 {
200     SvMetaObject::Load( rStm );
201     sal_uInt8 nMask;
202     rStm >> nMask;
203 
204     if( nMask >= 0x20 )
205     {
206         rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
207         DBG_ERROR( "wrong format" );
208         return;
209     }
210     if( nMask & 0x01 )	rStm >> aName;
211     if( nMask & 0x02 )  rStm >> aHelpContext;
212     if( nMask & 0x04 )	rStm >> aHelpText;
213     if( nMask & 0x08 )	rStm >> aConfigName;
214     if( nMask & 0x10 )	rStm >> aDescription;
215 }
216 
217 void SvMetaName::Save( SvPersistStream & rStm )
218 {
219     SvMetaObject::Save( rStm );
220     sal_uInt8 nMask = 0;
221     if( aName.IsSet() )			nMask |= 0x01;
222     if( aHelpContext.IsSet() )  nMask |= 0x02;
223     if( aHelpText.IsSet() )   	nMask |= 0x04;
224     if( aConfigName.IsSet() ) 	nMask |= 0x08;
225     if( aDescription.IsSet() ) 	nMask |= 0x10;
226 
227     rStm << nMask;
228     if( nMask & 0x01 ) rStm << aName;
229     if( nMask & 0x02 ) rStm << aHelpContext;
230     if( nMask & 0x04 ) rStm << aHelpText;
231     if( nMask & 0x08 ) rStm << aConfigName;
232     if( nMask & 0x10 ) rStm << aDescription;
233 }
234 
235 /*************************************************************************
236 |*
237 |*
238 |*    Beschreibung
239 *************************************************************************/
240 sal_Bool SvMetaName::SetName( const ByteString & rName, SvIdlDataBase * )
241 {
242     aName = rName;
243     return sal_True;
244 }
245 
246 #ifdef IDL_COMPILER
247 /*************************************************************************
248 |*    SvMetaName::ReadNameSvIdl()
249 |*
250 |*    Beschreibung
251 *************************************************************************/
252 sal_Bool SvMetaName::ReadNameSvIdl( SvIdlDataBase & rBase,
253                                 SvTokenStream & rInStm )
254 {
255     sal_uInt32 nTokPos = rInStm.Tell();
256     SvToken * pTok = rInStm.GetToken_Next();
257 
258     // Modulnamen lesen
259     if( pTok->IsIdentifier() )
260         if( SetName( pTok->GetString(), &rBase ) )
261             return sal_True;
262 
263     rInStm.Seek( nTokPos );
264     return sal_False;
265 }
266 
267 /*************************************************************************
268 |*    SvMetaName::ReadSvIdl()
269 |*
270 |*    Beschreibung
271 *************************************************************************/
272 void SvMetaName::ReadAttributesSvIdl( SvIdlDataBase & rBase,
273                                       SvTokenStream & rInStm )
274 {
275     sal_uInt32 nTokPos = rInStm.Tell();
276     if( aName.ReadSvIdl( SvHash_Name(), rInStm ) )
277     {
278         if( !SetName( aName, &rBase ) )
279             rInStm.Seek( nTokPos );
280     }
281     aHelpContext.ReadSvIdl( rBase, SvHash_HelpContext(), rInStm );
282     aHelpText.ReadSvIdl( rBase, rInStm );
283     aConfigName.ReadSvIdl( SvHash_ConfigName(), rInStm );
284     aDescription.ReadSvIdl( SvHash_Description(), rInStm );
285 /*
286     aHelpContext.ReadSvIdl( GetModule()->GetInfo()->GetHelpContextContainer(),
287                           rInStm );
288 */
289 }
290 
291 /*************************************************************************
292 |*    SvMetaName::DoReadContextSvIdl()
293 |*
294 |*    Beschreibung
295 *************************************************************************/
296 void SvMetaName::DoReadContextSvIdl( SvIdlDataBase & rBase,
297                                    SvTokenStream & rInStm, char cDel )
298 {
299     sal_uInt32 nBeginPos = 0; // kann mit Tell nicht vorkommen
300     while( nBeginPos != rInStm.Tell() )
301     {
302         nBeginPos = rInStm.Tell();
303         ReadContextSvIdl( rBase, rInStm );
304 		if( cDel == '\0' )
305         	rInStm.ReadDelemiter();
306 		else
307         	rInStm.Read( cDel );
308     }
309 }
310 
311 /*************************************************************************
312 |*    SvMetaName::ReadSvIdl()
313 |*
314 |*    Beschreibung
315 *************************************************************************/
316 void SvMetaName::ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & )
317 {
318 }
319 
320 /*************************************************************************
321 |*    SvMetaName::Test()
322 |*
323 |*    Beschreibung
324 *************************************************************************/
325 sal_Bool SvMetaName::Test( SvIdlDataBase &, SvTokenStream & )
326 {
327     return sal_True;
328 }
329 
330 /*************************************************************************
331 |*    SvMetaName::WriteContextSvIdl()
332 |*
333 |*    Beschreibung
334 *************************************************************************/
335 void SvMetaName::WriteContextSvIdl( SvIdlDataBase &, SvStream &, sal_uInt16 )
336 {
337 }
338 
339 /*************************************************************************
340 |*    SvMetaName::WriteDescription()
341 |*
342 |*    Beschreibung
343 *************************************************************************/
344 void SvMetaName::WriteDescription( SvStream & rOutStm )
345 {
346 	rOutStm << "<DESCRIPTION>" << endl;
347 
348 	ByteString aDesc( GetDescription() );
349 	sal_uInt16 nPos = aDesc.Search( '\n' );
350 	while ( nPos != STRING_NOTFOUND )
351 	{
352         rOutStm << aDesc.Copy( 0, nPos ).GetBuffer() << endl;
353         aDesc.Erase(0,nPos+1);
354 		nPos = aDesc.Search( '\n' );
355 	}
356 
357     rOutStm << aDesc.GetBuffer() << endl << "</DESCRIPTION>" << endl;
358 }
359 
360 /*************************************************************************
361 |*    SvMetaName::WriteAttributesIdl()
362 |*
363 |*    Beschreibung
364 *************************************************************************/
365 void SvMetaName::WriteAttributesSvIdl( SvIdlDataBase & rBase,
366                                        SvStream & rOutStm,
367                                        sal_uInt16 nTab )
368 {
369     if( aHelpContext.IsSet() || aHelpText.IsSet() || aConfigName.IsSet() )
370 	{
371     	WriteTab( rOutStm, nTab );
372     	rOutStm << "// class SvMetaName" << endl;
373 	}
374     if( aHelpContext.IsSet() )
375     {
376         WriteTab( rOutStm, nTab );
377         aHelpContext.WriteSvIdl( SvHash_HelpContext(), rOutStm, nTab );
378         rOutStm << ';' << endl;
379     }
380     if( aHelpText.IsSet() )
381     {
382         WriteTab( rOutStm, nTab );
383         aHelpText.WriteSvIdl( rBase, rOutStm, nTab );
384         rOutStm << ';' << endl;
385     }
386     if( aConfigName.IsSet() )
387     {
388         WriteTab( rOutStm, nTab );
389         aConfigName.WriteSvIdl( SvHash_ConfigName(), rOutStm, nTab );
390         rOutStm << ';' << endl;
391     }
392 }
393 
394 /*************************************************************************
395 |*    SvMetaName::ReadSvIdl()
396 |*
397 |*    Beschreibung
398 *************************************************************************/
399 sal_Bool SvMetaName::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
400 {
401     sal_uInt32 nTokPos = rInStm.Tell();
402     sal_Bool bOk = sal_True;
403     if( rInStm.Read( '[' ) )
404     {
405         sal_uInt32 nBeginPos = 0; // kann mit Tell nicht vorkommen
406         while( nBeginPos != rInStm.Tell() )
407         {
408             nBeginPos = rInStm.Tell();
409             ReadAttributesSvIdl( rBase, rInStm );
410             rInStm.ReadDelemiter();
411         }
412         bOk = rInStm.Read( ']' );
413     }
414 
415     if( bOk )
416     {
417         if( rInStm.Read( '{' ) )
418         {
419 			DoReadContextSvIdl( rBase, rInStm );
420             bOk = rInStm.Read( '}' );
421         }
422     }
423 
424     if( !bOk )
425         rInStm.Seek( nTokPos );
426     return bOk;
427 }
428 
429 /*************************************************************************
430 |*    SvMetaName::WriteSvIdl()
431 |*
432 |*    Beschreibung
433 *************************************************************************/
434 void SvMetaName::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
435                              sal_uInt16 nTab )
436 {
437     sal_uLong nBeginPos = rOutStm.Tell();
438     WriteTab( rOutStm, nTab );
439     rOutStm << '[' << endl;
440     sal_uLong nOldPos = rOutStm.Tell();
441     WriteAttributesSvIdl( rBase, rOutStm, nTab +1 );
442 
443     // keine leeren Klammern schreiben
444 	if( TestAndSeekSpaceOnly( rOutStm, nOldPos ) )
445         // nichts geschrieben
446         rOutStm.Seek( nBeginPos );
447     else
448     {
449         WriteTab( rOutStm, nTab );
450         rOutStm << ']';
451 	    nBeginPos = rOutStm.Tell();
452 	  	rOutStm << endl;
453     }
454 
455     WriteTab( rOutStm, nTab );
456     rOutStm << '{' << endl;
457     nOldPos = rOutStm.Tell();
458     WriteContextSvIdl( rBase, rOutStm, nTab +1 );
459 
460     // keine leeren Klammern schreiben
461 	if( TestAndSeekSpaceOnly( rOutStm, nOldPos ) )
462         // nichts geschrieben
463         rOutStm.Seek( nBeginPos );
464     else
465     {
466         WriteTab( rOutStm, nTab );
467         rOutStm << '}';
468     }
469 }
470 
471 /*************************************************************************
472 |*    SvMetaName::Write()
473 |*
474 |*    Beschreibung
475 *************************************************************************/
476 void SvMetaName::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
477                        	sal_uInt16 nTab,
478 		 				WriteType nT, WriteAttribute nA )
479 {
480     sal_uLong nBeginPos = rOutStm.Tell();
481     WriteTab( rOutStm, nTab );
482     rOutStm << '[' << endl;
483     sal_uLong nOldPos = rOutStm.Tell();
484     WriteAttributes( rBase, rOutStm, nTab +1, nT, nA );
485 
486     // keine leeren Klammern schreiben
487     sal_uLong nPos = rOutStm.Tell();
488     rOutStm.Seek( nOldPos );
489     sal_Bool bOnlySpace = sal_True;
490     while( bOnlySpace && rOutStm.Tell() < nPos )
491     {
492         char c;
493         rOutStm >> c;
494         if( !isspace( c ) )
495             bOnlySpace = sal_False;
496     }
497     if( bOnlySpace )
498         // nichts geschrieben
499         rOutStm.Seek( nBeginPos );
500     else
501     {
502         rOutStm.Seek( nPos );
503         WriteTab( rOutStm, nTab );
504         rOutStm << ']' << endl;
505     }
506 }
507 
508 /*************************************************************************
509 |*    SvMetaName::WriteAttributes()
510 |*
511 |*    Beschreibung
512 *************************************************************************/
513 void SvMetaName::WriteAttributes( SvIdlDataBase &, SvStream & rOutStm,
514                             	sal_uInt16 nTab,
515 		 						WriteType, WriteAttribute )
516 {
517     if( GetHelpText().IsSet() || GetHelpContext().IsSet() )
518 	{
519 		WriteTab( rOutStm, nTab );
520 		rOutStm << "// class SvMetaName" << endl;
521     }
522 	if( GetHelpText().IsSet() )
523 	{
524 		WriteTab( rOutStm, nTab );
525         rOutStm << "helpstring(\"" << GetHelpText().GetBuffer() << "\")," << endl;
526 	}
527     if( GetHelpContext().IsSet() )
528 	{
529 		WriteTab( rOutStm, nTab );
530         rOutStm << "helpcontext("
531                 << ByteString::CreateFromInt64(
532                     GetHelpContext().GetValue() ).GetBuffer()
533                 << ")," << endl;
534 	}
535 }
536 
537 /*************************************************************************
538 |*    SvMetaName::WriteContext()
539 |*
540 |*    Beschreibung
541 *************************************************************************/
542 void SvMetaName::WriteContext( SvIdlDataBase &, SvStream &,
543                             	sal_uInt16,
544 		 						WriteType, WriteAttribute )
545 {
546 }
547 #endif // IDL_COMPILER
548 
549 /****************** SvMetaReference *****************************************/
550 SV_IMPL_META_FACTORY1( SvMetaReference, SvMetaName );
551 
552 /*************************************************************************
553 |*    SvMetaReference::SvMetaReference()
554 |*
555 |*    Beschreibung
556 *************************************************************************/
557 SvMetaReference::SvMetaReference()
558 {
559 }
560 
561 void SvMetaReference::Load( SvPersistStream & rStm )
562 {
563     SvMetaName::Load( rStm );
564 
565     sal_uInt8 nMask;
566     rStm >> nMask;
567     if( nMask >= 0x2 )
568     {
569         rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
570         DBG_ERROR( "wrong format" );
571         return;
572     }
573     if( nMask & 0x01 )
574     {
575         SvMetaReference * pRef;
576         rStm >> pRef;
577         aRef = pRef;
578     }
579 }
580 
581 void SvMetaReference::Save( SvPersistStream & rStm )
582 {
583     SvMetaName::Save( rStm );
584 
585     // Maske erstellen
586     sal_uInt8 nMask = 0;
587     if( aRef.Is() )
588         nMask |= 0x01;
589 
590     // Daten schreiben
591     rStm << nMask;
592     if( nMask & 0x01 ) rStm << aRef;
593 }
594 
595 /**************************************************************************/
596 /****************** SvMetaExtern ******************************************/
597 SV_IMPL_META_FACTORY1( SvMetaExtern, SvMetaReference );
598 
599 /*************************************************************************
600 |*    SvMetaExtern::SvMetaExtern()
601 |*
602 |*    Beschreibung
603 *************************************************************************/
604 SvMetaExtern::SvMetaExtern()
605     : pModule( NULL )
606 	, bReadUUId( sal_False )
607 	, bReadVersion( sal_False )
608 {
609 }
610 
611 void SvMetaExtern::Load( SvPersistStream & rStm )
612 {
613     SvMetaReference::Load( rStm );
614 
615     sal_uInt8 nMask;
616     rStm >> nMask;
617     if( nMask >= 0x20 )
618     {
619         rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
620         DBG_ERROR( "wrong format" );
621         return;
622     }
623     if( nMask & 0x01 ) rStm >> pModule;
624     if( nMask & 0x02 ) rStm >> aUUId;
625     if( nMask & 0x04 ) rStm >> aVersion;
626     if( nMask & 0x08 ) bReadUUId = sal_True;
627     if( nMask & 0x10 ) bReadVersion = sal_True;
628 }
629 
630 void SvMetaExtern::Save( SvPersistStream & rStm )
631 {
632     SvMetaReference::Save( rStm );
633 
634     // Maske erstellen
635     sal_uInt8 nMask = 0;
636     if( pModule )                	nMask |= 0x01;
637     if( aUUId != SvGlobalName() )	nMask |= 0x02;
638     if( aVersion != SvVersion() )	nMask |= 0x04;
639     if( bReadUUId ) 				nMask |= 0x08;
640     if( bReadVersion )  			nMask |= 0x10;
641 
642     // Daten schreiben
643     rStm << nMask;
644     if( nMask & 0x01 ) rStm << pModule;
645     if( nMask & 0x02 ) rStm << aUUId;
646     if( nMask & 0x04 ) rStm << aVersion;
647 }
648 
649 /*************************************************************************
650 |*    SvMetaExtern::GetModule()
651 |*
652 |*    Beschreibung
653 *************************************************************************/
654 SvMetaModule * SvMetaExtern::GetModule() const
655 {
656     DBG_ASSERT( pModule != NULL, "module not set" );
657     return pModule;
658 }
659 
660 /*************************************************************************
661 |*    SvMetaExtern::GetUUId()
662 |*
663 |*    Beschreibung
664 *************************************************************************/
665 const SvGlobalName & SvMetaExtern::GetUUId() const
666 {
667 #ifdef IDL_COMPILER
668     if( aUUId == SvGlobalName() )
669         GetModule()->FillNextName( &((SvMetaExtern *)this)->aUUId );
670 #endif
671     return aUUId;
672 }
673 
674 #ifdef IDL_COMPILER
675 /*************************************************************************
676 |*    SvMetaExtern::SetModule()
677 |*
678 |*    Beschreibung
679 *************************************************************************/
680 void SvMetaExtern::SetModule( SvIdlDataBase & rBase )
681 {
682     pModule = (SvMetaModule *)rBase.GetStack().Get( TYPE( SvMetaModule ) );
683 }
684 
685 /*************************************************************************
686 |*    SvMetaExtern::ReadAttributesSvIdl()
687 |*
688 |*    Beschreibung
689 *************************************************************************/
690 void SvMetaExtern::ReadAttributesSvIdl( SvIdlDataBase & rBase,
691                                         SvTokenStream & rInStm )
692 {
693 	SvMetaReference::ReadAttributesSvIdl( rBase, rInStm );
694     if( aUUId.ReadSvIdl( rBase, rInStm ) )
695 		bReadUUId = sal_True;
696     if( aVersion.ReadSvIdl( rInStm ) )
697 		bReadVersion = sal_True;
698 }
699 
700 /*************************************************************************
701 |*    SvMetaExtern::WriteAttributesSvIdl()
702 |*
703 |*    Beschreibung
704 *************************************************************************/
705 void SvMetaExtern::WriteAttributesSvIdl( SvIdlDataBase & rBase,
706                                          SvStream & rOutStm, sal_uInt16 nTab )
707 {
708 	SvMetaReference::WriteAttributesSvIdl( rBase, rOutStm, nTab );
709 	if( bReadUUId || bReadVersion )
710     {
711 		WriteTab( rOutStm, nTab );
712 		rOutStm << "// class SvMetaExtern" << endl;
713 
714 		if( bReadUUId )
715 		{
716 		    WriteTab( rOutStm, nTab );
717 		    aUUId.WriteSvIdl( rOutStm );
718 		    rOutStm << ';' << endl;
719 		}
720 		if( bReadVersion )
721 		{
722 		    WriteTab( rOutStm, nTab );
723 		    aVersion.WriteSvIdl( rOutStm );
724 	    	rOutStm << ';' << endl;
725 		}
726 	}
727 }
728 
729 /*************************************************************************
730 |*    SvMetaExtern::ReadSvIdl()
731 |*
732 |*    Beschreibung
733 *************************************************************************/
734 sal_Bool SvMetaExtern::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
735 {
736 	SetModule( rBase );
737     GetUUId(); // Id wird angelegt
738     return SvMetaReference::ReadSvIdl( rBase, rInStm );
739 }
740 
741 /*************************************************************************
742 |*    SvMetaExtern::WriteSvIdl()
743 |*
744 |*    Beschreibung
745 *************************************************************************/
746 void SvMetaExtern::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
747                                sal_uInt16 nTab )
748 {
749     SvMetaReference::WriteSvIdl( rBase, rOutStm, nTab );
750 }
751 
752 /*************************************************************************
753 |*    SvMetaExtern::Write()
754 |*
755 |*    Beschreibung
756 *************************************************************************/
757 void SvMetaExtern::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
758                         sal_uInt16 nTab,
759 		 				WriteType nT, WriteAttribute nA )
760 {
761 	SvMetaReference::Write( rBase, rOutStm, nTab, nT, nA );
762 }
763 
764 /*************************************************************************
765 |*    SvMetaExtern::WriteAttributes()
766 |*
767 |*    Beschreibung
768 *************************************************************************/
769 void SvMetaExtern::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
770                              		sal_uInt16 nTab,
771 					 				WriteType nT, WriteAttribute nA )
772 {
773 	SvMetaReference::WriteAttributes( rBase, rOutStm, nTab, nT, nA );
774 
775 	WriteTab( rOutStm, nTab );
776 	rOutStm << "// class SvMetaExtern" << endl;
777 	WriteTab( rOutStm, nTab );
778     rOutStm << "uuid(" << ByteString( GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << ")," << endl;
779 	WriteTab( rOutStm, nTab );
780     rOutStm << "version(" << ByteString::CreateFromInt32( aVersion.GetMajorVersion() ).GetBuffer() << '.'
781              << ByteString::CreateFromInt32( aVersion.GetMinorVersion() ).GetBuffer() << ")," << endl;
782 }
783 
784 #endif // IDL_COMPILER
785 
786 
787