Kaydet (Commit) 7050fc44 authored tarafından Thomas Arnhold's avatar Thomas Arnhold

reduce some uglyness II

NUMTYPE is never defined outside this header. So this complexity can go.

There is no need to deliver nranges.hxx as there is only itemset.cxx using it.

NUMTYPE -> sal_uInt16
NUMTYPE_ARG -> int
SfxNumRanges -> SfxUShortRanges

Change-Id: I27027f9ec83ebf456bb545763954884d5de227b3
üst 84dc8e5b
......@@ -73,7 +73,6 @@ $(eval $(call gb_Package_add_file,svl_inc,inc/svl/metitem.hxx,svl/metitem.hxx))
$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfkeytab.hxx,svl/nfkeytab.hxx))
$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfsymbol.hxx,svl/nfsymbol.hxx))
$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nfversi.hxx,svl/nfversi.hxx))
$(eval $(call gb_Package_add_file,svl_inc,inc/svl/nranges.hxx,svl/nranges.hxx))
$(eval $(call gb_Package_add_file,svl_inc,inc/svl/numuno.hxx,svl/numuno.hxx))
$(eval $(call gb_Package_add_file,svl_inc,inc/svl/ondemand.hxx,svl/ondemand.hxx))
$(eval $(call gb_Package_add_file,svl_inc,inc/svl/outstrm.hxx,svl/outstrm.hxx))
......
......@@ -25,58 +25,40 @@
#ifndef _SFXNRANGES_HXX
#ifndef NUMTYPE
#define NUMTYPE sal_uInt16
#define SfxNumRanges SfxUShortRanges
#include <svl/nranges.hxx>
#undef NUMTYPE
#define _SFXNRANGES_HXX
#else
#include <tools/solar.h>
//========================================================================
#define NUMTYPE_ARG int
class SfxNumRanges
class SfxUShortRanges
{
NUMTYPE* _pRanges; // 0-terminated array of NUMTYPE-pairs
sal_uInt16* _pRanges; // 0-terminated array of sal_uInt16-pairs
public:
SfxNumRanges() : _pRanges( 0 ) {}
SfxNumRanges( const SfxNumRanges &rOrig );
SfxNumRanges( NUMTYPE nWhich1, NUMTYPE nWhich2 );
SfxNumRanges( const NUMTYPE* nNumTable );
~SfxNumRanges()
SfxUShortRanges() : _pRanges( 0 ) {}
SfxUShortRanges( const SfxUShortRanges &rOrig );
SfxUShortRanges( sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
SfxUShortRanges( const sal_uInt16* nNumTable );
~SfxUShortRanges()
{ delete [] _pRanges; }
sal_Bool operator == ( const SfxNumRanges & ) const;
sal_Bool operator != ( const SfxNumRanges & rRanges ) const
sal_Bool operator == ( const SfxUShortRanges & ) const;
sal_Bool operator != ( const SfxUShortRanges & rRanges ) const
{ return !( *this == rRanges ); }
SfxNumRanges& operator = ( const SfxNumRanges & );
SfxUShortRanges& operator = ( const SfxUShortRanges & );
SfxNumRanges& operator += ( const SfxNumRanges & );
SfxNumRanges& operator -= ( const SfxNumRanges & );
SfxNumRanges& operator /= ( const SfxNumRanges & );
SfxUShortRanges& operator += ( const SfxUShortRanges & );
SfxUShortRanges& operator -= ( const SfxUShortRanges & );
SfxUShortRanges& operator /= ( const SfxUShortRanges & );
NUMTYPE Count() const;
sal_Bool IsEmpty() const
sal_uInt16 Count() const;
sal_Bool IsEmpty() const
{ return !_pRanges || 0 == *_pRanges; }
operator const NUMTYPE* () const
operator const sal_uInt16* () const
{ return _pRanges; }
};
#undef NUMTYPE
#undef SfxNumRanges
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -43,11 +43,7 @@ DBG_NAME(SfxItemSet)
//========================================================================
#define NUMTYPE sal_uInt16
#define SfxNumRanges SfxUShortRanges
#include "nranges.cxx"
#undef NUMTYPE
#undef SfxNumRanges
//========================================================================
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment