summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 16:38:04 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-20 01:33:09 -0400
commit665eb58b9e460c969de1f49af5c1a7fae37c34cc (patch)
treef64a9ac9b59036a9e9575cfe782058311e6a10d9 /desktop/source
parent2a03b0e6fe09ba8ce02977d50814800e720b8d46 (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. Reviewed-on: https://gerrit.libreoffice.org/26423 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 45c2410041c48c22bd860efb42d4daadad7869b0) Change-Id: If79ef8b99ba391011b5d82b219ad13447d44cd5a
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 48db0ec73d7a..a03f6644c7ef 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -392,10 +392,10 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis,
int nTileTwipWidth,
int nTileTwipHeight);
static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight);
-static int doc_createView(LibreOfficeKitDocument* pThis);
-static void doc_destroyView(LibreOfficeKitDocument* pThis, int nId);
-static void doc_setView(LibreOfficeKitDocument* pThis, int nId);
-static int doc_getView(LibreOfficeKitDocument* pThis);
+static uintptr_t doc_createView(LibreOfficeKitDocument* pThis);
+static void doc_destroyView(LibreOfficeKitDocument* pThis, uintptr_t nId);
+static void doc_setView(LibreOfficeKitDocument* pThis, uintptr_t nId);
+static uintptr_t doc_getView(LibreOfficeKitDocument* pThis);
static int doc_getViews(LibreOfficeKitDocument* pThis);
static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
const char *pFontName,
@@ -1937,28 +1937,28 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int
pDoc->setClientVisibleArea(aRectangle);
}
-static int doc_createView(LibreOfficeKitDocument* /*pThis*/)
+static uintptr_t doc_createView(LibreOfficeKitDocument* /*pThis*/)
{
SolarMutexGuard aGuard;
return SfxLokHelper::createView();
}
-static void doc_destroyView(LibreOfficeKitDocument* /*pThis*/, int nId)
+static void doc_destroyView(LibreOfficeKitDocument* /*pThis*/, uintptr_t nId)
{
SolarMutexGuard aGuard;
SfxLokHelper::destroyView(nId);
}
-static void doc_setView(LibreOfficeKitDocument* /*pThis*/, int nId)
+static void doc_setView(LibreOfficeKitDocument* /*pThis*/, uintptr_t nId)
{
SolarMutexGuard aGuard;
SfxLokHelper::setView(nId);
}
-static int doc_getView(LibreOfficeKitDocument* /*pThis*/)
+static uintptr_t doc_getView(LibreOfficeKitDocument* /*pThis*/)
{
SolarMutexGuard aGuard;