From 31e939c9f4b29fb2b2e63eb096450cf3da35d67f Mon Sep 17 00:00:00 2001 From: Mert Tümer Date: Mon, 5 Mar 2018 02:39:36 +0300 Subject: tdf#96796 - Added clipboard actions for the Android Viewer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2779ef9a9f68dcf08c3072ffe83b9f2450b7257e Signed-off-by: Mert Tümer Reviewed-on: https://gerrit.libreoffice.org/50757 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- desktop/source/lib/lokandroid.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'desktop/source') diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx index b85619d3dad8..43286a93aea0 100644 --- a/desktop/source/lib/lokandroid.cxx +++ b/desktop/source/lib/lokandroid.cxx @@ -370,6 +370,23 @@ extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Document_getT return pEnv->NewStringUTF(pSelection); } +extern "C" SAL_JNI_EXPORT jboolean JNICALL Java_org_libreoffice_kit_Document_paste + (JNIEnv* pEnv, jobject aObject, jstring mimeType, jstring data) +{ + LibreOfficeKitDocument* pDocument = getHandle(pEnv, aObject); + + const char* pMimeType = pEnv->GetStringUTFChars(mimeType, NULL); + const char* pData = pEnv->GetStringUTFChars(data, NULL); + const size_t nSize = pEnv->GetStringLength(data); + + LibreOfficeKitDocumentClass* pcls = pDocument->pClass; + bool result = pcls->paste(pDocument, pMimeType, pData, nSize); + pEnv->ReleaseStringUTFChars(mimeType, pMimeType); + pEnv->ReleaseStringUTFChars(pData, data); + + return result; +} + extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setGraphicSelection (JNIEnv* pEnv, jobject aObject, jint type, jint x, jint y) { -- cgit