Lines 1-15
Link Here
|
1 |
--- src/GUI/ots_gui.c.orig 2010-03-02 06:46:32.000000000 -0700 |
1 |
--- src/GUI/ots_gui.c.orig 2011-01-16 10:31:20.000000000 -0700 |
2 |
+++ src/GUI/ots_gui.c 2010-03-08 17:55:11.000000000 -0700 |
2 |
+++ src/GUI/ots_gui.c 2011-01-24 14:49:02.000000000 -0700 |
3 |
@@ -638,7 +638,7 @@ |
3 |
@@ -664,7 +664,7 @@ |
4 |
/* Now create enough tabbed-panels to hold all the lines. */ |
|
|
5 |
npanels = nlines / lines_per_page + 1; |
4 |
npanels = nlines / lines_per_page + 1; |
|
|
5 |
if (npanels < 2) npanels = 2; |
6 |
panelnames = (char **)malloc( (npanels+1) * sizeof(char *)); |
6 |
panelnames = (char **)malloc( (npanels+1) * sizeof(char *)); |
7 |
- for (j=0; j<npanels; j++) {panelnames[j] = (char *)malloc(30); sprintf( panelnames[j], "Page %d ", j+1); } |
7 |
- for (j=0; j<npanels; j++) {panelnames[j] = (char *)malloc(30); sprintf( panelnames[j], "Page %d ", j+1); } |
8 |
+ for (j=0; j<npanels; j++) {panelnames[j] = (char *)malloc(30); snprintf(panelnames[j], sizeof(panelnames[j]), "Page %d ", j+1); } |
8 |
+ for (j=0; j<npanels; j++) {panelnames[j] = (char *)malloc(30); snprintf(panelnames[j], sizeof(panelnames[j]), "Page %d ", j+1); } |
9 |
Panels = Otk_Tabbed_Panel_New( main_panel, npanels, panelnames, Otk_LightGray, 1, 1, 98, 98, 5 ); |
9 |
Panels = Otk_Tabbed_Panel_New( main_panel, npanels, panelnames, Otk_LightGray, 1, 1, 98, 98, 5 ); |
10 |
TabbedPanel = Panels; |
10 |
TabbedPanel = Panels; |
11 |
|
11 |
|
12 |
@@ -698,7 +698,7 @@ |
12 |
@@ -724,7 +724,7 @@ |
13 |
switch (entry->kind) |
13 |
switch (entry->kind) |
14 |
{ |
14 |
{ |
15 |
case VKIND_FLOAT: // printf("Formbox: '%s'\n", messg); |
15 |
case VKIND_FLOAT: // printf("Formbox: '%s'\n", messg); |
Lines 18-24
Link Here
|
18 |
pos_x = leftmargin; |
18 |
pos_x = leftmargin; |
19 |
leftmargin = leftmargin + box_width + 1.5; |
19 |
leftmargin = leftmargin + box_width + 1.5; |
20 |
pos_y = (float)linenum * 9.0 + 6.5; |
20 |
pos_y = (float)linenum * 9.0 + 6.5; |
21 |
@@ -986,9 +986,9 @@ |
21 |
@@ -1048,9 +1048,9 @@ |
22 |
return; |
22 |
return; |
23 |
} |
23 |
} |
24 |
if (PLATFORM_KIND==Posix_Platform) |
24 |
if (PLATFORM_KIND==Posix_Platform) |
Lines 30-36
Link Here
|
30 |
|
30 |
|
31 |
printf("Invoking '%s'\n", cmd ); |
31 |
printf("Invoking '%s'\n", cmd ); |
32 |
system(cmd); /* Invoke the TaxSolver. */ |
32 |
system(cmd); /* Invoke the TaxSolver. */ |
33 |
@@ -1022,7 +1022,7 @@ |
33 |
@@ -1086,7 +1086,7 @@ |
34 |
|
34 |
|
35 |
void togprntcmd_in(void *x) |
35 |
void togprntcmd_in(void *x) |
36 |
{ |
36 |
{ |
Lines 39-45
Link Here
|
39 |
Otk_Modify_Text( printerformbox, printer_command ); |
39 |
Otk_Modify_Text( printerformbox, printer_command ); |
40 |
} |
40 |
} |
41 |
|
41 |
|
42 |
@@ -1030,7 +1030,7 @@ |
42 |
@@ -1094,7 +1094,7 @@ |
43 |
{ char tmpstr[MaxFname]; |
43 |
{ char tmpstr[MaxFname]; |
44 |
int k; |
44 |
int k; |
45 |
predict_output_filename(wrkingfname,tmpstr); |
45 |
predict_output_filename(wrkingfname,tmpstr); |
Lines 48-54
Link Here
|
48 |
Otk_Modify_Text( printerformbox, printer_command ); |
48 |
Otk_Modify_Text( printerformbox, printer_command ); |
49 |
} |
49 |
} |
50 |
|
50 |
|
51 |
@@ -1058,7 +1058,7 @@ |
51 |
@@ -1122,7 +1122,7 @@ |
52 |
Otk_Add_BoundingBox( printpopup, Otk_Blue, 1.0, 18.0, 16.0, 63.0, 47.0 ); |
52 |
Otk_Add_BoundingBox( printpopup, Otk_Blue, 1.0, 18.0, 16.0, 63.0, 47.0 ); |
53 |
|
53 |
|
54 |
if (working_file==0) strcpy(wrkingfname,filename_dat); else strcpy(wrkingfname,working_file); |
54 |
if (working_file==0) strcpy(wrkingfname,filename_dat); else strcpy(wrkingfname,working_file); |
Lines 57-63
Link Here
|
57 |
|
57 |
|
58 |
OtkMakeTextLabel( printpopup, "Print Command:", Otk_Black, /*scale=*/ 1.5, /*weight=*/ 1, /*x=*/ 4, /*y=*/ 57 ); |
58 |
OtkMakeTextLabel( printpopup, "Print Command:", Otk_Black, /*scale=*/ 1.5, /*weight=*/ 1, /*x=*/ 4, /*y=*/ 57 ); |
59 |
printerformbox = OtkMakeTextFormBox( printpopup, printer_command, 60, 28.5, 55, 68, 18, acceptprinter_command2, 0 ); |
59 |
printerformbox = OtkMakeTextFormBox( printpopup, printer_command, 60, 28.5, 55, 68, 18, acceptprinter_command2, 0 ); |
60 |
@@ -1117,15 +1117,15 @@ |
60 |
@@ -1181,15 +1181,15 @@ |
61 |
if (k>0) k--; |
61 |
if (k>0) k--; |
62 |
while ((k>0) && (tmpstr[k]!=slashchr)) k--; |
62 |
while ((k>0) && (tmpstr[k]!=slashchr)) k--; |
63 |
if (tmpstr[k]==slashchr) tmpstr[k+1] = '\0'; |
63 |
if (tmpstr[k]==slashchr) tmpstr[k+1] = '\0'; |
Lines 65-71
Link Here
|
65 |
- sprintf(directory_dat,"%sexamples_and_templates%c", tmpstr, slashchr); |
65 |
- sprintf(directory_dat,"%sexamples_and_templates%c", tmpstr, slashchr); |
66 |
+ else {snprintf(tmpstr, sizeof(tmpstr), ".%c", slashchr);} |
66 |
+ else {snprintf(tmpstr, sizeof(tmpstr), ".%c", slashchr);} |
67 |
+ snprintf(directory_dat, sizeof(directory_dat), "%sexamples_and_templates%c", tmpstr, slashchr); |
67 |
+ snprintf(directory_dat, sizeof(directory_dat), "%sexamples_and_templates%c", tmpstr, slashchr); |
68 |
Otk_Browse_Files( "Select TaxSolver:", MaxFname, directory_dat, wildcards_dat, taxsolvestrng, open_taxfile ); |
68 |
Otk_Browse_Files( "Select TaxForm:", MaxFname, directory_dat, wildcards_dat, taxsolvestrng, open_taxfile ); |
69 |
return; |
69 |
return; |
70 |
} |
70 |
} |
71 |
else |
71 |
else |
Lines 76-82
Link Here
|
76 |
printf("Setting Tax Program to be: '%s'\n", tmpstr); |
76 |
printf("Setting Tax Program to be: '%s'\n", tmpstr); |
77 |
taxsolvecmd = strdup(tmpstr); |
77 |
taxsolvecmd = strdup(tmpstr); |
78 |
strcpy(taxsolvestrng,tmpstr); |
78 |
strcpy(taxsolvestrng,tmpstr); |
79 |
@@ -1136,8 +1136,8 @@ |
79 |
@@ -1200,8 +1200,8 @@ |
80 |
if (k>0) k--; |
80 |
if (k>0) k--; |
81 |
while ((k>0) && (tmpstr[k]!=slashchr)) k--; |
81 |
while ((k>0) && (tmpstr[k]!=slashchr)) k--; |
82 |
if (tmpstr[k]==slashchr) tmpstr[k+1] = '\0'; |
82 |
if (tmpstr[k]==slashchr) tmpstr[k+1] = '\0'; |
Lines 85-93
Link Here
|
85 |
+ else {snprintf(tmpstr, sizeof(tmpstr), ".%c", slashchr);} |
85 |
+ else {snprintf(tmpstr, sizeof(tmpstr), ".%c", slashchr);} |
86 |
+ snprintf(directory_dat, sizeof(directory_dat), "%sexamples_and_templates%c", tmpstr, slashchr); |
86 |
+ snprintf(directory_dat, sizeof(directory_dat), "%sexamples_and_templates%c", tmpstr, slashchr); |
87 |
|
87 |
|
88 |
sel = strstr( strg, "_2009" ); |
88 |
sel = strstr( strg, "_2010" ); |
89 |
sel[0] = '\0'; |
89 |
sel[0] = '\0'; |
90 |
@@ -1208,7 +1208,7 @@ |
90 |
@@ -1272,7 +1272,7 @@ |
91 |
{printf("Unknown command-line parameter '%s'\n", argv[argn]); /* exit(1); */ } |
91 |
{printf("Unknown command-line parameter '%s'\n", argv[argn]); /* exit(1); */ } |
92 |
argn = argn + 1; |
92 |
argn = argn + 1; |
93 |
} |
93 |
} |
Lines 96-102
Link Here
|
96 |
invocation_path = strdup(argv[0]); |
96 |
invocation_path = strdup(argv[0]); |
97 |
k = strlen(invocation_path)-1; |
97 |
k = strlen(invocation_path)-1; |
98 |
while ((k>0) && (invocation_path[k]!=slashchr)) k--; |
98 |
while ((k>0) && (invocation_path[k]!=slashchr)) k--; |
99 |
@@ -1234,7 +1234,7 @@ |
99 |
@@ -1298,7 +1298,7 @@ |
100 |
main_panel = |
100 |
main_panel = |
101 |
OtkMakePanel( bckgrnd, Otk_Raised, Otk_LightGray, 1, 7.5, 98, 87 ); /* Main Panel. */ |
101 |
OtkMakePanel( bckgrnd, Otk_Raised, Otk_LightGray, 1, 7.5, 98, 87 ); /* Main Panel. */ |
102 |
Otk_SetBorderThickness( main_panel, 0.25 ); |
102 |
Otk_SetBorderThickness( main_panel, 0.25 ); |