Commit 1d8a5180 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Don't leak a style when faced with an empty label.

2007-09-24  Jody Goldberg <jody@gnome.org>

	* ms-chart.c (BC_R(end)) : Don't leak a style when faced with an empty
	  label.

2007-09-24  Jody Goldberg <jody@gnome.org>

	Merge in the win32 cleanup work
	* src/Makefile.am : Add a libspreadsheet CFLAG -DGNUMERIC_INTERNAL to
	  control dllimport/dllexport for win32.  Required some adjustment of
	  built-sources.

	* src/libgnumeric.h : Add 'GNM_VAR_DECL' and use it for extern data
	  that will be publicly visible.

	* src/libgnumeric.c : re-order and handle some of the renaming
	  style_init -> gnm_font_init, and gnumeric_color -> gnm_color.
	(gnm_get_option_group) : move the shared cmd line arg parsing in here
	  rather than duplicating the handlers in all the client apps.
	* src/main-application.c (gnumeric_arg_parse) : eg from here.
	  Rather than using global variables, pass the arguments as
	  parameters to clean things up.
	* src/ssconvert.c (main) : Use it here.
	* src/ssindex.c (main) : and here.

	* src/print-cell.h : just include the necessary gtk headers.  Even
	  this breaks WITH_GTK work.  Why isn't this ins glib ?
	* src/print.h : Move the renamed internal (not dllexported)
	  gnm_print_debug flag here

	* src/style.c : s/StyleFont/GnmFont/ and clean up the associated
	  method names.  Then move things into style-font.h for now.
	  This clarifies how much we'll need to move to GOFont.

	* src/print-cell.h : just include the necessary gtk headers.  Even
	  this breaks WITH_GTK work.  Why isn't this ins glib ?
	* src/print.h : Move the renamed internal (not dllexported)
	  gnm_print_debug flag here

svn path=/trunk/; revision=15905
parent 0d516ee3
......@@ -28,7 +28,6 @@ Review
Short term goals
----------------
- libthai for win32 build
- replicate win32 print problems
- Finish the Data -> Table dialog
- http://bugzilla.gnome.org/show_bug.cgi?id=450444 (themeable icons)
......@@ -36,7 +35,7 @@ Short term goals
- tango icons
http://live.gnome.org/GnomeGoals/AppIcon
http://live.gnome.org/ThemableAppSpecificIcons
- Add a go_glade_signal_connect (and friends)
- Use go_glade_signal_connect (and friends)
Worries
-------
......@@ -102,7 +101,6 @@ Architecture Changes
- Use gtk_window_group_new to keep wbcg's distinct
- merge GnmPane and GnmCanvas (DONE)
1) things to move into libgoffice
1.1) plugin-manager dialog
1.2) doc meta data
......@@ -1063,3 +1061,5 @@ General Ideas
- A connection to swivel (www.swivel.com)
- Sugar/OLPC UI & collab
- Add 'send a frown/smile' button
- 'fish eye' zoom to around selection
- treemap for heirarchical data
2007-09-24 Jody Goldberg <jody@gnome.org>
* src/io-context-gtk.c (icg_set_transient_for) : Use
go_gtk_window_set_transient instead of gtk_window_set_transient_for.
The former causes problems on win32, and breaks window stacking.
(icg_show_gui) : ditto.
2007-09-24 Jody Goldberg <jody@gnome.org>
* src/Makefile.am : install wbc-gtk-impl.h for now. It has the
definition of wbc_gtk_close.
2007-09-24 Jody Goldberg <jody@gnome.org>
* src/style.c : s/StyleFont/GnmFont/ and clean up the associated
method names. Then move things into style-font.h for now.
This clarifies how much we'll need to move to GOFont.
* src/print-cell.h : just include the necessary gtk headers. Even
this breaks WITH_GTK work. Why isn't this ins glib ?
* src/print.h : Move the renamed internal (not dllexported)
gnm_print_debug flag here
Merge in the win32 cleanup work
* src/Makefile.am : Add a libspreadsheet CFLAG -DGNUMERIC_INTERNAL to
control dllimport/dllexport for win32. Required some adjustment of
built-sources.
* src/libgnumeric.h : Add 'GNM_VAR_DECL' and use it for extern data
that will be publicly visible.
* src/libgnumeric.c : re-order and handle some of the renaming
style_init -> gnm_font_init, and gnumeric_color -> gnm_color.
(gnm_get_option_group) : move the shared cmd line arg parsing in here
rather than duplicating the handlers in all the client apps.
* src/main-application.c (gnumeric_arg_parse) : eg from here.
Rather than using global variables, pass the arguments as
parameters to clean things up.
* src/ssconvert.c (main) : Use it here.
* src/ssindex.c (main) : and here.
* src/print-cell.h : just include the necessary gtk headers. Even
this breaks WITH_GTK work. Why isn't this ins glib ?
* src/print.h : Move the renamed internal (not dllexported)
gnm_print_debug flag here
2007-09-20 Morten Welinder <terra@gnome.org>
* src/print.c (compute_sheet_pages): Return error indicator,
......
......@@ -6,6 +6,8 @@ Jean:
Jody:
* XLSX import chart axes, singletons, some styles.
* Merge in most of the win32 cleanup.
* Fix autofilters on win32.
Jon Kåre:
* Fix python crash. [#461845]
......
......@@ -79,7 +79,7 @@ typedef struct {
GOComponent parent;
WorkbookView *wv;
WorkbookControl *edited;
WBCGtk *edited;
Sheet *sheet;
int col_start, col_end, row_start, row_end;
int width, height;
......@@ -104,8 +104,8 @@ go_gnm_component_get_data (GOComponent *component, gpointer *data, int *length,
GOCmdContext *cc = go_component_get_command_context ();
IOContext *io_context = gnumeric_io_context_new (cc);
GsfOutput *output = gsf_output_memory_new ();
WorkbookView *wbv = wb_control_view (gognm->edited);
Workbook *wb = wb_control_get_workbook (gognm->edited);
WorkbookView *wbv = wb_control_view (WORKBOOK_CONTROL (gognm->edited));
Workbook *wb = wb_view_get_workbook (wbv);
GOFileSaver *gfs = workbook_get_file_saver (wb);
if (gfs == NULL)
gfs = go_file_saver_get_default ();
......@@ -387,7 +387,7 @@ go_gnm_component_edit (GOComponent *component)
GOGnmComponent *gognm = GO_GNM_COMPONENT (component);
WorkbookView *wv;
if (gognm->edited) {
gdk_window_raise (wbcg_toplevel (WBC_GTK (gognm->edited))->window);
gdk_window_raise (wbcg_toplevel (gognm->edited)->window);
return TRUE;
}
if (!gognm->wv) {
......@@ -405,7 +405,7 @@ go_gnm_component_edit (GOComponent *component)
g_object_unref (io_context);
}
uifilename = "Gnumeric-embed.xml";
gognm->edited = workbook_control_gui_new (wv, NULL, NULL);
gognm->edited = wbc_gtk_new (wv, NULL, NULL, NULL);
gtk_action_group_add_actions (wbcg->actions,
actions, G_N_ELEMENTS (actions), wbcg);
......
......@@ -11,5 +11,5 @@ Version: @VERSION@
Requires: glib-2.0 gobject-2.0 libgsf-1 libxml-2.0 gtk+-2.0 libglade-2.0 @LIBGOFFICE@
Requires.private: libart-2.0
Libs: -L${libdir} -lgoffice-0
Cflags: -I${includedir}/libspreadsheet-1-7
Cflags: -I${includedir}/libspreadsheet-1-7/ssheet
GOffice_plugins_dir=@gnumeric_plugindir@
2007-09-24 Jody Goldberg <jody@gnome.org>
* ms-chart.c (BC_R(end)) : Don't leak a style when faced with an empty
label.
2007-09-21 Morten Welinder <terra@gnome.org>
* md5.c: Switch to GPL2 version, see bug #478398. (Patch by
......
......@@ -2761,7 +2761,8 @@ not_a_matrix:
s->style = NULL;
break;
case BIFF_CHART_text :
case BIFF_CHART_text : {
gboolean clear_style = TRUE;
switch (BC_R(top_state) (s, 0)) {
case BIFF_CHART_chart: {
GnmValue *value;
......@@ -2781,29 +2782,28 @@ not_a_matrix:
else
value_release (value);
gog_object_add_by_name (GOG_OBJECT (s->chart), "Title", label);
if (s->style != NULL) {
if (s->style != NULL)
gog_styled_object_set_style (GOG_STYLED_OBJECT (label), s->style);
g_object_unref (s->style);
s->style = NULL;
}
break;
}
case BIFF_CHART_legend:
/* do not destroy the style if it belongs to the
parent object, applies only to legend at the moment,
what should be done for DEFAULTEXT? */
clear_style = FALSE;
break;
default:
if (s->style != NULL) {
g_object_unref (s->style);
s->style = NULL;
}
break;
}
if (clear_style && s->style != NULL) {
g_object_unref (s->style);
s->style = NULL;
}
g_free (s->text);
s->text = NULL;
break;
}
case BIFF_CHART_dropbar :
if (s->dropbar_style == NULL) {
......
......@@ -177,7 +177,7 @@ typedef struct {
GogObject *series_pt;
gboolean series_pt_has_index;
GogStyle *cur_style;
GOColor gcolor;
GOColor gocolor;
GOMarker *marker;
GOMarkerShape marker_symbol;
GogObject *cur_obj;
......@@ -192,6 +192,8 @@ typedef struct {
GHashTable *by_obj;
XLSXAxisInfo *info;
} axis;
GHashTable *theme_colors;
} XLSXReadState;
typedef struct {
GnmString *str;
......@@ -400,12 +402,12 @@ attr_int64 (GsfXMLIn *xin, xmlChar const **attrs,
}
static gboolean
attr_rgb (GsfXMLIn *xin, xmlChar const **attrs,
char const *target,
unsigned long *res)
attr_gocolor (GsfXMLIn *xin, xmlChar const **attrs,
char const *target,
GOColor *res)
{
char *end;
long tmp;
unsigned long rgb;
g_return_val_if_fail (attrs != NULL, FALSE);
g_return_val_if_fail (attrs[0] != NULL, FALSE);
......@@ -415,13 +417,19 @@ attr_rgb (GsfXMLIn *xin, xmlChar const **attrs,
return FALSE;
errno = 0;
tmp = strtoul (attrs[1], &end, 16);
rgb = strtoul (attrs[1], &end, 16);
if (errno == ERANGE || *end)
return xlsx_warning (xin,
_("Invalid RRGGBB color '%s' for attribute %s"),
attrs[1], target);
*res = tmp;
{
guint8 const r = (rgb >> 16) & 0xff;
guint8 const g = (rgb >> 8) & 0xff;
guint8 const b = (rgb >> 0) & 0xff;
*res = RGBA_TO_UINT(r, g, b, 0xff);
}
return TRUE;
}
......@@ -1371,28 +1379,29 @@ xlsx_draw_color_themed (GsfXMLIn *xin, xmlChar const **attrs)
};
XLSXReadState *state = (XLSXReadState *)xin->user_state;
int tmp;
if (simple_enum (xin, attrs, colors, &tmp))
#warning FINISH
state->gcolor = RGBA_BLACK;
gpointer val = NULL;
if (NULL != state->theme_colors) {
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (0 == strcmp (attrs[0], "val")) {
val = g_hash_table_lookup (state->theme_colors, attrs[1]);
if (NULL == val)
xlsx_warning (xin, _("Unknown color '%s'"), attrs[1]);
}
} else
xlsx_warning (xin, _("Missing theme"));
state->gocolor = GPOINTER_TO_UINT (val);
}
static void
xlsx_draw_color_rgb (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
unsigned long rgb = 0;
if (NULL == state->cur_style)
return;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_rgb (xin, attrs, "val", &rgb)) {
guint8 const r = (rgb >> 16) & 0xff;
guint8 const g = (rgb >> 8) & 0xff;
guint8 const b = (rgb >> 0) & 0xff;
state->gcolor = RGBA_TO_UINT(r, g, b, 0xff);
}
if (attr_gocolor (xin, attrs, "val", &state->gocolor))
;
}
static void
......@@ -1402,7 +1411,7 @@ xlsx_draw_color_alpha (GsfXMLIn *xin, xmlChar const **attrs)
int val;
if (simple_int (xin, attrs, &val)) {
int level = 255 * val / 100000;
state->gcolor = UINT_RGBA_CHANGE_A (state->gcolor, level);
state->gocolor = UINT_RGBA_CHANGE_A (state->gocolor, level);
}
}
......@@ -1411,14 +1420,14 @@ xlsx_draw_color_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
if (NULL != state->marker)
go_marker_set_fill_color (state->marker, state->gcolor);
go_marker_set_fill_color (state->marker, state->gocolor);
else if (NULL != state->cur_style) {
if (state->sp_type & GOG_STYLE_LINE) {
state->cur_style->line.color = state->gcolor;
state->cur_style->line.color = state->gocolor;
state->cur_style->line.auto_color = FALSE;
} else {
state->cur_style->fill.pattern.back = state->gcolor;
state->cur_style->fill.pattern.fore = state->gcolor;
state->cur_style->fill.pattern.back = state->gocolor;
state->cur_style->fill.pattern.fore = state->gocolor;
state->cur_style->fill.auto_fore = FALSE;
state->cur_style->fill.auto_back = FALSE;
}
......@@ -1746,7 +1755,7 @@ GSF_XML_IN_NODE_FULL (START, CHART_SPACE, XL_NS_CHART, "chartSpace", GSF_XML_NO_
GSF_XML_IN_NODE (SERIES_VAL, NUM_REF, XL_NS_CHART, "numRef", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE_FULL (SERIES, SERIES_X_VAL, XL_NS_CHART, "xVal", GSF_XML_NO_CONTENT, FALSE, TRUE,
&xlsx_ser_type_start, &xlsx_ser_type_end, GOG_MS_DIM_VALUES),
&xlsx_ser_type_start, &xlsx_ser_type_end, GOG_MS_DIM_CATEGORIES),
GSF_XML_IN_NODE (SERIES_X_VAL, NUM_REF, XL_NS_CHART, "numRef", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (SERIES_X_VAL, NUM_LIT, XL_NS_CHART, "numLit", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
......@@ -4303,48 +4312,80 @@ GSF_XML_IN_NODE_END
/****************************************************************************/
static void
xlsx_theme_color_sys (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
GOColor c;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_gocolor (xin, attrs, "lastClr", &c)) {
g_hash_table_replace (state->theme_colors,
g_strdup (((GsfXMLInNode *)xin->node_stack->data)->name),
GUINT_TO_POINTER (c));
}
}
static void
xlsx_theme_color_rgb (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
GOColor c;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_gocolor (xin, attrs, "val", &c)) {
g_hash_table_replace (state->theme_colors,
g_strdup (((GsfXMLInNode *)xin->node_stack->data)->name),
GUINT_TO_POINTER (c));
}
}
static void
xlsx_theme_start (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
state->theme_colors = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify)g_free, NULL);
}
static GsfXMLInNode const xlsx_theme_dtd[] = {
GSF_XML_IN_NODE_FULL (START, START, -1, NULL, GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, NULL, 0),
GSF_XML_IN_NODE_FULL (START, THEME, XL_NS_DRAW, "theme", GSF_XML_NO_CONTENT, FALSE, TRUE, NULL, NULL, 0),
GSF_XML_IN_NODE_FULL (START, THEME, XL_NS_DRAW, "theme", GSF_XML_NO_CONTENT, FALSE, TRUE, &xlsx_theme_start, NULL, 0),
GSF_XML_IN_NODE (THEME, ELEMENTS, XL_NS_DRAW, "themeElements", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (ELEMENTS, COLOR_SCHEME, XL_NS_DRAW, "clrScheme", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_DK1, XL_NS_DRAW, "dk1", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_DK1, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_DK1, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME, dk1, XL_NS_DRAW, "dk1", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (dk1, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, &xlsx_theme_color_sys, NULL),
GSF_XML_IN_NODE (dk1, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, &xlsx_theme_color_rgb, NULL),
GSF_XML_IN_NODE (RGB_COLOR, COLOR_ALPHA, XL_NS_DRAW, "alpha", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_LT1, XL_NS_DRAW, "lt1", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_LT1, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_LT1, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_LT2, XL_NS_DRAW, "lt2", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_LT2, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_LT2, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_DK2, XL_NS_DRAW, "dk2", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_DK2, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_DK2, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_A1, XL_NS_DRAW, "accent1", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_A1, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_A1, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_A2, XL_NS_DRAW, "accent2", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_A2, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_A2, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_A3, XL_NS_DRAW, "accent3", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_A3, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_A3, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_A4, XL_NS_DRAW, "accent4", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_A4, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_A4, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_A5, XL_NS_DRAW, "accent5", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_A5, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_A5, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_A6, XL_NS_DRAW, "accent6", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_A6, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_A6, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_LINK, XL_NS_DRAW, "hlink", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_LINK, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_LINK, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, COLOR_SCHEME_FOLINK, XL_NS_DRAW, "folHlink", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (COLOR_SCHEME_FOLINK, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME_FOLINK, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL),/* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, lt1, XL_NS_DRAW, "lt1", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (lt1, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (lt1, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, lt2, XL_NS_DRAW, "lt2", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (lt2, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (lt2, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, dk2, XL_NS_DRAW, "dk2", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (dk2, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (dk2, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, accent1, XL_NS_DRAW, "accent1", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (accent1, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (accent1, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, accent2, XL_NS_DRAW, "accent2", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (accent2, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (accent2, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, accent3, XL_NS_DRAW, "accent3", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (accent3, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (accent3, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, accent4, XL_NS_DRAW, "accent4", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (accent4, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (accent4, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, accent5, XL_NS_DRAW, "accent5", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (accent5, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (accent5, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, accent6, XL_NS_DRAW, "accent6", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (accent6, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (accent6, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, hlink, XL_NS_DRAW, "hlink", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (hlink, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (hlink, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (COLOR_SCHEME, folHlink, XL_NS_DRAW, "folHlink", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (folHlink, SYS_COLOR, XL_NS_DRAW, "sysClr", GSF_XML_NO_CONTENT, NULL, NULL), /* 2nd Def */
GSF_XML_IN_NODE (folHlink, RGB_COLOR, XL_NS_DRAW, "srgbClr", GSF_XML_NO_CONTENT, NULL, NULL),/* 2nd Def */
GSF_XML_IN_NODE (ELEMENTS, FONT_SCHEME, XL_NS_DRAW, "fontScheme", GSF_XML_NO_CONTENT, NULL, NULL),
GSF_XML_IN_NODE (FONT_SCHEME, MAJOR_FONT, XL_NS_DRAW, "majorFont", GSF_XML_NO_CONTENT, NULL, NULL),
......@@ -4463,6 +4504,7 @@ xlsx_file_open (GOFileOpener const *fo, IOContext *context,
state.num_fmts = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify)g_free, (GDestroyNotify) go_format_unref);
state.convs = xlsx_conventions_new ();
state.theme_colors = NULL;
locale = gnm_push_C_locale ();
......@@ -4517,6 +4559,8 @@ xlsx_file_open (GOFileOpener const *fo, IOContext *context,
xlsx_style_array_free (state.style_xfs);
xlsx_style_array_free (state.dxfs);
xlsx_style_array_free (state.table_styles);
if (state.theme_colors)
g_hash_table_destroy (state.theme_colors);
workbook_set_saveinfo (state.wb, FILE_FL_AUTO,
go_file_saver_for_id ("Gnumeric_Excel:xlsx"));
......
......@@ -40,6 +40,7 @@
#include <workbook.h>
#include <gnm-format.h>
#include <style.h>
#include <style-font.h>
#include <value.h>
#include <expr.h>
#include <expr-impl.h>
......@@ -340,7 +341,7 @@ gnumeric_cell (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
double charwidth;
int cellwidth;
charwidth = gnumeric_default_font_width;
charwidth = gnm_font_default_width;
cellwidth = info->size_pts;
return value_new_int (rint (cellwidth / charwidth));
......
......@@ -324,7 +324,7 @@ write_cell (GsfOutput *output, Sheet *sheet, gint row, gint col, html_version_t
default:
break;
}
switch (style_default_halign(style, cell)) {
switch (gnm_style_default_halign (style, cell)) {
case HALIGN_RIGHT:
gsf_output_puts (output, " align=\"right\" ");
break;
......
......@@ -928,7 +928,7 @@ latex2e_write_multicolumn_cell (GsfOutput *output, GnmCell *cell, int start_col,
/* Send the alignment of the cell through a routine to deal with
* HALIGN_GENERAL and then deal with the three cases. */
switch ( style_default_halign(style, cell) ) {
switch (gnm_style_default_halign (style, cell)) {
case HALIGN_RIGHT:
gsf_output_printf (output, "\\gnumericPB{\\raggedleft}");
break;
......@@ -952,7 +952,7 @@ latex2e_write_multicolumn_cell (GsfOutput *output, GnmCell *cell, int start_col,
/* if we don't wrap put it into an mbox, adjusted to width 0 to avoid moving */
/* it to the second line of the parbox */
if (!wrap)
switch ( style_default_halign(style, cell) ) {
switch (gnm_style_default_halign (style, cell)) {
case HALIGN_RIGHT:
gsf_output_printf (output, "\\gnumbox[r]{");
break;
......
......@@ -1723,7 +1723,7 @@ py_Workbook_sheet_add (py_Workbook_object *self, PyObject *args)
static PyObject *
py_Workbook_gui_add (py_Workbook_object *self, PyObject *args)
{
WorkbookControl *wbc;
WBCGtk *wbcg;
PyObject *result;
if (!PyArg_ParseTuple (args, (char *) ":gui_add"))
......@@ -1732,9 +1732,9 @@ py_Workbook_gui_add (py_Workbook_object *self, PyObject *args)
if (workbook_sheet_count (self->wb) == 0)
(void)workbook_sheet_add (self->wb, -1);
wbc = workbook_control_gui_new (NULL, self->wb, NULL);
result = py_new_Gui_object ((WBCGtk *)wbc);
g_object_unref (wbc); /* py_new_Gui_object added a reference */
wbcg = wbc_gtk_new (NULL, self->wb, NULL, NULL);
result = py_new_Gui_object (wbcg);
g_object_unref (wbcg); /* py_new_Gui_object added a reference */
return result;
}
......
......@@ -33,6 +33,7 @@ AM_CPPFLAGS = \
# A hint is needed to build these headers first:
BUILT_SOURCES = \
gnm-marshalers.c \
gnm-marshalers.h \
gnumeric-paths.h
......@@ -40,11 +41,10 @@ BUILT_SOURCES = \
non-intermediate: gnm-marshalers.c
CLEANFILES = $(BUILT_SOURCES) \
gnm-marshalers.c \
gnumeric.exe.a
libspreadsheet_la_CPPFLAGS = $(AM_CPPFLAGS) -DGNUMERIC_INTERNAL
libspreadsheet_la_LDFLAGS = -release $(VERSION)
libspreadsheet_la_LIBADD = \
$(gnumeric_app_libs) \
$(GNUMERIC_LIBS) \
......@@ -52,7 +52,7 @@ libspreadsheet_la_LIBADD = \
$(HILDON_LIBS)
libspreadsheet_la_SOURCES = \
gnm-marshalers.list \
gnm-marshalers.c \
application.c \
auto-format.c \
cell.c \
......@@ -80,6 +80,7 @@ libspreadsheet_la_SOURCES = \
gnm-format.c \
gnm-graph-window.c \
gnm-pane.c \
gnm-pane-impl.h \
gnumeric-simple-canvas.c \
graph.c \
gutils.c \
......@@ -105,6 +106,7 @@ libspreadsheet_la_SOURCES = \
pivottable.c \
position.c \
preview-grid.c \
preview-grid-impl.h \
print-info.c \
rangefunc.c \
rangefunc-strings.c \
......@@ -148,6 +150,7 @@ libspreadsheet_la_SOURCES = \
workbook-view.c \
workbook-control.c \
wbc-gtk.c \
wbc-gtk-impl.h \
wbc-gtk-actions.c \
wbc-gtk-edit.c \
xml-io.c \
......@@ -158,11 +161,10 @@ libspreadsheet_la_SOURCES = \
print.c \
print-cell.c
# When we switch to subversion fix this to nest as
# libspreadsheet-ver/ssheet/header
# doing it now would require massive cvs surgery.
libspreadsheet_includedir = $(includedir)/libspreadsheet-1-7
libspreadsheet_includedir = $(includedir)/libspreadsheet-1-7/ssheet
libspreadsheet_include_HEADERS = \
application.h \
auto-format.h \
......@@ -192,7 +194,6 @@ libspreadsheet_include_HEADERS = \
gnm-format.h \
gnm-graph-window.h \
gnm-pane.h \
gnm-pane-impl.h \
gnm-style-impl.h \
gnumeric.h \
gnumeric-simple-canvas.h \
......@@ -222,7 +223,6 @@ libspreadsheet_include_HEADERS = \
pivottable.h \
position.h \
preview-grid.h \
preview-grid-impl.h \
print-info.h \
rangefunc.h \
rangefunc-strings.h \
......@@ -276,7 +276,6 @@ libspreadsheet_include_HEADERS = \
workbook-control.h \
workbook-control-priv.h \
wbc-gtk.h \
wbc-gtk-impl.h \
xml-io.h \
xml-io-version.h \
xml-sax.h \
......@@ -296,9 +295,39 @@ gnumeric_LDADD = \
gnumeric_LDFLAGS = -export-dynamic
if WITH_WIN32
libspreadsheet_la_LDFLAGS += -no-undefined -Wl,--export-all-symbols,--enable-runtime-pseudo-relo
gnumeric_LDADD += gnumeric_rc.o
gnumeric_LDFLAGS += -mwindows
libspreadsheet_la_DEPENDENCIES = libspreadsheet.def
libspreadsheet_la_LDFLAGS += -no-undefined -export-symbols libspreadsheet.def
libspreadsheet.def: local.def
echo EXPORTS > $@ && \
cat $^ | sort >> $@
local.def: stamp-local.def
@true
stamp-local.def: $(libspreadsheet_include_HEADERS) Makefile $(top_srcdir)/tools/dumpdef.pl
hdrs='$(libspreadsheet_include_HEADERS) dialogs/dialogs.h dialogs/tool-dialogs.h tools/goal-seek.h tools/analysis-tools.h'; \
hdrs_list=''; \
for hdr in $$hdrs; do \
if test -f $(srcdir)/$$hdr; then \
hdrs_list="$$hdrs_list $(srcdir)/$$hdr"; \
else \
hdrs_list="$$hdrs_list $$hdr"; \
fi; \
done; \
cat $(top_builddir)/gnumeric-config.h $$hdrs_list | \
sed -e 's/^#[ \t]*include[ \t]\+.*$$//g' | \
$(CPP) $(AM_CPPFLAGS) "-DGNM_VAR_DECL=__declspec(dllexport)" -P - > xgen-localdef.1 && \
perl $(top_srcdir)/tools/dumpdef.pl \
xgen-localdef.1 > xgen-localdef.2 \
&& (cmp -s xgen-localdef.2 local.def || \
cp xgen-localdef.2 local.def) \
&& rm -f xgen-localdef.1 xgen-localdef.2 \
&& echo timestamp > $@
endif
gnumeric_app_libs = \
......@@ -380,14 +409,16 @@ uninstall-hook:
# include conditional files to ensure everything gets distributed no matter
# what the build
EXTRA_DIST = main-component.c \
gnm-conf-gconf.c \
gnm-conf-keyfile.c \
gnm-conf-win32.c \
README.gnm_float \
gnumeric.rc gnm-i18n.h \
GNOME_Gnumeric-gtk.xml.in \
HILDON_Gnumeric-gtk.xml.in
EXTRA_DIST = \
gnm-marshalers.list \
main-component.c \
gnm-conf-gconf.c \
gnm-conf-keyfile.c \
gnm-conf-win32.c \
README.gnm_float \
gnumeric.rc gnm-i18n.h \
GNOME_Gnumeric-gtk.xml.in \
HILDON_Gnumeric-gtk.xml.in
gtkactiondir=$(gnumeric_datadir)
......
......@@ -31,8 +31,9 @@
#include <goffice/utils/go-glib-extras.h>
#include <goffice/utils/go-file.h>
#include <gsf/gsf-impl-utils.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtkfilefilter.h>
#include <gtk/gtkrecentmanager.h>
#define GNM_APP(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GNM_APP_TYPE, GnmApp))
#define GNM_APP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNM_APP_TYPE, GnmAppClass))
......
......@@ -212,7 +212,7 @@ cell_calc_span (GnmCell const *cell, int *col1, int *col2)
sheet = cell->base.sheet;
style = gnm_cell_get_style (cell);
h_align = style_default_halign (style, cell);
h_align = gnm_style_default_halign (style, cell);
/*
* Report only one column is used if
......
......@@ -41,8 +41,6 @@
#include "clipboard.h"