[Libreoffice-commits] online.git: loolwsd/bundled loolwsd/LOKitClient.cpp
Miklos Vajna
vmiklos at collabora.co.uk
Fri Aug 19 14:55:28 UTC 2016
loolwsd/LOKitClient.cpp | 1
loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 25 +++++++++++
loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h | 19 ++++----
3 files changed, 36 insertions(+), 9 deletions(-)
New commits:
commit e0cd11848a0af7b5d87095a93d7139dc915895a3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Aug 19 16:52:16 2016 +0200
Update bundled headers
diff --git a/loolwsd/LOKitClient.cpp b/loolwsd/LOKitClient.cpp
index 330d521..4104e3d 100644
--- a/loolwsd/LOKitClient.cpp
+++ b/loolwsd/LOKitClient.cpp
@@ -73,6 +73,7 @@ extern "C"
CASE(GRAPHIC_VIEW_SELECTION);
CASE(VIEW_CURSOR_VISIBLE);
CASE(VIEW_LOCK);
+ CASE(REDLINE_TABLE_SIZE_CHANGED);
#undef CASE
}
std::cout << " payload: " << pPayload << std::endl;
diff --git a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 651e9bc..0805e62 100644
--- a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -406,6 +406,31 @@ typedef enum
*/
LOK_CALLBACK_VIEW_LOCK,
+ /**
+ * The size of the change tracking table has changed.
+ *
+ * The payload example:
+ * {
+ * "redline": {
+ * "action": "Remove",
+ * "index": "1",
+ * "author": "Unknown Author",
+ * "type": "Delete",
+ * "comment": "",
+ * "description": "Delete 'abc'",
+ * "dateTime": "2016-08-18T12:14:00"
+ * }
+ * }
+ *
+ * The format is the same as an entry of
+ * lok::Document::getCommandValues('.uno:AcceptTrackedChanges'), extra
+ * fields:
+ *
+ * - 'action' is either 'Add' or 'Remove', depending on if this is an
+ * insertion into the table or a removal.
+ */
+ LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED,
+
}
LibreOfficeKitCallbackType;
diff --git a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
index bdda642..bbef7d5 100644
--- a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -42,7 +42,7 @@ extern "C"
#endif
#define SEPARATOR '/'
- void *lok_loadlib(const char *pFN)
+ inline void *lok_loadlib(const char *pFN)
{
return dlopen(pFN, RTLD_LAZY
#if defined LOK_LOADLIB_GLOBAL
@@ -51,22 +51,22 @@ extern "C"
);
}
- char *lok_dlerror(void)
+ inline char *lok_dlerror(void)
{
return dlerror();
}
- void *lok_dlsym(void *Hnd, const char *pName)
+ inline void *lok_dlsym(void *Hnd, const char *pName)
{
return dlsym(Hnd, pName);
}
- int lok_dlclose(void *Hnd)
+ inline int lok_dlclose(void *Hnd)
{
return dlclose(Hnd);
}
- void extendUnoPath(const char *pPath)
+ inline void extendUnoPath(const char *pPath)
{
(void)pPath;
}
@@ -161,19 +161,20 @@ static void *lok_dlopen( const char *install_path, char ** _imp_lib )
// allocate large enough buffer
partial_length = strlen(install_path);
- imp_lib = (char *) malloc(partial_length + sizeof(TARGET_LIB) + sizeof(TARGET_MERGED_LIB) + 2);
+ size_t imp_lib_size = partial_length + sizeof(TARGET_LIB) + sizeof(TARGET_MERGED_LIB) + 2;
+ imp_lib = (char *) malloc(imp_lib_size);
if (!imp_lib)
{
fprintf( stderr, "failed to open library : not enough memory\n");
return NULL;
}
- strcpy(imp_lib, install_path);
+ strncpy(imp_lib, install_path, imp_lib_size);
extendUnoPath(install_path);
imp_lib[partial_length++] = SEPARATOR;
- strcpy(imp_lib + partial_length, TARGET_LIB);
+ strncpy(imp_lib + partial_length, TARGET_LIB, imp_lib_size - partial_length);
dlhandle = lok_loadlib(imp_lib);
if (!dlhandle)
@@ -191,7 +192,7 @@ static void *lok_dlopen( const char *install_path, char ** _imp_lib )
return NULL;
}
- strcpy(imp_lib + partial_length, TARGET_MERGED_LIB);
+ strncpy(imp_lib + partial_length, TARGET_MERGED_LIB, imp_lib_size - partial_length);
dlhandle = lok_loadlib(imp_lib);
if (!dlhandle)
More information about the Libreoffice-commits
mailing list