diff options
author | Mert Tümer <merttumer7@gmail.com> | 2018-03-05 02:39:36 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-03-14 00:35:21 +0100 |
commit | 31e939c9f4b29fb2b2e63eb096450cf3da35d67f (patch) | |
tree | 0519dd1c33a1aba3fa027221868011ece9b34648 /desktop/source | |
parent | 6d2f6f2f01a4fbf244ba16c355d2f43a2ddf671e (diff) |
tdf#96796 - Added clipboard actions for the Android Viewer
Change-Id: I2779ef9a9f68dcf08c3072ffe83b9f2450b7257e
Signed-off-by: Mert Tümer <merttumer7@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/50757
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/lokandroid.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
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<LibreOfficeKitDocument>(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) { |