[Libreoffice-commits] online.git: 2 commits - bundled/include loleaflet/dist loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Thu Nov 9 09:35:09 UTC 2017
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 10 ++++-
bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 38 ++++++++++++++------
bundled/include/LibreOfficeKit/LibreOfficeKitInit.h | 13 +++---
loleaflet/dist/loleaflet.css | 2 +
loleaflet/src/control/Control.LokDialog.js | 8 ++++
5 files changed, 54 insertions(+), 17 deletions(-)
New commits:
commit fea82f5d48b73d238527dfd079d328223072ce81
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Nov 9 14:57:09 2017 +0530
Update bundled headers
Change-Id: I3480b7465c19203699a68a148dde20dc7d36f47a
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index cc4752e0..14824821 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -268,7 +268,15 @@ struct _LibreOfficeKitDocumentClass
/// Paints dialog with given dialog id to the buffer
/// @see lok::Document::paintDialog().
- void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight);
+ void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId,
+ unsigned char* pBuffer,
+ const int x, const int y,
+ const int width, const int height);
+
+ /// Get info about dialog with given dialog id
+ /// @see lok::Document::getDialogInfo().
+ void (*getDialogInfo) (LibreOfficeKitDocument* pThis, const char* pDialogId,
+ char** pDialogTitle, int* pWidth, int* pHeight);
/// @see lok::Document::paintActiveFloatingWindow().
void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight);
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
index 9534bf3d..19e121fe 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -12,8 +12,8 @@
#include <cstddef>
-#include "LibreOfficeKit.h"
-#include "LibreOfficeKitInit.h"
+#include <LibreOfficeKit/LibreOfficeKit.h>
+#include <LibreOfficeKit/LibreOfficeKitInit.h>
/*
* The reasons this C++ code is not as pretty as it could be are:
@@ -162,19 +162,37 @@ public:
*
* @param pDialogId Unique dialog id to be painted
* @param pBuffer Buffer with enough memory allocated to render any dialog
- * @param pDialogTitle output parameter pointing to a dialog title
- * string. Should be freed by the caller.
- * @param nWidth output parameter returning the width of the rendered dialog.
- * @param nHeight output parameter returning the height of the rendered dialog
+ * @param x x-coordinate from where the dialog should start painting
+ * @param y y-coordinate from where the dialog should start painting
+ * @param width The width of the dialog image to be painted
+ * @param height The height of the dialog image to be painted
*/
void paintDialog(const char* pDialogId,
unsigned char* pBuffer,
- char** pDialogTitle,
- int& nWidth,
- int& nHeight)
+ const int x,
+ const int y,
+ const int width,
+ const int height)
{
return mpDoc->pClass->paintDialog(mpDoc, pDialogId, pBuffer,
- pDialogTitle, &nWidth, &nHeight);
+ x, y, width, height);
+ }
+
+ /* Get info about dialog with given dialog id
+ *
+ * @param pDialogId Unique dialog id for which to get info about
+ * @param pDialogTitle Pointer to pointer pointing to string containing the
+ * dialog title. Caller should the pointer to allocated string themselves.
+ * @param pWidth The width of the dialog
+ * @param pHeight The height of the dialog
+ */
+ void getDialogInfo(const char* pDialogId,
+ char** pDialogTitle,
+ int& pWidth,
+ int& pHeight)
+ {
+ return mpDoc->pClass->getDialogInfo(mpDoc, pDialogId, pDialogTitle, &pWidth, &pHeight);
+
}
/**
diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
index 73e2bbb8..f95ee496 100644
--- a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -10,7 +10,7 @@
#ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITINIT_H
#define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKITINIT_H
-#include "LibreOfficeKit.h"
+#include <LibreOfficeKit/LibreOfficeKit.h>
#ifdef __cplusplus
extern "C"
@@ -28,7 +28,7 @@ extern "C"
#ifndef _WIN32
- #include "dlfcn.h"
+ #include <dlfcn.h>
#ifdef _AIX
# include <sys/ldr.h>
@@ -42,7 +42,7 @@ extern "C"
#endif
#define SEPARATOR '/'
-#if !defined(TARGET_OS_IPHONE)
+#if !defined(IOS)
static void *lok_loadlib(const char *pFN)
{
return dlopen(pFN, RTLD_LAZY
@@ -68,7 +68,7 @@ extern "C"
{
(void)pPath;
}
-#endif // TARGET_OS_IPHONE
+#endif // IOS
static void *lok_dlsym(void *Hnd, const char *pName)
{
@@ -100,7 +100,8 @@ extern "C"
static char *lok_dlerror(void)
{
LPSTR buf = NULL;
- FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, reinterpret_cast<LPSTR>(&buf), 0, NULL);
+ FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, GetLastError(), 0, reinterpret_cast<LPSTR>(&buf), 0, NULL);
return buf;
}
@@ -169,7 +170,7 @@ static void *lok_dlopen( const char *install_path, char ** _imp_lib )
char *imp_lib;
void *dlhandle;
-#if !defined(TARGET_OS_IPHONE)
+#if !defined(IOS)
size_t partial_length, imp_lib_size;
struct stat dir_st;
commit 3dd644b1bc9c3afceac8f299f9413ae2527c4ca9
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Nov 9 14:44:49 2017 +0530
lokdialog: Let floating window pop out of the dialog container
Change-Id: If339cdff39137e68a1fb61bb49830f4734485001
diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index f139c026..48456535 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -339,6 +339,8 @@ body {
overflow: hidden;
width: auto;
height: auto;
+ border: none;
+ background-color: transparent;
}
.lokdialog.ui-dialog-content.ui-widget-content {
diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 329c45ea..fbfec9ee 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -216,6 +216,14 @@ L.Control.LokDialog = L.Control.extend({
ctx.drawImage(img, 0, 0);
};
img.src = e.dialog;
+
+ // increase the height of the container,
+ // so that if the floating window goes out of the parent,
+ // it doesn't get stripped off
+ var height = parseInt(canvas.style.top) + canvas.height;
+ var currentHeight = parseInt($('#' + dialogId).css('height'));
+ if (height > currentHeight)
+ $('#' + dialogId).css('height', height + 'px');
},
_onDialogChildClose: function(dialogId) {
More information about the Libreoffice-commits
mailing list