Commit e6700e822336854400f225f99df7e5f30f6c6504
1 parent
b417442e
Exists in
master
and in
5 other branches
Corrigido retorno do método set_text_at
Showing
3 changed files
with
8 additions
and
3 deletions
Show diff stats
src/lib3270/paste.c
| ... | ... | @@ -223,7 +223,7 @@ static int set_string(H3270 *hSession, const unsigned char *str) |
| 223 | 223 | |
| 224 | 224 | LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, const unsigned char *str) |
| 225 | 225 | { |
| 226 | - int rc = -1; | |
| 226 | + int rc = 0; | |
| 227 | 227 | |
| 228 | 228 | CHECK_SESSION_HANDLE(hSession); |
| 229 | 229 | |
| ... | ... | @@ -241,11 +241,12 @@ LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, cons |
| 241 | 241 | hSession->cbk.suspend(hSession); |
| 242 | 242 | |
| 243 | 243 | hSession->cursor_addr = (row * hSession->cols) + col; |
| 244 | - rc = set_string(hSession, str); | |
| 244 | + rc += set_string(hSession, str); | |
| 245 | 245 | |
| 246 | 246 | hSession->cbk.resume(hSession); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | + trace("%s rc=%d",__FUNCTION__,rc); | |
| 249 | 250 | return rc; |
| 250 | 251 | } |
| 251 | 252 | ... | ... |
src/plugins/dbus3270/gobject.c
| ... | ... | @@ -261,7 +261,10 @@ void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar * |
| 261 | 261 | |
| 262 | 262 | text = g_convert_with_fallback(utftext,-1,lib3270_get_display_charset(hSession),"UTF-8","?",NULL,NULL,NULL); |
| 263 | 263 | |
| 264 | - dbus_g_method_return(context,lib3270_set_string_at(hSession,row,col,(const unsigned char *) text)); | |
| 264 | + int sz = lib3270_set_string_at(hSession,row,col,(const unsigned char *) text); | |
| 265 | + | |
| 266 | + trace("%s returns %d",__FUNCTION__,sz); | |
| 267 | + dbus_g_method_return(context,sz); | |
| 265 | 268 | |
| 266 | 269 | g_free(text); |
| 267 | 270 | } | ... | ... |
src/plugins/dbus3270/pw3270dbus.xml
| ... | ... | @@ -66,6 +66,7 @@ |
| 66 | 66 | <arg type="i" name="row" direction="in" /> |
| 67 | 67 | <arg type="i" name="col" direction="in" /> |
| 68 | 68 | <arg type="s" name="text" direction="in" /> |
| 69 | + <arg type="i" name="result" direction="out" /> | |
| 69 | 70 | </method> |
| 70 | 71 | <method name="getTextAt"> |
| 71 | 72 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | ... | ... |