diff options
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 2 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 7cbaad38d5ec..ce1e63698686 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -146,7 +146,9 @@ struct _LibreOfficeKitClass LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis, const char* pURL, const char* pOptions); +#ifdef LOK_USE_UNSTABLE_API void (*postKeyEvent) (LibreOfficeKit* pThis, int nType, int nCode); +#endif // LOK_USE_UNSTABLE_API }; #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 ef365ce04f4e..74c8533d980d 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -147,11 +147,18 @@ public: mpThis->pClass->destroy(mpThis); } - inline Document* documentLoad(const char* pUrl) + inline Document* documentLoad(const char* pUrl, const char* pFilterOptions = NULL) { - LibreOfficeKitDocument* pDoc = mpThis->pClass->documentLoad(mpThis, pUrl); + LibreOfficeKitDocument* pDoc = NULL; + + if (LIBREOFFICEKIT_HAS(mpThis, documentLoadWithOptions)) + pDoc = mpThis->pClass->documentLoadWithOptions(mpThis, pUrl, pFilterOptions); + else + pDoc = mpThis->pClass->documentLoad(mpThis, pUrl); + if (pDoc == NULL) return NULL; + return new Document(pDoc); } @@ -161,6 +168,7 @@ public: return mpThis->pClass->getError(mpThis); } +#ifdef LOK_USE_UNSTABLE_API /** * Posts a keyboard event to the focused frame. * @@ -171,6 +179,7 @@ public: { mpThis->pClass->postKeyEvent(mpThis, nType, nCode); } +#endif // LOK_USE_UNSTABLE_API }; inline Office* lok_cpp_init(const char* pInstallPath) |