summaryrefslogtreecommitdiff
path: root/basebmp/inc
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2006-07-21 19:57:06 +0000
committerThorsten Behrens <thb@openoffice.org>2006-07-21 19:57:06 +0000
commit9e67e628d6cd4b04d192ac5f0528eb3cb691b219 (patch)
tree2f06f398d918f577c8ed61f22c8ffbbcfef14e0c /basebmp/inc
parented20c63f1ae67bb14b99be34a4bcdf56a0317e0f (diff)
#i65904# Compiler compatibility changes: made the BOOST_NO_MEMBER_TEMPLATE_FRIENDS path actually work; added SunCC kludge for nested template as function template parameter problem; corrected blend_functor specialization to make msvc happy
Diffstat (limited to 'basebmp/inc')
-rw-r--r--basebmp/inc/basebmp/accessoradapters.hxx46
-rw-r--r--basebmp/inc/basebmp/accessorfunctors.hxx6
-rw-r--r--basebmp/inc/basebmp/color.hxx6
-rw-r--r--basebmp/inc/basebmp/colormisc.hxx6
4 files changed, 34 insertions, 30 deletions
diff --git a/basebmp/inc/basebmp/accessoradapters.hxx b/basebmp/inc/basebmp/accessoradapters.hxx
index 0d0599a43760..b990e592b5e4 100644
--- a/basebmp/inc/basebmp/accessoradapters.hxx
+++ b/basebmp/inc/basebmp/accessoradapters.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: accessoradapters.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: thb $ $Date: 2006-07-12 15:09:43 $
+ * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -61,6 +61,10 @@ template< class WrappedAccessor,
typename GetterFunctor,
typename SetterFunctor > class UnaryFunctionAccessorAdapter
{
+public:
+ typedef typename GetterFunctor::result_type value_type;
+ typedef typename SetterFunctor::argument_type argument_type;
+
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
// making all members public, if no member template friends
private:
@@ -74,9 +78,6 @@ private:
SetterFunctor maSetterFunctor;
public:
- typedef typename GetterFunctor::result_type value_type;
- typedef typename SetterFunctor::argument_type argument_type;
-
UnaryFunctionAccessorAdapter() :
maAccessor(),
maGetterFunctor(),
@@ -92,7 +93,7 @@ public:
maSetterFunctor( rSrc.maSetterFunctor )
{}
- template< class T > explicit UnaryFunctionAccessorAdapter( T accessor ) :
+ template< class T > explicit UnaryFunctionAccessorAdapter( T const& accessor ) :
maAccessor( accessor ),
maGetterFunctor(),
maSetterFunctor()
@@ -178,6 +179,10 @@ public:
template< class WrappedAccessor,
typename SetterFunctor > class BinarySetterFunctionAccessorAdapter
{
+public:
+ typedef typename WrappedAccessor::value_type value_type;
+ typedef typename SetterFunctor::second_argument_type argument_type;
+
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
// making all members public, if no member template friends
private:
@@ -188,9 +193,6 @@ private:
SetterFunctor maFunctor;
public:
- typedef typename WrappedAccessor::value_type value_type;
- typedef typename SetterFunctor::second_argument_type argument_type;
-
BinarySetterFunctionAccessorAdapter() :
maAccessor(),
maFunctor()
@@ -204,7 +206,7 @@ public:
maFunctor( rSrc.maFunctor )
{}
- template< class T > explicit BinarySetterFunctionAccessorAdapter( T accessor ) :
+ template< class T > explicit BinarySetterFunctionAccessorAdapter( T const& accessor ) :
maAccessor( accessor ),
maFunctor()
{}
@@ -293,6 +295,10 @@ template< class WrappedAccessor1,
class WrappedAccessor2,
typename Functor > class TernarySetterFunctionAccessorAdapter
{
+public:
+ typedef typename WrappedAccessor1::value_type value_type;
+ typedef typename Functor::third_argument_type argument_type;
+
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
// making all members public, if no member template friends
private:
@@ -304,16 +310,13 @@ private:
Functor maFunctor;
public:
- typedef typename WrappedAccessor1::value_type value_type;
- typedef typename Functor::third_argument_type argument_type;
-
TernarySetterFunctionAccessorAdapter() :
ma1stAccessor(),
ma2ndAccessor(),
maFunctor()
{}
- template< class T > explicit TernarySetterFunctionAccessorAdapter( T accessor ) :
+ template< class T > explicit TernarySetterFunctionAccessorAdapter( T const& accessor ) :
ma1stAccessor( accessor ),
ma2ndAccessor(),
maFunctor()
@@ -428,6 +431,13 @@ public:
template< class WrappedAccessor1,
class WrappedAccessor2 > class JoinImageAccessorAdapter
{
+public:
+ // TODO(F3): Need numeric traits and a few free functions to
+ // actually calculate with a pair (semantic: apply every operation
+ // individually to the contained types)
+ typedef std::pair<typename WrappedAccessor1::value_type,
+ typename WrappedAccessor2::value_type> value_type;
+
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
// making all members public, if no member template friends
private:
@@ -438,18 +448,12 @@ private:
WrappedAccessor2 ma2ndAccessor;
public:
- // TODO(F3): Need numeric traits and a few free functions to
- // actually calculate with a pair (semantic: apply every operation
- // individually to the contained types)
- typedef std::pair<typename WrappedAccessor1::value_type,
- typename WrappedAccessor2::value_type> value_type;
-
JoinImageAccessorAdapter() :
ma1stAccessor(),
ma2ndAccessor()
{}
- template< class T > explicit JoinImageAccessorAdapter( T accessor ) :
+ template< class T > explicit JoinImageAccessorAdapter( T const& accessor ) :
ma1stAccessor( accessor ),
ma2ndAccessor()
{}
diff --git a/basebmp/inc/basebmp/accessorfunctors.hxx b/basebmp/inc/basebmp/accessorfunctors.hxx
index 89a30772459c..0c22d29a6032 100644
--- a/basebmp/inc/basebmp/accessorfunctors.hxx
+++ b/basebmp/inc/basebmp/accessorfunctors.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: accessorfunctors.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2006-07-13 12:03:25 $
+ * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -158,7 +158,7 @@ template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,false
An adaptable ternary functor (as can e.g. be passed to the
TernarySetterFunctionAccessorAdapter)
*/
-template< typename Functor > class BinaryFunctorSplittingWrapper :
+template< typename Functor > struct BinaryFunctorSplittingWrapper :
public std::binary_function<typename Functor::first_argument_type,
std::pair<typename Functor::third_argument_type,
typename Functor::second_argument_type>,
diff --git a/basebmp/inc/basebmp/color.hxx b/basebmp/inc/basebmp/color.hxx
index 72b3325f78ed..218947205a13 100644
--- a/basebmp/inc/basebmp/color.hxx
+++ b/basebmp/inc/basebmp/color.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: color.hxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: thb $ $Date: 2006-07-12 15:09:44 $
+ * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -99,7 +99,7 @@ public:
getGreen()==rhs.getGreen() &&
getBlue()==rhs.getBlue()); }
bool operator!=( const Color& rhs ) const { return !(*this==rhs); }
- double magnitude() const { return sqrt(getRed()*getRed()
+ double magnitude() const { return sqrt((double)getRed()*getRed()
+ getGreen()*getGreen()
+ getBlue()*getBlue()); }
};
diff --git a/basebmp/inc/basebmp/colormisc.hxx b/basebmp/inc/basebmp/colormisc.hxx
index c4f1ec0126a4..5a6eeadb3750 100644
--- a/basebmp/inc/basebmp/colormisc.hxx
+++ b/basebmp/inc/basebmp/colormisc.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: colormisc.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: thb $ $Date: 2006-07-13 12:03:25 $
+ * last change: $Author: thb $ $Date: 2006-07-21 20:57:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -130,7 +130,7 @@ template<> struct ColorTraits< Color >
};
/// Only defined for 8 bit alpha, currently
-template<> template<bool polarity> struct ColorTraits< Color >::blend_functor< sal_uInt8, polarity >
+template<bool polarity> struct ColorTraits< Color >::blend_functor< sal_uInt8, polarity >
{
typedef ColorBlendFunctor<polarity> type;
};