[Libreoffice-commits] core.git: sw/source

Takeshi Abe tabe at fixedpoint.jp
Mon May 21 18:43:16 UTC 2018


 sw/source/core/doc/DocumentFieldsManager.cxx |    5 +++--
 sw/source/filter/html/htmlfld.cxx            |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 338d5f14ba3e77286c3447fb0bcbf46b0627a35f
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Mon May 21 19:01:02 2018 +0900

    sw: Ask current datetime only once
    
    Change-Id: I99bed9a09ed1701ce441ddb0a19b5259ab37f135
    Reviewed-on: https://gerrit.libreoffice.org/54621
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx
index b4b3c0b32d80..9d56929ff792 100644
--- a/sw/source/core/doc/DocumentFieldsManager.cxx
+++ b/sw/source/core/doc/DocumentFieldsManager.cxx
@@ -1336,8 +1336,9 @@ void DocumentFieldsManager::SetFixFields( const DateTime* pNewDateTime )
     }
     else
     {
-        nDate = Date( Date::SYSTEM ).GetDate();
-        nTime = tools::Time( tools::Time::SYSTEM ).GetTime();
+        DateTime aDateTime( DateTime::SYSTEM );
+        nDate = aDateTime.GetDate();
+        nTime = aDateTime.GetTime();
     }
 
     SwFieldIds const aTypes[] {
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index 568f36576a84..53a7b1b435ab 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -320,8 +320,9 @@ void SwHTMLParser::NewField()
     case SwFieldIds::Time:
         {
             sal_uInt32 nNumFormat = 0;
-            sal_Int64 nTime = tools::Time( tools::Time::SYSTEM ).GetTime();
-            sal_Int32 nDate = Date( Date::SYSTEM ).GetDate();
+            DateTime aDateTime( DateTime::SYSTEM );
+            sal_Int64 nTime = aDateTime.GetTime();
+            sal_Int32 nDate = aDateTime.GetDate();
             sal_uInt16 nSub = 0;
             bool bValidFormat = false;
             HTMLNumFormatTableEntry * pFormatTable;


More information about the Libreoffice-commits mailing list