summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-03-27 22:52:48 +0900
committerTomaž Vajngerl <quikee@gmail.com>2022-04-05 01:57:21 +0200
commitcf4d5ed026c8799a70432a832a8a707c2e316216 (patch)
tree0b30a1863b4331208eca9454579714ff8e725d23 /comphelper
parentbe7d84a3fbd47bf9a078ac7e6854bc4927e84933 (diff)
add tools::Guid class to generate, parse GUID values
Change-Id: Ie4d8fad4d8f22c8277c22c21b7a9eb3e7c9e4f1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132513 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/xml/xmltools.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/comphelper/source/xml/xmltools.cxx b/comphelper/source/xml/xmltools.cxx
index 366321076bad..1b10964b1a35 100644
--- a/comphelper/source/xml/xmltools.cxx
+++ b/comphelper/source/xml/xmltools.cxx
@@ -9,7 +9,7 @@
#include <comphelper/xmltools.hxx>
#include <rtl/random.h>
-#include <rtl/uuid.h>
+#include <tools/Guid.hxx>
#include <vector>
using namespace com::sun::star;
@@ -92,15 +92,8 @@ namespace comphelper::xml
OString generateGUIDString()
{
- sal_uInt8 aSeq[16];
- rtl_createUuid(aSeq, nullptr, true);
-
- char str[39];
- sprintf(str, "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- aSeq[0], aSeq[1], aSeq[2], aSeq[3], aSeq[4], aSeq[5], aSeq[6], aSeq[7], aSeq[8],
- aSeq[9], aSeq[10], aSeq[11], aSeq[12], aSeq[13], aSeq[14], aSeq[15]);
-
- return OString(str);
+ tools::Guid aGuid(tools::Guid::Generate);
+ return aGuid.getString();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */