[Libreoffice-commits] .: basebmp/source vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Tue Nov 23 07:47:23 PST 2010


 basebmp/source/intconversion.hxx         |   11 +++++++++--
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |    8 +++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit c54ff0f2cd3cd28839b1053ff72c6f79e99da5bc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 23 15:47:07 2010 +0000

    make possible to build with c++0x

diff --git a/basebmp/source/intconversion.hxx b/basebmp/source/intconversion.hxx
index 966f1d3..b03aaab 100644
--- a/basebmp/source/intconversion.hxx
+++ b/basebmp/source/intconversion.hxx
@@ -57,11 +57,18 @@ namespace basebmp
         }
     };
 
+    //Current c++0x draft (apparently) has std::identity, but not operator()
+    template<typename T> struct SGI_identity : public std::unary_function<T,T>
+    {
+        T& operator()(T& x) const { return x; }
+        const T& operator()(const T& x) const { return x; }
+    };
+
     /// Get converter from given data type to sal_uInt32
     template< typename DataType > struct uInt32Converter
     {
-        typedef std::identity<DataType> to;
-        typedef std::identity<DataType> from;
+        typedef SGI_identity<DataType> to;
+        typedef SGI_identity<DataType> from;
     };
     template< unsigned int RedIndex, 
               unsigned int GreenIndex, 
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 13e3852..12566f3 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -918,7 +918,13 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck(	ControlType nType,
     // draw upper half in off state
     const_cast<ImplControlValue&>(aValue).setTristateVal( BUTTONVALUE_OFF );
     XLIB_Region aRegion = XCreateRegion();
-    XRectangle aXRect = { aCtrlRect.Left(), aCtrlRect.Top(), aCtrlRect.GetWidth(), aCtrlRect.GetHeight() };
+    XRectangle aXRect =
+    {
+        static_cast<short>(aCtrlRect.Left()),
+        static_cast<short>(aCtrlRect.Top()),
+        static_cast<unsigned short>(aCtrlRect.GetWidth()),
+        static_cast<unsigned short>(aCtrlRect.GetHeight())
+    };
     const unsigned short nH = aXRect.height/2;
     aXRect.height -= nH;
     XUnionRectWithRegion( &aXRect, aRegion, aRegion );


More information about the Libreoffice-commits mailing list