[Libreoffice-commits] core.git: include/svl svl/Library_svl.mk svl/source
Jochen Nitschke
j.nitschke+logerrit at ok.de
Wed Oct 26 06:59:53 UTC 2016
include/svl/nranges.hxx | 34 +++++++++++++++++++++++++++-------
svl/Library_svl.mk | 1 +
svl/source/items/itemset.cxx | 4 ++--
svl/source/items/nranges.cxx | 5 +++--
4 files changed, 33 insertions(+), 11 deletions(-)
New commits:
commit 20f2a6b3f719e83a0bef77c214c622026dbe5aca
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date: Tue Oct 25 23:31:31 2016 +0200
untangle .cxx include in itemset.cxx
Change-Id: I0102ad82d82c8f0e9f8939512bae83424613c54e
Reviewed-on: https://gerrit.libreoffice.org/30281
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svl/nranges.hxx b/include/svl/nranges.hxx
index 373086b..d374475 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 8e7b9a2..dc4e70a 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 f8e953a..c104305 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 b445cb7..85ed671 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
More information about the Libreoffice-commits
mailing list