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: nranges.hxx,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 // We need an empty block in here. Otherwise, if the #ifndef _SFXNRANGES_HXX
32 // line is the first line, the Mac OS X version of the gcc preprocessor will
33 // incorrectly optimize the inclusion process and will never include this file
37 #ifndef _SFXNRANGES_HXX
41 #define NUMTYPE USHORT
42 #define SfxNumRanges SfxUShortRanges
43 #include <bf_svtools/nranges.hxx>
47 #define SfxNumRanges SfxULongRanges
48 #include <bf_svtools/nranges.hxx>
50 #define _SFXNRANGES_HXX
55 #include <tools/solar.h>
61 //========================================================================
63 #define NUMTYPE_ARG int
67 NUMTYPE
* _pRanges
; // 0-terminated array of NUMTYPE-pairs
70 SfxNumRanges() : _pRanges( 0 ) {}
71 SfxNumRanges( const SfxNumRanges
&rOrig
);
73 { delete [] _pRanges
; }
75 BOOL
operator == ( const SfxNumRanges
& ) const;
76 BOOL
operator != ( const SfxNumRanges
& rRanges
) const
77 { return !( *this == rRanges
); }
79 SfxNumRanges
& operator = ( const SfxNumRanges
& );
81 SfxNumRanges
& operator += ( const SfxNumRanges
& );
82 SfxNumRanges
& operator -= ( const SfxNumRanges
& );
83 SfxNumRanges
& operator /= ( const SfxNumRanges
& );
85 NUMTYPE
Count() const;
87 { return !_pRanges
|| 0 == *_pRanges
; }
89 operator const NUMTYPE
* () const