1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
26 #include <rscclass.hxx>
28 #include <tools/rcid.h>
31 RscClass::RscClass( Atom nId
, sal_uInt32 nTypeId
, RscTop
* pSuperCl
)
32 : RscTop( nId
, nTypeId
, pSuperCl
)
36 nSuperSize
= RscTop::Size();
37 nSize
= nSuperSize
+ ALIGNED_SIZE( sizeof( RscClassInst
) );
40 void RscClass::Pre_dtor()
46 for( i
= 0; i
< nEntries
; i
++ )
48 if( pVarTypeList
[ i
].pDefault
)
50 pVarTypeList
[ i
].pClass
->Destroy(
51 RSCINST( pVarTypeList
[ i
].pClass
,
52 pVarTypeList
[ i
].pDefault
) );
53 rtl_freeMemory( pVarTypeList
[ i
].pDefault
);
54 pVarTypeList
[ i
].pDefault
= NULL
;
62 rtl_freeMemory( (void *)pVarTypeList
);
65 RSCCLASS_TYPE
RscClass::GetClassType() const
67 return RSCCLASS_COMPLEX
;
70 RSCINST
RscClass::GetInstData
79 aInst
.pClass
= pVarTypeList
[ nEle
].pClass
;
82 if( VAR_NODATAINST
& pVarTypeList
[ nEle
].nVarType
)
89 aInst
.pData
= GetCopyVar(
91 pVarTypeList
[ nEle
].nDataBaseName
94 aInst
.pData
= GetVariable(
96 pVarTypeList
[ nEle
].nDataBaseName
,
100 else if( VAR_POINTER
& pVarTypeList
[ nEle
].nVarType
)
102 if( VAR_EXTENDABLE
& pVarTypeList
[ nEle
].nVarType
)
103 aInst
= *reinterpret_cast<RSCINST
*>(pData
+ pVarTypeList
[ nEle
].nOffset
);
105 aInst
.pData
= *reinterpret_cast<CLASS_DATA
*>(pData
+ pVarTypeList
[ nEle
].nOffset
);
108 aInst
.pData
= pData
+ pVarTypeList
[ nEle
].nOffset
;
113 CLASS_DATA
RscClass::GetDfltData( sal_uInt32 nEle
)
115 if( pVarTypeList
[ nEle
].pDefault
)
116 return pVarTypeList
[ nEle
].pDefault
;
118 return pVarTypeList
[ nEle
].pClass
->GetDefault().pData
;
121 void RscClass::SetVarDflt( CLASS_DATA pData
, sal_uInt32 nEle
, bool bSet
)
123 RscClassInst
* pClass
;
125 pClass
= reinterpret_cast<RscClassInst
*>(pData
+ nSuperSize
);
127 pClass
->nVarDflt
|= ((sal_uLong
)1 << nEle
);
129 pClass
->nVarDflt
&= ~((sal_uLong
)1 << nEle
);
132 bool RscClass::IsDflt( CLASS_DATA pData
, sal_uInt32 nEle
)
134 RscClassInst
* pClass
;
136 pClass
= reinterpret_cast<RscClassInst
*>(pData
+ nSuperSize
);
137 return pClass
->nVarDflt
& ((sal_uLong
)1 << nEle
);
140 RSCINST
RscClass::Create( RSCINST
* pInst
,
141 const RSCINST
& rDflt
,
146 RSCINST aMemInst
, aDfltI
;
151 aInst
.pData
= static_cast<CLASS_DATA
>(rtl_allocateMemory( Size() ));
156 if( !bOwnClass
&& rDflt
.IsInst() )
157 bOwnClass
= rDflt
.pClass
->InHierarchy( this );
159 RscTop::Create( &aInst
, rDflt
, bOwnClass
);
162 reinterpret_cast<RscClassInst
*>(aInst
.pData
+ nSuperSize
)->nVarDflt
=
163 reinterpret_cast<RscClassInst
*>(rDflt
.pData
+ nSuperSize
)->nVarDflt
;
165 reinterpret_cast<RscClassInst
*>(aInst
.pData
+ nSuperSize
)->nVarDflt
= ~((sal_uLong
)0);
167 for( i
= 0; i
< nEntries
; i
++ )
169 aDfltI
= GetInstData( bOwnClass
? rDflt
.pData
: NULL
, i
, true );
171 if( (VAR_POINTER
& pVarTypeList
[ i
].nVarType
) &&
172 !(VAR_NODATAINST
& pVarTypeList
[ i
].nVarType
) )
175 if( VAR_EXTENDABLE
& pVarTypeList
[ i
].nVarType
)
177 RSCINST
* pInstance
= reinterpret_cast<RSCINST
*>(aInst
.pData
+ pVarTypeList
[ i
].nOffset
);
178 pInstance
->pClass
= pVarTypeList
[ i
].pClass
;
179 ppData
= &pInstance
->pData
;
182 ppData
= reinterpret_cast<CLASS_DATA
*>(aInst
.pData
+ pVarTypeList
[ i
].nOffset
);
185 if( aDfltI
.IsInst() )
187 aMemInst
= pVarTypeList
[ i
].pClass
->Create( NULL
, aDfltI
);
188 *ppData
= aMemInst
.pData
;
193 aMemInst
= GetInstData( aInst
.pData
, i
, true );
194 aMemInst
= aMemInst
.pClass
->Create( &aMemInst
, aDfltI
);
201 void RscClass::Destroy( const RSCINST
& rInst
)
205 RscTop::Destroy( rInst
);
207 for( i
= 0; i
< nEntries
; i
++ )
209 if( !(pVarTypeList
[ i
].nVarType
& VAR_NODATAINST
) )
213 aTmpI
= GetInstData( rInst
.pData
, i
, true );
217 aTmpI
.pClass
->Destroy( aTmpI
);
218 if( pVarTypeList
[ i
].nVarType
& VAR_POINTER
)
220 // Speicher freigeben
221 rtl_freeMemory( aTmpI
.pData
);
228 ERRTYPE
RscClass::SetVariable( Atom nVarName
,
237 pVarTypeList
= static_cast<VARTYPE_STRUCT
*>(rtl_reallocateMemory( (void *)pVarTypeList
,
238 ((nEntries
+1) * sizeof( VARTYPE_STRUCT
)) ));
242 pVarTypeList
= static_cast<VARTYPE_STRUCT
*>(rtl_allocateMemory( ((nEntries
+1)
243 * sizeof( VARTYPE_STRUCT
)) ));
245 pVarTypeList
[ nEntries
].nVarName
= nVarName
;
246 pVarTypeList
[ nEntries
].nMask
= nMask
;
247 pVarTypeList
[ nEntries
].pClass
= pClass
;
248 pVarTypeList
[ nEntries
].nOffset
= nSize
;
249 pVarTypeList
[ nEntries
].nDataBaseName
= nDataBaseName
;
251 pVarTypeList
[ nEntries
].pDefault
= pDflt
->pData
;
253 pVarTypeList
[ nEntries
].pDefault
= NULL
;
255 pVarTypeList
[ nEntries
].nVarType
= ~VAR_POINTER
& nVarType
;
256 if( pClass
->Size() > 10 || (nVarType
& VAR_EXTENDABLE
) )
257 pVarTypeList
[ nEntries
].nVarType
|= VAR_POINTER
;
259 if( !(pVarTypeList
[ nEntries
].nVarType
& VAR_NODATAINST
) )
261 if( pVarTypeList
[ nEntries
].nVarType
& VAR_POINTER
)
263 if( pVarTypeList
[ nEntries
].nVarType
& VAR_EXTENDABLE
)
264 nSize
+= sizeof( RSCINST
);
266 nSize
+= sizeof( CLASS_DATA
);
269 nSize
+= pClass
->Size();
273 if( nEntries
> (sizeof( sal_uLong
) * 8) )
275 // Bereich fuer Default zu klein
281 void RscClass::EnumVariables( void * pData
, VarEnumCallbackProc pProc
)
285 RscTop::EnumVariables( pData
, pProc
);
286 for( i
= 0; i
< nEntries
; i
++ )
288 if( !(pVarTypeList
[ i
].nVarType
& VAR_NOENUM
) )
289 (*pProc
)( pData
, pVarTypeList
[ i
].pClass
->GetClassType(), pVarTypeList
[ i
].nVarName
);
293 RSCINST
RscClass::GetVariable( const RSCINST
& rInst
,
295 const RSCINST
& rInitInst
,
297 RscTop
* pCreateClass
)
302 while( i
< nEntries
&& pVarTypeList
[ i
].nVarName
!= nVarName
)
307 if( VAR_NODATAINST
& pVarTypeList
[ i
].nVarType
)
309 aTmpI
= GetVariable( rInst
,
310 pVarTypeList
[ i
].nDataBaseName
,
312 aTmpI
.pClass
= pVarTypeList
[ i
].pClass
;
316 // Default Instanz generieren
317 RSCINST aDefInst
= rInitInst
;
318 if( !aDefInst
.IsInst() && bInitDflt
)
320 // mit dem Variablen-Default besetzen
321 aDefInst
.pData
= pVarTypeList
[ i
].pDefault
;
322 aDefInst
.pClass
= pVarTypeList
[ i
].pClass
;
325 aTmpI
= GetInstData( rInst
.pData
, i
);
328 if( aDefInst
.IsInst() )
330 aTmpI
.pClass
->Destroy( aTmpI
);
331 aTmpI
.pClass
->Create( &aTmpI
, aDefInst
);
335 { // Wird ueber Zeiger angegeben
336 if( VAR_EXTENDABLE
& pVarTypeList
[ i
].nVarType
)
338 RSCINST
* pInst
= reinterpret_cast<RSCINST
*>
339 (rInst
.pData
+ pVarTypeList
[ i
].nOffset
);
340 if( pCreateClass
&& pCreateClass
->InHierarchy( aTmpI
.pClass
) )
341 *pInst
= pCreateClass
->Create( NULL
, aDefInst
);
343 *pInst
= aTmpI
.pClass
->Create( NULL
, aDefInst
);
349 = reinterpret_cast<CLASS_DATA
*>(rInst
.pData
+ pVarTypeList
[ i
].nOffset
);
350 aTmpI
= aTmpI
.pClass
->Create( NULL
, aDefInst
);
351 *ppData
= aTmpI
.pData
;
355 // auf nicht Default setzen
356 SetVarDflt( rInst
.pData
, i
, false );
360 return RscTop::GetVariable( rInst
, nVarName
, rInitInst
,
361 bInitDflt
, pCreateClass
);
364 RSCINST
RscClass::GetCopyVar( const RSCINST
& rInst
, Atom nVarName
)
369 while( i
< nEntries
&& pVarTypeList
[ i
].nVarName
!= nVarName
)
374 if( VAR_NODATAINST
& pVarTypeList
[ i
].nVarType
)
376 aVarI
= GetCopyVar( rInst
, pVarTypeList
[ i
].nDataBaseName
);
377 aVarI
.pClass
= pVarTypeList
[ i
].pClass
;
381 if( IsDflt( rInst
.pData
, i
) )
383 // mit Variablen Default initialiaieren
384 aVarI
= GetVariable( rInst
, nVarName
, RSCINST(), true );
385 SetVarDflt( rInst
.pData
, i
, true );
388 aVarI
= GetInstData( rInst
.pData
, i
, true );
394 return RscTop::GetCopyVar( rInst
, nVarName
);
397 bool RscClass::IsConsistent( const RSCINST
& rInst
)
403 bRet
= RscTop::IsConsistent( rInst
);
405 for( i
= 0; i
< nEntries
; i
++ )
407 if( !(VAR_NODATAINST
& pVarTypeList
[ i
].nVarType
) )
409 aTmpI
= GetInstData( rInst
.pData
, i
, true );
412 if( ! aTmpI
.pClass
->IsConsistent( aTmpI
) )
420 void RscClass::SetToDefault( const RSCINST
& rInst
)
424 RscClassInst
* pClass
;
426 pClass
= reinterpret_cast<RscClassInst
*>(rInst
.pData
+ nSuperSize
);
428 for( i
= 0; i
< nEntries
; i
++ )
430 // Variablen ohne eigenen Speicher werden vom "Datenserver"
431 // auf Default gesetzt
432 if( !(VAR_NODATAINST
& pVarTypeList
[ i
].nVarType
) )
434 aTmpI
= GetInstData( rInst
.pData
, i
, true );
436 aTmpI
.pClass
->SetToDefault( aTmpI
);
439 pClass
->nVarDflt
= ~((sal_uLong
)0); // alles auf Default
441 RscTop::SetToDefault( rInst
);
444 bool RscClass::IsDefault( const RSCINST
& rInst
)
449 for( i
= 0; i
< nEntries
; i
++ )
451 // Variablen ohne eigenen Speicher werden vom "Datenserver"
452 // auf Default untersucht
453 if( !(VAR_NODATAINST
& pVarTypeList
[ i
].nVarType
) )
454 if( !IsDflt( rInst
.pData
, i
) )
458 return RscTop::IsDefault( rInst
);
461 RSCINST
RscClass::GetDefault( Atom nVarId
)
466 while( i
< nEntries
&& pVarTypeList
[ i
].nVarName
!= nVarId
)
473 aTmpI
.pClass
= pVarTypeList
[ i
].pClass
;
474 aTmpI
.pData
= GetDfltData( i
);
478 return RscTop::GetDefault( nVarId
);
481 bool RscClass::IsValueDflt( CLASS_DATA pData
, sal_uInt32 nEle
)
485 aTmpI
= GetInstData( pData
, nEle
, true );
489 if( VAR_SVDYNAMIC
& pVarTypeList
[ nEle
].nVarType
)
492 if( aTmpI
.pClass
== pVarTypeList
[ nEle
].pClass
)
493 //sie haben auch die gleiche Klasse
494 return aTmpI
.pClass
->IsValueDefault( aTmpI
, GetDfltData( nEle
) );
501 bool RscClass::IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
)
506 if( !RscTop::IsValueDefault( rInst
, pDef
) )
511 for( sal_uInt32 i
= 0; i
< nEntries
; i
++ )
513 aTmpI
= GetInstData( rInst
.pData
, i
, true );
516 if( aTmpI
.pClass
!= pVarTypeList
[ i
].pClass
)
517 //sie haben nicht die gleiche Klasse
520 aDfltI
= GetInstData( pDef
, i
, true );
521 if( !aDfltI
.IsInst() )
522 aDfltI
.pData
= GetDfltData( i
);
524 if( !aTmpI
.pClass
->IsValueDefault( aTmpI
, aDfltI
.pData
) )
535 void RscClass::SetDefault( const RSCINST
& rInst
, Atom nVarName
)
540 while( i
< nEntries
&& pVarTypeList
[ i
].nVarName
!= nVarName
)
545 aTmpI
= GetInstData( rInst
.pData
, i
, true );
548 aTmpI
.pClass
->Destroy( aTmpI
);
549 aTmpI
.pClass
->Create( &aTmpI
, RSCINST() );
550 SetVarDflt( rInst
.pData
, i
, true );
553 else //In Superklasse nach Variable suchen
554 RscTop::SetDefault( rInst
, nVarName
);
559 void RscClass::WriteSrc( const RSCINST
& rInst
,
563 const char * pVarName
)
565 sal_uInt32 i
= 0, n
= 0;
568 RscTop::WriteSrc( rInst
, fOutput
, pTC
, nTab
, pVarName
);
570 for( i
= 0; i
< nEntries
; i
++ )
572 if( !(VAR_HIDDEN
& pVarTypeList
[ i
].nVarType
) )
574 // Hack wegen Position und Dimensiuon
575 if( nRsc_XYMAPMODEId
== pVarTypeList
[ i
].nVarName
||
576 nRsc_WHMAPMODEId
== pVarTypeList
[ i
].nVarName
)
578 if( !IsDflt( rInst
.pData
, i
) || // MapUnit
579 !IsDflt( rInst
.pData
, i
+1 ) || //X, Width
580 !IsDflt( rInst
.pData
, i
+2 ) ) //Y, Height
582 // ein Wert ist nicht Default
583 for( n
= 0; n
< nTab
; n
++ )
584 fputc( '\t', fOutput
);
586 if( nRsc_XYMAPMODEId
== pVarTypeList
[ i
].nVarName
)
587 fprintf( fOutput
, "Pos = " );
589 fprintf( fOutput
, "Size = " );
591 if( !IsDflt( rInst
.pData
, i
) )
593 aTmpI
= GetInstData( rInst
.pData
, i
, true );
594 aTmpI
.pClass
->WriteSrcHeader(
595 aTmpI
, fOutput
, pTC
, nTab
, RscId(), pVarName
);
598 fprintf( fOutput
, "( " );
599 aTmpI
= GetInstData( rInst
.pData
, i
+1, true );
600 if( !aTmpI
.IsInst() )
601 aTmpI
.pData
= GetDfltData( i
+1 );
603 aTmpI
.pClass
->WriteSrcHeader( aTmpI
, fOutput
, pTC
, nTab
, RscId(), pVarName
);
605 fprintf( fOutput
, ", " );
606 aTmpI
= GetInstData( rInst
.pData
, i
+2, true );
608 if( !aTmpI
.IsInst() )
609 aTmpI
.pData
= GetDfltData( i
+2 );
611 aTmpI
.pClass
->WriteSrcHeader(
612 aTmpI
, fOutput
, pTC
, nTab
, RscId(), pVarName
);
613 fprintf( fOutput
, " );\n" );
615 i
+= 2; //_X, _Y oder _Width, Height ueberlesen
617 else if( !IsDflt( rInst
.pData
, i
)
618 && !IsValueDflt( rInst
.pData
, i
) )
620 aTmpI
= GetInstData( rInst
.pData
, i
, true );
624 const char * pName
= pHS
->getString( pVarTypeList
[ i
].nVarName
).getStr();
626 for( n
= 0; n
< nTab
; n
++ )
627 fputc( '\t', fOutput
);
629 fprintf( fOutput
, "%s", pName
);
630 fprintf( fOutput
, " = " );
631 aTmpI
.pClass
->WriteSrcHeader(
632 aTmpI
, fOutput
, pTC
, nTab
, RscId(), pName
);
633 fprintf( fOutput
, ";\n" );
642 sal_Int32
RscClass::GetCorrectValues( const RSCINST
& rInst
,
644 sal_uInt32 nTupelIdx
,
648 sal_Int32 nBaseValue
;
651 RSCINST aTmpI
= GetInstData( rInst
.pData
, nVarPos
, true );
652 aTmpI
.pClass
->GetNumber( aTmpI
, &nBaseValue
);
654 // Sprach Delta holen
655 aTmpI
= rInst
.pClass
->GetVariable( rInst
, nRsc_DELTALANG
, RSCINST() );
659 aTmpI
.pClass
->WriteRc( aTmpI
, aMem
, pTC
, 0, false );
660 nLang
= (sal_Int32
)aMem
.GetShort( nTupelIdx
* sizeof(sal_uInt16
) );
663 return nLang
+ nBaseValue
;
666 ERRTYPE
RscClass::WriteInstRc( const RSCINST
& rInst
,
675 sal_uInt32 nMaskOff
= 0;// Offset um Maskenfeld zu addressieren
677 // Wenn eine Variable Maskierung hat, dann Maskenfeld
678 for( i
= 0; i
< nEntries
; i
++ )
680 if( pVarTypeList
[ i
].nMask
)
682 nMaskOff
= rMem
.Size();
683 rMem
.Put( sal_uInt32(0) );
688 for( i
= 0; i
< nEntries
&& aError
.IsOk(); i
++ )
690 if( !((VAR_NODATAINST
| VAR_NORC
) & pVarTypeList
[ i
].nVarType
))
692 if( pVarTypeList
[ i
].nMask
)
694 if( !IsDflt( rInst
.pData
, i
) )
696 if( nRsc_X
== pVarTypeList
[ i
].nVarName
)
698 sal_Int32 nVal
= GetCorrectValues( rInst
, i
, 0, pTC
);
701 else if( nRsc_Y
== pVarTypeList
[ i
].nVarName
)
703 sal_Int32 nVal
= GetCorrectValues( rInst
, i
, 1, pTC
);
706 else if( nRsc_WIDTH
== pVarTypeList
[ i
].nVarName
)
708 sal_Int32 nVal
= GetCorrectValues( rInst
, i
, 2, pTC
);
711 else if( nRsc_HEIGHT
== pVarTypeList
[ i
].nVarName
)
713 sal_Int32 nVal
= GetCorrectValues( rInst
, i
, 3, pTC
);
718 aTmpI
= GetInstData( rInst
.pData
, i
, true );
719 // Nur an Variable Extradata bExtra nicht auf false
721 aError
= aTmpI
.pClass
->
722 WriteRcHeader( aTmpI
, rMem
, pTC
,
724 (nRsc_EXTRADATA
== pVarTypeList
[ i
].nVarName
) && bExtra
);
726 sal_uInt32 nMask
= rMem
.GetLong( nMaskOff
);
727 nMask
|= pVarTypeList
[ i
].nMask
;
728 rMem
.PutAt( nMaskOff
, nMask
);
733 if( IsDflt( rInst
.pData
, i
) )
735 aTmpI
.pClass
= pVarTypeList
[ i
].pClass
;
736 aTmpI
.pData
= GetDfltData( i
);
739 aTmpI
= GetInstData( rInst
.pData
, i
, true );
741 // Nur an Variable Extradata bExtra nicht auf false
743 aError
= aTmpI
.pClass
->
744 WriteRcHeader( aTmpI
, rMem
, pTC
,
746 (nRsc_EXTRADATA
== pVarTypeList
[ i
].nVarName
) && bExtra
);
754 ERRTYPE
RscClass::WriteRc( const RSCINST
& rInst
,
762 aError
= RscTop::WriteRc( rInst
, rMem
, pTC
, nDeep
, bExtra
);
764 aError
= WriteInstRc( rInst
, rMem
, pTC
, nDeep
, bExtra
);
769 RscSysDepend::RscSysDepend( Atom nId
, sal_uInt32 nTypeId
, RscTop
* pSuper
)
770 : RscClass( nId
, nTypeId
, pSuper
)
774 ERRTYPE
RscSysDepend::WriteSysDependRc( const RSCINST
& rInst
, RscWriteRc
& rMem
,
775 RscTypCont
* pTC
, sal_uInt32 nDeep
, bool bExtra
, bool bFirst
)
780 //Instanz mit dem Dateinamen "FILENAME" holen
781 aFileName
= RscClass::GetCopyVar( rInst
, pHS
->getID( "FILE", true ) );
782 if( aFileName
.IsInst() )
785 aError
= aFileName
.pClass
->WriteRcHeader( aFileName
, aTmpMem
, pTC
,
786 RscId(), nDeep
, bExtra
);
787 // Obsolete - need changes in VCL
788 rMem
.Put( sal_uInt32(0) );
790 // Identifier schreiben
791 sal_uInt32 nId
= 0xFFFFFFFF;
792 if( aTmpMem
.Size() && pTC
&& (*aTmpMem
.GetUTF8( 0 ) != '\0') )
794 nId
= pTC
->PutSysName( rInst
.pClass
->GetTypId(),
795 aTmpMem
.GetUTF8( 0 ),
799 aError
= aFileName
.pClass
->WriteRcHeader( aFileName
, rMem
, pTC
,
800 RscId(), nDeep
, bExtra
);
808 ERRTYPE
RscSysDepend::WriteRc( const RSCINST
& rInst
, RscWriteRc
& rMem
,
809 RscTypCont
* pTC
, sal_uInt32 nDeep
, bool bExtra
)
811 ERRTYPE aError
= RscClass::WriteRc( rInst
, rMem
, pTC
, nDeep
, bExtra
);
813 if( this == rInst
.pClass
)
815 // nur wenn es eigen Klasse ist
816 aError
= WriteSysDependRc( rInst
, rMem
, pTC
, nDeep
, bExtra
);
821 RscTupel::RscTupel( Atom nId
, sal_uInt32 nTypeId
, RscTop
* pSuper
)
822 : RscClass( nId
, nTypeId
, pSuper
)
826 RSCINST
RscTupel::GetTupelVar( const RSCINST
& rInst
, sal_uInt32 nPos
,
827 const RSCINST
& rInitInst
)
829 if( nPos
>= nEntries
)
834 return GetVariable( rInst
, pVarTypeList
[ nPos
].nVarName
, rInitInst
);
837 void RscTupel::WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
838 RscTypCont
* pTC
, sal_uInt32 nTab
,
839 const char * pVarName
)
844 RscTop::WriteSrc( rInst
, fOutput
, pTC
, nTab
, pVarName
);
846 fprintf( fOutput
, "< " );
847 for( i
= 0; i
< nEntries
; i
++ )
849 if( !(VAR_HIDDEN
& pVarTypeList
[ i
].nVarType
) )
851 if( !IsDflt( rInst
.pData
, i
)
852 && !IsValueDflt( rInst
.pData
, i
) )
854 aTmpI
= GetInstData( rInst
.pData
, i
, true );
857 aTmpI
.pClass
->WriteSrcHeader(
858 aTmpI
, fOutput
, pTC
, nTab
, RscId(), pVarName
);
860 fprintf( fOutput
, "Default" );
863 fprintf( fOutput
, "Default" );
864 fprintf( fOutput
, "; " );
867 fprintf( fOutput
, ">" );
872 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */