Merge remote-tracking branch 'origin/master' into YaSp 61/16761/1
Vincent COUVERT [Thu, 2 Jul 2015 09:34:25 +0000 (11:34 +0200)]
Conflicts:
scilab/modules/graphics/src/c/getHandleProperty/get_mark_background_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_foreground_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_size_property.c

Change-Id: I04943f088b436f2a642a7164e361f92021e1d528

1  2 
scilab/modules/graphics/src/c/getHandleProperty/get_mark_background_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_foreground_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_size_property.c

@@@ -39,17 -39,23 +39,23 @@@ void* get_mark_background_property(void
      int numMarkBackgrounds = 0;
      int * piNumMarkBackgrounds = &numMarkBackgrounds;
  
 -    getGraphicObjectProperty(iObjUID, __GO_NUM_MARK_BACKGROUNDS__, jni_int, (void**)&piNumMarkBackgrounds);
 +      getGraphicObjectProperty(iObjUID, __GO_NUM_MARK_BACKGROUNDS__, jni_int, (void**)&piNumMarkBackgrounds);
  
+     if (piNumMarkBackgrounds == NULL)
+     {
+         Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_background");
 -        return -1;
++        return NULL;
+     }
 -    if (numMarkBackgrounds == 0)
 -    {
 -        getGraphicObjectProperty(iObjUID, __GO_MARK_BACKGROUND__, jni_int, &piMarkBackground);
 -        return sciReturnDouble(_pvCtx, iMarkBackground);
 -    }
 -    else
 -    {
 -        getGraphicObjectProperty(iObjUID, __GO_MARK_BACKGROUNDS__, jni_int_vector, &markBackgrounds);
 -        return sciReturnRowVectorFromInt(_pvCtx, markBackgrounds, numMarkBackgrounds);
 -    }
 +      if (numMarkBackgrounds == 0)
 +      {
 +              getGraphicObjectProperty(iObjUID, __GO_MARK_BACKGROUND__, jni_int, &piMarkBackground);
 +              return sciReturnDouble(iMarkBackground);
 +      }
 +      else
 +      {
 +              getGraphicObjectProperty(iObjUID, __GO_MARK_BACKGROUNDS__, jni_int_vector, &markBackgrounds);
 +              return sciReturnRowVectorFromInt(markBackgrounds, numMarkBackgrounds);
 +      }
  }
  /*------------------------------------------------------------------------*/
@@@ -41,17 -41,23 +41,23 @@@ void* get_mark_foreground_property(void
      int numMarkForegrounds = 0;
      int * piNumMarkForegrounds = &numMarkForegrounds;
  
 -    getGraphicObjectProperty(iObjUID, __GO_NUM_MARK_FOREGROUNDS__, jni_int, (void**)&piNumMarkForegrounds);
 -
 -    if (piNumMarkForegrounds == NULL)
 -    {
 -        Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_foreground");
 -        return -1;
 -    }
 -
 -    if (numMarkForegrounds == 0)
 -    {
 -        getGraphicObjectProperty(iObjUID, __GO_MARK_FOREGROUND__, jni_int, &piMarkForeground);
 -        return sciReturnDouble(_pvCtx, iMarkForeground);
 -    }
 -    else
 -    {
 -        getGraphicObjectProperty(iObjUID, __GO_MARK_FOREGROUNDS__, jni_int_vector, &markForegrounds);
 -        return sciReturnRowVectorFromInt(_pvCtx, markForegrounds, numMarkForegrounds);
 -    }
 +      getGraphicObjectProperty(iObjUID, __GO_NUM_MARK_FOREGROUNDS__, jni_int, (void**)&piNumMarkForegrounds);
 +
++      if (piNumMarkForegrounds == NULL)
++      {
++              Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_foreground");
++              return NULL;
++      }
++
 +      if (numMarkForegrounds == 0)
 +      {
 +              getGraphicObjectProperty(iObjUID, __GO_MARK_FOREGROUND__, jni_int, &piMarkForeground);
 +              return sciReturnDouble(iMarkForeground);
 +      }
 +      else
 +      {
 +              getGraphicObjectProperty(iObjUID, __GO_MARK_FOREGROUNDS__, jni_int_vector, &markForegrounds);
 +              return sciReturnRowVectorFromInt(markForegrounds, numMarkForegrounds);
 +      }
  }
  /*------------------------------------------------------------------------*/
@@@ -39,17 -39,23 +39,23 @@@ void* get_mark_size_property(void* _pvC
      int numMarkSizes = 0;
      int * piNumMarkSizes = &numMarkSizes;
  
 -    getGraphicObjectProperty(iObjUID, __GO_NUM_MARK_SIZES__, jni_int, &piNumMarkSizes);
 +      getGraphicObjectProperty(iObjUID, __GO_NUM_MARK_SIZES__, jni_int, &piNumMarkSizes);
  
+     if (piNumMarkSizes == NULL)
+     {
+         Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_size");
 -        return -1;
++        return NULL;
+     }
 -    if (numMarkSizes == 0)
 -    {
 -        getGraphicObjectProperty(iObjUID, __GO_MARK_SIZE__, jni_int, &piMarkSize);
 -        return sciReturnDouble(_pvCtx, iMarkSize);
 -    }
 -    else
 -    {
 -        getGraphicObjectProperty(iObjUID, __GO_MARK_SIZES__, jni_int_vector, &markSizes);
 -        return sciReturnRowVectorFromInt(_pvCtx, markSizes, numMarkSizes);
 -    }
 +      if (numMarkSizes == 0)
 +      {
 +              getGraphicObjectProperty(iObjUID, __GO_MARK_SIZE__, jni_int, &piMarkSize);
 +              return sciReturnDouble(iMarkSize);
 +      }
 +      else
 +      {
 +              getGraphicObjectProperty(iObjUID, __GO_MARK_SIZES__, jni_int_vector, &markSizes);
 +              return sciReturnRowVectorFromInt(markSizes, numMarkSizes);
 +      }
  }
  /*------------------------------------------------------------------------*/