summaryrefslogtreecommitdiff
path: root/include/tools/helpers.hxx
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2024-06-25 18:59:23 +0900
committerMiklos Vajna <vmiklos@collabora.com>2024-07-08 19:18:46 +0200
commit9aaf21b2851410492797a7dcf9193396c8bde770 (patch)
treeffd0a34ab8e74508b262463706e0fc874fabbce6 /include/tools/helpers.hxx
parent6211461c50a4b713c81fc53ccafcfdf701c7388f (diff)
sd: function to return a presentation info in a JSON document
The presentation info includes properties like document size, if the slide is visible, master slide information and similar. [ Miklos: don't refer to removed tools::ScopedJsonWriterArray. ] Change-Id: I5b0acff2ee0df351dd1859e02695ca249e17c391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170155 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include/tools/helpers.hxx')
-rw-r--r--include/tools/helpers.hxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx
index 6e499a6564a0..a6617a3fafd6 100644
--- a/include/tools/helpers.hxx
+++ b/include/tools/helpers.hxx
@@ -7,11 +7,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
-
+#include <com/sun/star/uno/Reference.h>
#include <sal/config.h>
#include <sal/types.h>
#include <tools/long.hxx>
#include <limits>
+#include <string>
#include <type_traits>
inline sal_uInt32 AlignedWidth4Bytes(sal_uInt32 nWidthBits)
@@ -45,4 +46,17 @@ template <typename T> [[nodiscard]] inline T NormAngle360(T angle)
return angle;
}
+// get hash from interface
+// TODO: UNIT TEST
+[[nodiscard]] inline
+std::string GetInterfaceHash(const ::css::uno::Reference<::css::uno::XInterface>& xIf)
+{
+ if (xIf.is())
+ {
+ auto ptr = reinterpret_cast<sal_uIntPtr>(xIf.get());
+ return std::to_string(ptr);
+ }
+ return {};
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */