diff options
Diffstat (limited to 'scilab')
21 files changed, 521 insertions, 128 deletions
diff --git a/scilab/.gitignore b/scilab/.gitignore new file mode 100644 index 0000000..46bce1a --- /dev/null +++ b/scilab/.gitignore | |||
@@ -0,0 +1,128 @@ | |||
1 | # | ||
2 | # Linux objects files | ||
3 | # | ||
4 | *.lo | ||
5 | *.la | ||
6 | *.o | ||
7 | |||
8 | # | ||
9 | # Linux libtool files | ||
10 | # | ||
11 | .deps | ||
12 | .libs | ||
13 | Makefile | ||
14 | |||
15 | # | ||
16 | # Java compilation output dir | ||
17 | # | ||
18 | build | ||
19 | jar | ||
20 | |||
21 | # | ||
22 | # Documentation generation output files | ||
23 | # | ||
24 | .last_* | ||
25 | .list_* | ||
26 | |||
27 | # | ||
28 | # Scilab compiled macros | ||
29 | # | ||
30 | *.bin | ||
31 | names | ||
32 | lib | ||
33 | |||
34 | # | ||
35 | # backup files | ||
36 | # | ||
37 | *~ | ||
38 | *.bak | ||
39 | |||
40 | # | ||
41 | # windows files | ||
42 | # | ||
43 | |||
44 | # | ||
45 | # Innosetup files (Windows) | ||
46 | # | ||
47 | Scilab.iss | ||
48 | ScilabLogo.bmp | ||
49 | ScilabLogoSmall.bmp | ||
50 | scilab.ico | ||
51 | French.isl | ||
52 | English.isl | ||
53 | puffin.ico | ||
54 | base.iss | ||
55 | Output | ||
56 | atlas.iss | ||
57 | code.iss | ||
58 | components.iss | ||
59 | files.iss | ||
60 | icons.iss | ||
61 | ini.iss | ||
62 | languages.iss | ||
63 | registry.iss | ||
64 | run.iss | ||
65 | setup.iss | ||
66 | tasks.iss | ||
67 | types.iss | ||
68 | uninstalldelete.iss | ||
69 | # | ||
70 | # VS solution files (windows) | ||
71 | # | ||
72 | Scilab.sln_old | ||
73 | *.lib | ||
74 | *.exp | ||
75 | *.vcdef | ||
76 | Scilab.suo | ||
77 | Scilab.ncb | ||
78 | Release | ||
79 | Debug | ||
80 | *.icproj | ||
81 | *.user | ||
82 | *.u2d | ||
83 | *.suo | ||
84 | *.ncb | ||
85 | # | ||
86 | # others files (windows) | ||
87 | # | ||
88 | *.db | ||
89 | |||
90 | # | ||
91 | # scilab/ specific files | ||
92 | # | ||
93 | |||
94 | thirdparty | ||
95 | Makefile.OBJ | ||
96 | Makefile.incl | ||
97 | Makemex | ||
98 | Path.incl | ||
99 | config.log | ||
100 | config.status | ||
101 | libtool | ||
102 | history.scilab | ||
103 | lib | ||
104 | tcllib | ||
105 | _tmp_project.h | ||
106 | scilab-bin | ||
107 | tclmajor | ||
108 | tclminor | ||
109 | .libs | ||
110 | mainsci.o | ||
111 | *.log | ||
112 | java | ||
113 | .metadata | ||
114 | autom4te.cache | ||
115 | .deps | ||
116 | locale | ||
117 | *.dat | ||
118 | scilab-lib.properties | ||
119 | scilab-lib-doc.properties | ||
120 | scilab.pc | ||
121 | pvm3 | ||
122 | *.class | ||
123 | *.dia | ||
124 | |||
125 | # | ||
126 | # Subversion directories | ||
127 | # | ||
128 | .svn | ||
diff --git a/scilab/CHANGES_5.0.X b/scilab/CHANGES_5.0.X index 5a80ede..7de79f5 100644 --- a/scilab/CHANGES_5.0.X +++ b/scilab/CHANGES_5.0.X | |||
@@ -7,9 +7,11 @@ | |||
7 | Bug fixes: | 7 | Bug fixes: |
8 | ========== | 8 | ========== |
9 | 9 | ||
10 | * bug 2647 fixed - Bad display of some numbers in special cases due to a gfortran bug | ||
11 | |||
10 | * bug 3484 fixed - Scilab crashes when scicos is invoked from the command line. | 12 | * bug 3484 fixed - Scilab crashes when scicos is invoked from the command line. |
11 | 13 | ||
12 | * bug 2647 fixed - Bad display of some numbers in special cases due to a gfortran bug | 14 | * bug 3588 fixed - The figure number is missing from the title of graphic windows when Scilab in launched in French. |
13 | 15 | ||
14 | * bug 3621 fixed - Wrong setting of figure_position in the default figure. | 16 | * bug 3621 fixed - Wrong setting of figure_position in the default figure. |
15 | 17 | ||
diff --git a/scilab/CHANGES_5.1 b/scilab/CHANGES_5.1 index b75b2ed..c59e195 100644 --- a/scilab/CHANGES_5.1 +++ b/scilab/CHANGES_5.1 | |||
@@ -85,6 +85,8 @@ Bug fixes: | |||
85 | 85 | ||
86 | * bug 3566, 3567 fixed - sort and gsort didn't sort correctly complex matrix. | 86 | * bug 3566, 3567 fixed - sort and gsort didn't sort correctly complex matrix. |
87 | 87 | ||
88 | * bug 3588 fixed - The figure number is missing from the title of graphic windows when Scilab in launched in French. | ||
89 | |||
88 | * bug 3598 fixed - ls(1) or cd(1) or dir(1) or help(1), scilab crashes | 90 | * bug 3598 fixed - ls(1) or cd(1) or dir(1) or help(1), scilab crashes |
89 | 91 | ||
90 | * bug 3624 fixed - Nan returned when multiplying large zero vector by its transpose. | 92 | * bug 3624 fixed - Nan returned when multiplying large zero vector by its transpose. |
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c index 9219c76..a3f6e03 100644 --- a/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c +++ b/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c | |||
@@ -182,16 +182,7 @@ static int linkNoRhs(void) | |||
182 | LhsVar(1)=Rhs+1; | 182 | LhsVar(1)=Rhs+1; |
183 | C2F(putlhsvar)(); | 183 | C2F(putlhsvar)(); |
184 | 184 | ||
185 | for (i=0;i < sizeFunctionsList;i++) | 185 | freeArrayOfString(FunctionsList,sizeFunctionsList); |
186 | { | ||
187 | if (FunctionsList[i]) | ||
188 | { | ||
189 | FREE(FunctionsList[i]); | ||
190 | FunctionsList[i]=NULL; | ||
191 | } | ||
192 | } | ||
193 | FREE(FunctionsList); | ||
194 | FunctionsList = NULL; | ||
195 | } | 186 | } |
196 | else | 187 | else |
197 | { | 188 | { |
diff --git a/scilab/modules/dynamic_link/src/c/dynamic_link.c b/scilab/modules/dynamic_link/src/c/dynamic_link.c index fb5f6f0..aad7d87 100644 --- a/scilab/modules/dynamic_link/src/c/dynamic_link.c +++ b/scilab/modules/dynamic_link/src/c/dynamic_link.c | |||
@@ -169,21 +169,25 @@ char **getNamesOfFunctionsInSharedLibraries(int *sizearray) | |||
169 | char **NamesOfFunctions = NULL; | 169 | char **NamesOfFunctions = NULL; |
170 | *sizearray = 0; | 170 | *sizearray = 0; |
171 | 171 | ||
172 | if (NEpoints) | 172 | if ( (NEpoints) && (NEpoints > 0) ) |
173 | { | 173 | { |
174 | int i=0; | 174 | int i = 0; |
175 | for ( i = NEpoints-1 ; i >=0 ; i--) | 175 | NamesOfFunctions = (char **) MALLOC((NEpoints)*sizeof(char *)); |
176 | if (NamesOfFunctions) | ||
176 | { | 177 | { |
177 | if (EP[i].name) | 178 | for ( i = NEpoints-1 ; i >= 0 ; i--) |
178 | { | 179 | { |
179 | char *EntryName=(char *)MALLOC(strlen(EP[i].name)*sizeof(char)); | 180 | if (EP[i].name) |
180 | 181 | { | |
181 | (*sizearray)++; | 182 | char *EntryName = (char *)MALLOC(((int)strlen(EP[i].name)+1)*sizeof(char)); |
182 | if (NamesOfFunctions) NamesOfFunctions = (char **) REALLOC(NamesOfFunctions,(*sizearray)*sizeof(char *)); | 183 | |
183 | else NamesOfFunctions = (char **) MALLOC((*sizearray)*sizeof(char *)); | 184 | if (EntryName) |
184 | 185 | { | |
185 | strcpy(EntryName,EP[i].name); | 186 | (*sizearray)++; |
186 | NamesOfFunctions[(*sizearray)-1]=EntryName; | 187 | strcpy(EntryName , EP[i].name); |
188 | NamesOfFunctions[(*sizearray)-1] = EntryName; | ||
189 | } | ||
190 | } | ||
187 | } | 191 | } |
188 | } | 192 | } |
189 | } | 193 | } |
diff --git a/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.c b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.c new file mode 100644 index 0000000..c0a4d49 --- /dev/null +++ b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.c | |||
@@ -0,0 +1,93 @@ | |||
1 | /* ============================================== */ | ||
2 | #include "stack-c.h" | ||
3 | #include "sciprint.h" | ||
4 | /* ============================================== */ | ||
5 | /* Interfaces for c fonctions */ | ||
6 | /* ============================================== */ | ||
7 | void c_sum(double *b, double *c, double *a); | ||
8 | void c_sub(double *b, double *c, double *a); | ||
9 | /* ============================================== */ | ||
10 | int c_intsum(char *fname) | ||
11 | { | ||
12 | int l1=0, m1=0, n1=0, l2=0, m2=0, n2=0, l3=0, m3=1, n3=1; | ||
13 | int minlhs=1, maxlhs=1, minrhs=2, maxrhs=2; | ||
14 | |||
15 | /* Check number of inputs (rhs=2) and outputs (lhs=1) */ | ||
16 | CheckRhs(minrhs,maxrhs) ; | ||
17 | CheckLhs(minlhs,maxlhs) ; | ||
18 | |||
19 | /* Get Qdata (#1) and Param (#2) and create C (#3) as double ("d") matrices */ | ||
20 | GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1); /* b */ | ||
21 | GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE, &m2, &n2, &l2); /* c */ | ||
22 | |||
23 | CreateVar(Rhs+1, MATRIX_OF_DOUBLE_DATATYPE, &m3, &n3, &l3); /* Result : a = b+c */ | ||
24 | |||
25 | /* Check dimensions */ | ||
26 | if (!(m1==1)|!(n1==1)) | ||
27 | { | ||
28 | sciprint("%s: Wrong inputs \r\n", "c_fun"); | ||
29 | Error(999); | ||
30 | return 0; | ||
31 | } | ||
32 | if (!(m2==1)|!(n2==1)) | ||
33 | { | ||
34 | sciprint("%s: Wrong inputs \r\n", "c_fun"); | ||
35 | Error(999); | ||
36 | return 0; | ||
37 | } | ||
38 | |||
39 | /* Call c_fun */ | ||
40 | c_sum(stk(l1),stk(l2),stk(l3)); | ||
41 | |||
42 | /* Return result */ | ||
43 | LhsVar(1) = Rhs+1; | ||
44 | return 0; | ||
45 | } | ||
46 | /* ============================================== */ | ||
47 | int c_intsub(char *fname) | ||
48 | { | ||
49 | int l1=0, m1=0, n1=0, l2=0, m2=0, n2=0, l3=0, m3=1, n3=1; | ||
50 | int minlhs=1, maxlhs=1, minrhs=2, maxrhs=2; | ||
51 | |||
52 | /* Check number of inputs (rhs=2) and outputs (lhs=1) */ | ||
53 | CheckRhs(minrhs,maxrhs) ; | ||
54 | CheckLhs(minlhs,maxlhs) ; | ||
55 | |||
56 | /* Get Qdata (#1) and Param (#2) and create C (#3) as double ("d") matrices */ | ||
57 | GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1); /* b */ | ||
58 | GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE, &m2, &n2, &l2); /* c */ | ||
59 | |||
60 | CreateVar(Rhs+1, MATRIX_OF_DOUBLE_DATATYPE, &m3, &n3, &l3); /* Result : a = b-c */ | ||
61 | |||
62 | /* Check dimensions */ | ||
63 | if (!(m1==1)|!(n1==1)) | ||
64 | { | ||
65 | sciprint("%s: Wrong inputs \r\n", "c_fun"); | ||
66 | Error(999); | ||
67 | return 0; | ||
68 | } | ||
69 | if (!(m2==1)|!(n2==1)) | ||
70 | { | ||
71 | sciprint("%s: Wrong inputs \r\n", "c_fun"); | ||
72 | Error(999); | ||
73 | return 0; | ||
74 | } | ||
75 | |||
76 | /* Call c_fun */ | ||
77 | c_sub(stk(l1),stk(l2),stk(l3)); | ||
78 | |||
79 | /* Return result */ | ||
80 | LhsVar(1) = Rhs+1; | ||
81 | return 0; | ||
82 | } | ||
83 | /* ============================================== */ | ||
84 | void c_sum(double *b, double *c, double *a) | ||
85 | { | ||
86 | *a = *b + *c; | ||
87 | } | ||
88 | /* ============================================== */ | ||
89 | void c_sub(double *b, double *c, double *a) | ||
90 | { | ||
91 | *a = *b -*c; | ||
92 | } | ||
93 | /* ============================================== */ \ No newline at end of file | ||
diff --git a/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.tst b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.tst new file mode 100644 index 0000000..7cfa743 --- /dev/null +++ b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.tst | |||
@@ -0,0 +1,70 @@ | |||
1 | // ============================================================================= | ||
2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | // Copyright (C) 2008 - DIGITEO - Allan CORNET | ||
4 | // | ||
5 | // This file is distributed under the same license as the Scilab package. | ||
6 | // ============================================================================= | ||
7 | |||
8 | // <-- Non-regression test for bug 3639 --> | ||
9 | // | ||
10 | // <-- Bugzilla URL --> | ||
11 | // http://bugzilla.scilab.org/show_bug.cgi?id=3639 | ||
12 | // | ||
13 | // <-- Short Description --> | ||
14 | // link without parameters can crash | ||
15 | |||
16 | |||
17 | test_path = get_absolute_file_path('bug_3639.tst'); | ||
18 | |||
19 | currentpath = pwd(); | ||
20 | |||
21 | cd TMPDIR; | ||
22 | cd ../; | ||
23 | OS_TMP_DIR = pwd(); | ||
24 | |||
25 | |||
26 | mkdir(OS_TMP_DIR,'bug_3639'); | ||
27 | TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3639'; | ||
28 | |||
29 | copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3639.c' , TEST_DIR + filesep() + 'bug_3639.c'); | ||
30 | |||
31 | chdir(TEST_DIR); | ||
32 | |||
33 | files=['bug_3639.o']; | ||
34 | ilib_build('libc_fun1',['c_sum1','c_intsum';'c_sub1','c_intsub'],files,[]); | ||
35 | copyfile('loader.sce','loader1.sce'); | ||
36 | |||
37 | ilib_build('libc_fun2',['c_sum2','c_intsum';'c_sub2','c_intsub'],files,[]); | ||
38 | |||
39 | |||
40 | // disable message | ||
41 | warning_mode = warning('query'); | ||
42 | warning('off'); | ||
43 | |||
44 | // load the shared library | ||
45 | info_link = link(); | ||
46 | if info_link <> [] then pause,end | ||
47 | |||
48 | exec loader1.sce | ||
49 | info_link = link(); | ||
50 | if info_link <> 'libc_fun1' then pause,end | ||
51 | |||
52 | exec loader.sce | ||
53 | info_link = link(); | ||
54 | if or(info_link <> ['libc_fun2','libc_fun1']) then pause,end | ||
55 | |||
56 | // enable message | ||
57 | warning(warning_mode); | ||
58 | |||
59 | chdir(currentpath); | ||
60 | |||
61 | // ulink() all libraries | ||
62 | ulink(); | ||
63 | clearfun('c_sum1'); | ||
64 | clearfun('c_sub1'); | ||
65 | clearfun('c_sum2'); | ||
66 | clearfun('c_sub2'); | ||
67 | |||
68 | //remove TMP_DIR | ||
69 | rmdir(TEST_DIR,'s'); | ||
70 | // ============================================================================= | ||
diff --git a/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.win.dia.ref b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.win.dia.ref new file mode 100644 index 0000000..a9ff543 --- /dev/null +++ b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_3639.win.dia.ref | |||
@@ -0,0 +1,114 @@ | |||
1 | // ============================================================================= | ||
2 | // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab | ||
3 | // Copyright (C) 2008 - DIGITEO - Allan CORNET | ||
4 | // | ||
5 | // This file is distributed under the same license as the Scilab package. | ||
6 | // ============================================================================= | ||
7 | // <-- Non-regression test for bug 3639 --> | ||
8 | // | ||
9 | // <-- Bugzilla URL --> | ||
10 | // http://bugzilla.scilab.org/show_bug.cgi?id=3639 | ||
11 | // | ||
12 | // <-- Short Description --> | ||
13 | // link without parameters can crash | ||
14 | test_path = get_absolute_file_path('bug_3639.tst'); | ||
15 | currentpath = pwd(); | ||
16 | cd TMPDIR; | ||
17 | cd ../; | ||
18 | OS_TMP_DIR = pwd(); | ||
19 | mkdir(OS_TMP_DIR,'bug_3639'); | ||
20 | TEST_DIR = OS_TMP_DIR + filesep() + 'bug_3639'; | ||
21 | copyfile(SCI+'/modules/dynamic_link/tests/nonreg_tests/bug_3639.c' , TEST_DIR + filesep() + 'bug_3639.c'); | ||
22 | chdir(TEST_DIR); | ||
23 | files=['bug_3639.o']; | ||
24 | ilib_build('libc_fun1',['c_sum1','c_intsum';'c_sub1','c_intsub'],files,[]); | ||
25 | Generate a gateway file | ||
26 | Generate a loader file | ||
27 | Generate a Makefile: Makelib | ||
28 | Running the makefile | ||
29 | Compilation of bug_3639 | ||
30 | Building shared library (be patient) | ||
31 | copyfile('loader.sce','loader1.sce'); | ||
32 | ilib_build('libc_fun2',['c_sum2','c_intsum';'c_sub2','c_intsub'],files,[]); | ||
33 | Generate a gateway file | ||
34 | Generate a loader file | ||
35 | Generate a Makefile: Makelib | ||
36 | Running the makefile | ||
37 | Compilation of bug_3639 | ||
38 | Building shared library (be patient) | ||
39 | // disable message | ||
40 | warning_mode = warning('query'); | ||
41 | warning('off'); | ||
42 | // load the shared library | ||
43 | info_link = link(); | ||
44 | if info_link <> [] then bugmes();quit;end | ||
45 | exec loader1.sce | ||
46 | |||
47 | // ------------------------------------------------------ | ||
48 | |||
49 | // generated by builder.sce: Please do not edit this file | ||
50 | |||
51 | // ------------------------------------------------------ | ||
52 | |||
53 | |||
54 | libc_fun1_path = get_file_path('loader.sce'); | ||
55 | |||
56 | list_functions = [ 'c_sum1'; | ||
57 | 'c_sub1'; | ||
58 | ]; | ||
59 | |||
60 | addinter(libc_fun1_path+'/libc_fun1.dll','libc_fun1',list_functions); | ||
61 | |||
62 | // remove temp. variables on stack | ||
63 | |||
64 | clear libc_fun1_path; | ||
65 | |||
66 | clear list_functions; | ||
67 | |||
68 | clear get_file_path; | ||
69 | |||
70 | // ------------------------------------------------------ | ||
71 | |||
72 | info_link = link(); | ||
73 | if info_link <> 'libc_fun1' then bugmes();quit;end | ||
74 | exec loader.sce | ||
75 | |||
76 | // ------------------------------------------------------ | ||
77 | |||
78 | // generated by builder.sce: Please do not edit this file | ||
79 | |||
80 | // ------------------------------------------------------ | ||
81 | |||
82 | |||
83 | libc_fun2_path = get_file_path('loader.sce'); | ||
84 | |||
85 | list_functions = [ 'c_sum2'; | ||
86 | 'c_sub2'; | ||
87 | ]; | ||
88 | |||
89 | addinter(libc_fun2_path+'/libc_fun2.dll','libc_fun2',list_functions); | ||
90 | |||
91 | // remove temp. variables on stack | ||
92 | |||
93 | clear libc_fun2_path; | ||
94 | |||
95 | clear list_functions; | ||
96 | |||
97 | clear get_file_path; | ||
98 | |||
99 | // ------------------------------------------------------ | ||
100 | |||
101 | info_link = link(); | ||
102 | if or(info_link <> ['libc_fun2','libc_fun1']) then bugmes();quit;end | ||
103 | // enable message | ||
104 | warning(warning_mode); | ||
105 | chdir(currentpath); | ||
106 | // ulink() all libraries | ||
107 | ulink(); | ||
108 | clearfun('c_sum1'); | ||
109 | clearfun('c_sub1'); | ||
110 | clearfun('c_sum2'); | ||
111 | clearfun('c_sub2'); | ||
112 | //remove TMP_DIR | ||
113 | rmdir(TEST_DIR,'s'); | ||
114 | // ============================================================================= | ||
diff --git a/scilab/modules/graphics/includes/GetProperty.h b/scilab/modules/graphics/includes/GetProperty.h index afcb165a..3dd21e4 100644 --- a/scilab/modules/graphics/includes/GetProperty.h +++ b/scilab/modules/graphics/includes/GetProperty.h | |||
@@ -114,7 +114,6 @@ BOOL sciGetResize (sciPointObj * pobj); /* GET */ | |||
114 | 114 | ||
115 | /* Window Functions */ | 115 | /* Window Functions */ |
116 | char *sciGetName (sciPointObj * pobj); /* GET */ | 116 | char *sciGetName (sciPointObj * pobj); /* GET */ |
117 | int sciGetNameLength (sciPointObj * pobj); /* GET */ | ||
118 | int sciGetNum (sciPointObj * pobj); /* GET */ | 117 | int sciGetNum (sciPointObj * pobj); /* GET */ |
119 | int sciGetWidth (sciPointObj * pobj); /* GET */ | 118 | int sciGetWidth (sciPointObj * pobj); /* GET */ |
120 | int sciGetHeight (sciPointObj * pobj); /* GET */ | 119 | int sciGetHeight (sciPointObj * pobj); /* GET */ |
diff --git a/scilab/modules/graphics/includes/ObjectStructure.h b/scilab/modules/graphics/includes/ObjectStructure.h index e2706ba..dfac872 100644 --- a/scilab/modules/graphics/includes/ObjectStructure.h +++ b/scilab/modules/graphics/includes/ObjectStructure.h | |||
@@ -454,9 +454,8 @@ typedef struct | |||
454 | sciGraphicContext graphiccontext; /* the only property used here is background */ | 454 | sciGraphicContext graphiccontext; /* the only property used here is background */ |
455 | sciPointObj * originalsubwin0011; | 455 | sciPointObj * originalsubwin0011; |
456 | /** specifies the title for this window */ | 456 | /** specifies the title for this window */ |
457 | char name[SCI_FIGURE_NAME_LENGTH]; | 457 | char * name; |
458 | /** specifies le length of the string name */ | 458 | |
459 | int namelen; | ||
460 | /** specifies the number of this window */ | 459 | /** specifies the number of this window */ |
461 | int number; | 460 | int number; |
462 | 461 | ||
diff --git a/scilab/modules/graphics/includes/SetProperty.h b/scilab/modules/graphics/includes/SetProperty.h index ac9fe62..77ba172 100644 --- a/scilab/modules/graphics/includes/SetProperty.h +++ b/scilab/modules/graphics/includes/SetProperty.h | |||
@@ -155,7 +155,8 @@ int sciSetDefaultValues (void); /* SET */ | |||
155 | 155 | ||
156 | 156 | ||
157 | /* Window Functions */ | 157 | /* Window Functions */ |
158 | int sciSetName (sciPointObj * pobj, char *pvalue, int length); /* SET */ | 158 | int sciInitName(sciPointObj * pobj, char * newName); /* SET */ |
159 | int sciSetName (sciPointObj * pobj, char * newName); /* SET */ | ||
159 | int sciInitNum( sciPointObj * pobj, int value ) ; | 160 | int sciInitNum( sciPointObj * pobj, int value ) ; |
160 | int sciSetNum ( sciPointObj * pobj, int value ) ; /* SET */ | 161 | int sciSetNum ( sciPointObj * pobj, int value ) ; /* SET */ |
161 | 162 | ||
diff --git a/scilab/modules/graphics/locales/fr_FR/graphics.po b/scilab/modules/graphics/locales/fr_FR/graphics.po index 38a64ef..11c4f56 100644 --- a/scilab/modules/graphics/locales/fr_FR/graphics.po +++ b/scilab/modules/graphics/locales/fr_FR/graphics.po | |||
@@ -623,7 +623,7 @@ msgstr "" | |||
623 | 623 | ||
624 | #, c-format | 624 | #, c-format |
625 | msgid "Graphic window number %d" | 625 | msgid "Graphic window number %d" |
626 | msgstr "Figure n°%d" | 626 | msgstr "Figure n %d" |
627 | 627 | ||
628 | msgid "This object has not any graphic mode\n" | 628 | msgid "This object has not any graphic mode\n" |
629 | msgstr "" | 629 | msgstr "" |
diff --git a/scilab/modules/graphics/sci_gateway/c/sci_xname.c b/scilab/modules/graphics/sci_gateway/c/sci_xname.c index 3afa15b..5635634 100644 --- a/scilab/modules/graphics/sci_gateway/c/sci_xname.c +++ b/scilab/modules/graphics/sci_gateway/c/sci_xname.c | |||
@@ -32,7 +32,7 @@ int sci_xname(char *fname,unsigned long fname_len) | |||
32 | CheckLhs(1,1); | 32 | CheckLhs(1,1); |
33 | GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1); | 33 | GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1); |
34 | 34 | ||
35 | sciSetName( sciGetCurrentFigure(), cstk(l1), m1 ) ; | 35 | sciSetName( sciGetCurrentFigure(), cstk(l1) ) ; |
36 | 36 | ||
37 | LhsVar(1)=0; | 37 | LhsVar(1)=0; |
38 | return 0; | 38 | return 0; |
diff --git a/scilab/modules/graphics/src/c/BuildObjects.c b/scilab/modules/graphics/src/c/BuildObjects.c index 237d0a1..6da6418 100644 --- a/scilab/modules/graphics/src/c/BuildObjects.c +++ b/scilab/modules/graphics/src/c/BuildObjects.c | |||
@@ -203,7 +203,8 @@ sciPointObj * ConstructFigure(sciPointObj * pparent, int * figureIndex) | |||
203 | /* Set default figure index */ | 203 | /* Set default figure index */ |
204 | sciInitNum(pobj, getUnusedFigureIndex()); | 204 | sciInitNum(pobj, getUnusedFigureIndex()); |
205 | } | 205 | } |
206 | sciSetName(pobj, sciGetName(pfiguremdl), sciGetNameLength(pfiguremdl)); | 206 | |
207 | sciInitName(pobj, sciGetName(pfiguremdl)); | ||
207 | sciInitResize(pobj,sciGetResize(pfiguremdl)); | 208 | sciInitResize(pobj,sciGetResize(pfiguremdl)); |
208 | 209 | ||
209 | ppFigure->isiconified = ppModel->isiconified; | 210 | ppFigure->isiconified = ppModel->isiconified; |
diff --git a/scilab/modules/graphics/src/c/GetProperty.c b/scilab/modules/graphics/src/c/GetProperty.c index 3381693..d0557e5 100644 --- a/scilab/modules/graphics/src/c/GetProperty.c +++ b/scilab/modules/graphics/src/c/GetProperty.c | |||
@@ -2029,38 +2029,13 @@ sciGetName (sciPointObj * pobj) | |||
2029 | case SCI_SUBWIN: | 2029 | case SCI_SUBWIN: |
2030 | case SCI_AGREG: | 2030 | case SCI_AGREG: |
2031 | default: | 2031 | default: |
2032 | printSetGetErrorMessage("name"); | 2032 | printSetGetErrorMessage("figure_name"); |
2033 | return NULL; | 2033 | return NULL; |
2034 | break; | 2034 | break; |
2035 | } | 2035 | } |
2036 | } | 2036 | } |
2037 | 2037 | ||
2038 | 2038 | ||
2039 | /**sciGetNameLength | ||
2040 | * Returns the length of the name of the Figure or SubWindow | ||
2041 | * @param sciPointObj * pobj: the pointer to the entity | ||
2042 | * @return the length of the Name | ||
2043 | */ | ||
2044 | int | ||
2045 | sciGetNameLength (sciPointObj * pobj) | ||
2046 | { | ||
2047 | switch (sciGetEntityType (pobj)) | ||
2048 | { | ||
2049 | case SCI_FIGURE: | ||
2050 | return pFIGURE_FEATURE (pobj)->namelen; | ||
2051 | break; | ||
2052 | case SCI_SUBWIN: | ||
2053 | return pSUBWIN_FEATURE (pobj)->namelen; | ||
2054 | break; | ||
2055 | case SCI_AGREG: | ||
2056 | default: | ||
2057 | printSetGetErrorMessage("name"); | ||
2058 | return 0; | ||
2059 | break; | ||
2060 | } | ||
2061 | } | ||
2062 | |||
2063 | |||
2064 | /**sciGetNum | 2039 | /**sciGetNum |
2065 | * Returns the number of the Figure. | 2040 | * Returns the number of the Figure. |
2066 | * @param sciPointObj * pobj: the pointer to the entity | 2041 | * @param sciPointObj * pobj: the pointer to the entity |
diff --git a/scilab/modules/graphics/src/c/InitObjects.c b/scilab/modules/graphics/src/c/InitObjects.c index b45dceb..2966e4f 100644 --- a/scilab/modules/graphics/src/c/InitObjects.c +++ b/scilab/modules/graphics/src/c/InitObjects.c | |||
@@ -508,8 +508,8 @@ int InitFigureModel( void ) | |||
508 | /* F.Leray 10.06.04 */ | 508 | /* F.Leray 10.06.04 */ |
509 | return -1 ; | 509 | return -1 ; |
510 | } | 510 | } |
511 | strncpy (pFIGURE_FEATURE (pfiguremdl)->name, _("Graphic window number %d"), strlen(_("Graphic window number %d"))*sizeof(char) + 4); | 511 | |
512 | pFIGURE_FEATURE (pfiguremdl)->namelen = Min ((int)strlen(_("Graphic window number %d"))*sizeof(char) + 4, 24); | 512 | sciInitName(pfiguremdl, _("Graphic window number %d")); |
513 | pFIGURE_FEATURE (pfiguremdl)->number = 0 ; | 513 | pFIGURE_FEATURE (pfiguremdl)->number = 0 ; |
514 | 514 | ||
515 | /* Set figure model attributes */ | 515 | /* Set figure model attributes */ |
@@ -804,7 +804,7 @@ int ResetFigureToDefaultValues(sciPointObj * pobj) | |||
804 | return -1; | 804 | return -1; |
805 | } | 805 | } |
806 | /* sciSetNum(pobj, getUnusedFigureIndex()); Number can not be modified */ | 806 | /* sciSetNum(pobj, getUnusedFigureIndex()); Number can not be modified */ |
807 | sciSetName(pobj, sciGetName(pfiguremdl), sciGetNameLength(pfiguremdl)); | 807 | sciInitName(pobj, sciGetName(pfiguremdl)); |
808 | sciSetResize((sciPointObj *) pobj,sciGetResize(pobj)); | 808 | sciSetResize((sciPointObj *) pobj,sciGetResize(pobj)); |
809 | sciSetWindowDim( pobj, sciGetWindowWidth(pfiguremdl), sciGetWindowHeight(pfiguremdl) ) ; | 809 | sciSetWindowDim( pobj, sciGetWindowWidth(pfiguremdl), sciGetWindowHeight(pfiguremdl) ) ; |
810 | if (sciSetDimension( pobj, sciGetWidth(pfiguremdl), sciGetHeight(pfiguremdl) ) != RESIZE_SUCCESS) | 810 | if (sciSetDimension( pobj, sciGetWidth(pfiguremdl), sciGetHeight(pfiguremdl) ) != RESIZE_SUCCESS) |
diff --git a/scilab/modules/graphics/src/c/SetProperty.c b/scilab/modules/graphics/src/c/SetProperty.c index 1224b40..cc66c00 100644 --- a/scilab/modules/graphics/src/c/SetProperty.c +++ b/scilab/modules/graphics/src/c/SetProperty.c | |||
@@ -2180,51 +2180,44 @@ sciSetResize (sciPointObj * pobj, BOOL value) | |||
2180 | 2180 | ||
2181 | 2181 | ||
2182 | 2182 | ||
2183 | /**sciSetName | 2183 | int sciInitName(sciPointObj * pobj, char * newName) |
2184 | * Sets the name of the Figure | ||
2185 | * @param sciPointObj * pobj: the pointer to the entity | ||
2186 | * @param char pvalue: a pointer to the string contening name | ||
2187 | * @param int length: the length of the string (without the ending (char)0 ). | ||
2188 | * @return | ||
2189 | */ | ||
2190 | int | ||
2191 | sciSetName (sciPointObj * pobj, char *pvalue, int length) | ||
2192 | { | 2184 | { |
2193 | switch (sciGetEntityType (pobj)) | 2185 | switch (sciGetEntityType (pobj)) |
2194 | { | 2186 | { |
2195 | case SCI_FIGURE: | 2187 | case SCI_FIGURE: |
2196 | { | 2188 | { |
2197 | /* the length of the C string */ | 2189 | int newNameLength; |
2198 | int realLength = length + 1 ; | ||
2199 | int percentStatus = 0 ; | 2190 | int percentStatus = 0 ; |
2200 | if( realLength > SCI_FIGURE_NAME_LENGTH ) | ||
2201 | { | ||
2202 | sciprint(_("Figure name is limited to %d characters.\n"), SCI_FIGURE_NAME_LENGTH - 1 ); | ||
2203 | return -1 ; | ||
2204 | } | ||
2205 | 2191 | ||
2206 | percentStatus = checkPercent( pvalue ) ; | 2192 | /* first case newName is NULL */ |
2207 | if ( percentStatus < 0 ) | 2193 | if (newName == NULL) |
2194 | { | ||
2195 | /* Just set tan empty title for the phisical window if needed */ | ||
2196 | if (!isFigureModel(pobj)) | ||
2197 | { | ||
2198 | sciSetJavaTitle(pobj, ""); | ||
2199 | } | ||
2200 | |||
2201 | return 0; | ||
2202 | } | ||
2203 | |||
2204 | /* newName is a valid string */ | ||
2205 | newNameLength = strlen(newName); | ||
2206 | |||
2207 | /* Reallocate name */ | ||
2208 | pFIGURE_FEATURE(pobj)->name = MALLOC( (newNameLength + 1) * sizeof(char) ); | ||
2209 | |||
2210 | /* copy the string */ | ||
2211 | strcpy(pFIGURE_FEATURE(pobj)->name, newName) ; | ||
2212 | |||
2213 | /* Update the name of the physical window if one exists */ | ||
2214 | if (!isFigureModel(pobj)) | ||
2208 | { | 2215 | { |
2209 | sciprint(_("Figure name may not contains any %% character, except a single %%d.\n")) ; | 2216 | /* In this case, we need to send the name to the physical window */ |
2210 | return -1 ; | 2217 | if ( checkPercent(newName) == 0 ) |
2211 | } | ||
2212 | |||
2213 | strcpy (pFIGURE_FEATURE (pobj)->name, pvalue ) ; | ||
2214 | pFIGURE_FEATURE (pobj)->namelen = length ; | ||
2215 | |||
2216 | if (pobj != getFigureModel()) | ||
2217 | { | ||
2218 | char * str = NULL ; | ||
2219 | if ( percentStatus == 0 ) | ||
2220 | { | 2218 | { |
2221 | str = CALLOC( realLength, sizeof(char) ) ; | 2219 | /* no %d, set the java title directly */ |
2222 | if ( str == NULL ) | 2220 | sciSetJavaTitle(pobj, pFIGURE_FEATURE(pobj)->name); |
2223 | { | ||
2224 | sciprint(_("%s: No more memory.\n"),"sciSetName"); | ||
2225 | return -1 ; | ||
2226 | } | ||
2227 | strcpy( str, pvalue ) ; | ||
2228 | } | 2221 | } |
2229 | else | 2222 | else |
2230 | { | 2223 | { |
@@ -2232,33 +2225,62 @@ sciSetName (sciPointObj * pobj, char *pvalue, int length) | |||
2232 | /* get the number digits of the window number */ | 2225 | /* get the number digits of the window number */ |
2233 | int figureNumber = sciGetNum( pobj ) ; | 2226 | int figureNumber = sciGetNum( pobj ) ; |
2234 | int nbDigits = GET_NB_DIGITS( figureNumber ) ; | 2227 | int nbDigits = GET_NB_DIGITS( figureNumber ) ; |
2235 | realLength = realLength + nbDigits - 2 ; /* -2 for the %d */ | 2228 | int realTitleLength = newNameLength + nbDigits - 2 ; /* -2 for the %d which is replaced */ |
2236 | str = CALLOC( realLength, sizeof(char) ) ; | 2229 | char * realTitle = MALLOC( (realTitleLength + 1) * sizeof(char) ) ; |
2237 | if ( str == NULL ) | 2230 | if ( realTitle == NULL ) |
2238 | { | 2231 | { |
2239 | sciprint(_("%s: No more memory.\n"),"sciSetName"); | 2232 | sciprint(_("%s: No more memory.\n"),"sciSetName"); |
2240 | return -1 ; | 2233 | return -1 ; |
2241 | } | 2234 | } |
2242 | sprintf( str, pvalue, figureNumber ) ; | 2235 | sprintf( realTitle, newName, figureNumber ) ; |
2243 | length = realLength - 1 ; | 2236 | sciSetJavaTitle(pobj, realTitle); |
2237 | FREE(realTitle) ; | ||
2244 | } | 2238 | } |
2245 | 2239 | ||
2246 | /* set the java title */ | 2240 | |
2247 | sciSetJavaTitle(pobj, str); | ||
2248 | |||
2249 | FREE(str) ; | ||
2250 | } | 2241 | } |
2251 | 2242 | ||
2252 | break; | 2243 | return 0 ; |
2253 | } | 2244 | } |
2254 | case SCI_SUBWIN: | ||
2255 | case SCI_AGREG: | ||
2256 | default: | 2245 | default: |
2257 | printSetGetErrorMessage("name"); | 2246 | printSetGetErrorMessage("figure_name"); |
2258 | return -1 ; | 2247 | return -1 ; |
2259 | break; | 2248 | break; |
2260 | } | 2249 | } |
2261 | return 0 ; | 2250 | } |
2251 | |||
2252 | /**sciSetName | ||
2253 | * Sets the name of the Figure | ||
2254 | * @param sciPointObj * pobj: the pointer to the entity | ||
2255 | * @param char newName: a pointer to the string contening name | ||
2256 | * @return | ||
2257 | */ | ||
2258 | int | ||
2259 | sciSetName(sciPointObj * pobj, char * newName) | ||
2260 | { | ||
2261 | if ( newName != NULL | ||
2262 | && sciGetName(pobj) != NULL | ||
2263 | && strcmp(sciGetName(pobj), newName) == 0) | ||
2264 | { | ||
2265 | // nothing to do | ||
2266 | return 1; | ||
2267 | } | ||
2268 | |||
2269 | /* Check that the string contains at most one %d character */ | ||
2270 | if (checkPercent(newName) < 0) | ||
2271 | { | ||
2272 | sciprint(_("Figure name may not contains any %% character, except a single %%d.\n")) ; | ||
2273 | return -1 ; | ||
2274 | } | ||
2275 | |||
2276 | /* Free the current name if needed */ | ||
2277 | if (sciGetName(pobj) != NULL) | ||
2278 | { | ||
2279 | FREE(pFIGURE_FEATURE(pobj)->name); | ||
2280 | pFIGURE_FEATURE(pobj)->name = NULL; | ||
2281 | } | ||
2282 | |||
2283 | return sciInitName(pobj, newName); | ||
2262 | } | 2284 | } |
2263 | 2285 | ||
2264 | int sciInitNum( sciPointObj * pobj, int value ) | 2286 | int sciInitNum( sciPointObj * pobj, int value ) |
diff --git a/scilab/modules/graphics/src/c/getHandleProperty/set_figure_name_property.c b/scilab/modules/graphics/src/c/getHandleProperty/set_figure_name_property.c index cf553e7..c313f97 100644 --- a/scilab/modules/graphics/src/c/getHandleProperty/set_figure_name_property.c +++ b/scilab/modules/graphics/src/c/getHandleProperty/set_figure_name_property.c | |||
@@ -37,7 +37,7 @@ int set_figure_name_property( sciPointObj * pobj, size_t stackPointer, int value | |||
37 | } | 37 | } |
38 | /* disable protection since this function will call Java */ | 38 | /* disable protection since this function will call Java */ |
39 | disableFigureSynchronization(pobj); | 39 | disableFigureSynchronization(pobj); |
40 | status = sciSetName( pobj, getStringFromStack( stackPointer ), nbCol * nbRow ) ; | 40 | status = sciSetName( pobj, getStringFromStack( stackPointer )) ; |
41 | enableFigureSynchronization(pobj); | 41 | enableFigureSynchronization(pobj); |
42 | 42 | ||
43 | return status; | 43 | return status; |
diff --git a/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.cpp b/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.cpp index d00d1ae..11c78ed 100644 --- a/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.cpp +++ b/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.cpp | |||
@@ -153,9 +153,9 @@ void DrawableFigureJavaMapper::setWindowSize(int width, int height) | |||
153 | m_pJavaObject->setWindowSize(width, height); | 153 | m_pJavaObject->setWindowSize(width, height); |
154 | } | 154 | } |
155 | /*---------------------------------------------------------------------------------*/ | 155 | /*---------------------------------------------------------------------------------*/ |
156 | void DrawableFigureJavaMapper::setInfoMessage(char * infoMessage) | 156 | void DrawableFigureJavaMapper::setInfoMessage(const char * infoMessage) |
157 | { | 157 | { |
158 | m_pJavaObject->setInfoMessage(infoMessage); | 158 | m_pJavaObject->setInfoMessage((char *) infoMessage); |
159 | } | 159 | } |
160 | /*---------------------------------------------------------------------------------*/ | 160 | /*---------------------------------------------------------------------------------*/ |
161 | void DrawableFigureJavaMapper::setAutoResizeMode(bool onOrOff) | 161 | void DrawableFigureJavaMapper::setAutoResizeMode(bool onOrOff) |
@@ -210,9 +210,9 @@ void DrawableFigureJavaMapper::rubberBox(bool isClick, bool isZoom, const int in | |||
210 | 210 | ||
211 | } | 211 | } |
212 | /*---------------------------------------------------------------------------------*/ | 212 | /*---------------------------------------------------------------------------------*/ |
213 | void DrawableFigureJavaMapper::setTitle(char * title) | 213 | void DrawableFigureJavaMapper::setTitle(const char * title) |
214 | { | 214 | { |
215 | m_pJavaObject->setTitle(title); | 215 | m_pJavaObject->setTitle((char *) title); |
216 | } | 216 | } |
217 | /*---------------------------------------------------------------------------------*/ | 217 | /*---------------------------------------------------------------------------------*/ |
218 | bool DrawableFigureJavaMapper::getRotationDisplacement(int displacement[2]) | 218 | bool DrawableFigureJavaMapper::getRotationDisplacement(int displacement[2]) |
diff --git a/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.hxx b/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.hxx index 602e64b..d1c5a3a 100644 --- a/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.hxx +++ b/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJavaMapper.hxx | |||
@@ -69,7 +69,7 @@ public: | |||
69 | virtual int getWindowHeight(void); | 69 | virtual int getWindowHeight(void); |
70 | virtual void setWindowSize(int width, int height); | 70 | virtual void setWindowSize(int width, int height); |
71 | 71 | ||
72 | virtual void setInfoMessage(char * infoMessage); | 72 | virtual void setInfoMessage(const char * infoMessage); |
73 | 73 | ||
74 | virtual void setAutoResizeMode(bool onOrOff); | 74 | virtual void setAutoResizeMode(bool onOrOff); |
75 | virtual bool getAutoResizeMode(void); | 75 | virtual bool getAutoResizeMode(void); |
@@ -81,7 +81,7 @@ public: | |||
81 | 81 | ||
82 | virtual void rubberBox(bool isClick, bool isZoom, const int initialRect[4], int endRect[4], int * usedButton); | 82 | virtual void rubberBox(bool isClick, bool isZoom, const int initialRect[4], int endRect[4], int * usedButton); |
83 | 83 | ||
84 | virtual void setTitle(char * title); | 84 | virtual void setTitle(const char * title); |
85 | 85 | ||
86 | virtual bool getRotationDisplacement(int displacement[2]); | 86 | virtual bool getRotationDisplacement(int displacement[2]); |
87 | virtual void stopRotationRecording(void); | 87 | virtual void stopRotationRecording(void); |
diff --git a/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJoGL.cpp b/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJoGL.cpp index 67f8102..ab3bac7 100644 --- a/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJoGL.cpp +++ b/scilab/modules/renderer/src/cpp/figureDrawing/DrawableFigureJoGL.cpp | |||
@@ -127,11 +127,7 @@ void DrawableFigureJoGL::setWindowSize( const int size[2] ) | |||
127 | /*---------------------------------------------------------------------------------*/ | 127 | /*---------------------------------------------------------------------------------*/ |
128 | void DrawableFigureJoGL::setInfoMessage( const char * message ) | 128 | void DrawableFigureJoGL::setInfoMessage( const char * message ) |
129 | { | 129 | { |
130 | // we need to create a not const char | 130 | getFigureJavaMapper()->setInfoMessage(message); |
131 | char * infoMessage = new char[strlen(message)+1]; | ||
132 | strcpy(infoMessage, message); | ||
133 | getFigureJavaMapper()->setInfoMessage(infoMessage); | ||
134 | delete[] infoMessage; | ||
135 | } | 131 | } |
136 | /*---------------------------------------------------------------------------------*/ | 132 | /*---------------------------------------------------------------------------------*/ |
137 | void DrawableFigureJoGL::setAutoResizeMode(bool onOrOff) | 133 | void DrawableFigureJoGL::setAutoResizeMode(bool onOrOff) |
@@ -181,11 +177,7 @@ void DrawableFigureJoGL::destroy( void ) | |||
181 | /*---------------------------------------------------------------------------------*/ | 177 | /*---------------------------------------------------------------------------------*/ |
182 | void DrawableFigureJoGL::setTitle( const char * title ) | 178 | void DrawableFigureJoGL::setTitle( const char * title ) |
183 | { | 179 | { |
184 | // we need to create a not const char | 180 | getFigureJavaMapper()->setTitle(title); |
185 | char * constTitle = new char[strlen(title)+1]; | ||
186 | strcpy(constTitle, title); | ||
187 | getFigureJavaMapper()->setTitle(constTitle); | ||
188 | delete[] constTitle; | ||
189 | } | 181 | } |
190 | /*---------------------------------------------------------------------------------*/ | 182 | /*---------------------------------------------------------------------------------*/ |
191 | bool DrawableFigureJoGL::getRotationDisplacement(int displacement[2]) | 183 | bool DrawableFigureJoGL::getRotationDisplacement(int displacement[2]) |