xref: /aoo41x/main/rsc/source/res/rscrange.cxx (revision 477794c1)
1*477794c1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*477794c1SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*477794c1SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*477794c1SAndrew Rist  * distributed with this work for additional information
6*477794c1SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*477794c1SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*477794c1SAndrew Rist  * "License"); you may not use this file except in compliance
9*477794c1SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*477794c1SAndrew Rist  *
11*477794c1SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*477794c1SAndrew Rist  *
13*477794c1SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*477794c1SAndrew Rist  * software distributed under the License is distributed on an
15*477794c1SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*477794c1SAndrew Rist  * KIND, either express or implied.  See the License for the
17*477794c1SAndrew Rist  * specific language governing permissions and limitations
18*477794c1SAndrew Rist  * under the License.
19*477794c1SAndrew Rist  *
20*477794c1SAndrew Rist  *************************************************************/
21*477794c1SAndrew Rist 
22*477794c1SAndrew 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 
28cdf0e10cSrcweir // C and C++ Includes.
29cdf0e10cSrcweir #include <stdlib.h>
30cdf0e10cSrcweir #include <stdio.h>
31cdf0e10cSrcweir #include <string.h>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir // Solar Definitionen
34cdf0e10cSrcweir #include <tools/solar.h>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // Programmabh�ngige Includes.
37cdf0e10cSrcweir #include <rscrange.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir /****************** D E F I N E S ****************************************/
40cdf0e10cSrcweir /****************** C O D E **********************************************/
41cdf0e10cSrcweir /****************** R s c R a n g e **************************************/
42cdf0e10cSrcweir /*************************************************************************
43cdf0e10cSrcweir |*
44cdf0e10cSrcweir |*	  RscRange::RscRange()
45cdf0e10cSrcweir |*
46cdf0e10cSrcweir |*	  Beschreibung
47cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
48cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
49cdf0e10cSrcweir |*
50cdf0e10cSrcweir *************************************************************************/
RscRange(Atom nId,sal_uInt32 nTypeId)51cdf0e10cSrcweir RscRange::RscRange( Atom nId, sal_uInt32 nTypeId )
52cdf0e10cSrcweir 						: RscTop( nId, nTypeId )
53cdf0e10cSrcweir {
54cdf0e10cSrcweir 	nMin = nMax = 0;
55cdf0e10cSrcweir 	nSize = ALIGNED_SIZE( sizeof( RscRangeInst ) );
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir /*************************************************************************
59cdf0e10cSrcweir |*
60cdf0e10cSrcweir |*	  RscRange::GetClassType()
61cdf0e10cSrcweir |*
62cdf0e10cSrcweir |*	  Beschreibung
63cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
64cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
65cdf0e10cSrcweir |*
66cdf0e10cSrcweir *************************************************************************/
GetClassType() const67cdf0e10cSrcweir RSCCLASS_TYPE RscRange::GetClassType() const
68cdf0e10cSrcweir {
69cdf0e10cSrcweir 	return RSCCLASS_NUMBER;
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir /*************************************************************************
73cdf0e10cSrcweir |*
74cdf0e10cSrcweir |*	  RscRange::SetRange()
75cdf0e10cSrcweir |*
76cdf0e10cSrcweir |*	  Beschreibung
77cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
78cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
79cdf0e10cSrcweir |*
80cdf0e10cSrcweir *************************************************************************/
SetRange(sal_Int32 nMinimum,sal_Int32 nMaximum)81cdf0e10cSrcweir ERRTYPE RscRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum )
82cdf0e10cSrcweir {
83cdf0e10cSrcweir 	if( nMinimum > nMaximum )
84cdf0e10cSrcweir 	{
85cdf0e10cSrcweir 		nMin = nMaximum;
86cdf0e10cSrcweir 		nMax = nMinimum;
87cdf0e10cSrcweir 	}
88cdf0e10cSrcweir 	else
89cdf0e10cSrcweir 	{
90cdf0e10cSrcweir 		nMax = nMaximum;
91cdf0e10cSrcweir 		nMin = nMinimum;
92cdf0e10cSrcweir 	};
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	return( ERR_OK );
95cdf0e10cSrcweir }
96cdf0e10cSrcweir 
97cdf0e10cSrcweir /*************************************************************************
98cdf0e10cSrcweir |*
99cdf0e10cSrcweir |*	  RscRange::IsValueDefault()
100cdf0e10cSrcweir |*
101cdf0e10cSrcweir |*	  Beschreibung
102cdf0e10cSrcweir |*	  Ersterstellung	MM 15.02.92
103cdf0e10cSrcweir |*	  Letzte Aenderung	MM 15.02.92
104cdf0e10cSrcweir |*
105cdf0e10cSrcweir *************************************************************************/
IsValueDefault(const RSCINST & rInst,CLASS_DATA pDef)106cdf0e10cSrcweir sal_Bool RscRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	if( pDef )
109cdf0e10cSrcweir 	{
110cdf0e10cSrcweir 		if( ((RscRangeInst*)rInst.pData)->nValue ==
111cdf0e10cSrcweir 		  ((RscRangeInst*)pDef)->nValue )
112cdf0e10cSrcweir 		{
113cdf0e10cSrcweir 			return sal_True;
114cdf0e10cSrcweir 		}
115cdf0e10cSrcweir 	}
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 	return sal_False;
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir /*************************************************************************
121cdf0e10cSrcweir |*
122cdf0e10cSrcweir |*	  RscRange::SetNumber()
123cdf0e10cSrcweir |*
124cdf0e10cSrcweir |*	  Beschreibung
125cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
126cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
127cdf0e10cSrcweir |*
128cdf0e10cSrcweir *************************************************************************/
SetNumber(const RSCINST & rInst,sal_Int32 nValue)129cdf0e10cSrcweir ERRTYPE RscRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue )
130cdf0e10cSrcweir {
131cdf0e10cSrcweir 	if( nMax < nValue || nMin > nValue )
132cdf0e10cSrcweir 		return( ERR_RSCRANGE_OUTDEFSET );
133cdf0e10cSrcweir 	((RscRangeInst *)rInst.pData)->nValue = (sal_uInt16)( nValue - nMin );
134cdf0e10cSrcweir 	((RscRangeInst *)rInst.pData)->bDflt = sal_False;
135cdf0e10cSrcweir 	return( ERR_OK );
136cdf0e10cSrcweir }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir /*************************************************************************
139cdf0e10cSrcweir |*
140cdf0e10cSrcweir |*	  RscRange::GetNumber()
141cdf0e10cSrcweir |*
142cdf0e10cSrcweir |*	  Beschreibung
143cdf0e10cSrcweir |*	  Ersterstellung	MM 22.04.91
144cdf0e10cSrcweir |*	  Letzte Aenderung	MM 22.04.91
145cdf0e10cSrcweir |*
146cdf0e10cSrcweir *************************************************************************/
GetNumber(const RSCINST & rInst,sal_Int32 * pN)147cdf0e10cSrcweir ERRTYPE RscRange::GetNumber( const RSCINST & rInst, sal_Int32 * pN )
148cdf0e10cSrcweir {
149cdf0e10cSrcweir 	*pN = ((RscRangeInst *)rInst.pData)->nValue + nMin;
150cdf0e10cSrcweir 	return( ERR_OK );
151cdf0e10cSrcweir }
152cdf0e10cSrcweir 
153cdf0e10cSrcweir /*************************************************************************
154cdf0e10cSrcweir |*
155cdf0e10cSrcweir |*	  RscRange::Create()
156cdf0e10cSrcweir |*
157cdf0e10cSrcweir |*	  Beschreibung
158cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
159cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
160cdf0e10cSrcweir |*
161cdf0e10cSrcweir *************************************************************************/
Create(RSCINST * pInst,const RSCINST & rDflt,sal_Bool bOwnClass)162cdf0e10cSrcweir RSCINST RscRange::Create( RSCINST * pInst, const RSCINST & rDflt,
163cdf0e10cSrcweir 							sal_Bool bOwnClass )
164cdf0e10cSrcweir {
165cdf0e10cSrcweir 	RSCINST aInst;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir 	if( !pInst )
168cdf0e10cSrcweir 	{
169cdf0e10cSrcweir 		aInst.pClass = this;
170cdf0e10cSrcweir 		aInst.pData = (CLASS_DATA)
171cdf0e10cSrcweir 					  rtl_allocateMemory( sizeof( RscRangeInst ) );
172cdf0e10cSrcweir 	}
173cdf0e10cSrcweir 	else
174cdf0e10cSrcweir 		aInst = *pInst;
175cdf0e10cSrcweir 	if( !bOwnClass && rDflt.IsInst() )
176cdf0e10cSrcweir 		bOwnClass = rDflt.pClass->InHierarchy( this );
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 	if( bOwnClass )
179cdf0e10cSrcweir 		memmove( aInst.pData, rDflt.pData, sizeof( RscRangeInst ) );
180cdf0e10cSrcweir 	else
181cdf0e10cSrcweir 	{
182cdf0e10cSrcweir 		if( 0L >= nMin && 0L <= nMax )
183cdf0e10cSrcweir 			((RscRangeInst *)aInst.pData)->nValue = (sal_uInt16)(0L - nMin);
184cdf0e10cSrcweir 		else
185cdf0e10cSrcweir 			((RscRangeInst *)aInst.pData)->nValue = 0;
186cdf0e10cSrcweir 		((RscRangeInst *)aInst.pData)->bDflt = sal_True;
187cdf0e10cSrcweir 	}
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 	return( aInst );
190cdf0e10cSrcweir }
191cdf0e10cSrcweir 
192cdf0e10cSrcweir /*************************************************************************
193cdf0e10cSrcweir |*
194cdf0e10cSrcweir |*	  RscRange::WriteSrc()
195cdf0e10cSrcweir |*
196cdf0e10cSrcweir |*	  Beschreibung
197cdf0e10cSrcweir |*	  Ersterstellung	MM 08.04.91
198cdf0e10cSrcweir |*	  Letzte Aenderung	MM 08.04.91
199cdf0e10cSrcweir |*
200cdf0e10cSrcweir *************************************************************************/
WriteSrc(const RSCINST & rInst,FILE * fOutput,RscTypCont *,sal_uInt32,const char *)201cdf0e10cSrcweir void RscRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
202cdf0e10cSrcweir 						 RscTypCont *, sal_uInt32, const char * )
203cdf0e10cSrcweir {
204cdf0e10cSrcweir 	fprintf( fOutput, "%ld", long( ((RscRangeInst *)rInst.pData)->nValue + nMin ) );
205cdf0e10cSrcweir }
206cdf0e10cSrcweir 
207cdf0e10cSrcweir /*************************************************************************
208cdf0e10cSrcweir |*
209cdf0e10cSrcweir |*	  RscRange::WriteRc()
210cdf0e10cSrcweir |*
211cdf0e10cSrcweir |*	  Beschreibung
212cdf0e10cSrcweir |*	  Ersterstellung	MM 15.04.91
213cdf0e10cSrcweir |*	  Letzte Aenderung	MM 15.04.91
214cdf0e10cSrcweir |*
215cdf0e10cSrcweir *************************************************************************/
WriteRc(const RSCINST & rInst,RscWriteRc & aMem,RscTypCont *,sal_uInt32,sal_Bool)216cdf0e10cSrcweir ERRTYPE RscRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
217cdf0e10cSrcweir 						   RscTypCont *, sal_uInt32, sal_Bool )
218cdf0e10cSrcweir {
219cdf0e10cSrcweir 	if( nMin >= 0 )
220cdf0e10cSrcweir 	{
221cdf0e10cSrcweir 		sal_uInt16 n;
222cdf0e10cSrcweir 		n = (sal_uInt16)(((RscRangeInst *)rInst.pData)->nValue + nMin);
223cdf0e10cSrcweir 		aMem.Put( n );
224cdf0e10cSrcweir 	}
225cdf0e10cSrcweir 	else
226cdf0e10cSrcweir 	{
227cdf0e10cSrcweir 		sal_Int16 n;
228cdf0e10cSrcweir 		n = (sal_Int16)(((RscRangeInst *)rInst.pData)->nValue + nMin);
229cdf0e10cSrcweir 		aMem.Put( n );
230cdf0e10cSrcweir 	}
231cdf0e10cSrcweir 
232cdf0e10cSrcweir 	return( ERR_OK );
233cdf0e10cSrcweir }
234cdf0e10cSrcweir 
235cdf0e10cSrcweir //=======================================================================
WriteRcAccess(FILE * fOutput,RscTypCont *,const char * pName)236cdf0e10cSrcweir void RscRange::WriteRcAccess
237cdf0e10cSrcweir (
238cdf0e10cSrcweir 	FILE * fOutput,
239cdf0e10cSrcweir 	RscTypCont * /*pTC*/,
240cdf0e10cSrcweir 	const char * pName
241cdf0e10cSrcweir )
242cdf0e10cSrcweir {
243cdf0e10cSrcweir 	fprintf( fOutput, "\t\tSet%s( ", pName );
244cdf0e10cSrcweir 	if( nMin >= 0 )
245cdf0e10cSrcweir 		fprintf( fOutput, "*(sal_uInt32 *)(pResData+nOffset) );\n" );
246cdf0e10cSrcweir 	else
247cdf0e10cSrcweir 		fprintf( fOutput, "*(sal_Int32 *)(pResData+nOffset) );\n" );
248cdf0e10cSrcweir 	fprintf( fOutput, "\t\tnOffset += sizeof( sal_uInt32 );\n" );
249cdf0e10cSrcweir }
250cdf0e10cSrcweir 
251cdf0e10cSrcweir /****************** R s c L o n g R a n g e ******************************/
252cdf0e10cSrcweir /*************************************************************************
253cdf0e10cSrcweir |*
254cdf0e10cSrcweir |*	  RscLongRange::RscLongRange()
255cdf0e10cSrcweir |*
256cdf0e10cSrcweir |*	  Beschreibung
257cdf0e10cSrcweir |*	  Ersterstellung	MM 18.07.94
258cdf0e10cSrcweir |*	  Letzte Aenderung	MM 18.07.94
259cdf0e10cSrcweir |*
260cdf0e10cSrcweir *************************************************************************/
RscLongRange(Atom nId,sal_uInt32 nTypeId)261cdf0e10cSrcweir RscLongRange::RscLongRange( Atom nId, sal_uInt32 nTypeId )
262cdf0e10cSrcweir 						: RscTop( nId, nTypeId )
263cdf0e10cSrcweir {
264cdf0e10cSrcweir 	nMin = nMax = 0;
265cdf0e10cSrcweir 	nSize = ALIGNED_SIZE( sizeof( RscLongRangeInst ) );
266cdf0e10cSrcweir }
267cdf0e10cSrcweir 
268cdf0e10cSrcweir /*************************************************************************
269cdf0e10cSrcweir |*
270cdf0e10cSrcweir |*	  RscLongRange::GetClassType()
271cdf0e10cSrcweir |*
272cdf0e10cSrcweir |*	  Beschreibung
273cdf0e10cSrcweir |*	  Ersterstellung	MM 18.07.94
274cdf0e10cSrcweir |*	  Letzte Aenderung	MM 18.07.94
275cdf0e10cSrcweir |*
276cdf0e10cSrcweir *************************************************************************/
GetClassType() const277cdf0e10cSrcweir RSCCLASS_TYPE RscLongRange::GetClassType() const
278cdf0e10cSrcweir {
279cdf0e10cSrcweir 	return RSCCLASS_NUMBER;
280cdf0e10cSrcweir }
281cdf0e10cSrcweir 
282cdf0e10cSrcweir /*************************************************************************
283cdf0e10cSrcweir |*
284cdf0e10cSrcweir |*	  RscLongRange::SetRange()
285cdf0e10cSrcweir |*
286cdf0e10cSrcweir |*	  Beschreibung
287cdf0e10cSrcweir |*	  Ersterstellung	MM 18.07.94
288cdf0e10cSrcweir |*	  Letzte Aenderung	MM 18.07.94
289cdf0e10cSrcweir |*
290cdf0e10cSrcweir *************************************************************************/
SetRange(sal_Int32 nMinimum,sal_Int32 nMaximum)291cdf0e10cSrcweir ERRTYPE RscLongRange::SetRange( sal_Int32 nMinimum, sal_Int32 nMaximum )
292cdf0e10cSrcweir {
293cdf0e10cSrcweir 	if( nMinimum > nMaximum )
294cdf0e10cSrcweir 	{
295cdf0e10cSrcweir 		nMin = nMaximum;
296cdf0e10cSrcweir 		nMax = nMinimum;
297cdf0e10cSrcweir 	}
298cdf0e10cSrcweir 	else
299cdf0e10cSrcweir 	{
300cdf0e10cSrcweir 		nMax = nMaximum;
301cdf0e10cSrcweir 		nMin = nMinimum;
302cdf0e10cSrcweir 	};
303cdf0e10cSrcweir 
304cdf0e10cSrcweir 	return( ERR_OK );
305cdf0e10cSrcweir }
306cdf0e10cSrcweir 
307cdf0e10cSrcweir /*************************************************************************
308cdf0e10cSrcweir |*
309cdf0e10cSrcweir |*	  RscLongRange::IsValueDefault()
310cdf0e10cSrcweir |*
311cdf0e10cSrcweir |*	  Beschreibung
312cdf0e10cSrcweir |*	  Ersterstellung	MM 15.02.92
313cdf0e10cSrcweir |*	  Letzte Aenderung	MM 15.02.92
314cdf0e10cSrcweir |*
315cdf0e10cSrcweir *************************************************************************/
IsValueDefault(const RSCINST & rInst,CLASS_DATA pDef)316cdf0e10cSrcweir sal_Bool RscLongRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef )
317cdf0e10cSrcweir {
318cdf0e10cSrcweir 	if( pDef )
319cdf0e10cSrcweir 		return 0 == memcmp( &((RscLongRangeInst*)rInst.pData)->nValue,
320cdf0e10cSrcweir 							&((RscLongRangeInst*)pDef)->nValue,
321cdf0e10cSrcweir 							sizeof( sal_Int32 ) );
322cdf0e10cSrcweir 
323cdf0e10cSrcweir 	return sal_False;
324cdf0e10cSrcweir }
325cdf0e10cSrcweir 
326cdf0e10cSrcweir /*************************************************************************
327cdf0e10cSrcweir |*
328cdf0e10cSrcweir |*	  RscLongRange::SetNumber()
329cdf0e10cSrcweir |*
330cdf0e10cSrcweir |*	  Beschreibung
331cdf0e10cSrcweir |*	  Ersterstellung	MM 18.07.94
332cdf0e10cSrcweir |*	  Letzte Aenderung	MM 18.07.94
333cdf0e10cSrcweir |*
334cdf0e10cSrcweir *************************************************************************/
SetNumber(const RSCINST & rInst,sal_Int32 nValue)335cdf0e10cSrcweir ERRTYPE RscLongRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue )
336cdf0e10cSrcweir {
337cdf0e10cSrcweir 	if( nMax < nValue || nMin > nValue )
338cdf0e10cSrcweir 		return( ERR_RSCRANGE_OUTDEFSET );
339cdf0e10cSrcweir 	void * pData = &((RscLongRangeInst*)rInst.pData)->nValue;
340cdf0e10cSrcweir 	memmove( pData, &nValue, sizeof( sal_Int32 ) );
341cdf0e10cSrcweir 	((RscLongRangeInst *)rInst.pData)->bDflt = sal_False;
342cdf0e10cSrcweir 	return( ERR_OK );
343cdf0e10cSrcweir }
344cdf0e10cSrcweir 
345cdf0e10cSrcweir /*************************************************************************
346cdf0e10cSrcweir |*
347cdf0e10cSrcweir |*	  RscLongRange::GetNumber()
348cdf0e10cSrcweir |*
349cdf0e10cSrcweir |*	  Beschreibung
350cdf0e10cSrcweir |*	  Ersterstellung	MM 22.04.91
351cdf0e10cSrcweir |*	  Letzte Aenderung	MM 22.04.91
352cdf0e10cSrcweir |*
353cdf0e10cSrcweir *************************************************************************/
GetNumber(const RSCINST & rInst,sal_Int32 * pN)354cdf0e10cSrcweir ERRTYPE RscLongRange::GetNumber( const RSCINST & rInst, sal_Int32 * pN )
355cdf0e10cSrcweir {
356cdf0e10cSrcweir 	memmove( pN, &((RscLongRangeInst*)rInst.pData)->nValue,
357cdf0e10cSrcweir 			 sizeof( sal_Int32 ) );
358cdf0e10cSrcweir 	return( ERR_OK );
359cdf0e10cSrcweir }
360cdf0e10cSrcweir 
361cdf0e10cSrcweir /*************************************************************************
362cdf0e10cSrcweir |*
363cdf0e10cSrcweir |*	  RscLongRange::Create()
364cdf0e10cSrcweir |*
365cdf0e10cSrcweir |*	  Beschreibung
366cdf0e10cSrcweir |*	  Ersterstellung	MM 18.07.94
367cdf0e10cSrcweir |*	  Letzte Aenderung	MM 18.07.94
368cdf0e10cSrcweir |*
369cdf0e10cSrcweir *************************************************************************/
Create(RSCINST * pInst,const RSCINST & rDflt,sal_Bool bOwnClass)370cdf0e10cSrcweir RSCINST RscLongRange::Create( RSCINST * pInst, const RSCINST & rDflt,
371cdf0e10cSrcweir 							  sal_Bool bOwnClass )
372cdf0e10cSrcweir {
373cdf0e10cSrcweir 	RSCINST aInst;
374cdf0e10cSrcweir 
375cdf0e10cSrcweir 	if( !pInst )
376cdf0e10cSrcweir 	{
377cdf0e10cSrcweir 		aInst.pClass = this;
378cdf0e10cSrcweir 		aInst.pData = (CLASS_DATA)
379cdf0e10cSrcweir 					  rtl_allocateMemory( sizeof( RscLongRangeInst ) );
380cdf0e10cSrcweir 	}
381cdf0e10cSrcweir 	else
382cdf0e10cSrcweir 		aInst = *pInst;
383cdf0e10cSrcweir 	if( !bOwnClass && rDflt.IsInst() )
384cdf0e10cSrcweir 		bOwnClass = rDflt.pClass->InHierarchy( this );
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 	if( bOwnClass )
387cdf0e10cSrcweir 		memmove( aInst.pData, rDflt.pData, sizeof( RscLongRangeInst ) );
388cdf0e10cSrcweir 	else
389cdf0e10cSrcweir 	{
390cdf0e10cSrcweir 		sal_Int32	lDflt;
391cdf0e10cSrcweir 		if( 0L >= nMin && 0L <= nMax )
392cdf0e10cSrcweir 			lDflt = 0;
393cdf0e10cSrcweir 		else
394cdf0e10cSrcweir 			lDflt = nMin;
395cdf0e10cSrcweir 		void * pData = &((RscLongRangeInst*)aInst.pData)->nValue;
396cdf0e10cSrcweir 		memmove( pData, &lDflt, sizeof( sal_Int32 ) );
397cdf0e10cSrcweir 		((RscLongRangeInst *)aInst.pData)->bDflt = sal_True;
398cdf0e10cSrcweir 	}
399cdf0e10cSrcweir 
400cdf0e10cSrcweir 	return( aInst );
401cdf0e10cSrcweir }
402cdf0e10cSrcweir 
403cdf0e10cSrcweir /*************************************************************************
404cdf0e10cSrcweir |*
405cdf0e10cSrcweir |*	  RscLongRange::WriteSrc()
406cdf0e10cSrcweir |*
407cdf0e10cSrcweir |*	  Beschreibung
408cdf0e10cSrcweir |*	  Ersterstellung	MM 18.07.94
409cdf0e10cSrcweir |*	  Letzte Aenderung	MM 18.07.94
410cdf0e10cSrcweir |*
411cdf0e10cSrcweir *************************************************************************/
WriteSrc(const RSCINST & rInst,FILE * fOutput,RscTypCont *,sal_uInt32,const char *)412cdf0e10cSrcweir void RscLongRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
413cdf0e10cSrcweir 						 RscTypCont *, sal_uInt32, const char * )
414cdf0e10cSrcweir {
415cdf0e10cSrcweir 	sal_Int32 lVal;
416cdf0e10cSrcweir 	GetNumber( rInst, &lVal );
417cdf0e10cSrcweir 	fprintf( fOutput, "%d", static_cast<int>(lVal) );
418cdf0e10cSrcweir }
419cdf0e10cSrcweir 
420cdf0e10cSrcweir /*************************************************************************
421cdf0e10cSrcweir |*
422cdf0e10cSrcweir |*	  RscLongRange::WriteRc()
423cdf0e10cSrcweir |*
424cdf0e10cSrcweir |*	  Beschreibung
425cdf0e10cSrcweir |*	  Ersterstellung	MM 18.07.94
426cdf0e10cSrcweir |*	  Letzte Aenderung	MM 18.04.94
427cdf0e10cSrcweir |*
428cdf0e10cSrcweir *************************************************************************/
WriteRc(const RSCINST & rInst,RscWriteRc & aMem,RscTypCont *,sal_uInt32,sal_Bool)429cdf0e10cSrcweir ERRTYPE RscLongRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
430cdf0e10cSrcweir 							   RscTypCont *, sal_uInt32, sal_Bool )
431cdf0e10cSrcweir {
432cdf0e10cSrcweir 	sal_Int32 lVal;
433cdf0e10cSrcweir 
434cdf0e10cSrcweir 	GetNumber( rInst, &lVal );
435cdf0e10cSrcweir 	aMem.Put( (sal_Int32)lVal );
436cdf0e10cSrcweir 
437cdf0e10cSrcweir 	return( ERR_OK );
438cdf0e10cSrcweir }
439cdf0e10cSrcweir 
440cdf0e10cSrcweir //=======================================================================
WriteRcAccess(FILE * fOutput,RscTypCont *,const char * pName)441cdf0e10cSrcweir void RscLongRange::WriteRcAccess
442cdf0e10cSrcweir (
443cdf0e10cSrcweir 	FILE * fOutput,
444cdf0e10cSrcweir 	RscTypCont * /*pTC*/,
445cdf0e10cSrcweir 	const char * pName
446cdf0e10cSrcweir )
447cdf0e10cSrcweir {
448cdf0e10cSrcweir 	fprintf( fOutput, "\t\tSet%s( ", pName );
449cdf0e10cSrcweir 	fprintf( fOutput, "GetLong( pResData+nOffset ) );\n" );
450cdf0e10cSrcweir 	fprintf( fOutput, "\t\tnOffset += sizeof( sal_Int32 );\n" );
451cdf0e10cSrcweir }
452cdf0e10cSrcweir 
453cdf0e10cSrcweir /****************** R s c L o n g E n u m R a n g e *********************/
454cdf0e10cSrcweir /*************************************************************************
455cdf0e10cSrcweir |*	  RscLongEnumRange::RscLongEnumRange()
456cdf0e10cSrcweir |*
457cdf0e10cSrcweir |*	  Beschreibung
458cdf0e10cSrcweir *************************************************************************/
RscLongEnumRange(Atom nId,sal_uInt32 nTypeId)459cdf0e10cSrcweir RscLongEnumRange::RscLongEnumRange( Atom nId, sal_uInt32 nTypeId )
460cdf0e10cSrcweir 						: RscLongRange( nId, nTypeId )
461cdf0e10cSrcweir {
462cdf0e10cSrcweir }
463cdf0e10cSrcweir 
464cdf0e10cSrcweir /*************************************************************************
465cdf0e10cSrcweir |*	  RscLongEnumRange::SetConst()
466cdf0e10cSrcweir |*
467cdf0e10cSrcweir |*	  Beschreibung
468cdf0e10cSrcweir *************************************************************************/
SetConst(const RSCINST & rInst,Atom,sal_Int32 nValue)469cdf0e10cSrcweir ERRTYPE RscLongEnumRange::SetConst( const RSCINST & rInst, Atom /*nConst*/,
470cdf0e10cSrcweir 									sal_Int32 nValue )
471cdf0e10cSrcweir {
472cdf0e10cSrcweir 	return SetNumber( rInst, nValue );
473cdf0e10cSrcweir }
474cdf0e10cSrcweir 
475cdf0e10cSrcweir /****************** R s c I d R a n g e **********************************/
476cdf0e10cSrcweir /*************************************************************************
477cdf0e10cSrcweir |*
478cdf0e10cSrcweir |*	  RscIdRange::RscIdRange()
479cdf0e10cSrcweir |*
480cdf0e10cSrcweir |*	  Beschreibung
481cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
482cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
483cdf0e10cSrcweir |*
484cdf0e10cSrcweir *************************************************************************/
RscIdRange(Atom nId,sal_uInt32 nTypeId)485cdf0e10cSrcweir RscIdRange::RscIdRange( Atom nId, sal_uInt32 nTypeId )
486cdf0e10cSrcweir 			: RscTop( nId, nTypeId )
487cdf0e10cSrcweir {
488cdf0e10cSrcweir 	nSize = ALIGNED_SIZE( sizeof( RscId ) );
489cdf0e10cSrcweir 	nMin = nMax = 0;
490cdf0e10cSrcweir }
491cdf0e10cSrcweir 
492cdf0e10cSrcweir /*************************************************************************
493cdf0e10cSrcweir |*
494cdf0e10cSrcweir |*	  RscIdRange::RscIdRange()
495cdf0e10cSrcweir |*
496cdf0e10cSrcweir |*	  Beschreibung
497cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
498cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
499cdf0e10cSrcweir |*
500cdf0e10cSrcweir *************************************************************************/
GetClassType() const501cdf0e10cSrcweir RSCCLASS_TYPE RscIdRange::GetClassType() const
502cdf0e10cSrcweir {
503cdf0e10cSrcweir 	return RSCCLASS_NUMBER;
504cdf0e10cSrcweir }
505cdf0e10cSrcweir 
506cdf0e10cSrcweir /*************************************************************************
507cdf0e10cSrcweir |*
508cdf0e10cSrcweir |*	  RscIdRange::Create()
509cdf0e10cSrcweir |*
510cdf0e10cSrcweir |*	  Beschreibung
511cdf0e10cSrcweir |*	  Ersterstellung	MM 03.04.91
512cdf0e10cSrcweir |*	  Letzte Aenderung	MM 03.04.91
513cdf0e10cSrcweir |*
514cdf0e10cSrcweir *************************************************************************/
Create(RSCINST * pInst,const RSCINST & rDflt,sal_Bool bOwnClass)515cdf0e10cSrcweir RSCINST RscIdRange::Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool bOwnClass ){
516cdf0e10cSrcweir 	RSCINST aInst;
517cdf0e10cSrcweir 	RscId * pClassData;
518cdf0e10cSrcweir 
519cdf0e10cSrcweir 	if( !pInst ){
520cdf0e10cSrcweir 		aInst.pClass = this;
521cdf0e10cSrcweir 		aInst.pData = (CLASS_DATA)rtl_allocateMemory( sizeof( RscId ) );
522cdf0e10cSrcweir 	}
523cdf0e10cSrcweir 	else
524cdf0e10cSrcweir 		aInst = *pInst;
525cdf0e10cSrcweir 
526cdf0e10cSrcweir 
527cdf0e10cSrcweir 	if( !bOwnClass && rDflt.IsInst() )
528cdf0e10cSrcweir 		bOwnClass = rDflt.pClass->InHierarchy( this );
529cdf0e10cSrcweir 
530cdf0e10cSrcweir 	pClassData = (RscId *)aInst.pData;
531cdf0e10cSrcweir 
532cdf0e10cSrcweir 	pClassData->Create();
533cdf0e10cSrcweir 	if( bOwnClass )
534cdf0e10cSrcweir 		*pClassData = *(RscId *)rDflt.pData;
535cdf0e10cSrcweir 	else{
536cdf0e10cSrcweir 			*pClassData = RscId();
537cdf0e10cSrcweir 		if( 0 >= nMin && 0 <= nMax )
538cdf0e10cSrcweir 			*pClassData = RscId( (sal_Int32)0 );
539cdf0e10cSrcweir 		else
540cdf0e10cSrcweir 			*pClassData = RscId( nMin );
541cdf0e10cSrcweir 		//cUnused wird fuer Defaultkennung verwendet
542cdf0e10cSrcweir 		((RscId *)aInst.pData)->aExp.cUnused = sal_True;
543cdf0e10cSrcweir 	}
544cdf0e10cSrcweir 
545cdf0e10cSrcweir 	return( aInst );
546cdf0e10cSrcweir }
547cdf0e10cSrcweir 
548cdf0e10cSrcweir /*************************************************************************
549cdf0e10cSrcweir |*
550cdf0e10cSrcweir |*	  RscIdRange::Destroy()
551cdf0e10cSrcweir |*
552cdf0e10cSrcweir |*	  Beschreibung
553cdf0e10cSrcweir |*	  Ersterstellung	MM 22.11.91
554cdf0e10cSrcweir |*	  Letzte Aenderung	MM 22.11.91
555cdf0e10cSrcweir |*
556cdf0e10cSrcweir *************************************************************************/
Destroy(const RSCINST & rInst)557cdf0e10cSrcweir void RscIdRange :: Destroy( const RSCINST & rInst ){
558cdf0e10cSrcweir 	((RscId *)rInst.pData)->Destroy();
559cdf0e10cSrcweir }
560cdf0e10cSrcweir 
561cdf0e10cSrcweir /*************************************************************************
562cdf0e10cSrcweir |*
563cdf0e10cSrcweir |*	  RscIdRange::IsValueDefault()
564cdf0e10cSrcweir |*
565cdf0e10cSrcweir |*	  Beschreibung
566cdf0e10cSrcweir |*	  Ersterstellung	MM 15.01.92
567cdf0e10cSrcweir |*	  Letzte Aenderung	MM 15.01.92
568cdf0e10cSrcweir |*
569cdf0e10cSrcweir *************************************************************************/
IsValueDefault(const RSCINST & rInst,CLASS_DATA pDef)570cdf0e10cSrcweir sal_Bool RscIdRange::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
571cdf0e10cSrcweir 	if( pDef ){
572cdf0e10cSrcweir 		if( ((RscId*)rInst.pData)->aExp.IsNumber()
573cdf0e10cSrcweir 		  && ((RscId*)pDef)->aExp.IsNumber() )
574cdf0e10cSrcweir 		{
575cdf0e10cSrcweir 			if( ((RscId*)rInst.pData)->GetNumber() ==
576cdf0e10cSrcweir 			  ((RscId*)pDef)->GetNumber() )
577cdf0e10cSrcweir 			{
578cdf0e10cSrcweir 				return sal_True;
579cdf0e10cSrcweir 			}
580cdf0e10cSrcweir 		}
581cdf0e10cSrcweir 	}
582cdf0e10cSrcweir 
583cdf0e10cSrcweir 	return sal_False;
584cdf0e10cSrcweir }
585cdf0e10cSrcweir 
586cdf0e10cSrcweir /*************************************************************************
587cdf0e10cSrcweir |*
588cdf0e10cSrcweir |*	  RscIdRange::SetNumber()
589cdf0e10cSrcweir |*
590cdf0e10cSrcweir |*	  Beschreibung
591cdf0e10cSrcweir |*	  Ersterstellung	MM 25.11.91
592cdf0e10cSrcweir |*	  Letzte Aenderung	MM 25.11.91
593cdf0e10cSrcweir |*
594cdf0e10cSrcweir *************************************************************************/
SetNumber(const RSCINST & rInst,sal_Int32 nValue)595cdf0e10cSrcweir ERRTYPE RscIdRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue )
596cdf0e10cSrcweir {
597cdf0e10cSrcweir 	if( nMax < nValue || nMin > nValue )
598cdf0e10cSrcweir 		return( ERR_RSCRANGE_OUTDEFSET );
599cdf0e10cSrcweir 
600cdf0e10cSrcweir 	*(RscId *)rInst.pData = RscId( nValue );
601cdf0e10cSrcweir 	((RscId *)rInst.pData)->aExp.cUnused = sal_False;
602cdf0e10cSrcweir 	return( ERR_OK );
603cdf0e10cSrcweir }
604cdf0e10cSrcweir 
605cdf0e10cSrcweir /*************************************************************************
606cdf0e10cSrcweir |*
607cdf0e10cSrcweir |*	  RscIdRange::GetNumber()
608cdf0e10cSrcweir |*
609cdf0e10cSrcweir |*	  Beschreibung
610cdf0e10cSrcweir |*	  Ersterstellung	MM 25.11.91
611cdf0e10cSrcweir |*	  Letzte Aenderung	MM 25.11.91
612cdf0e10cSrcweir |*
613cdf0e10cSrcweir *************************************************************************/
GetNumber(const RSCINST & rInst,sal_Int32 * plValue)614cdf0e10cSrcweir ERRTYPE RscIdRange::GetNumber( const RSCINST & rInst, sal_Int32 * plValue ){
615cdf0e10cSrcweir 	*plValue = ((RscId *)rInst.pData)->GetNumber();
616cdf0e10cSrcweir 	return( ERR_OK );
617cdf0e10cSrcweir }
618cdf0e10cSrcweir 
619cdf0e10cSrcweir /*************************************************************************
620cdf0e10cSrcweir |*
621cdf0e10cSrcweir |*	  RscIdRange::SetRef()
622cdf0e10cSrcweir |*
623cdf0e10cSrcweir |*	  Beschreibung
624cdf0e10cSrcweir |*	  Ersterstellung	MM 22.11.91
625cdf0e10cSrcweir |*	  Letzte Aenderung	MM 22.11.91
626cdf0e10cSrcweir |*
627cdf0e10cSrcweir *************************************************************************/
SetRef(const RSCINST & rInst,const RscId & rRscId)628cdf0e10cSrcweir ERRTYPE RscIdRange::SetRef( const RSCINST & rInst, const RscId & rRscId ){
629cdf0e10cSrcweir 	ERRTYPE aError;
630cdf0e10cSrcweir 	if( rRscId.IsId() ){
631cdf0e10cSrcweir 		aError = SetNumber( rInst, rRscId );
632cdf0e10cSrcweir 		if( aError.IsOk() ){
633cdf0e10cSrcweir 			*(RscId *)rInst.pData = rRscId;
634cdf0e10cSrcweir 			((RscId *)rInst.pData)->aExp.cUnused = sal_False;
635cdf0e10cSrcweir 		}
636cdf0e10cSrcweir 	}
637cdf0e10cSrcweir 	else
638cdf0e10cSrcweir 		aError = ERR_RSCRANGE_OUTDEFSET;
639cdf0e10cSrcweir 
640cdf0e10cSrcweir 	return( aError );
641cdf0e10cSrcweir }
642cdf0e10cSrcweir 
643cdf0e10cSrcweir /*************************************************************************
644cdf0e10cSrcweir |*
645cdf0e10cSrcweir |*	  RscIdRange::GetRef()
646cdf0e10cSrcweir |*
647cdf0e10cSrcweir |*	  Beschreibung
648cdf0e10cSrcweir |*	  Ersterstellung	MM 22.11.91
649cdf0e10cSrcweir |*	  Letzte Aenderung	MM 22.11.91
650cdf0e10cSrcweir |*
651cdf0e10cSrcweir *************************************************************************/
GetRef(const RSCINST & rInst,RscId * pRscId)652cdf0e10cSrcweir ERRTYPE RscIdRange::GetRef( const RSCINST & rInst, RscId * pRscId ){
653cdf0e10cSrcweir 	*pRscId = *(RscId *)rInst.pData;
654cdf0e10cSrcweir 
655cdf0e10cSrcweir 	return( ERR_OK );
656cdf0e10cSrcweir }
657cdf0e10cSrcweir 
658cdf0e10cSrcweir /*************************************************************************
659cdf0e10cSrcweir |*
660cdf0e10cSrcweir |*	  RscIdRange::WriteSrc()
661cdf0e10cSrcweir |*
662cdf0e10cSrcweir |*	  Beschreibung
663cdf0e10cSrcweir |*	  Ersterstellung	MM 22.11.91
664cdf0e10cSrcweir |*	  Letzte Aenderung	MM 25.11.91
665cdf0e10cSrcweir |*
666cdf0e10cSrcweir *************************************************************************/
WriteSrc(const RSCINST & rInst,FILE * fOutput,RscTypCont *,sal_uInt32,const char *)667cdf0e10cSrcweir void RscIdRange::WriteSrc( const RSCINST & rInst, FILE * fOutput,
668cdf0e10cSrcweir 						   RscTypCont *, sal_uInt32, const char * )
669cdf0e10cSrcweir {
670cdf0e10cSrcweir 	fprintf( fOutput, "%s", ((RscId *)rInst.pData)->GetName().GetBuffer() );
671cdf0e10cSrcweir }
672cdf0e10cSrcweir 
673cdf0e10cSrcweir /*************************************************************************
674cdf0e10cSrcweir |*
675cdf0e10cSrcweir |*	  RscIdRange::WriteRc()
676cdf0e10cSrcweir |*
677cdf0e10cSrcweir |*	  Beschreibung
678cdf0e10cSrcweir |*	  Ersterstellung	MM 25.11.91
679cdf0e10cSrcweir |*	  Letzte Aenderung	MM 25.11.91
680cdf0e10cSrcweir |*
681cdf0e10cSrcweir *************************************************************************/
WriteRc(const RSCINST & rInst,RscWriteRc & aMem,RscTypCont *,sal_uInt32,sal_Bool)682cdf0e10cSrcweir ERRTYPE RscIdRange::WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
683cdf0e10cSrcweir 							 RscTypCont *, sal_uInt32, sal_Bool )
684cdf0e10cSrcweir {
685cdf0e10cSrcweir 	sal_Int32 lVal = ((RscId*)rInst.pData)->GetNumber();
686cdf0e10cSrcweir 
687cdf0e10cSrcweir     aMem.Put( (sal_Int32)lVal );
688cdf0e10cSrcweir 
689cdf0e10cSrcweir 	return( ERR_OK );
690cdf0e10cSrcweir }
691cdf0e10cSrcweir 
692cdf0e10cSrcweir //=======================================================================
WriteRcAccess(FILE * fOutput,RscTypCont *,const char * pName)693cdf0e10cSrcweir void RscIdRange::WriteRcAccess
694cdf0e10cSrcweir (
695cdf0e10cSrcweir 	FILE * fOutput,
696cdf0e10cSrcweir 	RscTypCont * /*pTC*/,
697cdf0e10cSrcweir 	const char * pName
698cdf0e10cSrcweir )
699cdf0e10cSrcweir {
700cdf0e10cSrcweir 	fprintf( fOutput, "\t\tSet%s( ", pName );
701cdf0e10cSrcweir 	fprintf( fOutput, "GetLong( pResData+nOffset ) );\n" );
702cdf0e10cSrcweir 	fprintf( fOutput, "\t\tnOffset += sizeof( sal_Int32 );\n" );
703cdf0e10cSrcweir }
704cdf0e10cSrcweir 
705cdf0e10cSrcweir /*************************************************************************
706cdf0e10cSrcweir |*
707cdf0e10cSrcweir |*	  RscIdRange::IsConsistent()
708cdf0e10cSrcweir |*
709cdf0e10cSrcweir |*	  Beschreibung
710cdf0e10cSrcweir |*	  Ersterstellung	MM 22.11.91
711cdf0e10cSrcweir |*	  Letzte Aenderung	MM 22.11.91
712cdf0e10cSrcweir |*
713cdf0e10cSrcweir *************************************************************************/
IsConsistent(const RSCINST & rInst,RscInconsList * pList)714cdf0e10cSrcweir sal_Bool RscIdRange::IsConsistent( const RSCINST & rInst, RscInconsList * pList )
715cdf0e10cSrcweir {
716cdf0e10cSrcweir 	long nValue = ((RscId *)rInst.pData)->GetNumber();
717cdf0e10cSrcweir 	if( (nMax >= nValue) && (nMin <= nValue) )
718cdf0e10cSrcweir 		return sal_True;
719cdf0e10cSrcweir 	else {
720cdf0e10cSrcweir 		if( pList )
721cdf0e10cSrcweir 			pList->Insert( new RscInconsistent(
722cdf0e10cSrcweir 				*(RscId *)rInst.pData, *(RscId *)rInst.pData ) );
723cdf0e10cSrcweir 		return sal_False;
724cdf0e10cSrcweir 	}
725cdf0e10cSrcweir }
726cdf0e10cSrcweir 
727cdf0e10cSrcweir /****************** R s c B o o l ****************************************/
728cdf0e10cSrcweir /*************************************************************************
729cdf0e10cSrcweir |*
730cdf0e10cSrcweir |*	  RscBool::RscBool()
731cdf0e10cSrcweir |*
732cdf0e10cSrcweir |*	  Beschreibung
733cdf0e10cSrcweir |*	  Ersterstellung	MM 29.04.91
734cdf0e10cSrcweir |*	  Letzte Aenderung	MM 29.04.91
735cdf0e10cSrcweir |*
736cdf0e10cSrcweir *************************************************************************/
RscBool(Atom nId,sal_uInt32 nTypeId)737cdf0e10cSrcweir RscBool::RscBool( Atom nId, sal_uInt32 nTypeId )
738cdf0e10cSrcweir 		: RscRange( nId, nTypeId )
739cdf0e10cSrcweir {
740cdf0e10cSrcweir 	RscRange::SetRange( 0, 1 );
741cdf0e10cSrcweir }
742cdf0e10cSrcweir 
743cdf0e10cSrcweir /*************************************************************************
744cdf0e10cSrcweir |*
745cdf0e10cSrcweir |*	  RscBool::GetClassType()
746cdf0e10cSrcweir |*
747cdf0e10cSrcweir |*	  Beschreibung
748cdf0e10cSrcweir |*	  Ersterstellung	MM 29.04.91
749cdf0e10cSrcweir |*	  Letzte Aenderung	MM 29.04.91
750cdf0e10cSrcweir |*
751cdf0e10cSrcweir *************************************************************************/
GetClassType() const752cdf0e10cSrcweir RSCCLASS_TYPE  RscBool::GetClassType() const
753cdf0e10cSrcweir {
754cdf0e10cSrcweir 	return RSCCLASS_BOOL;
755cdf0e10cSrcweir }
756cdf0e10cSrcweir 
757cdf0e10cSrcweir /*************************************************************************
758cdf0e10cSrcweir |*
759cdf0e10cSrcweir |*	  RscBool::WriteSrc()
760cdf0e10cSrcweir |*
761cdf0e10cSrcweir |*	  Beschreibung
762cdf0e10cSrcweir |*	  Ersterstellung	MM 29.04.91
763cdf0e10cSrcweir |*	  Letzte Aenderung	MM 29.04.91
764cdf0e10cSrcweir |*
765cdf0e10cSrcweir *************************************************************************/
WriteSrc(const RSCINST & rInst,FILE * fOutput,RscTypCont *,sal_uInt32,const char *)766cdf0e10cSrcweir void RscBool::WriteSrc( const RSCINST & rInst, FILE * fOutput,
767cdf0e10cSrcweir 						RscTypCont *, sal_uInt32, const char * )
768cdf0e10cSrcweir {
769cdf0e10cSrcweir 	sal_Int32 l;
770cdf0e10cSrcweir 
771cdf0e10cSrcweir 	GetNumber( rInst, &l );
772cdf0e10cSrcweir 	if( l )
773cdf0e10cSrcweir 		fprintf( fOutput, "TRUE" );
774cdf0e10cSrcweir 	else
775cdf0e10cSrcweir 		fprintf( fOutput, "FALSE" );
776cdf0e10cSrcweir }
777cdf0e10cSrcweir 
778cdf0e10cSrcweir //=======================================================================
WriteRcAccess(FILE * fOutput,RscTypCont *,const char * pName)779cdf0e10cSrcweir void RscBool::WriteRcAccess
780cdf0e10cSrcweir (
781cdf0e10cSrcweir 	FILE * fOutput,
782cdf0e10cSrcweir 	RscTypCont * /*pTC*/,
783cdf0e10cSrcweir 	const char * pName
784cdf0e10cSrcweir )
785cdf0e10cSrcweir {
786cdf0e10cSrcweir 	fprintf( fOutput, "\t\tSet%s( ", pName );
787cdf0e10cSrcweir 	fprintf( fOutput, "(sal_Bool)*(short *)(pResData+nOffset) );\n" );
788cdf0e10cSrcweir 	fprintf( fOutput, "\t\tnOffset += sizeof( short );\n" );
789cdf0e10cSrcweir }
790cdf0e10cSrcweir 
791cdf0e10cSrcweir /****************** R s c B r e a k R a n g e ****************************/
792cdf0e10cSrcweir /*************************************************************************
793cdf0e10cSrcweir |*
794cdf0e10cSrcweir |*	  RscBreakRange::SetNumber()
795cdf0e10cSrcweir |*
796cdf0e10cSrcweir |*	  Beschreibung
797cdf0e10cSrcweir |*	  Ersterstellung	MM 24.06.91
798cdf0e10cSrcweir |*	  Letzte Aenderung	MM 24.06.91
799cdf0e10cSrcweir |*
800cdf0e10cSrcweir *************************************************************************/
RscBreakRange(Atom nId,sal_uInt32 nTypeId)801cdf0e10cSrcweir RscBreakRange :: RscBreakRange( Atom nId, sal_uInt32 nTypeId )
802cdf0e10cSrcweir 						: RscRange( nId, nTypeId )
803cdf0e10cSrcweir {
804cdf0e10cSrcweir 	nOutRange = 0xFFFFFFFF;
805cdf0e10cSrcweir }
806cdf0e10cSrcweir 
807cdf0e10cSrcweir /*************************************************************************
808cdf0e10cSrcweir |*
809cdf0e10cSrcweir |*	  RscBreakRange::SetNumber()
810cdf0e10cSrcweir |*
811cdf0e10cSrcweir |*	  Beschreibung
812cdf0e10cSrcweir |*	  Ersterstellung	MM 24.06.91
813cdf0e10cSrcweir |*	  Letzte Aenderung	MM 24.06.91
814cdf0e10cSrcweir |*
815cdf0e10cSrcweir *************************************************************************/
SetNumber(const RSCINST & rInst,sal_Int32 nValue)816cdf0e10cSrcweir ERRTYPE RscBreakRange::SetNumber( const RSCINST & rInst, sal_Int32 nValue ){
817cdf0e10cSrcweir 	if( nValue == nOutRange )
818cdf0e10cSrcweir 		return( ERR_RSCRANGE_OUTDEFSET );
819cdf0e10cSrcweir 	else
820cdf0e10cSrcweir 		return( RscRange::SetNumber( rInst, nValue ) );
821cdf0e10cSrcweir }
822cdf0e10cSrcweir 
823cdf0e10cSrcweir /*************************************************************************
824cdf0e10cSrcweir |*
825cdf0e10cSrcweir |*	  RscBreakRange::Create()
826cdf0e10cSrcweir |*
827cdf0e10cSrcweir |*	  Beschreibung
828cdf0e10cSrcweir |*	  Ersterstellung	MM 24.06.91
829cdf0e10cSrcweir |*	  Letzte Aenderung	MM 24.06.91
830cdf0e10cSrcweir |*
831cdf0e10cSrcweir *************************************************************************/
Create(RSCINST * pInst,const RSCINST & rDflt,sal_Bool bOwnClass)832cdf0e10cSrcweir RSCINST RscBreakRange::Create( RSCINST * pInst, const RSCINST & rDflt,
833cdf0e10cSrcweir 							   sal_Bool bOwnClass )
834cdf0e10cSrcweir {
835cdf0e10cSrcweir 	RSCINST aInst;
836cdf0e10cSrcweir 	sal_Int32	l;
837cdf0e10cSrcweir 
838cdf0e10cSrcweir 	aInst = RscRange::Create( pInst, rDflt, bOwnClass );
839cdf0e10cSrcweir 
840cdf0e10cSrcweir 	GetNumber( aInst, &l );
841cdf0e10cSrcweir 	if( l == nOutRange )
842cdf0e10cSrcweir 		((RscRangeInst *)aInst.pData)->nValue++;
843cdf0e10cSrcweir 
844cdf0e10cSrcweir 	return( aInst );
845cdf0e10cSrcweir }
846cdf0e10cSrcweir 
847