Commit e6700e822336854400f225f99df7e5f30f6c6504

Authored by Perry Werneck
1 parent b417442e

Corrigido retorno do método set_text_at

src/lib3270/paste.c
@@ -223,7 +223,7 @@ static int set_string(H3270 *hSession, const unsigned char *str) @@ -223,7 +223,7 @@ static int set_string(H3270 *hSession, const unsigned char *str)
223 223
224 LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, const unsigned char *str) 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 CHECK_SESSION_HANDLE(hSession); 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,11 +241,12 @@ LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, cons
241 hSession->cbk.suspend(hSession); 241 hSession->cbk.suspend(hSession);
242 242
243 hSession->cursor_addr = (row * hSession->cols) + col; 243 hSession->cursor_addr = (row * hSession->cols) + col;
244 - rc = set_string(hSession, str); 244 + rc += set_string(hSession, str);
245 245
246 hSession->cbk.resume(hSession); 246 hSession->cbk.resume(hSession);
247 } 247 }
248 248
  249 + trace("%s rc=%d",__FUNCTION__,rc);
249 return rc; 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,7 +261,10 @@ void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *
261 261
262 text = g_convert_with_fallback(utftext,-1,lib3270_get_display_charset(hSession),"UTF-8","?",NULL,NULL,NULL); 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 g_free(text); 269 g_free(text);
267 } 270 }
src/plugins/dbus3270/pw3270dbus.xml
@@ -66,6 +66,7 @@ @@ -66,6 +66,7 @@
66 <arg type="i" name="row" direction="in" /> 66 <arg type="i" name="row" direction="in" />
67 <arg type="i" name="col" direction="in" /> 67 <arg type="i" name="col" direction="in" />
68 <arg type="s" name="text" direction="in" /> 68 <arg type="s" name="text" direction="in" />
  69 + <arg type="i" name="result" direction="out" />
69 </method> 70 </method>
70 <method name="getTextAt"> 71 <method name="getTextAt">
71 <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> 72 <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>