summaryrefslogtreecommitdiffstats
path: root/scilab/modules/graphics
diff options
context:
space:
mode:
authorPierre LANDO <pierre.lando@scilab.org>2010-03-29 17:13:35 +0200
committerPierre LANDO <pierre.lando@scilab.org>2010-03-29 17:13:35 +0200
commite0bef701fe37b29a00f3abce7db00d2ee85c9215 (patch)
tree1c1ed63d26346643ce1091fa6d8f02880cc697db /scilab/modules/graphics
parent32b4d425d93eb5aff634608359abff23d8100fe5 (diff)
downloadscilab-e0bef701fe37b29a00f3abce7db00d2ee85c9215.zip
scilab-e0bef701fe37b29a00f3abce7db00d2ee85c9215.tar.gz
fix bug 6720 : caption function doesn't handled properly polylines handles.
Diffstat (limited to 'scilab/modules/graphics')
-rw-r--r--scilab/modules/graphics/sci_gateway/c/sci_Legend.c17
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref24
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst31
3 files changed, 66 insertions, 6 deletions
diff --git a/scilab/modules/graphics/sci_gateway/c/sci_Legend.c b/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
index 99b3947..9b5ae22 100644
--- a/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
+++ b/scilab/modules/graphics/sci_gateway/c/sci_Legend.c
@@ -92,17 +92,22 @@ int sci_Legend( char * fname, unsigned long fname_len )
92 Scierror(999,_("%s: No more memory.\n"),fname); 92 Scierror(999,_("%s: No more memory.\n"),fname);
93 return 0; 93 return 0;
94 } 94 }
95
96 startGraphicDataWriting();
97 pFigure = sciGetCurrentFigure();
98 psubwin = sciGetCurrentSubWin();
99 endGraphicDataWriting();
100
101 95
102 for (i = 0; i < n;i++) 96 for (i = 0; i < n;i++)
103 { 97 {
104 handelsvalue = (unsigned long) (hstk(l1))[n-1-i]; 98 handelsvalue = (unsigned long) (hstk(l1))[n-1-i];
105 99
100 /**
101 We get the current pSubwin & pFigure from the first handel's parents.
102 **/
103 if (i==0) {
104 psubwin = sciGetParentSubwin( sciGetPointerFromHandle(handelsvalue) );
105 pFigure = sciGetParentFigure( sciGetPointerFromHandle(handelsvalue) );
106 }
107
108 /**
109 We check that the pSubwin is the same for all given handle.
110 **/
106 if (psubwin!=sciGetParentSubwin( sciGetPointerFromHandle(handelsvalue) )) 111 if (psubwin!=sciGetParentSubwin( sciGetPointerFromHandle(handelsvalue) ))
107 { 112 {
108 Scierror(999,_("%s: Objects must have the same axes.\n"),fname); 113 Scierror(999,_("%s: Objects must have the same axes.\n"),fname);
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref
new file mode 100644
index 0000000..4c31653
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.dia.ref
@@ -0,0 +1,24 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2006-2010 - DIGITEO - pierre.lando@scilab.org
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- TEST WITH GRAPHIC -->
8// <-- Non-regression test for bug 6720 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=6720
12//
13// <-- Short Description -->
14// For 'caption' function, scilab checked that
15// "all given handles was children of the current axes"
16// instead of checking that
17// "all given handles have the same parent axes".
18// The script below should now work.
19subplot(211);plot(1:10);h1=gce();
20subplot(212);plot(1:10);h2=gce();
21j1=h1.children;
22j2=h2.children;
23captions(j2,'two');
24captions(j1,'one');
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst
new file mode 100644
index 0000000..f3d4ba1
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_6720.tst
@@ -0,0 +1,31 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2006-2010 - DIGITEO - pierre.lando@scilab.org
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- TEST WITH GRAPHIC -->
9
10// <-- Non-regression test for bug 6720 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/show_bug.cgi?id=6720
14//
15// <-- Short Description -->
16// For 'caption' function, scilab checked that
17// "all given handles was children of the current axes"
18// instead of checking that
19// "all given handles have the same parent axes".
20
21// The script below should now work.
22
23subplot(211);plot(1:10);h1=gce();
24subplot(212);plot(1:10);h2=gce();
25
26j1=h1.children;
27j2=h2.children;
28
29captions(j2,'two');
30captions(j1,'one');
31