diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-29 17:27:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-30 06:16:28 +0000 |
commit | 615c37503cffa92a663245d7cb140f316ace0506 (patch) | |
tree | 9d1adcf7385f705e38fbbb925c1488962954a39c /desktop | |
parent | 76c2125ee3eeb64a95501c26c2fa660cd0f8818c (diff) |
LOK: change back type of view ids to int
Commit 45c2410041c48c22bd860efb42d4daadad7869b0 (LOK: change type of
view ids to uintptr_t, 2016-06-17) fixed the problem of view IDs being
reused for the price of random IDs, which makes debugging harder.
Implement a simple shellToView() function that makes sure view IDs are
not reused, and stop exposing view shell pointer addresses, which allows
reverting the LOK API change.
Change-Id: I63089e6de08ee7e1c7706757d43a11f6cf4d6e06
Reviewed-on: https://gerrit.libreoffice.org/26773
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 4 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index d341c76247cd..efe8601b378c 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -295,8 +295,8 @@ void DesktopLOKTest::testCreateView() LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViews(pDocument)); - std::uintptr_t nId0 = pDocument->m_pDocumentClass->getView(pDocument); - std::uintptr_t nId1 = pDocument->m_pDocumentClass->createView(pDocument); + int nId0 = pDocument->m_pDocumentClass->getView(pDocument); + int nId1 = pDocument->m_pDocumentClass->createView(pDocument); CPPUNIT_ASSERT_EQUAL(2, pDocument->m_pDocumentClass->getViews(pDocument)); // Make sure the created view is the active one, then switch to the old diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ab765dce3538..10f3430243a7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -365,10 +365,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 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_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 int doc_getViews(LibreOfficeKitDocument* pThis); static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis, const char *pFontName, @@ -1855,28 +1855,28 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int pDoc->setClientVisibleArea(aRectangle); } -static uintptr_t doc_createView(LibreOfficeKitDocument* /*pThis*/) +static int doc_createView(LibreOfficeKitDocument* /*pThis*/) { SolarMutexGuard aGuard; return SfxLokHelper::createView(); } -static void doc_destroyView(LibreOfficeKitDocument* /*pThis*/, uintptr_t nId) +static void doc_destroyView(LibreOfficeKitDocument* /*pThis*/, int nId) { SolarMutexGuard aGuard; SfxLokHelper::destroyView(nId); } -static void doc_setView(LibreOfficeKitDocument* /*pThis*/, uintptr_t nId) +static void doc_setView(LibreOfficeKitDocument* /*pThis*/, int nId) { SolarMutexGuard aGuard; SfxLokHelper::setView(nId); } -static uintptr_t doc_getView(LibreOfficeKitDocument* /*pThis*/) +static int doc_getView(LibreOfficeKitDocument* /*pThis*/) { SolarMutexGuard aGuard; |