goffice r2236 - in trunk: . goffice goffice/graph goffice/math goffice/utils



Author: jody
Date: Tue Oct 14 10:53:26 2008
New Revision: 2236
URL: http://svn.gnome.org/viewvc/goffice?rev=2236&view=rev

Log:
win32 build fixes


Modified:
   trunk/ChangeLog
   trunk/goffice/goffice.c
   trunk/goffice/graph/gog-style.c
   trunk/goffice/math/go-distribution.h
   trunk/goffice/utils/go-file.c
   trunk/goffice/utils/go-image.c

Modified: trunk/goffice/goffice.c
==============================================================================
--- trunk/goffice/goffice.c	(original)
+++ trunk/goffice/goffice.c	Tue Oct 14 10:53:26 2008
@@ -50,6 +50,12 @@
 
 #include <libintl.h>
 
+#ifdef G_OS_WIN32
+#define STRICT
+#include <windows.h>	// pickup HMODULE
+#undef STRICT
+#endif
+
 int goffice_graph_debug_level = 0;
 
 static char const *libgoffice_data_dir   = GOFFICE_DATADIR;
@@ -85,10 +91,17 @@
 
 #ifdef G_OS_WIN32
 	{
+	gchar *dir;
+
 #define S(s)	#s
-	gchar *dir = g_win32_get_package_installation_directory (NULL, (char *)
-		"libgoffice-" S(GO_VERSION_EPOCH) "-" S(GO_VERSION_MAJOR) ".dll");
+	char const *module_name = 
+		"libgoffice-" S(GO_VERSION_EPOCH) "-" S(GO_VERSION_MAJOR) ".dll";
 #undef S
+	wchar_t *wc_module_name = g_utf8_to_utf16 (module_name, -1, NULL, NULL, NULL);
+	HMODULE hmodule = GetModuleHandleW (wc_module_name);
+	g_free (wc_module_name);
+	dir = g_win32_get_package_installation_directory_of_module (hmodule);
+
 	libgoffice_data_dir = g_build_filename (dir,
 		"share", "goffice", GOFFICE_VERSION, NULL);
 	libgoffice_icon_dir = g_build_filename (dir,

Modified: trunk/goffice/graph/gog-style.c
==============================================================================
--- trunk/goffice/graph/gog-style.c	(original)
+++ trunk/goffice/graph/gog-style.c	Tue Oct 14 10:53:26 2008
@@ -1397,6 +1397,11 @@
 		gog_style_gradient_sax_save (output, style);
 		break;
 	case GOG_FILL_STYLE_IMAGE:
+		if (NULL == style->fill.image.image) {
+			g_warning ("droping fill with missing image");
+			break;
+		}
+
 		gsf_xml_out_start_element (output, "image");
 		/* FIXME : type is not a good characterization */
 		gsf_xml_out_add_cstr_unchecked (output, "type",

Modified: trunk/goffice/math/go-distribution.h
==============================================================================
--- trunk/goffice/math/go-distribution.h	(original)
+++ trunk/goffice/math/go-distribution.h	Tue Oct 14 10:53:26 2008
@@ -50,7 +50,6 @@
 GType go_distribution_get_type (void);
 
 GODistribution *go_distribution_new (GODistributionType type);
-GODistribution *go_distribution_new_by_name (char const *name);
 GODistributionType go_distribution_get_distribution_type (GODistribution *dist);
 char const *go_distribution_get_distribution_name (GODistribution *dist);
 

Modified: trunk/goffice/utils/go-file.c
==============================================================================
--- trunk/goffice/utils/go-file.c	(original)
+++ trunk/goffice/utils/go-file.c	Tue Oct 14 10:53:26 2008
@@ -691,6 +691,7 @@
 		file_permissions->owner_write   = ((mode & S_IWUSR) != 0);
 		file_permissions->owner_execute = ((mode & S_IXUSR) != 0);
 
+#ifndef G_OS_WIN32
 		/* Group  Permissions */
 		file_permissions->group_read    = ((mode & S_IRGRP) != 0);
 		file_permissions->group_write   = ((mode & S_IWGRP) != 0);
@@ -700,6 +701,14 @@
 		file_permissions->others_read    = ((mode & S_IROTH) != 0);
 		file_permissions->others_write   = ((mode & S_IWOTH) != 0);
 		file_permissions->others_execute = ((mode & S_IXOTH) != 0);
+#else
+		file_permissions->group_read    =
+		file_permissions->group_write   =
+		file_permissions->group_execute =
+		file_permissions->others_read    =
+		file_permissions->others_write   =
+		file_permissions->others_execute = FALSE;
+#endif /* G_OS_WIN32 */
 	}
 		
 	if (info)
@@ -726,6 +735,7 @@
 	if (file_permissions->owner_execute == TRUE)
 		permissions |= S_IXUSR;
 
+#ifndef G_OS_WIN32
 	/* Set group permissions */
 	if (file_permissions->group_read == TRUE)
 		permissions |= S_IRGRP;
@@ -745,6 +755,7 @@
 
 	if (file_permissions->others_execute == TRUE)
 		permissions |= S_IXOTH;
+#endif
 
 	/* Try setting unix mode */
 	g_file_set_attribute_uint32 (file,

Modified: trunk/goffice/utils/go-image.c
==============================================================================
--- trunk/goffice/utils/go-image.c	(original)
+++ trunk/goffice/utils/go-image.c	Tue Oct 14 10:53:26 2008
@@ -656,6 +656,7 @@
 char const *
 go_image_get_name (GOImage *image)
 {
+	g_return_val_if_fail (IS_GO_IMAGE (image), NULL);
 	return image->name;
 }
 



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