Convert uses of XKeycodeToKeysym (deprecated) to XkbKeycodeToKeysym
[oweals/cde.git] / cde / programs / dtcm / dtcm / props_pu.c
index c7c81bad3b3e7af720e43855ab9eca8ff66d6880..6315fb23dbd2531888aff8fe793744ca2969c5ef 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
 /* $TOG: props_pu.c /main/22 1999/05/26 09:45:49 mgreess $ */
 /*
  *  (c) Copyright 1993, 1994 Hewlett-Packard Company
@@ -8,7 +30,6 @@
 
 #include <EUSCompat.h>
 #include <stdlib.h>
-#include <malloc.h>
 #include <ctype.h>
 #include <sys/param.h>
 #include <Xm/Xm.h>
@@ -256,7 +277,7 @@ p_create_editor_pane(
                }
        }
 
-       XtVaGetValues(pu->ep_dur_cb, XmNtextField, &text_field, 0);
+       XtVaGetValues(pu->ep_dur_cb, XmNtextField, &text_field, NULL);
        XtAddCallback(text_field, XmNvalueChangedCallback, p_mark_change, pu);
        XtAddCallback(pu->ep_dur_cb, XmNselectionCallback, p_mark_change, pu);
 
@@ -2115,7 +2136,7 @@ p_save_changes(Calendar *c) {
 
         if (redisplay_mask & PROPS_REDO_EDITORS) {
 
-               if (((Editor *) c->editor)->base_form_mgr) {
+               if (c->editor && ((Editor *) c->editor)->base_form_mgr) {
 
                        Editor *e = (Editor *) c->editor;
                        DSSW *dssw = &((Editor *) c->editor)->dssw;
@@ -2138,7 +2159,7 @@ p_save_changes(Calendar *c) {
                }
        
 
-               if (((ToDo *) c->todo)->base_form_mgr) {
+               if (c->todo && ((ToDo *) c->todo)->base_form_mgr) {
                        ToDo *t = (ToDo *)c->todo;
                        DSSW *dssw = &((ToDo *) c->todo)->dssw;
 
@@ -2291,6 +2312,7 @@ p_flush_changes(Calendar *c) {
                else if (answer == 3) {
                        return(False);
                }
+               return(True);
        }
        else
                return(True);
@@ -2383,7 +2405,7 @@ p_make_props_pu(Calendar *c) {
 
        p->category_menu = widgets[0] = 
                XmVaCreateSimpleOptionMenu(p->base_form_mgr,
-               "category_menu",  label, NULL, 0, p_category_notify,
+               "category_menu",  label, 0, 0, p_category_notify,
                XmVaPUSHBUTTON, Pane_XmStrs[EDITOR_PANE], NULL, NULL, NULL,
                XmVaPUSHBUTTON, Pane_XmStrs[DISPLAY_PANE], NULL, NULL, NULL,
                XmVaPUSHBUTTON, Pane_XmStrs[GROUP_ACCESS_PANE], NULL, NULL,NULL,
@@ -3071,7 +3093,10 @@ set_editor_vals_on_ui(Props_pu *pu, Props *p) {
        val->selected = convert_boolean_str(get_char_prop(p, CP_MAILON));
        val->scope = convert_time_scope_str(get_char_prop(p, CP_MAILUNIT));
        val->scope_val = get_int_prop(p, CP_MAILADV);
-       strcpy(pu->ep_reminders.mailto_val, get_char_prop(p, CP_MAILTO));
+       snprintf(pu->ep_reminders.mailto_val,
+                sizeof(pu->ep_reminders.mailto_val),
+                "%s",
+                get_char_prop(p, CP_MAILTO));
 
        set_reminders_vals(&pu->ep_reminders, False);