summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svl/nranges.hxx34
-rw-r--r--svl/Library_svl.mk1
-rw-r--r--svl/source/items/itemset.cxx4
-rw-r--r--svl/source/items/nranges.cxx5
4 files changed, 33 insertions, 11 deletions
diff --git a/include/svl/nranges.hxx b/include/svl/nranges.hxx
index 373086b33708..d3744755b823 100644
--- a/include/svl/nranges.hxx
+++ b/include/svl/nranges.hxx
@@ -16,16 +16,12 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifdef MACOSX
-// We need an empty block in here. Otherwise, if the #ifndef INCLUDED_SVL_NRANGES_HXX
-// line is the first line, the Mac OS X version of the gcc preprocessor will
-// incorrectly optimize the inclusion process and will never include this file
-// a second time
-#endif
-
#ifndef INCLUDED_SVL_NRANGES_HXX
#define INCLUDED_SVL_NRANGES_HXX
+#include <cstdarg>
+#include <sal/types.h>
+
class SfxUShortRanges
{
sal_uInt16* _pRanges; // 0-terminated array of sal_uInt16-pairs
@@ -48,6 +44,30 @@ public:
{ 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
+ * remainder.
+ *
+ * It returns the number of sal_uInt16s which are contained in the described
+ * set of sal_uInt16s.
+ */
+sal_uInt16 InitializeRanges_Impl( sal_uInt16 *&rpRanges, va_list pArgs,
+ sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull );
+
+/**
+ * Determines the number of sal_uInt16s in a 0-terminated array of pairs of
+ * sal_uInt16s.
+ * The terminating 0 is not included in the count.
+ */
+sal_uInt16 Count_Impl( const sal_uInt16 *pRanges );
+
+/**
+ * Determines the total number of sal_uInt16s described in a 0-terminated
+ * array of pairs of sal_uInt16s, each representing an range of sal_uInt16s.
+ */
+sal_uInt16 Capacity_Impl( const sal_uInt16 *pRanges );
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index 8e7b9a2f1273..dc4e70a8b619 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -91,6 +91,7 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
svl/source/items/itemset \
svl/source/items/lckbitem \
svl/source/items/macitem \
+ svl/source/items/nranges \
svl/source/items/poolcach \
svl/source/items/poolio \
svl/source/items/poolitem \
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index f8e953ac80ad..c10430514061 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -36,10 +36,10 @@
#include <tools/solar.h>
#include <rtl/string.hxx>
-static const sal_uInt16 nInitCount = 10; // Single USHORTs => 5 pairs without '0'
-#include "nranges.cxx"
#include "poolio.hxx"
+static const sal_uInt16 nInitCount = 10; // Single USHORTs => 5 pairs without '0'
+
/**
* Ctor for a SfxItemSet with exactly the Which Ranges, which are known to
* the supplied SfxItemPool.
diff --git a/svl/source/items/nranges.cxx b/svl/source/items/nranges.cxx
index b445cb7f3272..85ed671e9122 100644
--- a/svl/source/items/nranges.cxx
+++ b/svl/source/items/nranges.cxx
@@ -16,13 +16,14 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <svl/nranges.hxx>
#include <cassert>
+#include <cstring>
#include <vector>
-// compiled via include from itemset.cxx only!
-#include <memory>
#include <osl/diagnose.h>
+#include <tools/debug.hxx>
#ifdef DBG_UTIL