sc/source/core/data/postit.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 1a26552de2e692f205695e581166f5eeca67b100
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jul 31 10:22:21 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Jul 31 13:57:58 2024 +0200

    tdf#161846 only need to get the local time once
    
    Change-Id: I5f24ab2357346ff3d515ab58d380ca1f844df11a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171278
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 34c395803dc8..c17e941ca683 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -490,8 +490,9 @@ void ScPostIt::SetAuthor( const OUString& rAuthor )
 
 void ScPostIt::AutoStamp()
 {
-    maNoteData.maDate = ScGlobal::getLocaleData().getDate( Date( Date::SYSTEM 
) ) + " " +
-        ScGlobal::getLocaleData().getTime(DateTime(DateTime::SYSTEM), false);
+    DateTime aNow(DateTime::SYSTEM);
+    auto const & rLocaleData = ScGlobal::getLocaleData();
+    maNoteData.maDate = rLocaleData.getDate( aNow ) + " " + 
rLocaleData.getTime(aNow, false);
     const OUString aAuthor = SvtUserOptions().GetFullName();
     maNoteData.maAuthor = !aAuthor.isEmpty() ? aAuthor : 
ScResId(STR_CHG_UNKNOWN_AUTHOR);
 }

Reply via email to