summaryrefslogtreecommitdiff
path: root/include/sfx2/lokhelper.hxx
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/sfx2/lokhelper.hxx
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/sfx2/lokhelper.hxx')
-rw-r--r--include/sfx2/lokhelper.hxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 399c1520c328..2a691f65759c 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -12,6 +12,7 @@
#include <sfx2/dllapi.h>
#include <cstddef>
+#include <cstdint>
class SfxViewShell;
@@ -19,13 +20,13 @@ class SFX2_DLLPUBLIC SfxLokHelper
{
public:
/// Create a new view shell from the current view frame.
- static int createView();
+ static std::uintptr_t createView();
/// Destroy a view shell from the global shell list.
- static void destroyView(std::size_t nId);
+ static void destroyView(std::uintptr_t nId);
/// Set a view shell as current one.
- static void setView(std::size_t nId);
+ static void setView(std::uintptr_t nId);
/// Get the currently active view.
- static std::size_t getView();
+ static std::uintptr_t getView();
/// Get the number of views of the current object shell.
static std::size_t getViews();
};