merge the formfield patch from ooo-build
[ooovba.git] / rsc / source / misc / rscdbl.cxx
blob1b629e0d80b8e928f516cd2f958647cc4b10514a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscdbl.cxx,v $
10 * $Revision: 1.5 $
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"
34 #include <stdio.h>
35 #include <rscdb.hxx>
36 #include <rscall.h>
37 #include <rschash.hxx>
38 #include <rsctree.hxx>
39 #include <rsctop.hxx>
40 #include "rsclst.hxx"
42 /*************************************************************************
44 |* RscTypCont::FillNameIdList()
46 |* Beschreibung
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;
55 ByteString aStrClass;
57 pStrClass = pHS->getString( nClassName ).getStr();
58 if( pStrClass )
59 aStrClass = pStrClass;
60 else
61 aStrClass = ByteString::CreateFromInt32( (long)nClassName );
63 pSubList = new REResourceList( pList, aStrClass, rId );
65 pList->Insert( pSubList, 0xFFFFFFFF );
66 return( pSubList );
69 void FillSubList( RSCINST & rInst, REResourceList * pList )
71 sal_uInt32 nCount, i;
72 SUBINFO_STRUCT aInfo;
73 REResourceList* pSubList;
74 RSCINST aTmpI;
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(),
81 aInfo.aId, pList );
82 FillSubList( aTmpI, pSubList );
86 void FillListObj( ObjNode * pObjNode, RscTop * pRscTop,
87 REResourceList * pList, ULONG lFileKey )
89 if( pObjNode ){
90 if( pObjNode->GetFileKey() == lFileKey ){
91 RSCINST aTmpI;
92 REResourceList* pSubList;
94 FillListObj( (ObjNode*)pObjNode->Left(), pRscTop,
95 pList, lFileKey );
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,
105 pList, lFileKey );
110 void FillList( RscTop * pRscTop, REResourceList * pList, ULONG lFileKey ){
111 if( pRscTop ){
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 );