Commit c9564ab8 authored by Jody Goldberg's avatar Jody Goldberg
Browse files

some cleanup.

parent 6b52aea3
......@@ -10,9 +10,6 @@ Release Critical
- Should cb_merge_cells free the ranges and not just the list? (It leaks.)
- Check strcpy()s in font_change_component_1: purify says one is overlapping
and thus undefined.
- 1. Select A1.
2. Format->Autoformat.
3. Click "ok". [This correctly gives an error about the range being too small]
......@@ -27,9 +24,6 @@ Pending Patches
Long term breakage
------------------
- In the format-cells dialog, font tab, selecting (say) "Bold" and hitting apply
leaks an mstyle consistently.
- Outline mode
: Ins/Del col/row breaks
......
......@@ -90,7 +90,7 @@ gnumeric_bonobo_obj_write (xmlNodePtr cur,
gboolean ret = TRUE;
g_return_val_if_fail (user_data != NULL, FALSE);
storage = bonobo_object_corba_objref (user_data);
storage = BONOBO_OBJREF (user_data);
g_return_val_if_fail (storage != CORBA_OBJECT_NIL, FALSE);
CORBA_exception_init (&ev);
#if 0
......@@ -104,7 +104,7 @@ gnumeric_bonobo_obj_write (xmlNodePtr cur,
sob = SHEET_OBJECT_BONOBO (object);
ps = Bonobo_Unknown_queryInterface (
bonobo_object_corba_objref (BONOBO_OBJECT (sob->object_server)),
BONOBO_OBJREF (sob->object_server),
"IDL:Bonobo/PersistStream:1.0", &ev);
if (!BONOBO_EX (&ev) && ps != CORBA_OBJECT_NIL) {
......@@ -196,7 +196,7 @@ gnumeric_bonobo_obj_read (xmlNodePtr tree,
return TRUE;
}
storage = bonobo_object_corba_objref (user_data);
storage = BONOBO_OBJREF (user_data);
g_return_val_if_fail (storage != CORBA_OBJECT_NIL, TRUE);
CORBA_exception_init (&ev);
......@@ -204,8 +204,7 @@ gnumeric_bonobo_obj_read (xmlNodePtr tree,
sname = xmlGetProp (tree, "Stream");
if (sname)
read_stream_from_storage (
bonobo_object_corba_objref (
BONOBO_OBJECT (sob->object_server)),
BONOBO_OBJREF (sob->object_server),
storage, sname, &ev);
else
g_warning ("No stream");
......@@ -288,7 +287,7 @@ gnumeric_bonobo_write_workbook (GnumFileSaver const *fs,
CORBA_exception_init (&ev);
stream = Bonobo_Storage_openStream (
bonobo_object_corba_objref (BONOBO_OBJECT (storage)),
BONOBO_OBJREF (storage),
"Workbook", flags, &ev);
if (ev._major == CORBA_USER_EXCEPTION &&
strcmp (ev._repo_id, ex_Bonobo_Storage_NameExists)) {
......@@ -442,7 +441,7 @@ gnumeric_bonobo_read_workbook (GnumFileOpener const *fo,
CORBA_exception_init (&ev);
stream = Bonobo_Storage_openStream (
bonobo_object_corba_objref (BONOBO_OBJECT (storage)),
BONOBO_OBJREF (storage),
"Workbook", Bonobo_Storage_READ, &ev);
if (BONOBO_EX (&ev) || stream == CORBA_OBJECT_NIL) {
......
......@@ -659,93 +659,6 @@ gnumeric_glade_group_value (GladeXML *gui, const char *group[])
return -1;
}
static char *
font_change_component_1 (const char *fontname, int idx,
const char *newvalue, char const **end)
{
char *res, *dst;
int hyphens = 0;
dst = res = (char *)g_malloc (strlen (fontname) + strlen (newvalue) + idx + 5);
while (*fontname && *fontname != ',') {
if (hyphens != idx)
*dst++ = *fontname;
if (*fontname++ == '-') {
if (hyphens == idx)
*dst++ = '-';
if (++hyphens == idx) {
strcpy (dst, newvalue);
dst += strlen (newvalue);
}
}
}
*end = fontname;
if (hyphens < idx) {
while (hyphens++ < idx)
*dst++ = '-';
strcpy (dst, newvalue);
dst += strlen (newvalue);
}
*dst = 0;
return res;
}
char *
x11_font_change_component (const char *fontname, int idx, const char *newvalue)
{
char *res = 0;
int reslen = 0;
while (*fontname) {
const char *end;
char *new;
int newlen;
new = font_change_component_1 (fontname, idx + 1, newvalue, &end);
newlen = strlen (new);
res = (char *)g_realloc (res, reslen + newlen + 2);
strcpy (res + reslen, new);
g_free (new);
reslen += newlen;
fontname = end;
if (*fontname == ',') {
res[reslen++] = ',';
fontname++;
}
}
if (reslen) {
res[reslen] = 0;
return res;
} else
return g_strdup ("");
}
char *
x11_font_get_bold_name (const char *fontname, int units)
{
char *f;
/*
* FIXME: this scheme is poor: in some cases, the fount strength is called 'bold',
* whereas in some others it is 'black', in others... Look font_get_italic_name
*/
f = x11_font_change_component (fontname, 2, "bold");
return f;
}
char *
x11_font_get_italic_name (const char *fontname, int units)
{
char *f;
f = x11_font_change_component (fontname, 3, "o");
return f;
}
static void
kill_popup_menu (GtkWidget *widget, GtkMenu *menu)
{
......@@ -992,7 +905,7 @@ gnumeric_inject_widget_into_bonoboui (WorkbookControlGUI *wbcg, GtkWidget *widge
control = bonobo_control_new (widget);
bonobo_ui_component_object_set (
wbcg->uic, path,
bonobo_object_corba_objref (BONOBO_OBJECT (control)),
BONOBO_OBJREF (control),
NULL);
}
#endif
......
......@@ -47,10 +47,6 @@ int gtk_radio_group_get_selected (GSList *radio_group);
/* Utility routine as libglade does not have any decent routine to do this */
int gnumeric_glade_group_value (GladeXML *gui, const char *group[]);
char *x11_font_get_bold_name (const char *fontname, int units);
char *x11_font_get_italic_name (const char *fontname, int units);
char *x11_font_change_component (const char *fontname, int idx, const char *value);
/*
* Use this on menus that are popped up
*/
......
......@@ -3546,7 +3546,7 @@ setup_progress_bar (WorkbookControlGUI *wbcg)
bonobo_ui_component_object_set (
wbcg->uic,
"/status/Progress",
bonobo_object_corba_objref (BONOBO_OBJECT (control)),
BONOBO_OBJREF (control),
NULL);
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment