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

« back to all changes in this revision

Viewing changes to modules/xcos/src/jni/Palette.cpp

  • 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:
159
159
}
160
160
// Method(s)
161
161
 
162
 
void Palette::loadPal (JavaVM * jvm_, char const* path, char const* const* category, int categorySize){
 
162
void Palette::loadPal (JavaVM * jvm_, char const* name, char const* const* category, int categorySize){
163
163
 
164
164
JNIEnv * curEnv = NULL;
165
165
jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
170
170
throw GiwsException::JniMethodNotFoundException(curEnv, "loadPal");
171
171
}
172
172
 
173
 
jstring path_ = curEnv->NewStringUTF( path );
174
 
if (path != NULL && path_ == NULL)
 
173
jstring name_ = curEnv->NewStringUTF( name );
 
174
if (name != NULL && name_ == NULL)
175
175
{
176
176
throw GiwsException::JniBadAllocException(curEnv);
177
177
}
199
199
// avoid keeping reference on to many strings
200
200
curEnv->DeleteLocalRef(TempString);
201
201
}
202
 
                         curEnv->CallStaticVoidMethod(cls, voidloadPaljstringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID ,path_, category_);
 
202
                         curEnv->CallStaticVoidMethod(cls, voidloadPaljstringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID ,name_, category_);
203
203
                        curEnv->DeleteLocalRef(stringArrayClass);
204
 
curEnv->DeleteLocalRef(path_);
 
204
curEnv->DeleteLocalRef(name_);
205
205
curEnv->DeleteLocalRef(category_);
206
206
curEnv->DeleteLocalRef(cls);
207
207
if (curEnv->ExceptionCheck()) {
209
209
}
210
210
}
211
211
 
212
 
void Palette::loadPal (JavaVM * jvm_, char const* path){
 
212
void Palette::loadPal (JavaVM * jvm_, char const* name){
213
213
 
214
214
JNIEnv * curEnv = NULL;
215
215
jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
220
220
throw GiwsException::JniMethodNotFoundException(curEnv, "loadPal");
221
221
}
222
222
 
223
 
jstring path_ = curEnv->NewStringUTF( path );
224
 
if (path != NULL && path_ == NULL)
 
223
jstring name_ = curEnv->NewStringUTF( name );
 
224
if (name != NULL && name_ == NULL)
225
225
{
226
226
throw GiwsException::JniBadAllocException(curEnv);
227
227
}
228
228
 
229
229
 
230
 
                         curEnv->CallStaticVoidMethod(cls, voidloadPaljstringjava_lang_StringID ,path_);
231
 
                        curEnv->DeleteLocalRef(path_);
 
230
                         curEnv->CallStaticVoidMethod(cls, voidloadPaljstringjava_lang_StringID ,name_);
 
231
                        curEnv->DeleteLocalRef(name_);
232
232
curEnv->DeleteLocalRef(cls);
233
233
if (curEnv->ExceptionCheck()) {
234
234
throw GiwsException::JniCallMethodException(curEnv);