[Libreoffice-commits] online.git: 6 commits - bundled/include

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 29 12:43:42 UTC 2018


 bundled/include/LibreOfficeKit/LibreOfficeKit.h      |   10 ++++
 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx    |   19 +++++++
 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |    3 -
 bundled/include/LibreOfficeKit/LibreOfficeKitInit.h  |   46 ++++++++++++++++---
 4 files changed, 70 insertions(+), 8 deletions(-)

New commits:
commit c6d2c9c26a0cb28e68ec53a2807ba27acf73be95
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Oct 29 14:23:03 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Oct 29 14:23:16 2018 +0200

    Add a newline to make the file match the one in core.git
    
    Change-Id: Icb4b285a1d1510af550f1a3d98276546a4dc6aad

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 1a9889ba9..c3ccc6aa0 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -574,6 +574,7 @@ typedef enum
      * - "close" - window is closed
      */
     LOK_CALLBACK_WINDOW = 36,
+
     /**
      * When for the current cell is defined a validity list we need to show
      * a drop down button in the form of a marker.
commit c730ce1d2c13a859847124b3f4165c53a7c6f459
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Oct 15 10:09:15 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Oct 29 14:23:16 2018 +0200

    lokit: add funct. to insert, sign and verify signature
    
    A lot of signing code paths trigger a GUI dialog (to select the
    certificate for example) which aren't acceptable when triggering
    through the LOKit. This code paths needed to be duplicated and
    reworked to not trigger any GUI action.
    
    Change-Id: I2f0d6038fb1bcd00adcdf86e432f9df8858cc21c
    Reviewed-on: https://gerrit.libreoffice.org/61780
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 0ae5c6ff1..24aa49621 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -321,6 +321,16 @@ struct _LibreOfficeKitDocumentClass
                                   const int nTileHeight);
 #endif // IOS
 
+// CERTIFICATE AND SIGNING
+
+    /// @see lok::Document::insertCertificate().
+    bool (*insertCertificate) (LibreOfficeKitDocument* pThis,
+                                const unsigned char* pCertificateBinary,
+                                const int pCertificateBinarySize);
+
+    /// @see lok::Document::getSignatureState().
+    int (*getSignatureState) (LibreOfficeKitDocument* pThis);
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 3568c861f..d6e4bee6f 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -578,6 +578,25 @@ public:
     }
 #endif // IOS
 
+    /**
+     *  Insert certificate (in binary form) to the certificate store.
+     */
+    bool insertCertificate(const unsigned char* pCertificateBinary,
+                           const int pCertificateBinarySize)
+    {
+        return mpDoc->pClass->insertCertificate(mpDoc, pCertificateBinary, pCertificateBinarySize);
+    }
+
+    /**
+     *  Verify signature of the document.
+     *
+     *  Check possible values in include/sfx2/signaturestate.hxx
+     */
+    int getSignatureState()
+    {
+        return mpDoc->pClass->getSignatureState(mpDoc);
+    }
+
 #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY
 };
 
commit 4ea29914eb7d3f6f284b76c053e3aad4c3d8be3e
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Jul 19 11:51:14 2018 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Oct 29 14:23:16 2018 +0200

    Avoid gcc: "specified bound depends on the length of the source argument"
    
    Just use memcpy().
    
    Change-Id: Icb705acb6c12baf28684c763a77da7abc514ea6d
    Reviewed-on: https://gerrit.libreoffice.org/57714
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
index 187b224d6..ae779f468 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -200,7 +200,7 @@ static void *lok_dlopen( const char *install_path, char ** _imp_lib )
         return NULL;
     }
 
-    strncpy(imp_lib, install_path, imp_lib_size);
+    memcpy(imp_lib, install_path, partial_length);
 
     extendUnoPath(install_path);
 
commit 3b2bc20502de30995873e5fe86839e0395499b7e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 26 12:22:16 2018 +0100
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Oct 29 14:23:16 2018 +0200

    Related: rhbz#1602589 add comments to coverity annotations
    
    Change-Id: I88c941832a0d682ea4b6028c28edd48cf5df38f7
    Reviewed-on: https://gerrit.libreoffice.org/58093
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
index e7731ea41..187b224d6 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -287,7 +287,7 @@ static LibreOfficeKit *lok_init_2( const char *install_path,  const char *user_p
         }
         free( imp_lib );
         // dlhandle is "leaked"
-        // coverity[leaked_storage]
+        // coverity[leaked_storage] - on purpose
         return pSym( install_path );
     }
 
@@ -302,7 +302,7 @@ static LibreOfficeKit *lok_init_2( const char *install_path,  const char *user_p
 
     free( imp_lib );
     // dlhandle is "leaked"
-    // coverity[leaked_storage]
+    // coverity[leaked_storage] - on purpose
     return pSym2( install_path, user_profile_url );
 #else
     return libreofficekit_hook_2( install_path, user_profile_url );
@@ -339,7 +339,7 @@ int lok_preinit( const char *install_path,  const char *user_profile_url )
     free( imp_lib );
 
     // dlhandle is "leaked"
-    // coverity[leaked_storage]
+    // coverity[leaked_storage] - on purpose
     return pSym( install_path, user_profile_url );
 }
 #endif
commit aac7ec8bea64be0ac3054468defae8b4adfc3621
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Jul 6 17:41:58 2018 +0100
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Oct 29 14:23:16 2018 +0200

    lok: export preinit helper, and share code variously.
    
    Change-Id: I09f2992c4ba45ce91190a9f61dd0fedd0eb8a581
    Reviewed-on: https://gerrit.libreoffice.org/57145
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
index 3251ade7d..e7731ea41 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -17,6 +17,12 @@ extern "C"
 {
 #endif
 
+#if defined __GNUC__ || defined __clang__
+#  define LOK_TOLERATE_UNUSED __attribute__((used))
+#else
+#  define LOK_TOLERATE_UNUSED
+#endif
+
 #if defined(__linux__) || defined (__FreeBSD_kernel__) || defined(_AIX) ||\
     defined(_WIN32) || defined(__APPLE__) || defined (__NetBSD__) ||\
     defined (__sun) || defined(__OpenBSD__)
@@ -303,15 +309,41 @@ static LibreOfficeKit *lok_init_2( const char *install_path,  const char *user_p
 #endif
 }
 
-static
-#if defined __GNUC__ || defined __clang__
-__attribute__((used))
-#endif
+static LOK_TOLERATE_UNUSED
 LibreOfficeKit *lok_init( const char *install_path )
 {
     return lok_init_2( install_path, NULL );
 }
 
+#if !defined(IOS)
+static LOK_TOLERATE_UNUSED
+int lok_preinit( const char *install_path,  const char *user_profile_url )
+{
+    void *dlhandle;
+    char *imp_lib;
+    LokHookPreInit *pSym;
+
+    dlhandle = lok_dlopen(install_path, &imp_lib);
+    if (!dlhandle)
+        return -1;
+
+    pSym = (LokHookPreInit *) lok_dlsym(dlhandle, "lok_preinit");
+    if (!pSym)
+    {
+        fprintf( stderr, "failed to find pre-init hook in library '%s'\n", imp_lib );
+        lok_dlclose( dlhandle );
+        free( imp_lib );
+        return -1;
+    }
+
+    free( imp_lib );
+
+    // dlhandle is "leaked"
+    // coverity[leaked_storage]
+    return pSym( install_path, user_profile_url );
+}
+#endif
+
 #undef SEPARATOR // It is used at least in enum class MenuItemType
 
 #endif // defined(__linux__) || defined (__FreeBSD_kernel__) || defined(_AIX) || defined(_WIN32) || defined(__APPLE__)
commit c5b67a8985c8316cb171a1146090eb4fc8273208
Author:     Andrea Gelmini <andrea.gelmini at gelma.net>
AuthorDate: Wed Aug 15 14:18:38 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Oct 29 14:23:16 2018 +0200

    Fix typo: s/an other/another/g
    
    Change-Id: Ifd83affcb16209f4134c725640fbd95077c8ab0f
    Reviewed-on: https://gerrit.libreoffice.org/59099
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index e338c4828..1a9889ba9 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -349,7 +349,7 @@ typedef enum
 
     /**
      * The size and/or the position of the view cursor changed. A view cursor
-     * is a cursor of an other view, the current view can't change it.
+     * is a cursor of another view, the current view can't change it.
      *
      * The payload format:
      *


More information about the Libreoffice-commits mailing list