diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2018-05-22 13:28:15 +0900 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-22 08:45:04 +0200 |
commit | 1091e786b420a964b899e9c0a9c399d07946536c (patch) | |
tree | c8d5f8d8fd9a4ac4295764b6b545ba83ac38bed2 /xmloff | |
parent | 038c607e4093d5a26e37d41805def1c5d65ff32d (diff) |
vbahelper, xmloff: Ask current datetime only once
Change-Id: I930983fab11d30f0887965fe30b07c5ac6eef8ef
Reviewed-on: https://gerrit.libreoffice.org/54651
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtlists.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx index ff57fbe0f601..40c85cb63c9c 100644 --- a/xmloff/source/text/txtlists.cxx +++ b/xmloff/source/text/txtlists.cxx @@ -23,8 +23,7 @@ #include <o3tl/make_unique.hxx> -#include <tools/date.hxx> -#include <tools/time.hxx> +#include <tools/datetime.hxx> #include <xmloff/txtimp.hxx> #include <xmloff/xmlimp.hxx> @@ -198,8 +197,9 @@ OUString XMLTextListsHelper::GenerateNewListId() const else { // Value of xml:id in element <text:list> has to be a valid ID type (#i92478#) - sal_Int64 n = ::tools::Time( ::tools::Time::SYSTEM ).GetTime(); - n += Date( Date::SYSTEM ).GetDateUnsigned(); + DateTime aDateTime( DateTime::SYSTEM ); + sal_Int64 n = aDateTime.GetTime(); + n += aDateTime.GetDateUnsigned(); n += comphelper::rng::uniform_int_distribution(0, std::numeric_limits<int>::max()); // Value of xml:id in element <text:list> has to be a valid ID type (#i92478#) sTmpStr += OUString::number( n ); |