Author: rpmcruz
Date: Wed Nov 7 17:26:50 2007
New Revision: 41862
URL: http://svn.opensuse.org/viewcvs/yast?rev=41862&view=rev
Log:
* src/ygtkratiobox.c: bug fix, dialog on disk.ycp tool was gutted.
Unsigned types involved on arithmetic operation resulting in some overflows.
As an extra issue size_request is not returning the exact size needed
(maybe a round problem?)
You should sent this upstream ASAP since it renders the disk tool useless
(in case you have sent a package upstream after Oct 11, which I guess was
when the bug was introduced: r41393.)
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGDialog.cc
trunk/gtk/src/YGPackageSelector.cc
trunk/gtk/src/YGUI.cc
trunk/gtk/src/YGUI.h
trunk/gtk/src/ygtkratiobox.c
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=41862&r1=41861&r2=41862&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Wed Nov 7 17:26:50 2007
@@ -1,3 +1,14 @@
+2007-11-07 Ricardo Cruz
+
+ * src/ygtkratiobox.c: bug fix, dialog on disk.ycp tool was gutted.
+ Unsigned types involved on arithmetic operation resulting in some overflows.
+ As an extra issue size_request is not returning the exact size needed
+ (maybe a round problem?)
+
+ You should sent this upstream ASAP since it renders the disk tool useless
+ (in case you have sent a package upstream after Oct 11, which I guess was
+ when the bug was introduced: r41393.)
+
2007-10-31 Ricardo Cruz
* src/ygtkmenubutton.c: simplified menu pos code.
Modified: trunk/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=41862&r1=41861&r2=41862&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.cc (original)
+++ trunk/gtk/src/YGDialog.cc Wed Nov 7 17:26:50 2007
@@ -154,7 +154,7 @@
system ("/usr/bin/xterm &");
return TRUE;
case GDK_T:
- dumpYastTree (pThis->getChild(), GTK_WINDOW (pThis->getWidget()));
+ dumpYastTree (pThis->getChild());
return TRUE;
case GDK_E: // easter egg
static guint explode_timeout = 0;
Modified: trunk/gtk/src/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelector.cc?rev=41862&r1=41861&r2=41862&view=diff
==============================================================================
--- trunk/gtk/src/YGPackageSelector.cc (original)
+++ trunk/gtk/src/YGPackageSelector.cc Wed Nov 7 17:26:50 2007
@@ -2677,3 +2677,4 @@
y2error ("The GTK+ UI does not support PkgSpecial subwidgets!");
return 0;
}
+
Modified: trunk/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=41862&r1=41861&r2=41862&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Wed Nov 7 17:26:50 2007
@@ -217,17 +217,15 @@
static void destroy_dialog (GtkDialog *dialog, gint arg)
{ IMPL; gtk_widget_destroy (GTK_WIDGET (dialog)); }
-void dumpYastTree (YWidget *widget, GtkWindow *parent_window)
+void dumpYastTree (YWidget *widget)
{
IMPL
GtkTreeStore *store = gtk_tree_store_new (4, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING);
dumpYastTree (widget, store, NULL);
- GtkWidget *dialog = gtk_dialog_new_with_buttons ("YWidgets Tree",
- parent_window,
- GtkDialogFlags (GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR),
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
+ GtkWidget *dialog = gtk_dialog_new_with_buttons ("YWidgets Tree", NULL,
+ GtkDialogFlags (GTK_DIALOG_NO_SEPARATOR), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 400);
GtkWidget *view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
Modified: trunk/gtk/src/YGUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.h?rev=41862&r1=41861&r2=41862&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.h (original)
+++ trunk/gtk/src/YGUI.h Wed Nov 7 17:26:50 2007
@@ -305,6 +305,7 @@
};
// debug helpers.
-void dumpYastTree (YWidget *widget, GtkWindow *parent_window = 0);
+void dumpYastTree (YWidget *widget);
#endif // YGUI_H
+
Modified: trunk/gtk/src/ygtkratiobox.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkratiobox.c?rev=41862&r1=41861&r2=41862&view=diff
==============================================================================
--- trunk/gtk/src/ygtkratiobox.c (original)
+++ trunk/gtk/src/ygtkratiobox.c Wed Nov 7 17:26:50 2007
@@ -175,7 +175,7 @@
// a first loop to get some data for expansibles (ie. childs with weight)
gfloat ratios_sum = 0;
- guint expand_num = 0, max_ratio = 0;
+ gint expand_num = 0, max_ratio = 0;
gint expansable_length;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
expansable_length = allocation->width - border*2;
@@ -209,7 +209,6 @@
}
expansable_length -= box->weight_length;
-
gint child_pos = 0;
if (orientation == GTK_ORIENTATION_HORIZONTAL)
child_pos = allocation->x + border;
@@ -245,7 +244,9 @@
length = (box_child->ratio * available_length) / ratios_sum;
}
else if (box_child->expand && (ratios_sum == 0 || box_child->must_expand))
+ {
length += expansable_length / expand_num;
+ }
if (orientation == GTK_ORIENTATION_HORIZONTAL) {
child_alloc.x = child_pos;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org