diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-01-24 06:51:46 -0500 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-04-23 11:58:54 +0200 |
commit | 6a2382c64f65d433d44ce74f936e42f744f04e21 (patch) | |
tree | 81736b12ec7d3adc7ef3055b6399146dfc927d1d /include | |
parent | 053b1417137b0cdec4e4fed7ae0c57cf67ff2698 (diff) |
LOK: support creating view with options
This adds a new API createViewWithOptions
that make createView similar to documentLoad,
which also has documentViewWithOptions version.
This is primarily to support setting per-view
language and similar settings.
Change-Id: I0ae5a5b2410cf9e053aee8f7c8a6204af9038a31
Reviewed-on: https://gerrit.libreoffice.org/68261
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/71111
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 3 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index f2c8dd40f1b3..62bd3c429fa1 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -375,6 +375,9 @@ struct _LibreOfficeKitDocumentClass int nY, int nOffset); + /// @see lok::Document::createViewWithOptions(). + int (*createViewWithOptions) (LibreOfficeKitDocument* pThis, const char* pOptions); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 6bebf36611dd..7027298a1481 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -440,13 +440,17 @@ public: } /** - * Create a new view for an existing document. + * Create a new view for an existing document with + * options similar to documentLoadWithOptions. * By default a loaded document has 1 view. * @return the ID of the new view. */ - int createView() + int createView(const char* pOptions = nullptr) { - return mpDoc->pClass->createView(mpDoc); + if (LIBREOFFICEKIT_DOCUMENT_HAS(mpDoc, createViewWithOptions)) + return mpDoc->pClass->createViewWithOptions(mpDoc, pOptions); + else + return mpDoc->pClass->createView(mpDoc); } /** |