1477794c1SAndrew Rist /**************************************************************
2477794c1SAndrew Rist *
3477794c1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4477794c1SAndrew Rist * or more contributor license agreements. See the NOTICE file
5477794c1SAndrew Rist * distributed with this work for additional information
6477794c1SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7477794c1SAndrew Rist * to you under the Apache License, Version 2.0 (the
8477794c1SAndrew Rist * "License"); you may not use this file except in compliance
9477794c1SAndrew Rist * with the License. You may obtain a copy of the License at
10477794c1SAndrew Rist *
11477794c1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13477794c1SAndrew Rist * Unless required by applicable law or agreed to in writing,
14477794c1SAndrew Rist * software distributed under the License is distributed on an
15477794c1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16477794c1SAndrew Rist * KIND, either express or implied. See the License for the
17477794c1SAndrew Rist * specific language governing permissions and limitations
18477794c1SAndrew Rist * under the License.
19477794c1SAndrew Rist *
20477794c1SAndrew Rist *************************************************************/
21477794c1SAndrew Rist
22477794c1SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_rsc.hxx"
26cdf0e10cSrcweir /****************** I N C L U D E S **************************************/
27cdf0e10cSrcweir // C and C++ Includes.
28cdf0e10cSrcweir #include <ctype.h> // isdigit(), isalpha()
29cdf0e10cSrcweir #include <stdlib.h>
30cdf0e10cSrcweir #include <stdio.h>
31cdf0e10cSrcweir #include <string.h>
32cdf0e10cSrcweir
33cdf0e10cSrcweir #include <tools/fsys.hxx>
34cdf0e10cSrcweir #include <tools/rc.h>
35cdf0e10cSrcweir #include <tools/isofallback.hxx>
36cdf0e10cSrcweir #include <rtl/strbuf.hxx>
37cdf0e10cSrcweir
38cdf0e10cSrcweir // Programmabhaengige Includes.
39cdf0e10cSrcweir #include <rsctree.hxx>
40cdf0e10cSrcweir #include <rsctop.hxx>
41cdf0e10cSrcweir #include <rscmgr.hxx>
42cdf0e10cSrcweir #include <rscdb.hxx>
43cdf0e10cSrcweir #include <rscrsc.hxx>
44cdf0e10cSrcweir
45cdf0e10cSrcweir using namespace rtl;
46cdf0e10cSrcweir
47cdf0e10cSrcweir /*************************************************************************
48cdf0e10cSrcweir |*
49cdf0e10cSrcweir |* RscTypCont :: RscTypCont
50cdf0e10cSrcweir |*
51cdf0e10cSrcweir |* Beschreibung RES.DOC
52cdf0e10cSrcweir |* Ersterstellung MM 22.03.90
53cdf0e10cSrcweir |* Letzte Aenderung MM 27.06.90
54cdf0e10cSrcweir |*
55cdf0e10cSrcweir *************************************************************************/
RscTypCont(RscError * pErrHdl,RSCBYTEORDER_TYPE nOrder,const ByteString & rSearchPath,sal_uInt32 nFlagsP)56cdf0e10cSrcweir RscTypCont :: RscTypCont( RscError * pErrHdl,
57cdf0e10cSrcweir RSCBYTEORDER_TYPE nOrder,
58cdf0e10cSrcweir const ByteString & rSearchPath,
59cdf0e10cSrcweir sal_uInt32 nFlagsP )
60cdf0e10cSrcweir :
61cdf0e10cSrcweir nSourceCharSet( RTL_TEXTENCODING_UTF8 ),
62cdf0e10cSrcweir nByteOrder( nOrder ),
63cdf0e10cSrcweir aSearchPath( rSearchPath ),
64cdf0e10cSrcweir aBool( pHS->getID( "sal_Bool" ), RSC_NOTYPE ),
65cdf0e10cSrcweir aShort( pHS->getID( "short" ), RSC_NOTYPE ),
66cdf0e10cSrcweir aUShort( pHS->getID( "sal_uInt16" ), RSC_NOTYPE ),
67cdf0e10cSrcweir aLong( pHS->getID( "long" ), RSC_NOTYPE ),
68cdf0e10cSrcweir aEnumLong( pHS->getID( "enum_long" ), RSC_NOTYPE ),
69cdf0e10cSrcweir aIdUShort( pHS->getID( "IDUSHORT" ), RSC_NOTYPE ),
70cdf0e10cSrcweir aIdNoZeroUShort( pHS->getID( "IDUSHORT" ), RSC_NOTYPE ),
71cdf0e10cSrcweir aNoZeroShort( pHS->getID( "NoZeroShort" ), RSC_NOTYPE ),
72cdf0e10cSrcweir a1to12Short( pHS->getID( "MonthShort" ), RSC_NOTYPE ),
73cdf0e10cSrcweir a0to23Short( pHS->getID( "HourShort" ), RSC_NOTYPE ),
74cdf0e10cSrcweir a1to31Short( pHS->getID( "DayShort" ), RSC_NOTYPE ),
75cdf0e10cSrcweir a0to59Short( pHS->getID( "MinuteShort" ), RSC_NOTYPE ),
76cdf0e10cSrcweir a0to99Short( pHS->getID( "_0to59Short" ), RSC_NOTYPE ),
77cdf0e10cSrcweir a0to9999Short( pHS->getID( "YearShort" ), RSC_NOTYPE ),
78cdf0e10cSrcweir aIdLong( pHS->getID( "IDLONG" ), RSC_NOTYPE ),
79cdf0e10cSrcweir aString( pHS->getID( "Chars" ), RSC_NOTYPE ),
80cdf0e10cSrcweir aStringLiteral( pHS->getID( "Chars" ), RSC_NOTYPE ),
81cdf0e10cSrcweir aWinBits( pHS->getID( "WinBits" ), RSC_NOTYPE ),
82cdf0e10cSrcweir aLangType(),
83cdf0e10cSrcweir aLangString( pHS->getID( "Lang_Chars" ), RSC_NOTYPE, &aString, &aLangType ),
84cdf0e10cSrcweir aLangShort( pHS->getID( "Lang_short" ), RSC_NOTYPE, &aShort, &aLangType ),
85cdf0e10cSrcweir nAcceleratorType( 0 ),
86cdf0e10cSrcweir nFlags( nFlagsP )
87cdf0e10cSrcweir {
88cdf0e10cSrcweir nUniqueId = 256;
89cdf0e10cSrcweir nPMId = RSC_VERSIONCONTROL +1; //mindestens einen groesser
90cdf0e10cSrcweir pEH = pErrHdl;
91cdf0e10cSrcweir Init();
92cdf0e10cSrcweir }
93cdf0e10cSrcweir
getLangIdAndShortenLocale(RscTypCont * pTypCont,rtl::OString & rLang,rtl::OString & rCountry,rtl::OString & rVariant)94cdf0e10cSrcweir static sal_uInt32 getLangIdAndShortenLocale( RscTypCont* pTypCont,
95cdf0e10cSrcweir rtl::OString& rLang,
96cdf0e10cSrcweir rtl::OString& rCountry,
97cdf0e10cSrcweir rtl::OString& rVariant )
98cdf0e10cSrcweir {
99cdf0e10cSrcweir rtl::OStringBuffer aLangStr( 64 );
100cdf0e10cSrcweir aLangStr.append( rLang.toAsciiLowerCase() );
101cdf0e10cSrcweir if( rCountry.getLength() )
102cdf0e10cSrcweir {
103cdf0e10cSrcweir aLangStr.append( '-' );
104cdf0e10cSrcweir aLangStr.append( rCountry.toAsciiUpperCase() );
105cdf0e10cSrcweir }
106cdf0e10cSrcweir if( rVariant.getLength() )
107cdf0e10cSrcweir {
108cdf0e10cSrcweir aLangStr.append( '-' );
109cdf0e10cSrcweir aLangStr.append( rVariant );
110cdf0e10cSrcweir }
111cdf0e10cSrcweir rtl::OString aL( aLangStr.makeStringAndClear() );
112cdf0e10cSrcweir sal_uInt32 nRet = GetLangId( aL );
113cdf0e10cSrcweir if( nRet == 0 )
114cdf0e10cSrcweir {
115*24c56ab9SHerbert Dürr pTypCont->AddLanguage( aL.getStr() );
116cdf0e10cSrcweir nRet = GetLangId( aL );
117cdf0e10cSrcweir }
118cdf0e10cSrcweir if( rVariant.getLength() )
119cdf0e10cSrcweir rVariant = rtl::OString();
120cdf0e10cSrcweir else if( rCountry.getLength() )
121cdf0e10cSrcweir rCountry = rtl::OString();
122cdf0e10cSrcweir else
123cdf0e10cSrcweir rLang = rtl::OString();
124cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
125cdf0e10cSrcweir fprintf( stderr, " %s (0x%hx)", aL.getStr(), (int)nRet );
126cdf0e10cSrcweir #endif
127cdf0e10cSrcweir return nRet;
128cdf0e10cSrcweir }
129cdf0e10cSrcweir
ChangeLanguage(const ByteString & rNewLang)130cdf0e10cSrcweir ByteString RscTypCont::ChangeLanguage( const ByteString& rNewLang )
131cdf0e10cSrcweir {
132cdf0e10cSrcweir ByteString aRet = aLanguage;
133cdf0e10cSrcweir aLanguage = rNewLang;
134cdf0e10cSrcweir
135cdf0e10cSrcweir rtl::OString aLang = aLanguage;
136cdf0e10cSrcweir rtl::OString aLg, aCountry, aVariant;
137cdf0e10cSrcweir sal_Int32 nIndex = 0;
138cdf0e10cSrcweir aLg = aLang.getToken( 0, '-', nIndex );
139cdf0e10cSrcweir if( nIndex != -1 )
140cdf0e10cSrcweir aCountry = aLang.getToken( 0, '-', nIndex );
141cdf0e10cSrcweir if( nIndex != -1 )
142cdf0e10cSrcweir aVariant = aLang.copy( nIndex );
143cdf0e10cSrcweir
144cdf0e10cSrcweir bool bAppendEnUsFallback =
145cdf0e10cSrcweir ! (rNewLang.EqualsIgnoreCaseAscii( "en-US" ) ||
146cdf0e10cSrcweir rNewLang.EqualsIgnoreCaseAscii( "x-no-translate" ) );
147cdf0e10cSrcweir
148cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
149cdf0e10cSrcweir fprintf( stderr, "RscTypCont::ChangeLanguage:" );
150cdf0e10cSrcweir #endif
151cdf0e10cSrcweir aLangFallbacks.clear();
152cdf0e10cSrcweir
153cdf0e10cSrcweir do
154cdf0e10cSrcweir {
155cdf0e10cSrcweir aLangFallbacks.push_back(getLangIdAndShortenLocale( this, aLg, aCountry, aVariant ) );
156cdf0e10cSrcweir } while( aLg.getLength() );
157cdf0e10cSrcweir
158cdf0e10cSrcweir if( bAppendEnUsFallback )
159cdf0e10cSrcweir {
160cdf0e10cSrcweir aLg = "en";
161cdf0e10cSrcweir aCountry = "US";
162cdf0e10cSrcweir aVariant = rtl::OString();
163cdf0e10cSrcweir aLangFallbacks.push_back( getLangIdAndShortenLocale( this, aLg, aCountry, aVariant ) );
164cdf0e10cSrcweir }
165cdf0e10cSrcweir
166cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1
167cdf0e10cSrcweir fprintf( stderr, "\n" );
168cdf0e10cSrcweir #endif
169cdf0e10cSrcweir
170cdf0e10cSrcweir return aRet;
171cdf0e10cSrcweir }
172cdf0e10cSrcweir
AddLanguage(const char * pLang)173cdf0e10cSrcweir Atom RscTypCont::AddLanguage( const char* pLang )
174cdf0e10cSrcweir {
175cdf0e10cSrcweir return aLangType.AddLanguage( pLang, aNmTb );
176cdf0e10cSrcweir }
177cdf0e10cSrcweir
178cdf0e10cSrcweir
179cdf0e10cSrcweir /*************************************************************************
180cdf0e10cSrcweir |*
181cdf0e10cSrcweir |* RscTypCont :: ~RscTypCont
182cdf0e10cSrcweir |*
183cdf0e10cSrcweir |* Beschreibung RES.DOC
184cdf0e10cSrcweir |* Ersterstellung MM 22.03.90
185cdf0e10cSrcweir |* Letzte Aenderung MM 27.06.90
186cdf0e10cSrcweir |*
187cdf0e10cSrcweir *************************************************************************/
DestroyNode(RscTop * pRscTop,ObjNode * pObjNode)188cdf0e10cSrcweir void DestroyNode( RscTop * pRscTop, ObjNode * pObjNode ){
189cdf0e10cSrcweir if( pObjNode ){
190cdf0e10cSrcweir DestroyNode( pRscTop, (ObjNode*)pObjNode->Left() );
191cdf0e10cSrcweir DestroyNode( pRscTop, (ObjNode*)pObjNode->Right() );
192cdf0e10cSrcweir
193cdf0e10cSrcweir if( pObjNode->GetRscObj() ){
194cdf0e10cSrcweir pRscTop->Destroy( RSCINST( pRscTop, pObjNode->GetRscObj() ) );
195cdf0e10cSrcweir rtl_freeMemory( pObjNode->GetRscObj() );
196cdf0e10cSrcweir }
197cdf0e10cSrcweir delete pObjNode;
198cdf0e10cSrcweir };
199cdf0e10cSrcweir }
200cdf0e10cSrcweir
DestroySubTrees(RscTop * pRscTop)201cdf0e10cSrcweir void DestroySubTrees( RscTop * pRscTop ){
202cdf0e10cSrcweir if( pRscTop ){
203cdf0e10cSrcweir DestroySubTrees( (RscTop*)pRscTop->Left() );
204cdf0e10cSrcweir
205cdf0e10cSrcweir DestroyNode( pRscTop, pRscTop->GetObjNode() );
206cdf0e10cSrcweir
207cdf0e10cSrcweir DestroySubTrees( (RscTop*)pRscTop->Right() );
208cdf0e10cSrcweir };
209cdf0e10cSrcweir }
210cdf0e10cSrcweir
DestroyTree(RscTop * pRscTop)211cdf0e10cSrcweir void DestroyTree( RscTop * pRscTop ){
212cdf0e10cSrcweir if( pRscTop ){
213cdf0e10cSrcweir DestroyTree( (RscTop*)pRscTop->Left() );
214cdf0e10cSrcweir DestroyTree( (RscTop*)pRscTop->Right() );
215cdf0e10cSrcweir
216cdf0e10cSrcweir delete pRscTop;
217cdf0e10cSrcweir };
218cdf0e10cSrcweir }
219cdf0e10cSrcweir
Pre_dtorTree(RscTop * pRscTop)220cdf0e10cSrcweir void Pre_dtorTree( RscTop * pRscTop ){
221cdf0e10cSrcweir if( pRscTop ){
222cdf0e10cSrcweir Pre_dtorTree( (RscTop*)pRscTop->Left() );
223cdf0e10cSrcweir Pre_dtorTree( (RscTop*)pRscTop->Right() );
224cdf0e10cSrcweir
225cdf0e10cSrcweir pRscTop->Pre_dtor();
226cdf0e10cSrcweir };
227cdf0e10cSrcweir }
228cdf0e10cSrcweir
~RscTypCont()229cdf0e10cSrcweir RscTypCont :: ~RscTypCont(){
230cdf0e10cSrcweir RscTop * pRscTmp;
231cdf0e10cSrcweir RscSysEntry * pSysEntry;
232cdf0e10cSrcweir
233cdf0e10cSrcweir // Alle Unterbaeume loeschen
234cdf0e10cSrcweir aVersion.pClass->Destroy( aVersion );
235cdf0e10cSrcweir rtl_freeMemory( aVersion.pData );
236cdf0e10cSrcweir DestroySubTrees( pRoot );
237cdf0e10cSrcweir
238cdf0e10cSrcweir // Alle Klassen noch gueltig, jeweilige Instanzen freigeben
239cdf0e10cSrcweir // BasisTypen
240cdf0e10cSrcweir pRscTmp = aBaseLst.First();
241cdf0e10cSrcweir while( pRscTmp ){
242cdf0e10cSrcweir pRscTmp->Pre_dtor();
243cdf0e10cSrcweir pRscTmp = aBaseLst.Next();
244cdf0e10cSrcweir };
245cdf0e10cSrcweir aBool.Pre_dtor();
246cdf0e10cSrcweir aShort.Pre_dtor();
247cdf0e10cSrcweir aUShort.Pre_dtor();
248cdf0e10cSrcweir aIdUShort.Pre_dtor();
249cdf0e10cSrcweir aIdNoZeroUShort.Pre_dtor();
250cdf0e10cSrcweir aNoZeroShort.Pre_dtor();
251cdf0e10cSrcweir aIdLong.Pre_dtor();
252cdf0e10cSrcweir aString.Pre_dtor();
253cdf0e10cSrcweir aWinBits.Pre_dtor();
254cdf0e10cSrcweir aVersion.pClass->Pre_dtor();
255cdf0e10cSrcweir // Zusammengesetzte Typen
256cdf0e10cSrcweir Pre_dtorTree( pRoot );
257cdf0e10cSrcweir
258cdf0e10cSrcweir // Klassen zerstoeren
259cdf0e10cSrcweir delete aVersion.pClass;
260cdf0e10cSrcweir DestroyTree( pRoot );
261cdf0e10cSrcweir
262cdf0e10cSrcweir while( NULL != (pRscTmp = aBaseLst.Remove()) ){
263cdf0e10cSrcweir delete pRscTmp;
264cdf0e10cSrcweir };
265cdf0e10cSrcweir
266cdf0e10cSrcweir while( NULL != (pSysEntry = aSysLst.Remove()) ){
267cdf0e10cSrcweir delete pSysEntry;
268cdf0e10cSrcweir };
269cdf0e10cSrcweir }
270cdf0e10cSrcweir
ClearSysNames()271cdf0e10cSrcweir void RscTypCont::ClearSysNames()
272cdf0e10cSrcweir {
273cdf0e10cSrcweir RscSysEntry * pSysEntry;
274cdf0e10cSrcweir while( NULL != (pSysEntry = aSysLst.Remove()) ){
275cdf0e10cSrcweir delete pSysEntry;
276cdf0e10cSrcweir };
277cdf0e10cSrcweir }
278cdf0e10cSrcweir
279cdf0e10cSrcweir //=======================================================================
SearchType(Atom nId)280cdf0e10cSrcweir RscTop * RscTypCont::SearchType( Atom nId )
281cdf0e10cSrcweir /* [Beschreibung]
282cdf0e10cSrcweir
283cdf0e10cSrcweir Sucht eine Basistyp nId;
284cdf0e10cSrcweir */
285cdf0e10cSrcweir {
286cdf0e10cSrcweir if( nId == InvalidAtom )
287cdf0e10cSrcweir return NULL;
288cdf0e10cSrcweir
289cdf0e10cSrcweir #define ELSE_IF( a ) \
290cdf0e10cSrcweir else if( a.GetId() == nId ) \
291cdf0e10cSrcweir return &a; \
292cdf0e10cSrcweir
293cdf0e10cSrcweir if( aBool.GetId() == nId )
294cdf0e10cSrcweir return &aBool;
295cdf0e10cSrcweir ELSE_IF( aShort )
296cdf0e10cSrcweir ELSE_IF( aUShort )
297cdf0e10cSrcweir ELSE_IF( aLong )
298cdf0e10cSrcweir ELSE_IF( aEnumLong )
299cdf0e10cSrcweir ELSE_IF( aIdUShort )
300cdf0e10cSrcweir ELSE_IF( aIdNoZeroUShort )
301cdf0e10cSrcweir ELSE_IF( aNoZeroShort )
302cdf0e10cSrcweir ELSE_IF( a1to12Short )
303cdf0e10cSrcweir ELSE_IF( a0to23Short )
304cdf0e10cSrcweir ELSE_IF( a1to31Short )
305cdf0e10cSrcweir ELSE_IF( a0to59Short )
306cdf0e10cSrcweir ELSE_IF( a0to99Short )
307cdf0e10cSrcweir ELSE_IF( a0to9999Short )
308cdf0e10cSrcweir ELSE_IF( aIdLong )
309cdf0e10cSrcweir ELSE_IF( aString )
310cdf0e10cSrcweir ELSE_IF( aWinBits )
311cdf0e10cSrcweir ELSE_IF( aLangType )
312cdf0e10cSrcweir ELSE_IF( aLangString )
313cdf0e10cSrcweir ELSE_IF( aLangShort )
314cdf0e10cSrcweir
315cdf0e10cSrcweir RscTop * pEle = aBaseLst.First();
316cdf0e10cSrcweir while( pEle )
317cdf0e10cSrcweir {
318cdf0e10cSrcweir if( pEle->GetId() == nId )
319cdf0e10cSrcweir return pEle;
320cdf0e10cSrcweir pEle = aBaseLst.Next();
321cdf0e10cSrcweir }
322cdf0e10cSrcweir return NULL;
323cdf0e10cSrcweir }
324cdf0e10cSrcweir
325cdf0e10cSrcweir /*************************************************************************
326cdf0e10cSrcweir |*
327cdf0e10cSrcweir |* RscTypCont :: Search
328cdf0e10cSrcweir |*
329cdf0e10cSrcweir |* Beschreibung RES.DOC
330cdf0e10cSrcweir |* Ersterstellung MM 22.03.90
331cdf0e10cSrcweir |* Letzte Aenderung MM 27.06.90
332cdf0e10cSrcweir |*
333cdf0e10cSrcweir *************************************************************************/
Search(Atom nRT)334cdf0e10cSrcweir RscTop * RscTypCont :: Search( Atom nRT ){
335cdf0e10cSrcweir return( (RscTop *)pRoot->Search( nRT ) );
336cdf0e10cSrcweir }
337cdf0e10cSrcweir
Search(Atom nRT,const RscId & rId)338cdf0e10cSrcweir CLASS_DATA RscTypCont :: Search( Atom nRT, const RscId & rId ){
339cdf0e10cSrcweir ObjNode *pObjNode;
340cdf0e10cSrcweir RscTop *pRscTop;
341cdf0e10cSrcweir
342cdf0e10cSrcweir if( NULL != (pRscTop = Search( nRT )) ){
343cdf0e10cSrcweir if( NULL != (pObjNode = pRscTop->GetObjNode( rId )) ){
344cdf0e10cSrcweir return( pObjNode->GetRscObj() );
345cdf0e10cSrcweir }
346cdf0e10cSrcweir }
347cdf0e10cSrcweir return( (CLASS_DATA)0 );
348cdf0e10cSrcweir }
349cdf0e10cSrcweir
350cdf0e10cSrcweir /*************************************************************************
351cdf0e10cSrcweir |*
352cdf0e10cSrcweir |* RscTypCont :: Delete()
353cdf0e10cSrcweir |*
354cdf0e10cSrcweir |* Beschreibung
355cdf0e10cSrcweir |* Ersterstellung MM 10.07.91
356cdf0e10cSrcweir |* Letzte Aenderung MM 10.07.91
357cdf0e10cSrcweir |*
358cdf0e10cSrcweir *************************************************************************/
Delete(Atom nRT,const RscId & rId)359cdf0e10cSrcweir void RscTypCont :: Delete( Atom nRT, const RscId & rId ){
360cdf0e10cSrcweir ObjNode * pObjNode;
361cdf0e10cSrcweir RscTop * pRscTop;
362cdf0e10cSrcweir
363cdf0e10cSrcweir if( NULL != (pRscTop = Search( nRT )) ){
364cdf0e10cSrcweir if( NULL != (pObjNode = pRscTop->GetObjNode()) ){
365cdf0e10cSrcweir pObjNode = pObjNode->Search( rId );
366cdf0e10cSrcweir
367cdf0e10cSrcweir if( pObjNode ){
368cdf0e10cSrcweir //Objekt aus Baum entfernen
369cdf0e10cSrcweir pRscTop->pObjBiTree =
370cdf0e10cSrcweir (ObjNode *)pRscTop->pObjBiTree->Remove( pObjNode );
371cdf0e10cSrcweir
372cdf0e10cSrcweir if( pObjNode->GetRscObj() ){
373cdf0e10cSrcweir pRscTop->Destroy( RSCINST( pRscTop,
374cdf0e10cSrcweir pObjNode->GetRscObj() ) );
375cdf0e10cSrcweir rtl_freeMemory( pObjNode->GetRscObj() );
376cdf0e10cSrcweir }
377cdf0e10cSrcweir delete pObjNode;
378cdf0e10cSrcweir }
379cdf0e10cSrcweir }
380cdf0e10cSrcweir }
381cdf0e10cSrcweir }
382cdf0e10cSrcweir
383cdf0e10cSrcweir /*************************************************************************
384cdf0e10cSrcweir |*
385cdf0e10cSrcweir |* RscTypCont :: PutSysName()
386cdf0e10cSrcweir |*
387cdf0e10cSrcweir |* Beschreibung RES.DOC
388cdf0e10cSrcweir |* Ersterstellung MM 22.03.90
389cdf0e10cSrcweir |* Letzte Aenderung MM 27.06.90
390cdf0e10cSrcweir |*
391cdf0e10cSrcweir *************************************************************************/
PutSysName(sal_uInt32 nRscTyp,char * pFileName,sal_uInt32 nConst,sal_uInt32 nId,sal_Bool bFirst)392cdf0e10cSrcweir sal_uInt32 RscTypCont :: PutSysName( sal_uInt32 nRscTyp, char * pFileName,
393cdf0e10cSrcweir sal_uInt32 nConst, sal_uInt32 nId, sal_Bool bFirst )
394cdf0e10cSrcweir {
395cdf0e10cSrcweir RscSysEntry * pSysEntry;
396cdf0e10cSrcweir sal_Bool bId1 = sal_False;
397cdf0e10cSrcweir
398cdf0e10cSrcweir pSysEntry = aSysLst.First();
399cdf0e10cSrcweir while( pSysEntry )
400cdf0e10cSrcweir {
401cdf0e10cSrcweir if( pSysEntry->nKey == 1 )
402cdf0e10cSrcweir bId1 = sal_True;
403cdf0e10cSrcweir if( !strcmp( pSysEntry->aFileName.GetBuffer(), pFileName ) )
404cdf0e10cSrcweir if( pSysEntry->nRscTyp == nRscTyp
405cdf0e10cSrcweir && pSysEntry->nTyp == nConst
406cdf0e10cSrcweir && pSysEntry->nRefId == nId )
407cdf0e10cSrcweir break;
408cdf0e10cSrcweir pSysEntry = aSysLst.Next();
409cdf0e10cSrcweir }
410cdf0e10cSrcweir
411cdf0e10cSrcweir if ( !pSysEntry || (bFirst && !bId1) )
412cdf0e10cSrcweir {
413cdf0e10cSrcweir pSysEntry = new RscSysEntry;
414cdf0e10cSrcweir pSysEntry->nKey = nUniqueId++;
415cdf0e10cSrcweir pSysEntry->nRscTyp = nRscTyp;
416cdf0e10cSrcweir pSysEntry->nTyp = nConst;
417cdf0e10cSrcweir pSysEntry->nRefId = nId;
418cdf0e10cSrcweir pSysEntry->aFileName = (const char*)pFileName;
419cdf0e10cSrcweir if( bFirst && !bId1 )
420cdf0e10cSrcweir {
421cdf0e10cSrcweir pSysEntry->nKey = 1;
422cdf0e10cSrcweir aSysLst.Insert( pSysEntry, (sal_uLong)0 );
423cdf0e10cSrcweir }
424cdf0e10cSrcweir else
425cdf0e10cSrcweir aSysLst.Insert( pSysEntry, LIST_APPEND );
426cdf0e10cSrcweir }
427cdf0e10cSrcweir
428cdf0e10cSrcweir return pSysEntry->nKey;
429cdf0e10cSrcweir }
430cdf0e10cSrcweir
431cdf0e10cSrcweir /*************************************************************************
432cdf0e10cSrcweir |*
433cdf0e10cSrcweir |* RscTypCont :: WriteInc
434cdf0e10cSrcweir |*
435cdf0e10cSrcweir |* Beschreibung RES.DOC
436cdf0e10cSrcweir |* Ersterstellung MM 21.06.90
437cdf0e10cSrcweir |* Letzte Aenderung MM 21.06.90
438cdf0e10cSrcweir |*
439cdf0e10cSrcweir *************************************************************************/
WriteInc(FILE * fOutput,sal_uLong lFileKey)440cdf0e10cSrcweir void RscTypCont :: WriteInc( FILE * fOutput, sal_uLong lFileKey )
441cdf0e10cSrcweir {
442cdf0e10cSrcweir RscFile * pFName;
443cdf0e10cSrcweir
444cdf0e10cSrcweir if( NOFILE_INDEX == lFileKey )
445cdf0e10cSrcweir {
446cdf0e10cSrcweir pFName = aFileTab.First();
447cdf0e10cSrcweir while( pFName )
448cdf0e10cSrcweir {
449cdf0e10cSrcweir if( pFName && pFName->IsIncFile() )
450cdf0e10cSrcweir {
451cdf0e10cSrcweir fprintf( fOutput, "#include " );
452cdf0e10cSrcweir fprintf( fOutput, "\"%s\"\n",
453cdf0e10cSrcweir pFName->aFileName.GetBuffer() );
454cdf0e10cSrcweir }
455cdf0e10cSrcweir pFName = aFileTab.Next();
456cdf0e10cSrcweir }
457cdf0e10cSrcweir }
458cdf0e10cSrcweir else
459cdf0e10cSrcweir {
460cdf0e10cSrcweir RscDepend * pDep;
461cdf0e10cSrcweir RscFile * pFile;
462cdf0e10cSrcweir
463cdf0e10cSrcweir pFName = aFileTab.Get( lFileKey );
464cdf0e10cSrcweir if( pFName )
465cdf0e10cSrcweir {
466cdf0e10cSrcweir pDep = pFName->First();
467cdf0e10cSrcweir while( pDep )
468cdf0e10cSrcweir {
469cdf0e10cSrcweir if( pDep->GetFileKey() != lFileKey )
470cdf0e10cSrcweir {
471cdf0e10cSrcweir pFile = aFileTab.GetFile( pDep->GetFileKey() );
472cdf0e10cSrcweir if( pFile )
473cdf0e10cSrcweir {
474cdf0e10cSrcweir fprintf( fOutput, "#include " );
475cdf0e10cSrcweir fprintf( fOutput, "\"%s\"\n",
476cdf0e10cSrcweir pFile->aFileName.GetBuffer() );
477cdf0e10cSrcweir }
478cdf0e10cSrcweir }
479cdf0e10cSrcweir pDep = pFName->Next();
480cdf0e10cSrcweir };
481cdf0e10cSrcweir };
482cdf0e10cSrcweir };
483cdf0e10cSrcweir }
484cdf0e10cSrcweir
485cdf0e10cSrcweir /*************************************************************************
486cdf0e10cSrcweir |*
487cdf0e10cSrcweir |* RscTypCont :: Methoden die ueber all Knoten laufen
488cdf0e10cSrcweir |*
489cdf0e10cSrcweir |* Beschreibung RES.DOC
490cdf0e10cSrcweir |* Ersterstellung MM 22.03.90
491cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
492cdf0e10cSrcweir |*
493cdf0e10cSrcweir *************************************************************************/
494cdf0e10cSrcweir
495cdf0e10cSrcweir class RscEnumerateObj
496cdf0e10cSrcweir {
497cdf0e10cSrcweir friend class RscEnumerateRef;
498cdf0e10cSrcweir private:
499cdf0e10cSrcweir ERRTYPE aError; // Enthaelt den ersten Fehler
500cdf0e10cSrcweir RscTypCont* pTypCont;
501cdf0e10cSrcweir FILE * fOutput; // AusgabeDatei
502cdf0e10cSrcweir sal_uLong lFileKey; // Welche src-Datei
503cdf0e10cSrcweir RscTop * pClass;
504cdf0e10cSrcweir
505cdf0e10cSrcweir DECL_LINK( CallBackWriteRc, ObjNode * );
506cdf0e10cSrcweir DECL_LINK( CallBackWriteSrc, ObjNode * );
507cdf0e10cSrcweir DECL_LINK( CallBackWriteCxx, ObjNode * );
508cdf0e10cSrcweir DECL_LINK( CallBackWriteHxx, ObjNode * );
509cdf0e10cSrcweir
WriteRc(RscTop * pCl,ObjNode * pRoot)510cdf0e10cSrcweir ERRTYPE WriteRc( RscTop * pCl, ObjNode * pRoot )
511cdf0e10cSrcweir {
512cdf0e10cSrcweir pClass = pCl;
513cdf0e10cSrcweir if( pRoot )
514cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteRc ) );
515cdf0e10cSrcweir return aError;
516cdf0e10cSrcweir }
WriteSrc(RscTop * pCl,ObjNode * pRoot)517cdf0e10cSrcweir ERRTYPE WriteSrc( RscTop * pCl, ObjNode * pRoot ){
518cdf0e10cSrcweir pClass = pCl;
519cdf0e10cSrcweir if( pRoot )
520cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteSrc ) );
521cdf0e10cSrcweir return aError;
522cdf0e10cSrcweir }
WriteCxx(RscTop * pCl,ObjNode * pRoot)523cdf0e10cSrcweir ERRTYPE WriteCxx( RscTop * pCl, ObjNode * pRoot ){
524cdf0e10cSrcweir pClass = pCl;
525cdf0e10cSrcweir if( pRoot )
526cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteCxx ) );
527cdf0e10cSrcweir return aError;
528cdf0e10cSrcweir }
WriteHxx(RscTop * pCl,ObjNode * pRoot)529cdf0e10cSrcweir ERRTYPE WriteHxx( RscTop * pCl, ObjNode * pRoot ){
530cdf0e10cSrcweir pClass = pCl;
531cdf0e10cSrcweir if( pRoot )
532cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateObj, CallBackWriteHxx ) );
533cdf0e10cSrcweir return aError;
534cdf0e10cSrcweir }
535cdf0e10cSrcweir public:
536cdf0e10cSrcweir void WriteRcFile( RscWriteRc & rMem, FILE * fOutput );
537cdf0e10cSrcweir };
538cdf0e10cSrcweir
539cdf0e10cSrcweir /*************************************************************************
540cdf0e10cSrcweir |*
541cdf0e10cSrcweir |* RscEnumerateObj :: CallBackWriteRc
542cdf0e10cSrcweir |*
543cdf0e10cSrcweir |* Beschreibung
544cdf0e10cSrcweir |* Ersterstellung MM 09.12.91
545cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
546cdf0e10cSrcweir |*
547cdf0e10cSrcweir *************************************************************************/
IMPL_LINK(RscEnumerateObj,CallBackWriteRc,ObjNode *,pObjNode)548cdf0e10cSrcweir IMPL_LINK( RscEnumerateObj, CallBackWriteRc, ObjNode *, pObjNode )
549cdf0e10cSrcweir {
550cdf0e10cSrcweir RscWriteRc aMem( pTypCont->GetByteOrder() );
551cdf0e10cSrcweir
552cdf0e10cSrcweir aError = pClass->WriteRcHeader( RSCINST( pClass, pObjNode->GetRscObj() ),
553cdf0e10cSrcweir aMem, pTypCont,
554cdf0e10cSrcweir pObjNode->GetRscId(), 0, sal_True );
555cdf0e10cSrcweir if( aError.IsError() || aError.IsWarning() )
556cdf0e10cSrcweir pTypCont->pEH->Error( aError, pClass, pObjNode->GetRscId() );
557cdf0e10cSrcweir
558cdf0e10cSrcweir WriteRcFile( aMem, fOutput );
559cdf0e10cSrcweir return 0;
560cdf0e10cSrcweir }
561cdf0e10cSrcweir
562cdf0e10cSrcweir /*************************************************************************
563cdf0e10cSrcweir |*
564cdf0e10cSrcweir |* RscEnumerateObj :: CallBackWriteSrc
565cdf0e10cSrcweir |*
566cdf0e10cSrcweir |* Beschreibung
567cdf0e10cSrcweir |* Ersterstellung MM 09.12.91
568cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
569cdf0e10cSrcweir |*
570cdf0e10cSrcweir *************************************************************************/
IMPL_LINK_INLINE_START(RscEnumerateObj,CallBackWriteSrc,ObjNode *,pObjNode)571cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateObj, CallBackWriteSrc, ObjNode *, pObjNode )
572cdf0e10cSrcweir {
573cdf0e10cSrcweir if( pObjNode->GetFileKey() == lFileKey ){
574cdf0e10cSrcweir pClass->WriteSrcHeader( RSCINST( pClass, pObjNode->GetRscObj() ),
575cdf0e10cSrcweir fOutput, pTypCont, 0,
576cdf0e10cSrcweir pObjNode->GetRscId(), "" );
577cdf0e10cSrcweir fprintf( fOutput, ";\n" );
578cdf0e10cSrcweir }
579cdf0e10cSrcweir return 0;
580cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateObj,CallBackWriteSrc,ObjNode *,pObjNode)581cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateObj, CallBackWriteSrc, ObjNode *, pObjNode )
582cdf0e10cSrcweir
583cdf0e10cSrcweir /*************************************************************************
584cdf0e10cSrcweir |*
585cdf0e10cSrcweir |* RscEnumerateObj :: CallBackWriteCxx
586cdf0e10cSrcweir |*
587cdf0e10cSrcweir |* Beschreibung
588cdf0e10cSrcweir |* Ersterstellung MM 09.12.91
589cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
590cdf0e10cSrcweir |*
591cdf0e10cSrcweir *************************************************************************/
592cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateObj, CallBackWriteCxx, ObjNode *, pObjNode )
593cdf0e10cSrcweir {
594cdf0e10cSrcweir if( pClass->IsCodeWriteable() && pObjNode->GetFileKey() == lFileKey )
595cdf0e10cSrcweir aError = pClass->WriteCxxHeader(
596cdf0e10cSrcweir RSCINST( pClass, pObjNode->GetRscObj() ),
597cdf0e10cSrcweir fOutput, pTypCont, pObjNode->GetRscId() );
598cdf0e10cSrcweir return 0;
599cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateObj,CallBackWriteCxx,ObjNode *,pObjNode)600cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateObj, CallBackWriteCxx, ObjNode *, pObjNode )
601cdf0e10cSrcweir
602cdf0e10cSrcweir /*************************************************************************
603cdf0e10cSrcweir |*
604cdf0e10cSrcweir |* RscEnumerateObj :: CallBackWriteHxx
605cdf0e10cSrcweir |*
606cdf0e10cSrcweir |* Beschreibung
607cdf0e10cSrcweir |* Ersterstellung MM 09.12.91
608cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
609cdf0e10cSrcweir |*
610cdf0e10cSrcweir *************************************************************************/
611cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateObj, CallBackWriteHxx, ObjNode *, pObjNode )
612cdf0e10cSrcweir {
613cdf0e10cSrcweir if( pClass->IsCodeWriteable() && pObjNode->GetFileKey() == lFileKey )
614cdf0e10cSrcweir aError = pClass->WriteHxxHeader(
615cdf0e10cSrcweir RSCINST( pClass, pObjNode->GetRscObj() ),
616cdf0e10cSrcweir fOutput, pTypCont, pObjNode->GetRscId() );
617cdf0e10cSrcweir return 0;
618cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateObj,CallBackWriteHxx,ObjNode *,pObjNode)619cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateObj, CallBackWriteHxx, ObjNode *, pObjNode )
620cdf0e10cSrcweir
621cdf0e10cSrcweir /*************************************************************************
622cdf0e10cSrcweir |*
623cdf0e10cSrcweir |* RscEnumerateObj :: WriteRcFile
624cdf0e10cSrcweir |*
625cdf0e10cSrcweir |* Beschreibung
626cdf0e10cSrcweir |* Ersterstellung MM 09.12.91
627cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
628cdf0e10cSrcweir |*
629cdf0e10cSrcweir *************************************************************************/
630cdf0e10cSrcweir void RscEnumerateObj :: WriteRcFile( RscWriteRc & rMem, FILE * fOut ){
631cdf0e10cSrcweir // Definition der Struktur, aus denen die Resource aufgebaut ist
632cdf0e10cSrcweir /*
633cdf0e10cSrcweir struct RSHEADER_TYPE{
634cdf0e10cSrcweir sal_uInt32 nId; // Identifier der Resource
635cdf0e10cSrcweir sal_uInt32 nRT; // Resource Typ
636cdf0e10cSrcweir sal_uInt32 nGlobOff; // Globaler Offset
637cdf0e10cSrcweir sal_uInt32 nLocalOff; // Lokaler Offset
638cdf0e10cSrcweir } aHeader;
639cdf0e10cSrcweir */
640cdf0e10cSrcweir
641cdf0e10cSrcweir sal_uInt32 nId = rMem.GetLong( 0 );
642cdf0e10cSrcweir sal_uInt32 nRT = rMem.GetLong( 4 );
643cdf0e10cSrcweir
644cdf0e10cSrcweir // Tabelle wird entsprechend gefuellt
645cdf0e10cSrcweir pTypCont->PutTranslatorKey( (sal_uInt64(nRT) << 32) + sal_uInt64(nId) );
646cdf0e10cSrcweir
647cdf0e10cSrcweir if( nRT == RSC_VERSIONCONTROL )
648cdf0e10cSrcweir { // kommt immmer als letztes
649cdf0e10cSrcweir sal_Int32 nCount = pTypCont->aIdTranslator.size();
650cdf0e10cSrcweir // groesse der Tabelle
651cdf0e10cSrcweir sal_uInt32 nSize = (nCount * (sizeof(sal_uInt64)+sizeof(sal_Int32))) + sizeof(sal_Int32);
652cdf0e10cSrcweir
653cdf0e10cSrcweir rMem.Put( nCount ); //Anzahl speichern
654cdf0e10cSrcweir for( std::map< sal_uInt64, sal_uLong >::const_iterator it =
655cdf0e10cSrcweir pTypCont->aIdTranslator.begin(); it != pTypCont->aIdTranslator.end(); ++it )
656cdf0e10cSrcweir {
657cdf0e10cSrcweir // Schluessel schreiben
658cdf0e10cSrcweir rMem.Put( it->first );
659cdf0e10cSrcweir // Objekt Id oder Position schreiben
660cdf0e10cSrcweir rMem.Put( (sal_Int32)it->second );
661cdf0e10cSrcweir }
662cdf0e10cSrcweir rMem.Put( nSize ); // Groesse hinten Speichern
663cdf0e10cSrcweir }
664cdf0e10cSrcweir
665cdf0e10cSrcweir //Dateioffset neu setzen
666cdf0e10cSrcweir pTypCont->IncFilePos( rMem.Size() );
667cdf0e10cSrcweir
668cdf0e10cSrcweir
669cdf0e10cSrcweir //Position wurde vorher in Tabelle geschrieben
670cdf0e10cSrcweir fwrite( rMem.GetBuffer(), rMem.Size(), 1, fOut );
671cdf0e10cSrcweir
672cdf0e10cSrcweir };
673cdf0e10cSrcweir
674cdf0e10cSrcweir class RscEnumerateRef
675cdf0e10cSrcweir {
676cdf0e10cSrcweir private:
677cdf0e10cSrcweir RscTop * pRoot;
678cdf0e10cSrcweir
679cdf0e10cSrcweir DECL_LINK( CallBackWriteRc, RscTop * );
680cdf0e10cSrcweir DECL_LINK( CallBackWriteSrc, RscTop * );
681cdf0e10cSrcweir DECL_LINK( CallBackWriteCxx, RscTop * );
682cdf0e10cSrcweir DECL_LINK( CallBackWriteHxx, RscTop * );
683cdf0e10cSrcweir DECL_LINK( CallBackWriteSyntax, RscTop * );
684cdf0e10cSrcweir DECL_LINK( CallBackWriteRcCtor, RscTop * );
685cdf0e10cSrcweir public:
686cdf0e10cSrcweir RscEnumerateObj aEnumObj;
687cdf0e10cSrcweir
RscEnumerateRef(RscTypCont * pTC,RscTop * pR,FILE * fOutput)688cdf0e10cSrcweir RscEnumerateRef( RscTypCont * pTC, RscTop * pR,
689cdf0e10cSrcweir FILE * fOutput )
690cdf0e10cSrcweir {
691cdf0e10cSrcweir aEnumObj.pTypCont = pTC;
692cdf0e10cSrcweir aEnumObj.fOutput = fOutput;
693cdf0e10cSrcweir pRoot = pR;
694cdf0e10cSrcweir }
WriteRc()695cdf0e10cSrcweir ERRTYPE WriteRc()
696cdf0e10cSrcweir {
697cdf0e10cSrcweir aEnumObj.aError.Clear();
698cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteRc ) );
699cdf0e10cSrcweir return aEnumObj.aError;
700cdf0e10cSrcweir };
701cdf0e10cSrcweir
WriteSrc(sal_uLong lFileKey)702cdf0e10cSrcweir ERRTYPE WriteSrc( sal_uLong lFileKey )
703cdf0e10cSrcweir {
704cdf0e10cSrcweir aEnumObj.lFileKey = lFileKey;
705cdf0e10cSrcweir
706cdf0e10cSrcweir aEnumObj.aError.Clear();
707cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteSrc ) );
708cdf0e10cSrcweir return aEnumObj.aError;
709cdf0e10cSrcweir }
710cdf0e10cSrcweir
WriteCxx(sal_uLong lFileKey)711cdf0e10cSrcweir ERRTYPE WriteCxx( sal_uLong lFileKey )
712cdf0e10cSrcweir {
713cdf0e10cSrcweir aEnumObj.lFileKey = lFileKey;
714cdf0e10cSrcweir
715cdf0e10cSrcweir aEnumObj.aError.Clear();
716cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteCxx ) );
717cdf0e10cSrcweir return aEnumObj.aError;
718cdf0e10cSrcweir }
719cdf0e10cSrcweir
WriteHxx(sal_uLong lFileKey)720cdf0e10cSrcweir ERRTYPE WriteHxx( sal_uLong lFileKey )
721cdf0e10cSrcweir {
722cdf0e10cSrcweir aEnumObj.lFileKey = lFileKey;
723cdf0e10cSrcweir
724cdf0e10cSrcweir aEnumObj.aError.Clear();
725cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateRef, CallBackWriteHxx ) );
726cdf0e10cSrcweir return aEnumObj.aError;
727cdf0e10cSrcweir }
728cdf0e10cSrcweir
WriteSyntax()729cdf0e10cSrcweir void WriteSyntax()
730cdf0e10cSrcweir {
731cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateRef,
732cdf0e10cSrcweir CallBackWriteSyntax ) );
733cdf0e10cSrcweir }
734cdf0e10cSrcweir
WriteRcCtor()735cdf0e10cSrcweir void WriteRcCtor()
736cdf0e10cSrcweir {
737cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscEnumerateRef,
738cdf0e10cSrcweir CallBackWriteRcCtor ) );
739cdf0e10cSrcweir }
740cdf0e10cSrcweir };
741cdf0e10cSrcweir
742cdf0e10cSrcweir /*************************************************************************
743cdf0e10cSrcweir |*
744cdf0e10cSrcweir |* RscRscEnumerateRef :: CallBack...
745cdf0e10cSrcweir |*
746cdf0e10cSrcweir |* Beschreibung
747cdf0e10cSrcweir |* Ersterstellung MM 09.12.91
748cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
749cdf0e10cSrcweir |*
750cdf0e10cSrcweir *************************************************************************/
IMPL_LINK_INLINE_START(RscEnumerateRef,CallBackWriteRc,RscTop *,pRef)751cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteRc, RscTop *, pRef )
752cdf0e10cSrcweir {
753cdf0e10cSrcweir aEnumObj.WriteRc( pRef, pRef->GetObjNode() );
754cdf0e10cSrcweir return 0;
755cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateRef,CallBackWriteRc,RscTop *,pRef)756cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteRc, RscTop *, pRef )
757cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteSrc, RscTop *, pRef )
758cdf0e10cSrcweir {
759cdf0e10cSrcweir aEnumObj.WriteSrc( pRef, pRef->GetObjNode() );
760cdf0e10cSrcweir return 0;
761cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateRef,CallBackWriteSrc,RscTop *,pRef)762cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteSrc, RscTop *, pRef )
763cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteCxx, RscTop *, pRef )
764cdf0e10cSrcweir {
765cdf0e10cSrcweir if( pRef->IsCodeWriteable() )
766cdf0e10cSrcweir aEnumObj.WriteCxx( pRef, pRef->GetObjNode() );
767cdf0e10cSrcweir return 0;
768cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateRef,CallBackWriteCxx,RscTop *,pRef)769cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteCxx, RscTop *, pRef )
770cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteHxx, RscTop *, pRef )
771cdf0e10cSrcweir {
772cdf0e10cSrcweir if( pRef->IsCodeWriteable() )
773cdf0e10cSrcweir aEnumObj.WriteHxx( pRef, pRef->GetObjNode() );
774cdf0e10cSrcweir return 0;
775cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateRef,CallBackWriteHxx,RscTop *,pRef)776cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteHxx, RscTop *, pRef )
777cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteSyntax, RscTop *, pRef )
778cdf0e10cSrcweir {
779cdf0e10cSrcweir pRef->WriteSyntaxHeader( aEnumObj.fOutput, aEnumObj.pTypCont );
780cdf0e10cSrcweir return 0;
781cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateRef,CallBackWriteSyntax,RscTop *,pRef)782cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteSyntax, RscTop *, pRef )
783cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscEnumerateRef, CallBackWriteRcCtor, RscTop *, pRef )
784cdf0e10cSrcweir {
785cdf0e10cSrcweir pRef->WriteRcCtor( aEnumObj.fOutput, aEnumObj.pTypCont );
786cdf0e10cSrcweir return 0;
787cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscEnumerateRef,CallBackWriteRcCtor,RscTop *,pRef)788cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscEnumerateRef, CallBackWriteRcCtor, RscTop *, pRef )
789cdf0e10cSrcweir
790cdf0e10cSrcweir /*************************************************************************
791cdf0e10cSrcweir |*
792cdf0e10cSrcweir |* RscTypCont :: WriteRc
793cdf0e10cSrcweir |*
794cdf0e10cSrcweir |* Beschreibung RES.DOC
795cdf0e10cSrcweir |* Ersterstellung MM 22.03.90
796cdf0e10cSrcweir |* Letzte Aenderung MM 22.07.91
797cdf0e10cSrcweir |*
798cdf0e10cSrcweir *************************************************************************/
799cdf0e10cSrcweir
800cdf0e10cSrcweir ERRTYPE RscTypCont::WriteRc( WriteRcContext& rContext )
801cdf0e10cSrcweir {
802cdf0e10cSrcweir ERRTYPE aError;
803cdf0e10cSrcweir RscEnumerateRef aEnumRef( this, pRoot, rContext.fOutput );
804cdf0e10cSrcweir
805cdf0e10cSrcweir aIdTranslator.clear();
806cdf0e10cSrcweir nFilePos = 0;
807cdf0e10cSrcweir nPMId = RSCVERSION_ID +1; //mindestens einen groesser
808cdf0e10cSrcweir
809cdf0e10cSrcweir aError = aEnumRef.WriteRc();
810cdf0e10cSrcweir
811cdf0e10cSrcweir // version control
812cdf0e10cSrcweir RscWriteRc aMem( nByteOrder );
813cdf0e10cSrcweir aVersion.pClass->WriteRcHeader( aVersion, aMem, this, RscId( RSCVERSION_ID ), 0, sal_True );
814cdf0e10cSrcweir aEnumRef.aEnumObj.WriteRcFile( aMem, rContext.fOutput );
815cdf0e10cSrcweir
816cdf0e10cSrcweir return aError;
817cdf0e10cSrcweir }
818cdf0e10cSrcweir
819cdf0e10cSrcweir /*************************************************************************
820cdf0e10cSrcweir |*
821cdf0e10cSrcweir |* RscTypCont :: WriteSrc
822cdf0e10cSrcweir |*
823cdf0e10cSrcweir |* Beschreibung RES.DOC
824cdf0e10cSrcweir |* Ersterstellung MM 22.03.90
825cdf0e10cSrcweir |* Letzte Aenderung MM 27.06.90
826cdf0e10cSrcweir |*
827cdf0e10cSrcweir *************************************************************************/
WriteSrc(FILE * fOutput,sal_uLong nFileKey,CharSet,sal_Bool bName)828cdf0e10cSrcweir void RscTypCont :: WriteSrc( FILE * fOutput, sal_uLong nFileKey,
829cdf0e10cSrcweir CharSet /*nCharSet*/, sal_Bool bName )
830cdf0e10cSrcweir {
831cdf0e10cSrcweir RscFile * pFName;
832cdf0e10cSrcweir RscEnumerateRef aEnumRef( this, pRoot, fOutput );
833cdf0e10cSrcweir
834cdf0e10cSrcweir unsigned char aUTF8BOM[3] = { 0xef, 0xbb, 0xbf };
835cdf0e10cSrcweir fwrite( aUTF8BOM, sizeof(unsigned char), sizeof(aUTF8BOM)/sizeof(aUTF8BOM[0]), fOutput );
836cdf0e10cSrcweir if( bName )
837cdf0e10cSrcweir {
838cdf0e10cSrcweir WriteInc( fOutput, nFileKey );
839cdf0e10cSrcweir
840cdf0e10cSrcweir if( NOFILE_INDEX == nFileKey )
841cdf0e10cSrcweir {
842cdf0e10cSrcweir pFName = aFileTab.First();
843cdf0e10cSrcweir while( pFName ){
844cdf0e10cSrcweir if( !pFName->IsIncFile() )
845cdf0e10cSrcweir pFName->aDefLst.WriteAll( fOutput );
846cdf0e10cSrcweir aEnumRef.WriteSrc( aFileTab.GetIndex( pFName ) );
847cdf0e10cSrcweir pFName = aFileTab.Next();
848cdf0e10cSrcweir };
849cdf0e10cSrcweir }
850cdf0e10cSrcweir else
851cdf0e10cSrcweir {
852cdf0e10cSrcweir pFName = aFileTab.Get( nFileKey );
853cdf0e10cSrcweir if( pFName ){
854cdf0e10cSrcweir pFName->aDefLst.WriteAll( fOutput );
855cdf0e10cSrcweir aEnumRef.WriteSrc( nFileKey );
856cdf0e10cSrcweir }
857cdf0e10cSrcweir }
858cdf0e10cSrcweir }
859cdf0e10cSrcweir else
860cdf0e10cSrcweir {
861cdf0e10cSrcweir RscId::SetNames( sal_False );
862cdf0e10cSrcweir if( NOFILE_INDEX == nFileKey )
863cdf0e10cSrcweir {
864cdf0e10cSrcweir pFName = aFileTab.First();
865cdf0e10cSrcweir while( pFName )
866cdf0e10cSrcweir {
867cdf0e10cSrcweir aEnumRef.WriteSrc( aFileTab.GetIndex( pFName ) );
868cdf0e10cSrcweir pFName = aFileTab.Next();
869cdf0e10cSrcweir };
870cdf0e10cSrcweir }
871cdf0e10cSrcweir else
872cdf0e10cSrcweir aEnumRef.WriteSrc( nFileKey );
873cdf0e10cSrcweir RscId::SetNames();
874cdf0e10cSrcweir };
875cdf0e10cSrcweir }
876cdf0e10cSrcweir
877cdf0e10cSrcweir /*************************************************************************
878cdf0e10cSrcweir |*
879cdf0e10cSrcweir |* RscTypCont :: WriteHxx
880cdf0e10cSrcweir |*
881cdf0e10cSrcweir |* Beschreibung
882cdf0e10cSrcweir |* Ersterstellung MM 30.05.91
883cdf0e10cSrcweir |* Letzte Aenderung MM 30.05.91
884cdf0e10cSrcweir |*
885cdf0e10cSrcweir *************************************************************************/
WriteHxx(FILE * fOutput,sal_uLong nFileKey)886cdf0e10cSrcweir ERRTYPE RscTypCont :: WriteHxx( FILE * fOutput, sal_uLong nFileKey )
887cdf0e10cSrcweir {
888cdf0e10cSrcweir fprintf( fOutput, "#include <tools/rc.hxx>\n" );
889cdf0e10cSrcweir fprintf( fOutput, "#include <tools/resid.hxx>\n" );
890cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/accel.hxx>\n" );
891cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/bitmap.hxx>\n" );
892cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/button.hxx>\n" );
893cdf0e10cSrcweir fprintf( fOutput, "#include <tools/color.hxx>\n" );
894cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/combobox.hxx>\n" );
895cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/ctrl.hxx>\n" );
896cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/dialog.hxx>\n" );
897cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/edit.hxx>\n" );
898cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/field.hxx>\n" );
899cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/fixed.hxx>\n" );
900cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/group.hxx>\n" );
901cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/image.hxx>\n" );
902cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/button.hxx>\n" );
903cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/keycod.hxx>\n" );
904cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/lstbox.hxx>\n" );
905cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/mapmod.hxx>\n" );
906cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/menu.hxx>\n" );
907cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/menubtn.hxx>\n" );
908cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/morebtn.hxx>\n" );
909cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/msgbox.hxx>\n" );
910cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/scrbar.hxx>\n" );
911cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/spin.hxx>\n" );
912cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/spinfld.hxx>\n" );
913cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/splitwin.hxx>\n" );
914cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/status.hxx>\n" );
915cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/tabctrl.hxx>\n" );
916cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/tabdlg.hxx>\n" );
917cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/tabpage.hxx>\n" );
918cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/toolbox.hxx>\n" );
919cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/window.hxx>\n" );
920cdf0e10cSrcweir fprintf( fOutput, "#include <vcl/wrkwin.hxx>\n" );
921cdf0e10cSrcweir fprintf( fOutput, "#include <svtools/svmedit.hxx>\n" );
922cdf0e10cSrcweir
923cdf0e10cSrcweir RscEnumerateRef aEnumRef( this, pRoot, fOutput );
924cdf0e10cSrcweir ERRTYPE aError;
925cdf0e10cSrcweir
926cdf0e10cSrcweir if( NOFILE_INDEX == nFileKey )
927cdf0e10cSrcweir {
928cdf0e10cSrcweir RscFile * pFName;
929cdf0e10cSrcweir
930cdf0e10cSrcweir pFName = aFileTab.First();
931cdf0e10cSrcweir while( pFName )
932cdf0e10cSrcweir {
933cdf0e10cSrcweir aError = aEnumRef.WriteHxx( aFileTab.GetIndex( pFName ) );
934cdf0e10cSrcweir pFName = aFileTab.Next();
935cdf0e10cSrcweir };
936cdf0e10cSrcweir }
937cdf0e10cSrcweir else
938cdf0e10cSrcweir aError = aEnumRef.WriteHxx( nFileKey );
939cdf0e10cSrcweir
940cdf0e10cSrcweir return aError;
941cdf0e10cSrcweir }
942cdf0e10cSrcweir
943cdf0e10cSrcweir /*************************************************************************
944cdf0e10cSrcweir |*
945cdf0e10cSrcweir |* RscTypCont :: WriteCxx
946cdf0e10cSrcweir |*
947cdf0e10cSrcweir |* Beschreibung
948cdf0e10cSrcweir |* Ersterstellung MM 30.05.91
949cdf0e10cSrcweir |* Letzte Aenderung MM 30.05.91
950cdf0e10cSrcweir |*
951cdf0e10cSrcweir *************************************************************************/
WriteCxx(FILE * fOutput,sal_uLong nFileKey,const ByteString & rHxxName)952cdf0e10cSrcweir ERRTYPE RscTypCont::WriteCxx( FILE * fOutput, sal_uLong nFileKey,
953cdf0e10cSrcweir const ByteString & rHxxName )
954cdf0e10cSrcweir {
955cdf0e10cSrcweir RscEnumerateRef aEnumRef( this, pRoot, fOutput );
956cdf0e10cSrcweir ERRTYPE aError;
957cdf0e10cSrcweir fprintf( fOutput, "#include <string.h>\n" );
958cdf0e10cSrcweir WriteInc( fOutput, nFileKey );
959cdf0e10cSrcweir if( rHxxName.Len() )
960cdf0e10cSrcweir fprintf( fOutput, "#include \"%s\"\n", rHxxName.GetBuffer() );
961cdf0e10cSrcweir fprintf( fOutput, "\n\n" );
962cdf0e10cSrcweir
963cdf0e10cSrcweir if( NOFILE_INDEX == nFileKey )
964cdf0e10cSrcweir {
965cdf0e10cSrcweir RscFile * pFName;
966cdf0e10cSrcweir
967cdf0e10cSrcweir pFName = aFileTab.First();
968cdf0e10cSrcweir while( pFName )
969cdf0e10cSrcweir {
970cdf0e10cSrcweir aError = aEnumRef.WriteCxx( aFileTab.GetIndex( pFName ) );
971cdf0e10cSrcweir pFName = aFileTab.Next();
972cdf0e10cSrcweir };
973cdf0e10cSrcweir }
974cdf0e10cSrcweir else
975cdf0e10cSrcweir aError = aEnumRef.WriteCxx( nFileKey );
976cdf0e10cSrcweir
977cdf0e10cSrcweir return aError;
978cdf0e10cSrcweir }
979cdf0e10cSrcweir
980cdf0e10cSrcweir /*************************************************************************
981cdf0e10cSrcweir |*
982cdf0e10cSrcweir |* RscTypCont :: WriteSyntax
983cdf0e10cSrcweir |*
984cdf0e10cSrcweir |* Beschreibung
985cdf0e10cSrcweir |* Ersterstellung MM 30.05.91
986cdf0e10cSrcweir |* Letzte Aenderung MM 30.05.91
987cdf0e10cSrcweir |*
988cdf0e10cSrcweir *************************************************************************/
WriteSyntax(FILE * fOutput)989cdf0e10cSrcweir void RscTypCont::WriteSyntax( FILE * fOutput )
990cdf0e10cSrcweir {
991cdf0e10cSrcweir for( sal_uInt32 i = 0; i < aBaseLst.Count(); i++ )
992cdf0e10cSrcweir aBaseLst.GetObject( i )->WriteSyntaxHeader( fOutput, this );
993cdf0e10cSrcweir RscEnumerateRef aEnumRef( this, pRoot, fOutput );
994cdf0e10cSrcweir aEnumRef.WriteSyntax();
995cdf0e10cSrcweir }
996cdf0e10cSrcweir
997cdf0e10cSrcweir //=======================================================================
WriteRcCtor(FILE * fOutput)998cdf0e10cSrcweir void RscTypCont::WriteRcCtor
999cdf0e10cSrcweir (
1000cdf0e10cSrcweir FILE * fOutput
1001cdf0e10cSrcweir )
1002cdf0e10cSrcweir {
1003cdf0e10cSrcweir RscEnumerateRef aEnumRef( this, pRoot, fOutput );
1004cdf0e10cSrcweir aEnumRef.WriteRcCtor();
1005cdf0e10cSrcweir }
1006cdf0e10cSrcweir
1007cdf0e10cSrcweir /*************************************************************************
1008cdf0e10cSrcweir |*
1009cdf0e10cSrcweir |* RscTypCont :: Delete()
1010cdf0e10cSrcweir |*
1011cdf0e10cSrcweir |* Beschreibung
1012cdf0e10cSrcweir |* Ersterstellung MM 09.12.91
1013cdf0e10cSrcweir |* Letzte Aenderung MM 09.12.91
1014cdf0e10cSrcweir |*
1015cdf0e10cSrcweir *************************************************************************/
1016cdf0e10cSrcweir class RscDel
1017cdf0e10cSrcweir {
1018cdf0e10cSrcweir sal_uLong lFileKey;
1019cdf0e10cSrcweir DECL_LINK( Delete, RscTop * );
1020cdf0e10cSrcweir public:
1021cdf0e10cSrcweir RscDel( RscTop * pRoot, sal_uLong lKey );
1022cdf0e10cSrcweir };
1023cdf0e10cSrcweir
1024cdf0e10cSrcweir
RscDel(RscTop * pRoot,sal_uLong lKey)1025cdf0e10cSrcweir inline RscDel::RscDel( RscTop * pRoot, sal_uLong lKey )
1026cdf0e10cSrcweir {
1027cdf0e10cSrcweir lFileKey = lKey;
1028cdf0e10cSrcweir pRoot->EnumNodes( LINK( this, RscDel, Delete ) );
1029cdf0e10cSrcweir }
1030cdf0e10cSrcweir
IMPL_LINK_INLINE_START(RscDel,Delete,RscTop *,pNode)1031cdf0e10cSrcweir IMPL_LINK_INLINE_START( RscDel, Delete, RscTop *, pNode )
1032cdf0e10cSrcweir {
1033cdf0e10cSrcweir if( pNode->GetObjNode() )
1034cdf0e10cSrcweir pNode->pObjBiTree = pNode->GetObjNode()->DelObjNode( pNode, lFileKey );
1035cdf0e10cSrcweir return 0;
1036cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(RscDel,Delete,RscTop *,pNode)1037cdf0e10cSrcweir IMPL_LINK_INLINE_END( RscDel, Delete, RscTop *, pNode )
1038cdf0e10cSrcweir
1039cdf0e10cSrcweir void RscTypCont :: Delete( sal_uLong lFileKey ){
1040cdf0e10cSrcweir // Resourceinstanzen loeschen
1041cdf0e10cSrcweir RscDel aDel( pRoot, lFileKey );
1042cdf0e10cSrcweir // Defines loeschen
1043cdf0e10cSrcweir aFileTab.DeleteFileContext( lFileKey );
1044cdf0e10cSrcweir }
1045cdf0e10cSrcweir
1046cdf0e10cSrcweir /*************************************************************************
1047cdf0e10cSrcweir |*
1048cdf0e10cSrcweir |* RscTypCont :: MakeConsistent()
1049cdf0e10cSrcweir |*
1050cdf0e10cSrcweir |* Beschreibung
1051cdf0e10cSrcweir |* Ersterstellung MM 23.09.91
1052cdf0e10cSrcweir |* Letzte Aenderung MM 23.09.91
1053cdf0e10cSrcweir |*
1054cdf0e10cSrcweir *************************************************************************/
IsInstConsistent(ObjNode * pObjNode,RscTop * pRscTop,RscInconsList * pList)1055cdf0e10cSrcweir sal_Bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop,
1056cdf0e10cSrcweir RscInconsList * pList )
1057cdf0e10cSrcweir {
1058cdf0e10cSrcweir sal_Bool bRet = sal_True;
1059cdf0e10cSrcweir
1060cdf0e10cSrcweir if( pObjNode ){
1061cdf0e10cSrcweir RSCINST aTmpI;
1062cdf0e10cSrcweir
1063cdf0e10cSrcweir if( ! IsInstConsistent( (ObjNode*)pObjNode->Left(), pRscTop, pList ) )
1064cdf0e10cSrcweir bRet = sal_False;
1065cdf0e10cSrcweir
1066cdf0e10cSrcweir aTmpI.pClass = pRscTop;
1067cdf0e10cSrcweir aTmpI.pData = pObjNode->GetRscObj();
1068cdf0e10cSrcweir if( ! aTmpI.pClass->IsConsistent( aTmpI, pList ) )
1069cdf0e10cSrcweir bRet = sal_False;
1070cdf0e10cSrcweir
1071cdf0e10cSrcweir if( ! IsInstConsistent( (ObjNode*)pObjNode->Right(), pRscTop, pList ) )
1072cdf0e10cSrcweir bRet = sal_False;
1073cdf0e10cSrcweir };
1074cdf0e10cSrcweir
1075cdf0e10cSrcweir return( bRet );
1076cdf0e10cSrcweir }
1077cdf0e10cSrcweir
MakeConsistent(RscTop * pRscTop,RscInconsList * pList)1078cdf0e10cSrcweir sal_Bool MakeConsistent( RscTop * pRscTop, RscInconsList * pList )
1079cdf0e10cSrcweir {
1080cdf0e10cSrcweir sal_Bool bRet = sal_True;
1081cdf0e10cSrcweir
1082cdf0e10cSrcweir if( pRscTop ){
1083cdf0e10cSrcweir if( ! ::MakeConsistent( (RscTop*)pRscTop->Left(), pList ) )
1084cdf0e10cSrcweir bRet = sal_False;
1085cdf0e10cSrcweir
1086cdf0e10cSrcweir if( pRscTop->GetObjNode() ){
1087cdf0e10cSrcweir if( ! pRscTop->GetObjNode()->IsConsistent() ){
1088cdf0e10cSrcweir pRscTop->GetObjNode()->OrderTree();
1089cdf0e10cSrcweir if( ! pRscTop->GetObjNode()->IsConsistent( pList ) )
1090cdf0e10cSrcweir bRet = sal_False;
1091cdf0e10cSrcweir }
1092cdf0e10cSrcweir if( ! IsInstConsistent( pRscTop->GetObjNode(), pRscTop, pList ) )
1093cdf0e10cSrcweir bRet = sal_False;
1094cdf0e10cSrcweir }
1095cdf0e10cSrcweir
1096cdf0e10cSrcweir if( ! ::MakeConsistent( (RscTop*)pRscTop->Right(), pList ) )
1097cdf0e10cSrcweir bRet = sal_False;
1098cdf0e10cSrcweir };
1099cdf0e10cSrcweir
1100cdf0e10cSrcweir return bRet;
1101cdf0e10cSrcweir }
1102cdf0e10cSrcweir
MakeConsistent(RscInconsList * pList)1103cdf0e10cSrcweir sal_Bool RscTypCont :: MakeConsistent( RscInconsList * pList ){
1104cdf0e10cSrcweir return( ::MakeConsistent( pRoot, pList ) );
1105cdf0e10cSrcweir }
1106cdf0e10cSrcweir
PutTranslatorKey(sal_uInt64 nKey)1107cdf0e10cSrcweir sal_uInt32 RscTypCont::PutTranslatorKey( sal_uInt64 nKey )
1108cdf0e10cSrcweir {
1109cdf0e10cSrcweir aIdTranslator[ nKey ] = nFilePos;
1110cdf0e10cSrcweir return nPMId++;
1111cdf0e10cSrcweir }
1112cdf0e10cSrcweir
1113