diff --git a/goffice/gtk/go-format-sel.c b/goffice/gtk/go-format-sel.c
index 0124965..34efb4c 100644
--- a/goffice/gtk/go-format-sel.c
+++ b/goffice/gtk/go-format-sel.c
@@ -831,11 +831,9 @@ set_format_category (GOFormatSel *gfs, int row)
 }
 
 static GOFormatFamily
-study_format (GOFormatSel *gfs)
+study_this_format (GOFormat const *fmt, GOFormatDetails *details)
 {
-	const GOFormat *fmt = gfs->format.spec;
 	gboolean exact;
-	GOFormatDetails *details = &gfs->format.details;
 
 	go_format_get_details (fmt, details, &exact);
 
@@ -853,11 +851,17 @@ study_format (GOFormatSel *gfs)
 		const char *str = go_format_as_XL (fmt);
 		if (!find_builtin (str, details->family, FALSE))
 			details->family = FMT_CUSTOM;
-	}
-
+	}	
+	
 	return details->family;
 }
 
+static GOFormatFamily
+study_format (GOFormatSel *gfs)
+{
+	return study_this_format (gfs->format.spec, &gfs->format.details);
+}
+
 
 static void
 set_format_category_menu_from_style (GOFormatSel *gfs)
@@ -1348,7 +1352,10 @@ go_format_sel_set_locale (GOFormatSel *gfs,
 char const *
 go_format_sel_format_classification (GOFormat const *style_format)
 {
-	GOFormatFamily page = go_format_get_family (style_format);
+	GOFormatFamily page;
+	GOFormatDetails details;
+
+	page = study_this_format (style_format, &details);
 
 	if (page < 0 || page > FMT_CUSTOM)
 		page = FMT_CUSTOM; /* Default to custom */
