diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-16 12:38:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-16 14:48:23 +0200 |
commit | dcc92a7cb5aa1faa711c8da7f7d8ecee0a192c25 (patch) | |
tree | f6ed2e55dd7dad168af83e266dc53acbe2926af9 /include/LibreOfficeKit | |
parent | 9035f00ede7925eb699864d17baf7c897a8c7e53 (diff) |
sfx2: add SfxLokHelper::getViewIds
and also expose it in the LOK API. This way clients don't have to keep
track of what views they created / destroyed, they can also get an up to
date list with this method.
Change-Id: Ibaee42c545803e04a31e7c13ab6ec370b99465c4
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 5 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index a0ed81947280..c97655f94f8e 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -244,6 +244,11 @@ struct _LibreOfficeKitDocumentClass const int nTileWidth, const int nTileHeight); + /// @see lok::Document::getViewIds(). + bool (*getViewIds) (LibreOfficeKitDocument* pThis, + int* pArray, + size_t nSize); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index cd3488505673..7c90df53c2f2 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -435,6 +435,22 @@ public: nTileWidth, nTileHeight); } + /** + * Returns the viewID for each existing view. Since viewIDs are not reused, + * viewIDs are not the same as the index of the view in the view array over + * time. Use getViewsCount() to know the minimal nSize that's large enough. + * + * @param pArray the array to write the viewIDs into + * @param nSize the size of pArray + * @returns true if pArray was large enough and result is written, false + * otherwise. + */ + inline bool getViewIds(int* pArray, + size_t nSize) + { + return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize); + } + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; |