~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/graphics/src/c/getHandleProperty/set_x_ticks_property.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "DrawObjects.h"
33
33
#include "freeArrayOfString.h"
34
34
#include "loadTextRenderingAPI.h"
 
35
#include "sci_types.h"
35
36
 
36
37
#include "setGraphicObjectProperty.h"
37
38
#include "graphicObjectProperties.h"
48
49
    double* userGrads = NULL;
49
50
    char** userLabels = NULL;
50
51
 
51
 
    if ( !isParameterTlist( valueType ) )
 
52
    if ( !(valueType == sci_tlist ))
52
53
    {
53
54
        Scierror(999, _("Wrong type for '%s' property: Typed list expected.\n"), "x_ticks");
54
55
        return SET_PROPERTY_ERROR ;
66
67
 
67
68
    if ( userGrads == NULL && nbTicsRow == -1 )
68
69
    {
69
 
        Scierror(999, _("%s: No more memory.\n"),"set_x_ticks_property");
 
70
        Scierror(999, _("%s: No more memory.\n"), "set_x_ticks_property");
70
71
        return SET_PROPERTY_ERROR ;
71
72
    }
72
73
 
75
76
 
76
77
    setGraphicObjectProperty(pobjUID, __GO_X_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
77
78
 
78
 
    status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow*nbTicsCol);
 
79
    status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow * nbTicsCol);
79
80
 
80
81
    if (status == FALSE)
81
82
    {
82
 
        Scierror(999, _("'%s' property does not exist for this handle.\n"),"x_ticks");
 
83
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "x_ticks");
83
84
        FREE(userGrads);
84
85
        return SET_PROPERTY_ERROR;
85
86
    }
89
90
    // We need to check the size to not be 0 because an empty matrix is a matrix of double
90
91
    // and 'getCurrentStringMatrixFromList' expect a matrix of string (see bug 5148).
91
92
    // P.Lando
92
 
    if( nbTicsCol * nbTicsRow )
 
93
    if ( nbTicsCol * nbTicsRow )
93
94
    {
94
95
        userLabels = getCurrentStringMatrixFromList( tlist, &nbTicsRow, &nbTicsCol );
95
96
        /* Check if we should load LaTex / MathML Java libraries */
96
97
        loadTextRenderingAPI(userLabels, nbTicsCol, nbTicsRow);
97
98
 
98
 
        setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow*nbTicsCol);
 
99
        setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow * nbTicsCol);
99
100
    }
100
101
    else
101
102
    {