[gtkmm] style.hg: get_style_property(): Use const_cast to maybe



commit c58575fcbd924962ad8df5dc8b79322530b5e8c8
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Sep 21 09:50:35 2009 +0200

    style.hg: get_style_property(): Use const_cast to maybe
    avoid a (correct) compiler error with the Intel C++ compiler.
    Bug #594171 (Alexander Shaduri).
    
    * gdk/src/gdk_methods.defs: Comment out an unused broken definition.

 ChangeLog                |    8 ++++++++
 gdk/src/gdk_methods.defs |   18 +++++++++---------
 gtk/src/style.hg         |    8 +++++++-
 3 files changed, 24 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0f59907..5d9c6d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-21  Murray Cumming  <murrayc murrayc com>
+
+	* gtk/src/style.hg: get_style_property(): Use const_cast to maybe 
+	avoid a (correct) compiler error with the Intel C++ compiler.
+	Bug #594171 (Alexander Shaduri).
+
+	* gdk/src/gdk_methods.defs: Comment out an unused broken definition.
+
 2009-09-19  Daniel Elstner  <daniel kitta gmail com>
 
 	Support Automake silent rules
diff --git a/gdk/src/gdk_methods.defs b/gdk/src/gdk_methods.defs
index 972200b..bcf1684 100644
--- a/gdk/src/gdk_methods.defs
+++ b/gdk/src/gdk_methods.defs
@@ -6441,15 +6441,15 @@
   )
 )
 
-(define-method invalidate_maybe_recurse
-  (of-object "GdkWindow")
-  (c-name "gdk_window_invalidate_maybe_recurse")
-  (return-type "none")
-  (parameters
-    '("const-GdkRegion*" "region")
-    '("gboolean-(*" "child_func")
-  )
-)
+;;(define-method invalidate_maybe_recurse
+;;  (of-object "GdkWindow")
+;; (c-name "gdk_window_invalidate_maybe_recurse")
+;;  (return-type "none")
+;;  (parameters
+;;    '("const-GdkRegion*" "region")
+;;    '("gboolean-(*" "child_func")
+;;  )
+;;)
 
 (define-method get_update_area
   (of-object "GdkWindow")
diff --git a/gtk/src/style.hg b/gtk/src/style.hg
index 63f2b7a..5cc0074 100644
--- a/gtk/src/style.hg
+++ b/gtk/src/style.hg
@@ -612,7 +612,13 @@ void Style::get_style_property(GType widget_type, const Glib::ustring& property_
   Glib::Value<PropertyType> property_value;
   property_value.init(Glib::Value<PropertyType>::value_type());
 
-  this->get_style_property_value(widget_type, property_name, property_value);
+  //We cast away the const.
+  //TODO: Either this get_style_property() should be non-const, 
+  //or get_style_property_value() should be const.
+  //We can't really have both const and unconst versions of them because output parameters can't be const.
+  //Bug https://bugzilla.gnome.org/show_bug.cgi?id=594171
+  Style* unconst_this = const_cast<Style*>(this);
+  unconst_this->get_style_property_value(widget_type, property_name, property_value);
 
   value = property_value.get();
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]