Add routine for checking out-of-memory on get_surrounding_text
[platform/core/uifw/libscl-core.git] / src / sclconnection.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 6a7b6e2..0f09588
@@ -273,11 +273,13 @@ void CSCLConnection::get_surrounding_text(const sclchar *ic_uuid, sclint maxlen_
     }
 }
 
-void CSCLConnection::get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor)
+sclint CSCLConnection::get_surrounding_text(sclint maxlen_before, sclint maxlen_after, sclchar **text, int &cursor)
 {
+    sclint ret = -1;
     if (m_impl) {
-        m_impl->get_surrounding_text(maxlen_before, maxlen_after, text, cursor);
+        ret = m_impl->get_surrounding_text(maxlen_before, maxlen_after, text, cursor);
     }
+    return ret;
 }
 
 void CSCLConnection::delete_surrounding_text(sclint offset, sclint len) const