convert GlobalSymList to hash table
[nedit-bw.git] / enhanced-fix-XmNuserData.patch
blob9675a18e91bb8de516ed9f869c7a1d3b16993627
1 ---
3 source/preferences.c | 6 ++++--
4 util/getfiles.c | 8 +++++---
5 2 files changed, 9 insertions(+), 5 deletions(-)
7 diff --quilt old/source/preferences.c new/source/preferences.c
8 --- old/source/preferences.c
9 +++ new/source/preferences.c
10 @@ -2808,11 +2808,11 @@ void WrapMarginDialog(Widget parent, Win
11 ShowWrapMarginPulldownItems[i] = XtVaCreateManagedWidget(
12 "ShowWrapMarginPulldown",
13 xmPushButtonWidgetClass, ShowWrapMarginPulldown,
14 XmNlabelString, s1,
15 XmNmarginHeight, 0,
16 - XmNuserData, i,
17 + XmNuserData, (XtPointer) i,
18 NULL);
19 XmStringFree(s1);
21 n = 0;
22 XtSetArg(args[n], XmNspacing, 0); n++;
23 @@ -2887,10 +2887,11 @@ static void wrapOKCB(Widget w, XtPointer
25 int wrapAtWindow, margin, stat;
26 WindowInfo *window = WrapDialogForWindow;
27 int showWrapMargin;
28 Widget showWrapMarginSelectedItem;
29 + XtPointer userData;
31 /* get the values that the user entered and make sure they're ok */
32 wrapAtWindow = XmToggleButtonGetState(WrapWindowToggle);
33 if (wrapAtWindow)
34 margin = 0;
35 @@ -2908,11 +2909,12 @@ static void wrapOKCB(Widget w, XtPointer
39 XtVaGetValues(ShowWrapMarginOptMenu, XmNmenuHistory,
40 &showWrapMarginSelectedItem, NULL);
41 - XtVaGetValues(showWrapMarginSelectedItem, XmNuserData, &showWrapMargin, NULL);
42 + XtVaGetValues(showWrapMarginSelectedItem, XmNuserData, &userData, NULL);
43 + showWrapMargin = (int)userData;
44 if (showWrapMargin > N_SHOW_WRAP_MARGIN_STYLES || showWrapMargin < 0) {
45 showWrapMargin = SHOW_WRAP_MARGIN_NEVER;
48 #ifdef SGI_CUSTOM
49 diff --quilt old/util/getfiles.c new/util/getfiles.c
50 --- old/util/getfiles.c
51 +++ new/util/getfiles.c
52 @@ -434,11 +434,11 @@ static Widget addUtilForm(const Widget f
53 showOptionsLabel = XmStringCreateLocalized("Less...");
54 showOptionsPushButton = XtVaCreateManagedWidget("showOptionsPushButton",
55 xmPushButtonWidgetClass, showOptionsCheckBox,
56 XmNmnemonic, 'M',
57 XmNlabelString, showOptionsLabel,
58 - XmNuserData, 1,
59 + XmNuserData, (XtPointer) 1,
60 NULL);
61 XmStringFree(showOptionsLabel);
62 XtAddCallback(showOptionsPushButton,
63 XmNactivateCallback, showOptionsCB,
64 (XtPointer) &fsd);
65 @@ -598,17 +598,19 @@ static void hiddenFilesCB(Widget widget,
66 static void showOptionsCB(Widget pushButton,
67 XtPointer client_data,
68 XtPointer call_data)
70 Boolean isShown;
71 + XtPointer isShownPtr;
72 XmString buttonLabel;
73 Widget* fsb = (Widget*) client_data;
74 Dimension optionFormHeight;
75 Widget optionsForm = XtNameToWidget(*fsb, "*optionsForm");
76 Dimension fsbHeight;
78 - XtVaGetValues(pushButton, XmNuserData, &isShown, NULL);
79 + XtVaGetValues(pushButton, XmNuserData, &isShownPtr, NULL);
80 + isShown = isShownPtr ? True : False;
82 /* Get initial size of FSB */
83 XtVaGetValues(*fsb, XmNheight, &fsbHeight, NULL);
85 if (isShown) {
86 @@ -637,11 +639,11 @@ static void showOptionsCB(Widget pushBut
87 buttonLabel = XmStringCreateLocalized("Less...");
88 XtVaSetValues(pushButton, XmNlabelString, buttonLabel, NULL);
89 XmStringFree(buttonLabel);
92 - XtVaSetValues(pushButton, XmNuserData, isShown, NULL);
93 + XtVaSetValues(pushButton, XmNuserData, (XtPointer) isShown, NULL);
97 ** Callback procedure for toggle button requesting newlines to be inserted
98 ** to emulate continuous wrapping.