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 : :
21 : : #include <ctype.h>
22 : : #include <stdio.h>
23 : :
24 : : #include <module.hxx>
25 : : #include <globals.hxx>
26 : : #include <database.hxx>
27 : : #include <tools/fsys.hxx>
28 : : #include <tools/debug.hxx>
29 : :
30 [ # # ][ # # ]: 30212 : SV_IMPL_META_FACTORY1( SvMetaModule, SvMetaExtern );
[ # # ][ # # ]
[ # # ][ + - ]
[ # # ]
31 : :
32 : 0 : SvMetaModule::SvMetaModule()
33 : : : bImported( sal_False )
34 [ # # ][ # # ]: 0 : , bIsModified( sal_False )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
35 : : {
36 : 0 : }
37 : :
38 : 16 : SvMetaModule::SvMetaModule( const String & rIdlFileName, sal_Bool bImp )
39 : : : aIdlFileName( rIdlFileName )
40 [ + - ][ + - ]: 16 : , bImported( bImp ), bIsModified( sal_False )
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
41 : : {
42 : 16 : }
43 : :
44 : : #define MODULE_VER 0x0001
45 : 0 : void SvMetaModule::Load( SvPersistStream & rStm )
46 : : {
47 : 0 : bImported = sal_True; // import always
48 [ # # ]: 0 : SvMetaExtern::Load( rStm );
49 : :
50 : : sal_uInt16 nVer;
51 : :
52 [ # # ]: 0 : rStm >> nVer; // version
53 : : DBG_ASSERT( (nVer & ~IDL_WRITE_MASK) == MODULE_VER, "false version" );
54 : :
55 [ # # ]: 0 : rStm >> aClassList;
56 [ # # ]: 0 : rStm >> aTypeList;
57 [ # # ]: 0 : rStm >> aAttrList;
58 : : // browser
59 [ # # ][ # # ]: 0 : aIdlFileName = rStm.ReadUniOrByteString( rStm.GetStreamCharSet() );
60 [ # # ]: 0 : aHelpFileName.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
61 [ # # ]: 0 : aSlotIdFile.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
62 [ # # ]: 0 : aModulePrefix.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
63 : :
64 : : // read compiler data
65 : : sal_uInt16 nCmpLen;
66 [ # # ]: 0 : rStm >> nCmpLen;
67 : : DBG_ASSERT( (nVer & IDL_WRITE_MASK) == IDL_WRITE_COMPILER,
68 : : "no idl compiler format" );
69 [ # # ]: 0 : rStm >> aBeginName;
70 [ # # ]: 0 : rStm >> aEndName;
71 [ # # ]: 0 : rStm >> aNextName;
72 : 0 : }
73 : :
74 : 16 : void SvMetaModule::Save( SvPersistStream & rStm )
75 : : {
76 : 16 : SvMetaExtern::Save( rStm );
77 : :
78 : 16 : rStm << (sal_uInt16)(MODULE_VER | IDL_WRITE_COMPILER); // Version
79 : :
80 : 16 : rStm << aClassList;
81 : 16 : rStm << aTypeList;
82 : 16 : rStm << aAttrList;
83 : : // browser
84 [ + - ]: 16 : rStm.WriteUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() );
85 : 16 : write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aHelpFileName.getString());
86 : 16 : write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aSlotIdFile.getString());
87 : 16 : write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aModulePrefix.getString());
88 : :
89 : : // write compiler data
90 : 16 : sal_uInt16 nCmpLen = 0;
91 : 16 : sal_uLong nLenPos = rStm.Tell();
92 : 16 : rStm << nCmpLen;
93 : 16 : rStm << aBeginName;
94 : 16 : rStm << aEndName;
95 : 16 : rStm << aNextName;
96 : : // write length of compiler data
97 : 16 : sal_uLong nPos = rStm.Tell();
98 : 16 : rStm.Seek( nLenPos );
99 : 16 : rStm << (sal_uInt16)( nPos - nLenPos - sizeof( sal_uInt16 ) );
100 : 16 : rStm.Seek( nPos );
101 : 16 : }
102 : :
103 : 16 : sal_Bool SvMetaModule::SetName( const rtl::OString& rName, SvIdlDataBase * pBase )
104 : : {
105 [ + - ]: 16 : if( pBase )
106 : : {
107 [ - + ]: 16 : if( pBase->GetModule( rName ) )
108 : 0 : return sal_False;
109 : : }
110 : 16 : return SvMetaExtern::SetName( rName );
111 : : }
112 : :
113 : 2904 : sal_Bool SvMetaModule::FillNextName( SvGlobalName * pName )
114 : : {
115 : 2904 : *pName = aNextName;
116 : :
117 [ + - ]: 2904 : if( aNextName < aEndName )
118 : : {
119 : 2904 : ++aNextName;
120 : 2904 : bIsModified = sal_True;
121 : 2904 : return sal_True;
122 : : }
123 : 2904 : return sal_False;
124 : : }
125 : :
126 : 42 : void SvMetaModule::ReadAttributesSvIdl( SvIdlDataBase & rBase,
127 : : SvTokenStream & rInStm )
128 : : {
129 : 42 : SvMetaExtern::ReadAttributesSvIdl( rBase, rInStm );
130 : :
131 : 42 : aHelpFileName.ReadSvIdl( SvHash_HelpFile(), rInStm );
132 [ + + ]: 42 : if( aSlotIdFile.ReadSvIdl( SvHash_SlotIdFile(), rInStm ) )
133 : : {
134 : 22 : sal_uInt32 nTokPos = rInStm.Tell();
135 [ + - ][ + - ]: 22 : if( !rBase.ReadIdFile( rtl::OStringToOUString(aSlotIdFile.getString(), RTL_TEXTENCODING_ASCII_US)) )
[ - + ][ + - ]
136 : : {
137 [ # # ]: 0 : rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("cannot read file: "));
138 [ # # ]: 0 : aStr.append(aSlotIdFile.getString());
139 [ # # ][ # # ]: 0 : rBase.SetError( aStr.makeStringAndClear(), rInStm.GetToken() );
140 [ # # ]: 0 : rBase.WriteError( rInStm );
141 : :
142 [ # # ]: 0 : rInStm.Seek( nTokPos );
143 : : }
144 : : }
145 : 42 : aTypeLibFile.ReadSvIdl( SvHash_TypeLibFile(), rInStm );
146 : 42 : aModulePrefix.ReadSvIdl( SvHash_ModulePrefix(), rInStm );
147 : 42 : }
148 : :
149 : 16 : void SvMetaModule::WriteAttributesSvIdl( SvIdlDataBase & rBase,
150 : : SvStream & rOutStm,
151 : : sal_uInt16 nTab )
152 : : {
153 : 16 : SvMetaExtern::WriteAttributesSvIdl( rBase, rOutStm, nTab );
154 [ - + ][ # # ]: 16 : if( !aTypeLibFile.getString().isEmpty() || !aSlotIdFile.getString().isEmpty() || !aTypeLibFile.getString().isEmpty() )
[ + - ][ + - ]
155 : : {
156 [ - + ]: 16 : if( !aHelpFileName.getString().isEmpty() )
157 : : {
158 : 0 : WriteTab( rOutStm, nTab );
159 : 0 : aHelpFileName.WriteSvIdl( SvHash_HelpFile(), rOutStm, nTab +1 );
160 : 0 : rOutStm << ';' << endl;
161 : : }
162 [ + - ]: 16 : if( !aSlotIdFile.getString().isEmpty() )
163 : : {
164 : 16 : WriteTab( rOutStm, nTab );
165 : 16 : aSlotIdFile.WriteSvIdl( SvHash_SlotIdFile(), rOutStm, nTab +1 );
166 : 16 : rOutStm << ';' << endl;
167 : : }
168 [ - + ]: 16 : if( !aTypeLibFile.getString().isEmpty() )
169 : : {
170 : 0 : WriteTab( rOutStm, nTab );
171 : 0 : aTypeLibFile.WriteSvIdl( SvHash_TypeLibFile(), rOutStm, nTab +1 );
172 : 0 : rOutStm << ';' << endl;
173 : : }
174 : : }
175 : 16 : }
176 : :
177 : 20254 : void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
178 : : SvTokenStream & rInStm )
179 : : {
180 : 20254 : sal_uInt32 nTokPos = rInStm.Tell();
181 [ + + ]: 40294 : if( rInStm.GetToken()->Is( SvHash_interface() )
[ + + + + ]
182 : 20040 : || rInStm.GetToken()->Is( SvHash_shell() ) )
183 : : {
184 [ + - ][ + - ]: 386 : SvMetaClassRef aClass = new SvMetaClass();
185 [ + - ][ + - ]: 386 : if( aClass->ReadSvIdl( rBase, rInStm ) )
186 : : {
187 [ + - ]: 386 : aClassList.push_back( aClass );
188 : : // announce globally
189 [ + - ]: 386 : rBase.GetClassList().push_back( aClass );
190 [ + - ]: 386 : }
191 : : }
192 [ + + ]: 19868 : else if( rInStm.GetToken()->Is( SvHash_enum() ) )
193 : : {
194 [ + - ][ + - ]: 410 : SvMetaTypeEnumRef aEnum = new SvMetaTypeEnum();
195 : :
196 [ + - ][ + - ]: 410 : if( aEnum->ReadSvIdl( rBase, rInStm ) )
197 : : {
198 : : // declared in module
199 [ + - ]: 410 : aTypeList.push_back( aEnum );
200 : : // announce globally
201 [ + - ][ + - ]: 410 : rBase.GetTypeList().push_back( aEnum );
202 [ + - ]: 410 : }
203 : : }
204 [ + + + + : 53180 : else if( rInStm.GetToken()->Is( SvHash_item() )
- + ][ + + ]
205 : 17168 : || rInStm.GetToken()->Is( SvHash_struct() )
206 : 16554 : || rInStm.GetToken()->Is( SvHash_typedef() ) )
207 : : {
208 [ + - ][ + - ]: 2904 : SvMetaTypeRef xItem = new SvMetaType();
209 : :
210 [ + - ][ + - ]: 2904 : if( xItem->ReadSvIdl( rBase, rInStm ) )
211 : : {
212 : : // declared in module
213 [ + - ]: 2904 : aTypeList.push_back( xItem );
214 : : // announce globally
215 [ + - ][ + - ]: 2904 : rBase.GetTypeList().push_back( xItem );
216 [ + - ]: 2904 : }
217 : : }
218 [ + + ]: 16554 : else if( rInStm.GetToken()->Is( SvHash_include() ) )
219 : : {
220 : 266 : sal_Bool bOk = sal_False;
221 : 266 : rInStm.GetToken_Next();
222 : 266 : SvToken * pTok = rInStm.GetToken_Next();
223 [ + - ]: 266 : if( pTok->IsString() )
224 : : {
225 [ + - ][ + - ]: 266 : DirEntry aFullName( rtl::OStringToOUString(pTok->GetString(), RTL_TEXTENCODING_ASCII_US) );
[ + - ][ + - ]
226 [ + - ][ + - ]: 266 : rBase.StartNewFile( aFullName.GetFull() );
[ + - ]
227 [ + - ][ + - ]: 266 : if( aFullName.Find( rBase.GetPath() ) )
228 : : {
229 [ + - ][ + - ]: 266 : rBase.AddDepFile(aFullName.GetFull());
[ + - ]
230 [ + - ][ + - ]: 266 : SvTokenStream aTokStm( aFullName.GetFull() );
[ + - ]
231 [ + - ]: 266 : if( SVSTREAM_OK == aTokStm.GetStream().GetError() )
232 : : {
233 : : // rescue error from old file
234 : 266 : SvIdlError aOldErr = rBase.GetError();
235 : : // reset error
236 : 266 : rBase.SetError( SvIdlError() );
237 : :
238 : 266 : sal_uInt32 nBeginPos = 0xFFFFFFFF; // can not happen with Tell
239 [ + - ][ + + ]: 20184 : while( nBeginPos != aTokStm.Tell() )
240 : : {
241 [ + - ]: 19918 : nBeginPos = aTokStm.Tell();
242 [ + - ]: 19918 : ReadContextSvIdl( rBase, aTokStm );
243 [ + - ]: 19918 : aTokStm.ReadDelemiter();
244 : : }
245 [ + - ]: 266 : bOk = aTokStm.GetToken()->IsEof();
246 [ - + ]: 266 : if( !bOk )
247 : : {
248 [ # # ]: 0 : rBase.WriteError( aTokStm );
249 : : }
250 : : // recover error from old file
251 : 266 : rBase.SetError( aOldErr );
252 : : }
253 : : else
254 : : {
255 : : rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
256 [ # # ]: 0 : "cannot open file: "));
257 : : aStr.append(rtl::OUStringToOString(aFullName.GetFull(),
258 [ # # ][ # # ]: 0 : RTL_TEXTENCODING_UTF8));
[ # # ][ # # ]
[ # # ]
259 [ # # ]: 0 : rBase.SetError(aStr.makeStringAndClear(), pTok);
260 [ + - ]: 266 : }
261 : : }
262 : : else
263 : : {
264 : : rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
265 [ # # ]: 0 : "cannot find file:"));
266 : : aStr.append(rtl::OUStringToOString(aFullName.GetFull(),
267 [ # # ][ # # ]: 0 : RTL_TEXTENCODING_UTF8));
[ # # ][ # # ]
[ # # ]
268 [ # # ]: 0 : rBase.SetError(aStr.makeStringAndClear(), pTok);
269 [ + - ]: 266 : }
270 : : }
271 [ - + ]: 266 : if( !bOk )
272 : 0 : rInStm.Seek( nTokPos );
273 : : }
274 : : else
275 : : {
276 [ + - ][ + - ]: 16288 : SvMetaSlotRef xSlot = new SvMetaSlot();
277 : :
278 [ + + ][ + - ]: 16288 : if( xSlot->ReadSvIdl( rBase, rInStm ) )
279 : : {
280 [ + - ][ + - ]: 16006 : if( xSlot->Test( rBase, rInStm ) )
281 : : {
282 : : // declared in module
283 [ + - ]: 16006 : aAttrList.push_back( xSlot );
284 : : // announce globally
285 [ + - ]: 16006 : rBase.AppendAttr( xSlot );
286 : : }
287 [ + - ]: 16288 : }
288 : : }
289 : 20254 : }
290 : :
291 : 16 : void SvMetaModule::WriteContextSvIdl( SvIdlDataBase & rBase,
292 : : SvStream & rOutStm,
293 : : sal_uInt16 nTab )
294 : : {
295 : 16 : SvMetaExtern::WriteContextSvIdl( rBase, rOutStm, nTab );
296 : : sal_uLong n;
297 [ + + ]: 3330 : for( n = 0; n < aTypeList.size(); n++ )
298 : : {
299 : 3314 : WriteTab( rOutStm, nTab );
300 : 3314 : aTypeList[n]->WriteSvIdl( rBase, rOutStm, nTab );
301 : : }
302 : 16 : rOutStm << endl;
303 [ + + ]: 16022 : for( n = 0; n < aAttrList.size(); n++ )
304 : : {
305 : 16006 : WriteTab( rOutStm, nTab );
306 : 16006 : aAttrList[n]->WriteSvIdl( rBase, rOutStm, nTab );
307 : : }
308 : 16 : rOutStm << endl;
309 [ + + ]: 402 : for( n = 0; n < aClassList.size(); n++ )
310 : : {
311 : 386 : WriteTab( rOutStm, nTab );
312 : 386 : aClassList[n]->WriteSvIdl( rBase, rOutStm, nTab );
313 : : }
314 : 16 : }
315 : :
316 : 16 : sal_Bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
317 : : {
318 : 16 : bIsModified = sal_True; // up to now always when compiler running
319 : :
320 : 16 : sal_uInt32 nTokPos = rInStm.Tell();
321 : 16 : SvToken * pTok = rInStm.GetToken_Next();
322 : 16 : sal_Bool bOk = sal_False;
323 : 16 : bOk = pTok->Is( SvHash_module() );
324 [ + - ]: 16 : if( bOk )
325 : : {
326 : 16 : pTok = rInStm.GetToken_Next();
327 [ + - ]: 16 : if( pTok->IsString() )
328 [ + - ][ + - ]: 16 : bOk = aBeginName.MakeId(rtl::OStringToOUString(pTok->GetString(), RTL_TEXTENCODING_ASCII_US));
[ + - ]
329 : : }
330 : 16 : rInStm.ReadDelemiter();
331 [ + - ]: 16 : if( bOk )
332 : : {
333 : 16 : pTok = rInStm.GetToken_Next();
334 [ + - ]: 16 : if( pTok->IsString() )
335 [ + - ][ + - ]: 16 : bOk = aEndName.MakeId(rtl::OStringToOUString(pTok->GetString(), RTL_TEXTENCODING_ASCII_US));
[ + - ]
336 : : }
337 : 16 : rInStm.ReadDelemiter();
338 [ + - ]: 16 : if( bOk )
339 : : {
340 : 16 : aNextName = aBeginName;
341 : :
342 : 16 : rBase.Push( this ); // onto the context stack
343 : :
344 [ + - ]: 16 : if( ReadNameSvIdl( rBase, rInStm ) )
345 : : {
346 : : // set pointer to itself
347 : 16 : SetModule( rBase );
348 : 16 : bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
349 : : }
350 : 16 : rBase.GetStack().Pop(); // remove from stack
351 : : }
352 [ - + ]: 16 : if( !bOk )
353 : 0 : rInStm.Seek( nTokPos );
354 : 16 : return bOk;
355 : : }
356 : :
357 : 16 : void SvMetaModule::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
358 : : sal_uInt16 nTab )
359 : : {
360 : 16 : rOutStm << SvHash_module()->GetName().getStr() << endl
361 : 16 : << '\"';
362 [ + - ][ + - ]: 16 : rOutStm.WriteUniOrByteString( aBeginName.GetHexName(), rOutStm.GetStreamCharSet() );
363 : 16 : rOutStm << '\"' << endl << '\"';
364 [ + - ][ + - ]: 16 : rOutStm.WriteUniOrByteString( aEndName.GetHexName(), rOutStm.GetStreamCharSet() );
365 : 16 : rOutStm << '\"' << endl;
366 : 16 : SvMetaExtern::WriteSvIdl( rBase, rOutStm, nTab );
367 : 16 : }
368 : :
369 : 16 : void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
370 : : {
371 [ + + ]: 402 : for( sal_uLong n = 0; n < aClassList.size(); n++ )
372 : : {
373 : 386 : SvMetaClass * pClass = aClassList[n];
374 : 386 : pClass->WriteSfx( rBase, rOutStm );
375 : : }
376 : 16 : }
377 : :
378 : 16 : void SvMetaModule::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
379 : : HelpIdTable& rTable )
380 : : {
381 [ + + ]: 402 : for( sal_uLong n = 0; n < aClassList.size(); n++ )
382 : : {
383 : 386 : SvMetaClass * pClass = aClassList[n];
384 : 386 : pClass->WriteHelpIds( rBase, rOutStm, rTable );
385 : : }
386 : 16 : }
387 : :
388 : 0 : void SvMetaModule::WriteAttributes( SvIdlDataBase & rBase,
389 : : SvStream & rOutStm,
390 : : sal_uInt16 nTab,
391 : : WriteType nT, WriteAttribute nA )
392 : : {
393 : 0 : SvMetaExtern::WriteAttributes( rBase, rOutStm, nTab, nT, nA );
394 [ # # ]: 0 : if( !aHelpFileName.getString().isEmpty() )
395 : : {
396 : 0 : WriteTab( rOutStm, nTab );
397 : 0 : rOutStm << "// class SvMetaModule" << endl;
398 : 0 : WriteTab( rOutStm, nTab );
399 : 0 : rOutStm << "helpfile(\"" << aHelpFileName.getString().getStr() << "\");" << endl;
400 : : }
401 : 0 : }
402 : :
403 : 0 : void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
404 : : sal_uInt16 nTab,
405 : : WriteType nT, WriteAttribute nA )
406 : : {
407 [ # # # # ]: 0 : switch ( nT )
408 : : {
409 : : case WRITE_ODL:
410 : : {
411 [ # # ]: 0 : if( !aSlotIdFile.getString().isEmpty() )
412 : : {
413 : 0 : WriteTab( rOutStm, nTab );
414 : 0 : rOutStm << "#include \"" << aSlotIdFile.getString().getStr() << '"' << endl << endl;
415 : : }
416 : 0 : SvMetaExtern::Write( rBase, rOutStm, nTab, nT, nA );
417 : 0 : rOutStm << endl;
418 : 0 : WriteTab( rOutStm, nTab );
419 : 0 : rOutStm << "library " << GetName().getString().getStr() << endl;
420 : 0 : WriteTab( rOutStm, nTab );
421 : 0 : rOutStm << '{' << endl;
422 : 0 : WriteTab( rOutStm, nTab );
423 : 0 : rOutStm << "importlib(\"STDOLE.TLB\");" << endl;
424 : :
425 [ # # ]: 0 : for( sal_uLong n = 0; n < aClassList.size(); n++ )
426 : : {
427 : 0 : SvMetaClass * pClass = aClassList[n];
428 [ # # ][ # # ]: 0 : if( !pClass->IsShell() && pClass->GetAutomation() )
[ # # ]
429 : : {
430 : 0 : WriteTab( rOutStm, nTab );
431 : 0 : WriteStars( rOutStm );
432 : 0 : pClass->Write( rBase, rOutStm, nTab +1, nT, nA );
433 [ # # ]: 0 : if( n +1 < aClassList.size() )
434 : 0 : rOutStm << endl;
435 : : }
436 : : }
437 : :
438 : 0 : rOutStm << '}' << endl;
439 : : }
440 : 0 : break;
441 : : case WRITE_DOCU:
442 : : {
443 : 0 : rOutStm << "SvIDL interface documentation" << endl << endl;
444 : 0 : rOutStm << "<MODULE>" << endl << GetName().getString().getStr() << endl;
445 : 0 : WriteDescription( rOutStm );
446 : 0 : rOutStm << "</MODULE>" << endl << endl;
447 : :
448 : 0 : rOutStm << "<CLASSES>" << endl;
449 [ # # ]: 0 : for( sal_uLong n = 0; n < aClassList.size(); n++ )
450 : : {
451 : 0 : SvMetaClass * pClass = aClassList[n];
452 [ # # ]: 0 : if( !pClass->IsShell() )
453 : : {
454 : 0 : rOutStm << pClass->GetName().getString().getStr();
455 : 0 : SvMetaClass* pSC = pClass->GetSuperClass();
456 [ # # ]: 0 : if( pSC )
457 : 0 : rOutStm << " : " << pSC->GetName().getString().getStr();
458 : :
459 : : // imported classes
460 : 0 : const SvClassElementMemberList& rClassList = pClass->GetClassList();
461 [ # # ]: 0 : if ( !rClassList.empty() )
462 : : {
463 : 0 : rOutStm << " ( ";
464 : :
465 [ # # ]: 0 : for( sal_uLong m=0; m<rClassList.size(); ++m )
466 : : {
467 : 0 : SvClassElement *pEle = rClassList[m];
468 : 0 : SvMetaClass *pCl = pEle->GetClass();
469 : 0 : rOutStm << pCl->GetName().getString().getStr();
470 [ # # ]: 0 : if ( m+1 == rClassList.size() )
471 : 0 : rOutStm << " )";
472 : : else
473 : 0 : rOutStm << " , ";
474 : : }
475 : : }
476 : :
477 : 0 : rOutStm << endl;
478 : : }
479 : : }
480 : 0 : rOutStm << "</CLASSES>" << endl << endl;
481 : : // no break!
482 : : }
483 : :
484 : : case WRITE_C_SOURCE:
485 : : case WRITE_C_HEADER:
486 : : {
487 [ # # ]: 0 : for( sal_uLong n = 0; n < aClassList.size(); n++ )
488 : : {
489 : 0 : SvMetaClass * pClass = aClassList[n];
490 [ # # ]: 0 : if( !pClass->IsShell() )
491 : 0 : pClass->Write( rBase, rOutStm, nTab, nT, nA );
492 : : }
493 : : }
494 : 0 : break;
495 : :
496 : : default:
497 : 0 : break;
498 : : }
499 : 0 : }
500 : :
501 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|