< prev index next >

src/java.desktop/aix/native/libawt_xawt/awt/awt_InputMethod.c

Print this page




1131                 THROW_OUT_OF_MEMORY_ERROR();
1132                 goto finally;
1133             }
1134 
1135             if (sizeof(XIMFeedback) == sizeof(jint)) {
1136                 /*
1137                  * Optimization to avoid copying the array
1138                  */
1139                 (*env)->SetIntArrayRegion(env, style, 0,
1140                                           text->length, (jint *)text->feedback);
1141             } else {
1142                 tmpstyle  = (jint *)malloc(sizeof(jint)*(text->length));
1143                 if (tmpstyle == (jint *) NULL) {
1144                     THROW_OUT_OF_MEMORY_ERROR();
1145                     goto finally;
1146                 }
1147                 for (cnt = 0; cnt < (int)text->length; cnt++)
1148                         tmpstyle[cnt] = text->feedback[cnt];
1149                 (*env)->SetIntArrayRegion(env, style, 0,
1150                                           text->length, (jint *)tmpstyle);

1151             }
1152         }
1153     }
1154     JNU_CallMethodByName(env, NULL, pX11IMData->x11inputmethod,
1155                          "dispatchComposedText",
1156                          "(Ljava/lang/String;[IIIIJ)V",
1157                          javastr,
1158                          style,
1159                          (jint)pre_draw->chg_first,
1160                          (jint)pre_draw->chg_length,
1161                          (jint)pre_draw->caret,
1162                          awt_util_nowMillisUTC());
1163 
1164     if ((*env)->ExceptionOccurred(env)) {
1165         (*env)->ExceptionDescribe(env);
1166         (*env)->ExceptionClear(env);
1167     }
1168 
1169 finally:
1170     AWT_UNLOCK();




1131                 THROW_OUT_OF_MEMORY_ERROR();
1132                 goto finally;
1133             }
1134 
1135             if (sizeof(XIMFeedback) == sizeof(jint)) {
1136                 /*
1137                  * Optimization to avoid copying the array
1138                  */
1139                 (*env)->SetIntArrayRegion(env, style, 0,
1140                                           text->length, (jint *)text->feedback);
1141             } else {
1142                 tmpstyle  = (jint *)malloc(sizeof(jint)*(text->length));
1143                 if (tmpstyle == (jint *) NULL) {
1144                     THROW_OUT_OF_MEMORY_ERROR();
1145                     goto finally;
1146                 }
1147                 for (cnt = 0; cnt < (int)text->length; cnt++)
1148                         tmpstyle[cnt] = text->feedback[cnt];
1149                 (*env)->SetIntArrayRegion(env, style, 0,
1150                                           text->length, (jint *)tmpstyle);
1151                 free(tmpstyle);
1152             }
1153         }
1154     }
1155     JNU_CallMethodByName(env, NULL, pX11IMData->x11inputmethod,
1156                          "dispatchComposedText",
1157                          "(Ljava/lang/String;[IIIIJ)V",
1158                          javastr,
1159                          style,
1160                          (jint)pre_draw->chg_first,
1161                          (jint)pre_draw->chg_length,
1162                          (jint)pre_draw->caret,
1163                          awt_util_nowMillisUTC());
1164 
1165     if ((*env)->ExceptionOccurred(env)) {
1166         (*env)->ExceptionDescribe(env);
1167         (*env)->ExceptionClear(env);
1168     }
1169 
1170 finally:
1171     AWT_UNLOCK();


< prev index next >