diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-02-04 09:13:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-02-04 15:02:03 +0100 |
commit | e00032ba6a2ddd4c08ae6f03b1982d3c099d288e (patch) | |
tree | 33f52e795971fd330922e21857b12c6097727ca8 /include/vcl | |
parent | 8d3f658aa58ddee8c7bc32ddea070c1bb3bf19b8 (diff) |
add toId/fromId to tidy up some ugly casting
Change-Id: I70f34ac5e9b5d2f2d6c0375e823908eaa2e540b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129487
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/weld.hxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 4190072690b7..d02f5b43c086 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -642,6 +642,16 @@ public: void connect_jump_page(const Link<const OString&, bool>& rLink) { m_aJumpPageHdl = rLink; } }; +inline OUString toId(const void* pValue) +{ + return OUString::number(reinterpret_cast<const sal_uInt64>(pValue)); +} + +template <typename T> T fromId(const OUString& rValue) +{ + return reinterpret_cast<T>(rValue.toUInt64()); +} + struct VCL_DLLPUBLIC ComboBoxEntry { OUString sString; |