canvas/source/vcl/impltools.cxx | 7 ++++-- include/o3tl/compat_functional.hxx | 43 ------------------------------------- 2 files changed, 5 insertions(+), 45 deletions(-)
New commits: commit 7e6628f374cdb87631b54ccdafd69554eda9536e Author: Thorsten Behrens <t...@documentfoundation.org> Date: Tue Apr 15 21:36:02 2014 +0200 Unused code: binary_compose, identity Seems noone is using those anymore. Change-Id: I63f775d391c58753e89549dbcae8739708395487 diff --git a/include/o3tl/compat_functional.hxx b/include/o3tl/compat_functional.hxx index 0484060..6dff02b 100644 --- a/include/o3tl/compat_functional.hxx +++ b/include/o3tl/compat_functional.hxx @@ -37,16 +37,6 @@ namespace o3tl { -/// Identity functor - return the input value -template<class T> -struct identity : public std::unary_function<T, T> -{ - T operator()(const T& y) const - { - return (y); - } -}; - /// Functor, given two parameters, return the first template<class T1,class T2> struct project1st : public std::binary_function<T1, T2, T1> @@ -111,31 +101,6 @@ inline unary_compose<F1, F2> compose1(const F1& fnction1, const F2& fnction2) return (unary_compose<F1, F2>(fnction1, fnction2)); } -/// Calls F2 and F3 for the two args of F1, respectively -template<class F1, class F2, class F3> -class binary_compose : public std::unary_function<typename F2::argument_type,typename F1::result_type> -{ - public: - binary_compose(const F1& fnction1, const F2& fnction2, const F3& fnction3) : ftor1(fnction1), ftor2(fnction2), ftor3(fnction3) {} - - typename F1::result_type operator()(const typename F2::argument_type& y) const - { - return (ftor1(ftor2(y), ftor3(y))); - } - - protected: - F1 ftor1; - F2 ftor2; - F3 ftor3; -}; - -/// Creates functor that calls F2 and F3 for the two args of F1, respectively -template<class F1, class F2, class F3> -inline binary_compose<F1, F2, F3> compose2(const F1& fnction1, const F2& fnction2, const F3& fnction3) -{ - return (binary_compose<F1, F2, F3>(fnction1, fnction2, fnction3)); -} - } // namespace o3tl #endif commit 3764cfbc69815e5e74a689a5aeb07b0668ee861f Author: Thorsten Behrens <t...@documentfoundation.org> Date: Tue Apr 15 21:31:00 2014 +0200 Remove iota template function & last call site. Nice function, but with just one place using it in 9 years best coded verbatim at the call site... Change-Id: Ib306cf2311a39299cb007441c7cb1b0d81e67bce diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index d46ac32..4a5091d 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -48,7 +48,6 @@ #include <basegfx/numeric/ftools.hxx> #include <canvas/canvastools.hxx> -#include <o3tl/compat_functional.hxx> #include "impltools.hxx" #include "canvasbitmap.hxx" @@ -281,7 +280,11 @@ namespace vclcanvas { // source already has alpha channel - 1:1 mapping, // i.e. aAlphaMap[0]=0,...,aAlphaMap[255]=255. - ::o3tl::iota( aAlphaMap, &aAlphaMap[256], 0 ); + sal_uInt8 val=0; + sal_uInt8* pCur=aAlphaMap; + sal_uInt8* const pEnd=&aAlphaMap[256]; + while(pCur != pEnd) + *pCur++ = val++; } else { diff --git a/include/o3tl/compat_functional.hxx b/include/o3tl/compat_functional.hxx index 00ae33c..0484060 100644 --- a/include/o3tl/compat_functional.hxx +++ b/include/o3tl/compat_functional.hxx @@ -136,14 +136,6 @@ inline binary_compose<F1, F2, F3> compose2(const F1& fnction1, const F2& fnction return (binary_compose<F1, F2, F3>(fnction1, fnction2, fnction3)); } -/// Algo that assigns val, val+1, ... to the given range -template<typename FwdIter, typename ValueType> -inline void iota(FwdIter first, FwdIter last, ValueType val) -{ - while(first != last) - *first++ = val++; -} - } // namespace o3tl #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits