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