summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@gmx.com>2012-07-01 01:06:04 +0200
committerMuthu Subramanian <sumuthu@suse.com>2012-07-11 11:12:15 +0530
commit739e20ac58983925f2076a9848435b7d4fb5366a (patch)
tree17b9a337f9ff5a59760eb52ba261fa02dedfbcae /tools
parent185b8bfc6796ec0a8cc701bf2de5df9cc6abd10d (diff)
Decrease header files dependencies
Change-Id: I654e71e56d60bf629625df09eb93b21c9ef670e8
Diffstat (limited to 'tools')
-rw-r--r--tools/Package_inc.mk1
-rw-r--r--tools/inc/tools/gen.hxx30
-rw-r--r--tools/inc/tools/helpers.hxx33
-rw-r--r--tools/source/generic/line.cxx1
-rw-r--r--tools/source/generic/poly.cxx1
5 files changed, 36 insertions, 30 deletions
diff --git a/tools/Package_inc.mk b/tools/Package_inc.mk
index f216f057be2c..b0ac9ed4cc2b 100644
--- a/tools/Package_inc.mk
+++ b/tools/Package_inc.mk
@@ -49,6 +49,7 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/fsys.hxx,tools/fsys.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/gen.hxx,tools/gen.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/getprocessworkingdir.hxx,tools/getprocessworkingdir.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/globname.hxx,tools/globname.hxx))
+$(eval $(call gb_Package_add_file,tools_inc,inc/tools/helpers.hxx,tools/helpers.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmime.hxx,tools/inetmime.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetmsg.hxx,tools/inetmsg.hxx))
$(eval $(call gb_Package_add_file,tools_inc,inc/tools/inetstrm.hxx,tools/inetstrm.hxx))
diff --git a/tools/inc/tools/gen.hxx b/tools/inc/tools/gen.hxx
index 6c07542b3294..5252bdd22ac7 100644
--- a/tools/inc/tools/gen.hxx
+++ b/tools/inc/tools/gen.hxx
@@ -35,36 +35,6 @@
class SvStream;
-// --------------------
-// - Helper functions -
-// --------------------
-
-inline long MinMax( long nVal, long nMin, long nMax );
-inline long AlignedWidth4Bytes( long nWidthBits );
-inline long FRound( double fVal );
-
-// ---------------
-// - Inlines -
-// ---------------
-
-inline long MinMax( long nVal, long nMin, long nMax )
-{
- return( nVal >= nMin ? ( nVal <= nMax ? nVal : nMax ) : nMin );
-}
-
-// ------------------------------------------------------------------
-
-inline long AlignedWidth4Bytes( long nWidthBits )
-{
- return( ( ( nWidthBits + 31 ) >> 5 ) << 2 );
-}
-
-// ------------------------------------------------------------------
-
-inline long FRound( double fVal )
-{
- return( fVal > 0.0 ? (long) ( fVal + 0.5 ) : -(long) ( -fVal + 0.5 ) );
-}
// --------
// - Pair -
diff --git a/tools/inc/tools/helpers.hxx b/tools/inc/tools/helpers.hxx
new file mode 100644
index 000000000000..f34a7c20893c
--- /dev/null
+++ b/tools/inc/tools/helpers.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+
+#ifndef _TOOLS_HELPERS_HXX
+#define _TOOLS_HELPERS_HXX
+
+inline long MinMax( long nVal, long nMin, long nMax )
+{
+ return nVal >= nMin ? ( nVal <= nMax ? nVal : nMax ) : nMin;
+}
+
+
+inline long AlignedWidth4Bytes( long nWidthBits )
+{
+ return ( ( nWidthBits + 31 ) >> 5 ) << 2;
+}
+
+
+inline long FRound( double fVal )
+{
+ return fVal > 0.0 ? static_cast<long>( fVal + 0.5 ) : -static_cast<long>( -fVal + 0.5 );
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/generic/line.cxx b/tools/source/generic/line.cxx
index 5b9073efaeae..d9984efcc731 100644
--- a/tools/source/generic/line.cxx
+++ b/tools/source/generic/line.cxx
@@ -29,6 +29,7 @@
#include <tools/link.hxx>
#include <tools/line.hxx>
#include <tools/debug.hxx>
+#include <tools/helpers.hxx>
#include <cstdlib>
#include <math.h>
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 7f2afcac7661..b712e6449f46 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -29,6 +29,7 @@
#include <osl/endian.h>
#include <tools/bigint.hxx>
#include <tools/debug.hxx>
+#include <tools/helpers.hxx>
#include <tools/stream.hxx>
#include <tools/vcompat.hxx>
#include <poly.h>