[Libreoffice-commits] core.git: 2 commits - canvas/source framework/source include/canvas include/comphelper

Michael Stahl mstahl at redhat.com
Thu Jul 9 01:26:17 PDT 2015


 canvas/source/cairo/cairo_spritecanvashelper.cxx  |    1 
 canvas/source/directx/dx_spritecanvashelper.cxx   |    1 
 canvas/source/opengl/ogl_canvashelper.cxx         |    2 +
 canvas/source/vcl/spritecanvas.cxx                |    2 +
 canvas/source/vcl/spritecanvashelper.cxx          |    1 
 framework/source/fwe/helper/undomanagerhelper.cxx |    4 ++-
 include/canvas/base/bufferedgraphicdevicebase.hxx |    7 ++---
 include/canvas/base/graphicdevicebase.hxx         |   24 +++++++------------
 include/canvas/spriteredrawmanager.hxx            |    1 
 include/canvas/verifyinput.hxx                    |    1 
 include/comphelper/flagguard.hxx                  |   27 +++++++++++-----------
 include/comphelper/scopeguard.hxx                 |    1 
 12 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit e6a0ef5eeea7b353541d1c45b5b3c8c11344ab41
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jul 8 22:23:43 2015 +0200

    comphelper: remove boost::bind from headers
    
    Change-Id: I40c504d086c8ae1fd825acdafaada283ad9db8d0

diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx b/framework/source/fwe/helper/undomanagerhelper.cxx
index c9b68c7..36d84b5 100644
--- a/framework/source/fwe/helper/undomanagerhelper.cxx
+++ b/framework/source/fwe/helper/undomanagerhelper.cxx
@@ -29,9 +29,11 @@
 #include <tools/diagnose_ex.h>
 #include <osl/conditn.hxx>
 
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+
 #include <stack>
 #include <queue>
-#include <boost/function.hpp>
 
 namespace framework
 {
diff --git a/include/comphelper/flagguard.hxx b/include/comphelper/flagguard.hxx
index 30106c1..7ab88e4 100644
--- a/include/comphelper/flagguard.hxx
+++ b/include/comphelper/flagguard.hxx
@@ -26,15 +26,13 @@
 namespace comphelper
 {
 
-
-
     //= FlagRestorationGuard
 
     class COMPHELPER_DLLPUBLIC FlagRestorationGuard : public ScopeGuard
     {
     public:
         FlagRestorationGuard( bool& i_flagRef, bool i_temporaryValue, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
-            :ScopeGuard( ::boost::bind( RestoreFlag, ::boost::ref( i_flagRef ), !!i_flagRef ), i_excHandling )
+            : ScopeGuard(RestoreFlag(i_flagRef), i_excHandling)
         {
             i_flagRef = i_temporaryValue;
         }
@@ -42,10 +40,19 @@ namespace comphelper
         ~FlagRestorationGuard();
 
     private:
-        static void RestoreFlag( bool& i_flagRef, bool i_originalValue )
+        // note: can't store the originalValue in a FlagRestorationGuard member,
+        // because it will be used from base class dtor
+        struct RestoreFlag
         {
-            i_flagRef = i_originalValue;
-        }
+            bool & rFlag;
+            bool originalValue;
+            RestoreFlag(bool & i_flagRef)
+                : rFlag(i_flagRef), originalValue(i_flagRef) {}
+            void operator()()
+            {
+                rFlag = originalValue;
+            }
+        };
     };
 
 
@@ -55,18 +62,12 @@ namespace comphelper
     {
     public:
         explicit FlagGuard( bool& i_flagRef, exc_handling i_excHandling = IGNORE_EXCEPTIONS )
-            :ScopeGuard( ::boost::bind( ResetFlag, ::boost::ref( i_flagRef ) ), i_excHandling )
+            : ScopeGuard( [&i_flagRef] () { i_flagRef = false; }, i_excHandling)
         {
             i_flagRef = true;
         }
 
         ~FlagGuard();
-
-    private:
-        static void ResetFlag( bool& i_flagRef )
-        {
-            i_flagRef = false;
-        }
     };
 
 
diff --git a/include/comphelper/scopeguard.hxx b/include/comphelper/scopeguard.hxx
index 4f64d5b..f120cd7 100644
--- a/include/comphelper/scopeguard.hxx
+++ b/include/comphelper/scopeguard.hxx
@@ -22,7 +22,6 @@
 
 #include <comphelper/comphelperdllapi.h>
 #include <boost/function.hpp>
-#include <boost/bind.hpp>
 
 namespace comphelper {
 
commit e8eb49995a9d8baba19b527fbccc7aebcdf259a6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jul 8 17:54:08 2015 +0200

    canvas: remove boost::bind from headers
    
    Change-Id: Ieaa8a74d59ee9c74fafe823e01db4a349c49821e

diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx
index 3f638a8..a07fc1e 100644
--- a/canvas/source/cairo/cairo_spritecanvashelper.cxx
+++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx
@@ -29,6 +29,7 @@
 #include <basegfx/range/b2drectangle.hxx>
 #include <basegfx/tools/canvastools.hxx>
 
+#include <boost/bind.hpp>
 #include <boost/cast.hpp>
 
 #include "cairo_spritecanvashelper.hxx"
diff --git a/canvas/source/directx/dx_spritecanvashelper.cxx b/canvas/source/directx/dx_spritecanvashelper.cxx
index 67f0d81..6a06c6a 100644
--- a/canvas/source/directx/dx_spritecanvashelper.cxx
+++ b/canvas/source/directx/dx_spritecanvashelper.cxx
@@ -28,6 +28,7 @@
 #include <basegfx/range/b2drectangle.hxx>
 #include <basegfx/tools/canvastools.hxx>
 
+#include <boost/bind.hpp>
 #include <boost/cast.hpp>
 
 #include "dx_spritecanvashelper.hxx"
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index 15bac80..3861c4a 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -36,6 +36,8 @@
 
 #include <GL/glew.h>
 
+#include <boost/bind.hpp>
+
 #include <memory>
 
 
diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx
index 91e2103..bcbaffb 100644
--- a/canvas/source/vcl/spritecanvas.cxx
+++ b/canvas/source/vcl/spritecanvas.cxx
@@ -34,6 +34,8 @@
 
 #include <basegfx/tools/canvastools.hxx>
 
+#include <boost/bind.hpp>
+
 #include <algorithm>
 
 #include "spritecanvas.hxx"
diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx
index e6fa3e7f7..d7a7fee 100644
--- a/canvas/source/vcl/spritecanvashelper.cxx
+++ b/canvas/source/vcl/spritecanvashelper.cxx
@@ -31,6 +31,7 @@
 #include <basegfx/range/b2drectangle.hxx>
 #include <basegfx/tools/canvastools.hxx>
 
+#include <boost/bind.hpp>
 #include <boost/cast.hpp>
 
 #include "spritecanvashelper.hxx"
diff --git a/include/canvas/base/bufferedgraphicdevicebase.hxx b/include/canvas/base/bufferedgraphicdevicebase.hxx
index 102f048..c9aec5f 100644
--- a/include/canvas/base/bufferedgraphicdevicebase.hxx
+++ b/include/canvas/base/bufferedgraphicdevicebase.hxx
@@ -87,10 +87,9 @@ namespace canvas
             mbIsVisible( false ),
             mbIsTopLevel( false )
         {
-            BaseType::maPropHelper.addProperties( PropertySetHelper::MakeMap
-                                                  ("Window",
-                                                   boost::bind(&OurType::getXWindow,
-                                                               this)));
+            BaseType::maPropHelper.addProperties(
+                PropertySetHelper::MakeMap("Window",
+                   [this] () { return this->getXWindow(); }));
         }
 
         // XGraphicDevice
diff --git a/include/canvas/base/graphicdevicebase.hxx b/include/canvas/base/graphicdevicebase.hxx
index e7c75c8..83b5adc69 100644
--- a/include/canvas/base/graphicdevicebase.hxx
+++ b/include/canvas/base/graphicdevicebase.hxx
@@ -119,21 +119,15 @@ namespace canvas
             mbDumpScreenContent(false)
         {
             maPropHelper.initProperties( PropertySetHelper::MakeMap
-                                         ("HardwareAcceleration",
-                                          boost::bind(&DeviceHelper::isAccelerated,
-                                                      boost::ref(maDeviceHelper)))
-                                         ("DeviceHandle",
-                                          boost::bind(&DeviceHelper::getDeviceHandle,
-                                                      boost::ref(maDeviceHelper)))
-                                         ("SurfaceHandle",
-                                          boost::bind(&DeviceHelper::getSurfaceHandle,
-                                                      boost::ref(maDeviceHelper)))
-                                         ("DumpScreenContent",
-                                          boost::bind(&ThisType::getDumpScreenContent,
-                                                      this),
-                                          boost::bind(&ThisType::setDumpScreenContent,
-                                                      this,
-                                                      _1)));
+                ("HardwareAcceleration",
+                 [this] () { return this->maDeviceHelper.isAccelerated(); } )
+                ("DeviceHandle",
+                 [this] () { return this->maDeviceHelper.getDeviceHandle(); } )
+                ("SurfaceHandle",
+                 [this] () { return this->maDeviceHelper.getSurfaceHandle(); } )
+                ("DumpScreenContent",
+                 [this] () { return this->getDumpScreenContent(); },
+                 [this] (css::uno::Any const& rAny) { this->setDumpScreenContent(rAny); }));
         }
 
         virtual void disposeThis() SAL_OVERRIDE
diff --git a/include/canvas/spriteredrawmanager.hxx b/include/canvas/spriteredrawmanager.hxx
index 7609b4f..f56970d 100644
--- a/include/canvas/spriteredrawmanager.hxx
+++ b/include/canvas/spriteredrawmanager.hxx
@@ -33,7 +33,6 @@
 #include <algorithm>
 
 #include <boost/utility.hpp>
-#include <boost/bind.hpp>
 
 #include <canvas/canvastoolsdllapi.h>
 
diff --git a/include/canvas/verifyinput.hxx b/include/canvas/verifyinput.hxx
index 14f8676..e3a2c1f 100644
--- a/include/canvas/verifyinput.hxx
+++ b/include/canvas/verifyinput.hxx
@@ -27,7 +27,6 @@
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 
 #include <algorithm>
-#include <boost/bind.hpp>
 #include <boost/current_function.hpp>
 
 #include <canvas/canvastoolsdllapi.h>


More information about the Libreoffice-commits mailing list