sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / nranges.hxx
blob55211f6deead4684334c93a32e176bf7e24fa144
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: nranges.hxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
30 #ifdef MACOSX
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
34 // a second time
35 #endif
37 #ifndef _SFXNRANGES_HXX
39 #ifndef NUMTYPE
41 #define NUMTYPE USHORT
42 #define SfxNumRanges SfxUShortRanges
43 #include <bf_svtools/nranges.hxx>
45 #undef NUMTYPE
46 #define NUMTYPE ULONG
47 #define SfxNumRanges SfxULongRanges
48 #include <bf_svtools/nranges.hxx>
50 #define _SFXNRANGES_HXX
52 #else
54 #ifndef _SOLAR_H
55 #include <tools/solar.h>
56 #endif
58 namespace binfilter
61 //========================================================================
63 #define NUMTYPE_ARG int
65 class SfxNumRanges
67 NUMTYPE* _pRanges; // 0-terminated array of NUMTYPE-pairs
69 public:
70 SfxNumRanges() : _pRanges( 0 ) {}
71 SfxNumRanges( const SfxNumRanges &rOrig );
72 ~SfxNumRanges()
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;
86 BOOL IsEmpty() const
87 { return !_pRanges || 0 == *_pRanges; }
89 operator const NUMTYPE* () const
90 { return _pRanges; }
95 #undef NUMTYPE
96 #undef SfxNumRanges
98 #endif
100 #endif