diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-10-30 12:31:26 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-30 18:59:13 +0000 |
commit | e75561bd19faa332c077ec249a397d056fae63f2 (patch) | |
tree | 4ec9622274abac1fde1d8781cd495041ae591125 /include | |
parent | 3d531da5ac08d5da5d7177306dba0f8a38696002 (diff) |
bin SfxUShortRanges, inline and rewrite only usage
only use was to merge 2 range tables in SfxItemSet::MergeRange
of which one table always contained a single range.
rewrite the merge algorithm (SfxUShortRanges += operator).
sort new range into the table of ranges and merge overlapping
ranges afterwards. Not as optimal as the original code but it's
short, maintainable and works without 'goto'
inline the DBG_CHECK_RANGES macro
Change-Id: I991c050f069d44fe72b3ea374863f5f26e7099e9
Reviewed-on: https://gerrit.libreoffice.org/30299
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/svl/nranges.hxx | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/include/svl/nranges.hxx b/include/svl/nranges.hxx index d3744755b823..d9329d1007f1 100644 --- a/include/svl/nranges.hxx +++ b/include/svl/nranges.hxx @@ -22,28 +22,6 @@ #include <cstdarg> #include <sal/types.h> -class SfxUShortRanges -{ - sal_uInt16* _pRanges; // 0-terminated array of sal_uInt16-pairs - -public: - SfxUShortRanges( const SfxUShortRanges &rOrig ); - SfxUShortRanges( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ); - SfxUShortRanges( const sal_uInt16* nNumTable ); - ~SfxUShortRanges() - { delete [] _pRanges; } - - SfxUShortRanges& operator = ( const SfxUShortRanges & ); - - SfxUShortRanges& operator += ( const SfxUShortRanges & ); - - bool IsEmpty() const - { return !_pRanges || 0 == *_pRanges; } - - operator const sal_uInt16* () const - { return _pRanges; } -}; - /** * Creates a sal_uInt16-ranges-array in 'rpRanges' using 'nWh1' and 'nWh2' as * first range, 'nNull' as terminator or start of 2nd range and 'pArgs' as |