summaryrefslogtreecommitdiff
path: root/include/LibreOfficeKit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 16:38:04 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 16:00:44 +0000
commit45c2410041c48c22bd860efb42d4daadad7869b0 (patch)
tree7adf4d278976bcadd284c8d1cbd6a863f98c14d0 /include/LibreOfficeKit
parent9ec54e92407cd632c4e38317f914edd557835a86 (diff)
LOK: change type of view ids to uintptr_t
This fixes the following problem: - createView() = 1 - createView() = 2 - destroyView(1) and then view #2 was renumbered to 1. Instead expose the pointer address of the SfxViewShell as the ID, which is not changing in such a situation. Note that the SfxViewShell <-> ID mapping is an implementation detail of SfxLokHelper, and only pointers are converted to IDs, user-supplied IDs are never converted back to pointers. Change-Id: If79ef8b99ba391011b5d82b219ad13447d44cd5a Reviewed-on: https://gerrit.libreoffice.org/26423 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include/LibreOfficeKit')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h8
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx8
2 files changed, 8 insertions, 8 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 110d4d58f8c8..a337bc319168 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -209,13 +209,13 @@ struct _LibreOfficeKitDocumentClass
void (*setClientVisibleArea) (LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight);
/// @see lok::Document::createView().
- int (*createView) (LibreOfficeKitDocument* pThis);
+ uintptr_t (*createView) (LibreOfficeKitDocument* pThis);
/// @see lok::Document::destroyView().
- void (*destroyView) (LibreOfficeKitDocument* pThis, int nId);
+ void (*destroyView) (LibreOfficeKitDocument* pThis, uintptr_t nId);
/// @see lok::Document::setView().
- void (*setView) (LibreOfficeKitDocument* pThis, int nId);
+ void (*setView) (LibreOfficeKitDocument* pThis, uintptr_t nId);
/// @see lok::Document::getView().
- int (*getView) (LibreOfficeKitDocument* pThis);
+ uintptr_t (*getView) (LibreOfficeKitDocument* pThis);
/// @see lok::Document::getViews().
int (*getViews) (LibreOfficeKitDocument* pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 7969ed52d32e..c496e2e5e7b8 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -363,7 +363,7 @@ public:
* By default a loaded document has 1 view.
* @return the ID of the new view.
*/
- int createView()
+ uintptr_t createView()
{
return mpDoc->pClass->createView(mpDoc);
}
@@ -372,7 +372,7 @@ public:
* Destroy a view of an existing document.
* @param nId a view ID, returned by createView().
*/
- void destroyView(int nId)
+ void destroyView(uintptr_t nId)
{
mpDoc->pClass->destroyView(mpDoc, nId);
}
@@ -381,7 +381,7 @@ public:
* Set an existing view of an existing document as current.
* @param nId a view ID, returned by createView().
*/
- void setView(int nId)
+ void setView(uintptr_t nId)
{
mpDoc->pClass->setView(mpDoc, nId);
}
@@ -390,7 +390,7 @@ public:
* Get the current view.
* @return a view ID, previously returned by createView().
*/
- int getView()
+ uintptr_t getView()
{
return mpDoc->pClass->getView(mpDoc);
}