summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--basebmp/source/intconversion.hxx11
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx8
2 files changed, 16 insertions, 3 deletions
diff --git a/basebmp/source/intconversion.hxx b/basebmp/source/intconversion.hxx
index d18a88cfe912..407948e80c28 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 b307f955cc2a..c44285220dd2 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 );