1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscdbl.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_rsc.hxx"
37 #include <rschash.hxx>
38 #include <rsctree.hxx>
42 /*************************************************************************
44 |* RscTypCont::FillNameIdList()
47 |* Ersterstellung MM 07.05.91
48 |* Letzte Aenderung MM 30.05.91
50 *************************************************************************/
51 REResourceList
* InsertList( Atom nClassName
, const RscId
& rId
,
52 REResourceList
* pList
){
53 REResourceList
* pSubList
;
54 const char * pStrClass
;
57 pStrClass
= pHS
->getString( nClassName
).getStr();
59 aStrClass
= pStrClass
;
61 aStrClass
= ByteString::CreateFromInt32( (long)nClassName
);
63 pSubList
= new REResourceList( pList
, aStrClass
, rId
);
65 pList
->Insert( pSubList
, 0xFFFFFFFF );
69 void FillSubList( RSCINST
& rInst
, REResourceList
* pList
)
73 REResourceList
* pSubList
;
76 nCount
= rInst
.pClass
->GetCount( rInst
);
77 for( i
= 0; i
< nCount
; i
++ ){
78 aInfo
= rInst
.pClass
->GetInfoEle( rInst
, i
);
79 aTmpI
= rInst
.pClass
->GetPosEle( rInst
, i
);
80 pSubList
= InsertList( aInfo
.pClass
->GetId(),
82 FillSubList( aTmpI
, pSubList
);
86 void FillListObj( ObjNode
* pObjNode
, RscTop
* pRscTop
,
87 REResourceList
* pList
, ULONG lFileKey
)
90 if( pObjNode
->GetFileKey() == lFileKey
){
92 REResourceList
* pSubList
;
94 FillListObj( (ObjNode
*)pObjNode
->Left(), pRscTop
,
97 pSubList
= InsertList( pRscTop
->GetId(),
98 pObjNode
->GetRscId(), pList
);
100 aTmpI
.pClass
= pRscTop
;
101 aTmpI
.pData
= pObjNode
->GetRscObj();
102 FillSubList( aTmpI
, pSubList
);
104 FillListObj( (ObjNode
*)pObjNode
->Right(), pRscTop
,
110 void FillList( RscTop
* pRscTop
, REResourceList
* pList
, ULONG lFileKey
){
112 FillList( (RscTop
*)pRscTop
->Left(), pList
, lFileKey
);
114 FillListObj( pRscTop
->GetObjNode(), pRscTop
, pList
, lFileKey
);
116 FillList( (RscTop
*)pRscTop
->Right(), pList
, lFileKey
);
120 void RscTypCont::FillNameIdList( REResourceList
* pList
, ULONG lFileKey
){
121 FillList( pRoot
, pList
, lFileKey
);