1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Merge /u/l-chang/cdesktopenv1/ branch master into master

https://sourceforge.net/p/cdesktopenv/code/merge-requests/22/
This commit is contained in:
Jon Trulson 2021-02-14 20:37:30 +00:00
commit f171814fa4
8 changed files with 48 additions and 22 deletions

View file

@ -164,7 +164,7 @@ _csa_tick_to_iso8601(time_t tick, char *buf_out)
{ {
struct tm *time_str; struct tm *time_str;
time_t tk=tick; time_t tk=tick;
char tz_orig[BUFSIZ]; char tz_orig[BUFSIZ], *s;
boolean_t orig_tzset = B_FALSE; boolean_t orig_tzset = B_FALSE;
_Xgtimeparams gmtime_buf; _Xgtimeparams gmtime_buf;
@ -197,7 +197,7 @@ _csa_tick_to_iso8601(time_t tick, char *buf_out)
#endif /* !linux && !CSGRC_BASED */ #endif /* !linux && !CSGRC_BASED */
/* format string forces fixed width (zero-padded) fields */ /* format string forces fixed width (zero-padded) fields */
sprintf(buf_out, "%04d%02d%02dT%02d%02d%02dZ", asprintf(&s, "%04d%02d%02dT%02d%02d%02dZ",
time_str->tm_year + 1900, time_str->tm_year + 1900,
time_str->tm_mon + 1, time_str->tm_mon + 1,
time_str->tm_mday, time_str->tm_mday,
@ -205,7 +205,10 @@ _csa_tick_to_iso8601(time_t tick, char *buf_out)
time_str->tm_min, time_str->tm_min,
time_str->tm_sec); time_str->tm_sec);
return (0); strcpy(buf_out, s);
free(s);
return (0);
} }
/* /*
@ -258,7 +261,7 @@ _csa_iso8601_to_range(char *buf, time_t *start, time_t *end)
int int
_csa_range_to_iso8601(time_t start, time_t end, char *buf) _csa_range_to_iso8601(time_t start, time_t end, char *buf)
{ {
char tmpstr1[BUFSIZ], tmpstr2[BUFSIZ]; char tmpstr1[BUFSIZ], tmpstr2[BUFSIZ], *s;
/* validate: ticks must be +ve, and end can't precede start */ /* validate: ticks must be +ve, and end can't precede start */
if ((start < 0) || (end < 0) || (end < start)) { if ((start < 0) || (end < 0) || (end < start)) {
@ -272,11 +275,15 @@ _csa_range_to_iso8601(time_t start, time_t end, char *buf)
return (-1); return (-1);
} }
if (sprintf(buf, "%s/%s", tmpstr1, tmpstr2) < 0) { if (asprintf(&s, "%s/%s", tmpstr1, tmpstr2) < 0) {
free(s);
return (-1); return (-1);
} }
else else {
strcpy(buf, s);
free(s);
return(0); return(0);
}
} }
static int static int
@ -340,7 +347,11 @@ _csa_iso8601_to_duration(char *buf, time_t *sec)
int int
_csa_duration_to_iso8601(time_t sec, char *buf) _csa_duration_to_iso8601(time_t sec, char *buf)
{ {
sprintf(buf, "%cPT%dS", (sec < 0) ? '-': '+', abs(sec)); char *s;
return(0);
}
asprintf(&s, "%cPT%dS", (sec < 0) ? '-': '+', abs(sec));
strcpy(buf, s);
free(s);
return(0);
}

View file

@ -1881,12 +1881,14 @@ setup_vwr_graphics(
GCForeground|GCBackground|GCGraphicsExposures|GCLineWidth, &gcvalues); GCForeground|GCBackground|GCGraphicsExposures|GCLineWidth, &gcvalues);
} }
if (!ui_handle->sm_font) if (!ui_handle->sm_font)
{
ui_handle->sm_font = (XFontStruct *)XLoadQueryFont(dpy, sm_font_name); ui_handle->sm_font = (XFontStruct *)XLoadQueryFont(dpy, sm_font_name);
XSetFont(dpy, ui_handle->normal_gc, ui_handle->sm_font->fid);
XSetFont(dpy, ui_handle->select_gc, ui_handle->sm_font->fid); if (!ui_handle->sm_font)
} ui_handle->sm_font = (XFontStruct *)XLoadQueryFont(dpy, XmDEFAULT_FONT);
XSetFont(dpy, ui_handle->normal_gc, ui_handle->sm_font->fid);
XSetFont(dpy, ui_handle->select_gc, ui_handle->sm_font->fid);
} }
/* /*

View file

@ -722,7 +722,7 @@ set_edit_menu_stateCB(
BOOL clipboard_full = False; BOOL clipboard_full = False;
WidgetList menu_items; WidgetList menu_items;
int num_menu_items; int num_menu_items;
int value; XtArgVal value;
AB_EDIT_TYPE item_key; AB_EDIT_TYPE item_key;
int i; int i;

View file

@ -1026,8 +1026,8 @@ delete_selected_item(
) )
{ {
ABObj current_obj; ABObj current_obj;
ABObj *iobj_list, ABObj *iobj_list;
*new_iobj_list; ABObj *new_iobj_list = NULL;
int num_items; int num_items;
int select_pos; int select_pos;
int i, j; int i, j;
@ -1536,7 +1536,7 @@ set_edit_menu_stateCB(
BOOL clipboard_full = False; BOOL clipboard_full = False;
WidgetList menu_items; WidgetList menu_items;
int num_menu_items; int num_menu_items;
int item_key; XtArgVal item_key;
int i; int i;
listitem_exists = (pis->current_item != NULL); listitem_exists = (pis->current_item != NULL);

View file

@ -1922,6 +1922,12 @@ show_editor_view(Calendar *c, Glance glance) {
Editor *e = (Editor *)c->editor; Editor *e = (Editor *)c->editor;
Props_pu *p = (Props_pu *)c->properties_pu; Props_pu *p = (Props_pu *)c->properties_pu;
if (get_data_version(c->cal_handle) <= CMS_VERS_2) {
backend_err_msg(c->frame, c->view->current_calendar,
CSA_E_NOT_SUPPORTED, p->xm_error_pixmap);
return;
}
if (!e->view_frame) { if (!e->view_frame) {
e->cal = c; e->cal = c;
e_build_view_popup(e); e_build_view_popup(e);

View file

@ -1684,7 +1684,7 @@ attrs_to_string(CSA_attribute * attrs, int num_attrs)
CSA_access_list a_ptr; CSA_access_list a_ptr;
char *buffer = malloc(1); char *buffer = malloc(1);
char tmp_buf[MAXNAMELEN]; char tmp_buf[MAXNAMELEN];
int advance_time; time_t advance_time;
buffer[0] = '\0'; buffer[0] = '\0';
for (i = 0; i < num_attrs; i++) { for (i = 0; i < num_attrs; i++) {

View file

@ -1153,9 +1153,14 @@ create_replace_rename_dialog(Widget parent_widget,
XtFree(title); XtFree(title);
XtFree(actions.actionList[1].label);
actions.actionList[1].label = orig_label; if (actions.actionList[1].label != orig_label) {
XtFree(actions.actionList[1].label);
actions.actionList[1].label = orig_label;
}
actions.actionList[1].msg_num = orig_msg_num; actions.actionList[1].msg_num = orig_msg_num;
return; return;
} /* end create_replace_rename_dialog */ } /* end create_replace_rename_dialog */

View file

@ -1357,7 +1357,9 @@ printVersion(
/*** DTB_USER_CODE_START vvv Add C code below vvv ***/ /*** DTB_USER_CODE_START vvv Add C code below vvv ***/
snoopStream << "ttsnoop: " << globalVersionString << endl; snoopStream << "ttsnoop: " << globalVersionString << endl;
snoopStream << "tt_c.h: " << TT_VERSION << endl; snoopStream << "tt_c.h: " << TT_VERSION << endl;
snoopStream << "libtt: " << _tt_lib_version << endl;
if (_tt_lib_version)
snoopStream << "libtt: " << _tt_lib_version << endl;
/*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/ /*** DTB_USER_CODE_END ^^^ Add C code above ^^^ ***/
} }