[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit

Jan Holesovsky kendy at collabora.com
Thu Sep 14 07:51:18 UTC 2017


 desktop/source/lib/init.cxx               |    8 ++++----
 desktop/source/lib/lokandroid.cxx         |    2 +-
 include/LibreOfficeKit/LibreOfficeKit.h   |   13 ++++++++-----
 include/LibreOfficeKit/LibreOfficeKit.hxx |    2 +-
 4 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 5bcc79e825d542c40c9ee0f48d1d72ea9aa53c54
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Sep 14 09:23:46 2017 +0200

    [API CHANGE] lok: Don't use 'bool' and 'uint64_t' in the stable API.
    
    This is a f70e0ec6b3c61a7c7caa469949b0ac8016c89854 follow-up.
    
    Change-Id: I4acf00a6da85ed14be4ed0ca20d541a9441736e7
    Reviewed-on: https://gerrit.libreoffice.org/42266
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ad88ab270252..6e8136d740a0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1098,12 +1098,12 @@ static void                    lo_registerCallback (LibreOfficeKit* pThis,
                                                     LibreOfficeKitCallback pCallback,
                                                     void* pData);
 static char* lo_getFilterTypes(LibreOfficeKit* pThis);
-static void lo_setOptionalFeatures(LibreOfficeKit* pThis, uint64_t features);
+static void                    lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long features);
 static void                    lo_setDocumentPassword(LibreOfficeKit* pThis,
                                                        const char* pURL,
                                                        const char* pPassword);
 static char*                   lo_getVersionInfo(LibreOfficeKit* pThis);
-static bool                    lo_runMacro      (LibreOfficeKit* pThis, const char* pURL);
+static int                     lo_runMacro      (LibreOfficeKit* pThis, const char* pURL);
 
 LibLibreOffice_Impl::LibLibreOffice_Impl()
     : m_pOfficeClass( gOfficeClass.lock() )
@@ -1262,7 +1262,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
     return nullptr;
 }
 
-static bool lo_runMacro( LibreOfficeKit* pThis, const char *pURL)
+static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL)
 {
     SolarMutexGuard aGuard;
 
@@ -3014,7 +3014,7 @@ static char* lo_getFilterTypes(LibreOfficeKit* pThis)
     return strdup(aStream.str().c_str());
 }
 
-static void lo_setOptionalFeatures(LibreOfficeKit* pThis, uint64_t const features)
+static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long const features)
 {
     SolarMutexGuard aGuard;
 
diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index 3055d38957da..b85619d3dad8 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -163,7 +163,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Office_setOption
 {
     LibreOfficeKit* pLibreOfficeKit = getHandle<LibreOfficeKit>(pEnv, aObject);
 
-    uint64_t pOptions = (uint64_t)options;
+    unsigned long long pOptions = (unsigned long long)options;
 
     pLibreOfficeKit->pClass->setOptionalFeatures(pLibreOfficeKit, pOptions);
 }
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 34b67ac092b1..0633f46f97e2 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -12,11 +12,14 @@
 
 #include <stddef.h>
 
-#ifndef _WIN32
 // the unstable API needs C99's bool
-# include <stdbool.h>
+// TODO remove the C99 types from the API before making stable
+#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
+# ifndef _WIN32
+#  include <stdbool.h>
+# endif
+# include <stdint.h>
 #endif
-#include <stdint.h>
 
 #include <LibreOfficeKit/LibreOfficeKitTypes.h>
 
@@ -73,7 +76,7 @@ struct _LibreOfficeKitClass
     /** @see lok::Office::setOptionalFeatures().
         @since LibreOffice 6.0
      */
-    void (*setOptionalFeatures)(LibreOfficeKit* pThis, uint64_t features);
+    void (*setOptionalFeatures)(LibreOfficeKit* pThis, unsigned long long features);
 
     /** @see lok::Office::setDocumentPassword().
         @since LibreOffice 6.0
@@ -90,7 +93,7 @@ struct _LibreOfficeKitClass
     /** @see lok::Office::runMacro().
         @since LibreOffice 6.0
      */
-    bool (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
+    int (*runMacro) (LibreOfficeKit *pThis, const char* pURL);
 };
 
 #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 18122a7e3b05..10e0f0f199d0 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -554,7 +554,7 @@ public:
      * @since LibreOffice 6.0
      * @see LibreOfficeKitOptionalFeatures
      */
-    void setOptionalFeatures(uint64_t features)
+    void setOptionalFeatures(unsigned long long features)
     {
         return mpThis->pClass->setOptionalFeatures(mpThis, features);
     }


More information about the Libreoffice-commits mailing list