gnumeric r16333 - in branches/gnumeric-1-8: . src



Author: mortenw
Date: Sat Feb  2 01:16:53 2008
New Revision: 16333
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16333&view=rev

Log:
2008-02-01  Morten Welinder  <terra gnome org>

	* src/main-application.c (pathetic_qt_workaround): Work around
	Qt-theme (or Qt-library) bug.
	(main): Install pathetic_qt_workaround.  Fixes #512752.




Modified:
   branches/gnumeric-1-8/ChangeLog
   branches/gnumeric-1-8/NEWS
   branches/gnumeric-1-8/src/main-application.c

Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS	(original)
+++ branches/gnumeric-1-8/NEWS	Sat Feb  2 01:16:53 2008
@@ -8,6 +8,7 @@
 	* Fix non-ascii export problem.  [#511135]
 	* Band-aid evaluation problem with broken xls.  [#513559]
 	* Fix circular array formula problem.
+	* Work around Qt theme bug.  [#512752]
 
 --------------------------------------------------------------------------
 Gnumeric 1.8.1

Modified: branches/gnumeric-1-8/src/main-application.c
==============================================================================
--- branches/gnumeric-1-8/src/main-application.c	(original)
+++ branches/gnumeric-1-8/src/main-application.c	Sat Feb  2 01:16:53 2008
@@ -45,6 +45,7 @@
 #include <fcntl.h>
 #include <time.h>
 #include <string.h>
+#include <locale.h>
 
 #ifdef GNM_WITH_GNOME
 #include <bonobo/bonobo-main.h>
@@ -258,7 +259,7 @@
 	g_slist_free (active_plugins);
 }
 
-static int
+static gboolean
 cb_kill_wbcg (WBCGtk *wbcg)
 {
 	gboolean still_open = wbc_gtk_close (wbcg);
@@ -266,6 +267,26 @@
 	return FALSE;
 }
 
+static gboolean
+pathetic_qt_workaround (void)
+{
+	/*
+	 * When using with the Qt theme, the qt library will be initialized
+	 * somewhere around the time the first widget is created or maybe
+	 * realized.  That code literally does
+	 *
+	 *        setlocale( LC_NUMERIC, "C" );	// make sprintf()/scanf() work
+	 *
+	 * I am not kidding.  It seems like we can fix this by re-setting the
+	 * proper locale when the gui comes up.
+	 *
+	 * See bug 512752, for example.
+	 */
+	setlocale (LC_ALL, "");
+	return FALSE;
+}
+
+
 static void
 check_pango_attr_list_splice_bug (void)
 {
@@ -422,7 +443,7 @@
 				break; /* Don't load any more workbooks */
 		}
 	}
-	/* FIXME: May be we should quit here if we were asked to open
+	/* FIXME: Maybe we should quit here if we were asked to open
 	   files and failed to do so. */
 
 	/* If we were intentionally short circuited exit now */
@@ -445,6 +466,8 @@
 			warn_about_ancient_gnumerics (g_get_prgname(), ioc);
 		}
 		g_object_unref (ioc);
+
+		g_idle_add ((GSourceFunc)pathetic_qt_workaround, NULL);
 #ifdef GNM_WITH_GNOME
 		bonobo_main ();
 #else



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